binutils-gdb/gdb/stabsread.c

4799 lines
138 KiB
C
Raw Normal View History

/* Support routines for decoding "stabs" debugging information format.
Copyright (C) 1986-2020 Free Software Foundation, Inc.
1999-07-07 22:19:36 +02:00
This file is part of GDB.
1999-07-07 22:19:36 +02:00
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
1999-07-07 22:19:36 +02:00
(at your option) any later version.
1999-07-07 22:19:36 +02:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
1999-07-07 22:19:36 +02:00
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Support routines for reading and decoding debugging information in
gdb: Remove support for obsolete OSABIs and a.out gdb/ChangeLog: 2016-12-09 Pedro Alves <palves@redhat.com> * Makefile.in (ALL_TARGET_OBS): Remove vax-obsd-tdep.o. * alpha-fbsd-tdep.c (_initialize_alphafbsd_tdep): Adjust. * alpha-nbsd-tdep.c: Move comment to _initialize_alphanbsd_tdep. (alphanbsd_core_osabi_sniffer): Delete. (_initialize_alphanbsd_tdep): No longer handle a.out. * alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Adjust. * amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Adjust. * amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Adjust. * amd64-obsd-tdep.c (amd64obsd_supply_regset) (amd64obsd_combined_regset) (amd64obsd_iterate_over_regset_sections, amd64obsd_core_init_abi): Delete. (_initialize_amd64obsd_tdep): Don't handle a.out. * arm-nbsd-nat.c (struct md_core, fetch_core_registers) (arm_netbsd_core_fns): Delete. (_initialize_arm_netbsd_nat): Don't register arm_netbsd_core_fns. * arm-nbsd-tdep.c (arm_netbsd_aout_init_abi) (arm_netbsd_aout_osabi_sniffer): Delete. (_initialize_arm_netbsd_tdep): Don't handle a.out. * arm-obsd-tdep.c (armobsd_core_osabi_sniffer): Delete. (_initialize_armobsd_tdep): Don't handle a.out. * arm-tdep.c (arm_gdbarch_init): Remove bfd_target_aout_flavour case. * breakpoint.c (disable_breakpoints_in_unloaded_shlib): Remove SunOS a.out handling. * configure.tgt (vax-*-netbsd* | vax-*-knetbsd*-gnu): Remove vax-obsd-tdep.o from gdb_target_objs. (vax-*-openbsd*): Likewise. (*-*-freebsd*): Adjust default gdb_osabi. (*-*-openbsd*): Likewise. * dbxread.c (block_address_function_relative): Delete. (dbx_symfile_read): Remove reference to block_address_function_relative. (dbx_symfile_read): Don't call read_dbx_dynamic_symtab. (read_dbx_dynamic_symtab): Delete. (process_one_symbol): Remove references to block_address_function_relative. * defs.h (GDB_OSABI_FREEBSD_AOUT, GDB_OSABI_NETBSD_AOUT): Remove. (GDB_OSABI_FREEBSD_ELF): Rename to ... (GDB_OSABI_FREEBSD): ... this. (GDB_OSABI_NETBSD_ELF): Rename to ... (GDB_OSABI_NETBSD): ... this. (GDB_OSABI_OPENBSD_ELF): Rename to ... (GDB_OSABI_OPENBSD): ... this. (GDB_OSABI_HPUX_ELF, GDB_OSABI_HPUX_SOM): Remove. * fbsd-tdep.c: Adjust comment. * hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Adjust. * hppa-obsd-tdep.c (GDB_OSABI_NETBSD_CORE): Delete. (hppaobsd_core_osabi_sniffer): Delete. (_initialize_hppabsd_tdep): Don't handle a.out. * hppa-tdep.c (hppa_stub_frame_unwind_cache): Don't handle GDB_OSABI_HPUX_SOM. (hppa_gdbarch_init): Likewise. * i386-bsd-tdep.c (i386bsd_aout_osabi_sniffer) (i386bsd_core_osabi_sniffer, _initialize_i386bsd_tdep): Delete. * i386-fbsd-tdep.c (i386fbsdaout_init_abi): Delete. Merge bits with ... (i386fbsd_init_abi): ... this. (_initialize_i386fbsd_tdep): Don't handle a.out. * i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Adjust. * i386-obsd-tdep.c (i386obsd_aout_supply_regset) (i386obsd_aout_gregset) (i386obsd_aout_iterate_over_regset_sections): Delete. (i386obsd_init_abi): Merge with i386obsd_elf_init_abi. (i386obsd_aout_init_abi): Delete. (_initialize_i386obsd_tdep): Don't handle a.out. * m68k-bsd-tdep.c (m68kobsd_sigtramp_cache_init) (m68kobsd_sigtramp): Delete. (m68kbsd_init_abi): Merge with ... (m68kbsd_elf_init_abi): ... this, and delete it. (m68kbsd_aout_init_abi): Delete. (m68kbsd_aout_osabi_sniffer, m68kbsd_core_osabi_sniffer): Delete. (_initialize_m68kbsd_tdep): Don't handle a.out. * mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Adjust. * mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Adjust. * osabi.c (gdb_osabi_names): Remove "a.out" entries. Drop "ELF" suffixes. Remove "HP-UX" entries. (generic_elf_osabi_sniff_abi_tag_sections): Adjust. (generic_elf_osabi_sniffer): No longer handle GDB_OSABI_HPUX_ELF. Adjust. (_initialize_ppcfbsd_tdep): Adjust. * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Adjust. * ppc-obsd-tdep.c (GDB_OSABI_NETBSD_CORE) (ppcobsd_core_osabi_sniffer): Delete. (_initialize_ppcobsd_tdep): Don't handle a.out. * rs6000-tdep.c (rs6000_gdbarch_init): Adjust. * sh-nbsd-tdep.c (GDB_OSABI_NETBSD_CORE) (shnbsd_core_osabi_sniffer): Delete. (_initialize_shnbsd_tdep): Don't handle a.out. * solib.c (clear_solib): Don't handle SunOS/a.out. * sparc-nbsd-tdep.c (sparc32nbsd_init_abi): Make extern. (sparc32nbsd_aout_init_abi): Delete. (sparc32nbsd_elf_init_abi): Merged into sparc32nbsd_init_abi. (sparcnbsd_aout_osabi_sniffer): Delete. (GDB_OSABI_NETBSD_CORE, sparcnbsd_core_osabi_sniffer): Delete. (_initialize_sparcnbsd_tdep): No longer handle a.out. * sparc-obsd-tdep.c (sparc32obsd_init_abi) (_initialize_sparc32obsd_tdep): Adjust. * sparc-tdep.h (sparc32nbsd_elf_init_abi): Rename to ... (sparc32nbsd_init_abi): ... this. * sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Adjust. * sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Adjust. * sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Adjust. * stabsread.c: Update comment. * symmisc.c (print_objfile_statistics): Don't mention "a.out" in output. * vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Adjust. * vax-obsd-tdep.c: Delete file.
2016-12-09 17:08:49 +01:00
the "stabs" format. This format is used by some systems that use
COFF or ELF where the stabs data is placed in a special section (as
well as with many old systems that used the a.out object file
format). Avoid placing any object file format specific code in
this file. */
#include "defs.h"
#include "bfd.h"
#include "gdb_obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "symfile.h"
#include "objfiles.h"
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
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native. */
#include "libaout.h"
#include "aout/aout64.h"
#include "gdb-stabs.h"
#include "buildsym-legacy.h"
#include "complaints.h"
#include "demangle.h"
#include "gdb-demangle.h"
#include "language.h"
Target FP: Add string routines to target-float.{c,h} This adds target_float_to_string and target_float_from_string, which dispatch to the corresponding floatformat_ or decimal_ routines. Existing users of those routines are changed to use the new target-float routines instead (most of those places already handle both binary and decimal FP). In addition, two other places are changes to use target_float_from_string: - define_symbol in stabsread.c, when parsing a floating-point literal from stabs debug info - gdbarch-selftest.c when initializing a target format values (to eliminate use of DOUBLEST there). gdb/ChangeLog: 2017-11-06 Ulrich Weigand <uweigand@de.ibm.com> * target-float.c (target_float_to_string): New function. (target_float_from_string): New function. * target-float.h (target_float_to_string): Add prototype. (target_float_from_string): Add prototype. * valprint.c: Include "target-float.h". Do not include "doublest.h" and "dfp.h". (print_floating): Use target_float_to_string. * printcmd.c: Include "target-float.h". Do not include "dfp.h". (printf_floating): Use target_float_to_string. * i387-tdep.c: Include "target-float.h". Do not include "doublest.h". (print_i387_value): Use target_float_to_string. * mips-tdep.c: Include "target-float.h". (mips_print_fp_register): Use target_float_to_string. * sh64-tdep.c: Include "target-float.h". (sh64_do_fp_register): Use target_float_to_string. * parse.c: Include "target-float.h". Do not include "doublest.h" and "dfp.h". (parse_float): Use target_float_from_string. * stabsread.c: Include "target-float.h". Do not include "doublest.h". (define_symbol): Use target_float_from_string. * gdbarch-selftests.c: Include "target-float.h". (register_to_value_test): Use target_float_from_string.
2017-11-06 15:56:35 +01:00
#include "target-float.h"
#include "c-lang.h"
#include "cp-abi.h"
#include "cp-support.h"
#include <ctype.h>
#include "stabsread.h"
/* See stabsread.h for these globals. */
unsigned int symnum;
const char *(*next_symbol_text_func) (struct objfile *);
unsigned char processing_gcc_compilation;
int within_function;
struct symbol *global_sym_chain[HASHSIZE];
struct pending_stabs *global_stabs;
int previous_stab_code;
int *this_object_header_files;
int n_this_object_header_files;
int n_allocated_this_object_header_files;
Fix struct, union, and enum nesting in C++ In C, an enum or structure defined inside other structure has global scope just like it had been defined outside the struct in the first place. However, in C++, such a nested structure is given a name that is nested inside the structure. This patch moves such affected structures/enums out to global scope, so that code using them works the same in C++ as it works today in C. gdb/ChangeLog: 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> * dwarf2-frame.c (enum cfa_how_kind, struct dwarf2_frame_state_reg_info): Move out of struct dwarf2_frame_state. * dwarf2read.c (struct tu_stats): Move out of struct dwarf2_per_objfile. (struct file_entry): Move out of struct line_header. (struct nextfield, struct nextfnfield, struct fnfieldlist, struct typedef_field_list): Move out of struct field_info. * gdbtypes.h (enum dynamic_prop_kind, union dynamic_prop_data): Move out of struct dynamic_prop. (union type_owner, union field_location, struct field, struct range_bounds, union type_specific): Move out of struct main_type. (struct fn_fieldlist, struct fn_field, struct typedef_field) (VOFFSET_STATIC): Move out of struct cplus_struct_type. (struct call_site_target, union call_site_parameter_u, struct call_site_parameter): Move out of struct call_site. * m32c-tdep.c (enum m32c_prologue_kind): Move out of struct m32c_prologue. (enum srcdest_kind): Move out of struct srcdest. * main.c (enum cmdarg_kind): Move out of struct cmdarg. * prologue-value.h (enum prologue_value_kind): Move out of struct prologue_value. * s390-linux-tdep.c (enum s390_abi_kind): Move out of struct gdbarch_tdep. * stabsread.c (struct nextfield, struct next_fnfieldlist): Move out of struct field_info. * symfile.h (struct other_sections): Move out of struct section_addr_info. * symtab.c (struct symbol_cache_slot): Move out struct block_symbol_cache. * target-descriptions.c (enum tdesc_type_kind): Move out of typedef struct tdesc_type. * tui/tui-data.h (enum tui_line_or_address_kind): Move out of struct tui_line_or_address. * value.c (enum internalvar_kind, union internalvar_data): Move out of struct internalvar. * xtensa-tdep.h (struct ctype_cache): Move out of struct gdbarch_tdep.
2015-02-09 15:59:05 +01:00
struct nextfield
{
struct nextfield *next;
/* This is the raw visibility from the stab. It is not checked
for being one of the visibilities we recognize, so code which
examines this field better be able to deal. */
int visibility;
struct field field;
};
struct next_fnfieldlist
{
struct next_fnfieldlist *next;
struct fn_fieldlist fn_fieldlist;
};
/* The routines that read and process a complete stabs for a C struct or
C++ class pass lists of data member fields and lists of member function
fields in an instance of a field_info structure, as defined below.
This is part of some reorganization of low level C++ support and is
expected to eventually go away... (FIXME) */
struct stab_field_info
1999-07-07 22:19:36 +02:00
{
struct nextfield *list = nullptr;
struct next_fnfieldlist *fnlist = nullptr;
auto_obstack obstack;
1999-07-07 22:19:36 +02:00
};
static void
read_one_struct_field (struct stab_field_info *, const char **, const char *,
2000-05-28 03:12:42 +02:00
struct type *, struct objfile *);
2000-05-28 03:12:42 +02:00
static struct type *dbx_alloc_type (int[2], struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static long read_huge_number (const char **, int, int *, int);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *error_type (const char **, struct objfile *);
static void
2000-05-28 03:12:42 +02:00
patch_block_stabs (struct pending *, struct pending_stabs *,
struct objfile *);
static void fix_common_block (struct symbol *, CORE_ADDR);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static int read_type_number (const char **, int *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *read_type (const char **, struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *read_range_type (const char **, int[2],
int, struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *read_sun_builtin_type (const char **,
int[2], struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *read_sun_floating_type (const char **, int[2],
2000-05-28 03:12:42 +02:00
struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *read_enum_type (const char **, struct type *, struct objfile *);
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
static struct type *rs6000_builtin_type (int, struct objfile *);
static int
read_member_functions (struct stab_field_info *, const char **, struct type *,
2000-05-28 03:12:42 +02:00
struct objfile *);
static int
read_struct_fields (struct stab_field_info *, const char **, struct type *,
2000-05-28 03:12:42 +02:00
struct objfile *);
static int
read_baseclasses (struct stab_field_info *, const char **, struct type *,
2000-05-28 03:12:42 +02:00
struct objfile *);
static int
read_tilde_fields (struct stab_field_info *, const char **, struct type *,
2000-05-28 03:12:42 +02:00
struct objfile *);
static int attach_fn_fields_to_type (struct stab_field_info *, struct type *);
static int attach_fields_to_type (struct stab_field_info *, struct type *,
struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *read_struct_type (const char **, struct type *,
enum type_code,
2000-05-28 03:12:42 +02:00
struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct type *read_array_type (const char **, struct type *,
2000-05-28 03:12:42 +02:00
struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static struct field *read_args (const char **, int, struct objfile *,
int *, int *);
static void add_undefined_type (struct type *, int[2]);
static int
read_cpp_abbrev (struct stab_field_info *, const char **, struct type *,
2000-05-28 03:12:42 +02:00
struct objfile *);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static const char *find_name_end (const char *name);
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static int process_reference (const char **string);
2000-05-28 03:12:42 +02:00
void stabsread_clear_cache (void);
1999-08-16 21:57:19 +02:00
* c-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * cp-valprint.c (vtbl_ptr_name_old): Delete. (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old. * demangle.c (cplus_markers): Update comment. Put '$' first. Remove CPLUS_MARKER. (_initialize_demangler): Don't call set_cplus_marker_for_demangling. * jv-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER. * objc-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * p-exp.y (yylex): Remove reference to CPLUS_MARKER. * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'. (read_member_functions): Likewise for opname. (read_tilde_fields): Use is_cplus_marker. * defs.h (CPLUS_MARKER): Don't define. * config/tm-sysv4.h (CPLUS_MARKER): Likewise. * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise. * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise. * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise. * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise. * config/i386/tm-i386v4.h: Delete file. * config/djgpp/fnchange.lst: Delete tm-i386v4.h. * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead. * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead. * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead. * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h. * config/i386/i386sco5.mt (TM_FILE): Likewise. * config/i386/i386v4.mt (TM_FILE): Likewise. * config/i386/ncr3000.mt (TM_FILE): Likewise.
2002-10-11 16:02:39 +02:00
static const char vptr_name[] = "_vptr$";
static const char vb_name[] = "_vb$";
2002-12-17 01:39:08 +01:00
static void
invalid_cpp_abbrev_complaint (const char *arg1)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("invalid C++ abbreviation `%s'"), arg1);
2002-12-17 01:39:08 +01:00
}
2002-12-17 01:39:08 +01:00
static void
reg_value_complaint (int regnum, int num_regs, const char *sym)
2002-12-17 01:39:08 +01:00
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("bad register number %d (max %d) in symbol %s"),
regnum, num_regs - 1, sym);
2002-12-17 01:39:08 +01:00
}
2002-12-17 01:39:08 +01:00
static void
stabs_general_complaint (const char *arg1)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint ("%s", arg1);
2002-12-17 01:39:08 +01:00
}
/* Make a list of forward references which haven't been defined. */
static struct type **undef_types;
static int undef_types_allocated;
static int undef_types_length;
static struct symbol *current_symbol = NULL;
/* Make a list of nameless types that are undefined.
This happens when another type is referenced by its number
before this type is actually defined. For instance "t(0,1)=k(0,2)"
and type (0,2) is defined only later. */
struct nat
{
int typenums[2];
struct type *type;
};
static struct nat *noname_undefs;
static int noname_undefs_allocated;
static int noname_undefs_length;
/* Check for and handle cretinous stabs symbol name continuation! */
#define STABS_CONTINUE(pp,objfile) \
do { \
if (**(pp) == '\\' || (**(pp) == '?' && (*(pp))[1] == '\0')) \
*(pp) = next_symbol_text (objfile); \
} while (0)
/* Vector of types defined so far, indexed by their type numbers.
(In newer sun systems, dbx uses a pair of numbers in parens,
as in "(SUBFILENUM,NUMWITHINSUBFILE)".
Then these numbers must be translated through the type_translations
hash table to get the index into the type vector.) */
static struct type **type_vector;
/* Number of elements allocated for type_vector currently. */
static int type_vector_length;
/* Initial size of type vector. Is realloc'd larger if needed, and
realloc'd down to the size actually used, when completed. */
#define INITIAL_TYPE_VECTOR_LENGTH 160
/* Look up a dbx type-number pair. Return the address of the slot
where the type for that number-pair is stored.
The number-pair is in TYPENUMS.
This can be used for finding the type associated with that pair
or for associating a new type with the pair. */
static struct type **
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
dbx_lookup_type (int typenums[2], struct objfile *objfile)
{
int filenum = typenums[0];
int index = typenums[1];
unsigned old_len;
int real_filenum;
struct header_file *f;
int f_orig_length;
if (filenum == -1) /* -1,-1 is for temporary types. */
return 0;
if (filenum < 0 || filenum >= n_this_object_header_files)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Invalid symbol data: type number "
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
"(%d,%d) out of range at symtab pos %d."),
2002-12-17 01:39:08 +01:00
filenum, index, symnum);
goto error_return;
}
if (filenum == 0)
{
if (index < 0)
{
/* Caller wants address of address of type. We think
that negative (rs6k builtin) types will never appear as
"lvalues", (nor should they), so we stuff the real type
pointer into a temp, and return its address. If referenced,
this will do the right thing. */
static struct type *temp_type;
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
temp_type = rs6000_builtin_type (index, objfile);
return &temp_type;
}
/* Type is defined outside of header files.
1999-07-07 22:19:36 +02:00
Find it in this object file's type vector. */
if (index >= type_vector_length)
{
old_len = type_vector_length;
if (old_len == 0)
{
type_vector_length = INITIAL_TYPE_VECTOR_LENGTH;
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
type_vector = XNEWVEC (struct type *, type_vector_length);
}
while (index >= type_vector_length)
{
type_vector_length *= 2;
}
type_vector = (struct type **)
xrealloc ((char *) type_vector,
(type_vector_length * sizeof (struct type *)));
memset (&type_vector[old_len], 0,
(type_vector_length - old_len) * sizeof (struct type *));
}
return (&type_vector[index]);
}
else
{
real_filenum = this_object_header_files[filenum];
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
if (real_filenum >= N_HEADER_FILES (objfile))
{
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
static struct type *temp_type;
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
warning (_("GDB internal error: bad real_filenum"));
error_return:
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
temp_type = objfile_type (objfile)->builtin_error;
return &temp_type;
}
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
f = HEADER_FILES (objfile) + real_filenum;
f_orig_length = f->length;
if (index >= f_orig_length)
{
while (index >= f->length)
{
f->length *= 2;
}
f->vector = (struct type **)
xrealloc ((char *) f->vector, f->length * sizeof (struct type *));
memset (&f->vector[f_orig_length], 0,
(f->length - f_orig_length) * sizeof (struct type *));
}
return (&f->vector[index]);
}
}
/* Make sure there is a type allocated for type numbers TYPENUMS
and return the type object.
This can create an empty (zeroed) type object.
TYPENUMS may be (-1, -1) to return a new type object that is not
put into the type vector, and so may not be referred to by number. */
static struct type *
2000-10-24 19:45:35 +02:00
dbx_alloc_type (int typenums[2], struct objfile *objfile)
{
struct type **type_addr;
if (typenums[0] == -1)
{
return (alloc_type (objfile));
}
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
type_addr = dbx_lookup_type (typenums, objfile);
/* If we are referring to a type not known at all yet,
allocate an empty type for it.
We will fill it in later if we find out how. */
if (*type_addr == 0)
{
*type_addr = alloc_type (objfile);
}
return (*type_addr);
}
Add gdbarch callback to provide formats for debug info float types At this point, all TYPE_CODE_FLT types carry their floating-point format, except for those creating from reading DWARF or stabs debug info. Those will be addressed by this commit. The main issue here is that we actually have to determine which floating- point format to use. Currently, we only have the type length as input to this decision. In the future, we may hopefully get --at least in DWARF-- additional information to help disambiguate multiple different formats of the same length. For now, we can still look at the type name as a hint. This decision logic is encapsulated in a gdbarch callback to allow platform-specific overrides. The default implementation use the same logic (compare type length against the various gdbarch_..._bit sizes) that is currently implemented in floatformat_from_length. With this commit, all platforms still use the default logic, so there should be no actual change in behavior. A follow-on commit will add support for __float128 on Intel and Power. Once dwarf2read.c and stabsread.c make use of the new callback to determine floating-point formats, we're now sure every TYPE_CODE_FLT type will always carry its format. The commit therefore adds asserts to verify_floatformat to ensure new code will continue to always provide formats, and removes the code in floatformat_from_type that used to handle types with a NULL TYPE_FLOATFORMAT. gdb/ChangeLog: * gdbarch.sh (floatformat_for_type): New gdbarch callback. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.h (default_floatformat_for_type): New prototype. * arch-utils.c (default_floatformat_for_type): New function. * doublest.c (floatformat_from_length): Remove. (floatformat_from_type): Assume TYPE_FLOATFORMAT is non-NULL. * gdbtypes.c (verify_floatformat): Require non-NULL format. * dwarf2read.c (dwarf2_init_float_type): New function. (read_base_type): Use it. * stabsread.c (dbx_init_float_type): New function. (read_sun_floating_type): Use it. (read_range_type): Likewise. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:31:53 +02:00
/* Allocate a floating-point type of size BITS. */
static struct type *
dbx_init_float_type (struct objfile *objfile, int bits)
{
Change get_objfile_arch to a method on objfile This changes get_objfile_arch to be a new inline method, objfile::arch. To my surprise, this function came up while profiling DWARF psymbol reading. Making this change improved performance from 1.986 seconds to 1.869 seconds. Both measurements were done by taking the mean of 10 runs on a fixed copy of the gdb executable. gdb/ChangeLog 2020-04-18 Tom Tromey <tom@tromey.com> * xcoffread.c (enter_line_range, scan_xcoff_symtab): Update. * value.c (value_fn_field): Update. * valops.c (find_function_in_inferior) (value_allocate_space_in_inferior): Update. * tui/tui-winsource.c (tui_update_source_windows_with_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * symtab.c (lookup_global_or_static_symbol) (find_function_start_sal_1, skip_prologue_sal) (print_msymbol_info, find_gnu_ifunc, symbol_arch): Update. * symmisc.c (dump_msymbols, dump_symtab_1) (maintenance_print_one_line_table): Update. * symfile.c (init_entry_point_info, section_is_mapped) (list_overlays_command, simple_read_overlay_table) (simple_overlay_update_1): Update. * stap-probe.c (handle_stap_probe): Update. * stabsread.c (dbx_init_float_type, define_symbol) (read_one_struct_field, read_enum_type, read_range_type): Update. * source.c (info_line_command): Update. * python/python.c (gdbpy_source_objfile_script) (gdbpy_execute_objfile_script): Update. * python/py-type.c (save_objfile_types): Update. * python/py-objfile.c (py_free_objfile): Update. * python/py-inferior.c (python_new_objfile): Update. * psymtab.c (psym_find_pc_sect_compunit_symtab, dump_psymtab) (dump_psymtab_addrmap_1, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * printcmd.c (info_address_command): Update. * objfiles.h (struct objfile) <arch>: New method, from get_objfile_arch. (get_objfile_arch): Don't declare. * objfiles.c (get_objfile_arch): Remove. (filter_overlapping_sections): Update. * minsyms.c (msymbol_is_function): Update. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines) (output_nondebug_symbol): Update. * mdebugread.c (parse_symbol, basic_type, parse_partial_symbols) (mdebug_expand_psymtab): Update. * machoread.c (macho_add_oso_symfile): Update. * linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap): Update. * linux-fork.c (checkpoint_command): Update. * linespec.c (convert_linespec_to_sals): Update. * jit.c (finalize_symtab): Update. * infrun.c (insert_exception_resume_from_probe): Update. * ia64-tdep.c (ia64_find_unwind_table): Update. * hppa-tdep.c (internalize_unwinds): Update. * gdbtypes.c (get_type_arch, init_float_type, objfile_type): Update. * gcore.c (call_target_sbrk): Update. * elfread.c (record_minimal_symbol, elf_symtab_read) (elf_rel_plt_read, elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Update. * dwarf2/read.c (create_addrmap_from_index) (create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab) (read_debug_names_from_section) (process_psymtab_comp_unit_reader, add_partial_symbol) (add_partial_subprogram, process_full_comp_unit) (read_file_scope, read_func_scope, read_lexical_block_scope) (read_call_site_scope, dwarf2_ranges_read) (dwarf2_record_block_ranges, dwarf2_add_field) (mark_common_block_symbol_computed, read_tag_pointer_type) (read_tag_string_type, dwarf2_init_float_type) (dwarf2_init_complex_target_type, read_base_type) (partial_die_info::read, partial_die_info::read) (read_attribute_value, dwarf_decode_lines_1, new_symbol) (dwarf2_fetch_die_loc_sect_off): Update. * dwarf2/loc.c (dwarf2_find_location_expression) (class dwarf_evaluate_loc_desc, rw_pieced_value) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval) (dwarf2_loc_desc_get_symbol_read_needs) (locexpr_describe_location_piece, locexpr_describe_location_1) (loclist_describe_location): Update. * dwarf2/index-write.c (write_debug_names): Update. * dwarf2/frame.c (dwarf2_build_frame_info): Update. * dtrace-probe.c (dtrace_process_dof): Update. * dbxread.c (read_dbx_symtab, dbx_end_psymtab) (process_one_symbol): Update. * ctfread.c (ctf_init_float_type, read_base_type): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_base_type) (coff_read_enum_type): Update. * cli/cli-cmds.c (edit_command, list_command): Update. * buildsym.c (buildsym_compunit::finish_block_internal): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint, get_sal_arch): Update. * block.c (block_gdbarch): Update. * annotate.c (annotate_source_line): Update.
2020-04-18 16:35:04 +02:00
struct gdbarch *gdbarch = objfile->arch ();
Add gdbarch callback to provide formats for debug info float types At this point, all TYPE_CODE_FLT types carry their floating-point format, except for those creating from reading DWARF or stabs debug info. Those will be addressed by this commit. The main issue here is that we actually have to determine which floating- point format to use. Currently, we only have the type length as input to this decision. In the future, we may hopefully get --at least in DWARF-- additional information to help disambiguate multiple different formats of the same length. For now, we can still look at the type name as a hint. This decision logic is encapsulated in a gdbarch callback to allow platform-specific overrides. The default implementation use the same logic (compare type length against the various gdbarch_..._bit sizes) that is currently implemented in floatformat_from_length. With this commit, all platforms still use the default logic, so there should be no actual change in behavior. A follow-on commit will add support for __float128 on Intel and Power. Once dwarf2read.c and stabsread.c make use of the new callback to determine floating-point formats, we're now sure every TYPE_CODE_FLT type will always carry its format. The commit therefore adds asserts to verify_floatformat to ensure new code will continue to always provide formats, and removes the code in floatformat_from_type that used to handle types with a NULL TYPE_FLOATFORMAT. gdb/ChangeLog: * gdbarch.sh (floatformat_for_type): New gdbarch callback. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.h (default_floatformat_for_type): New prototype. * arch-utils.c (default_floatformat_for_type): New function. * doublest.c (floatformat_from_length): Remove. (floatformat_from_type): Assume TYPE_FLOATFORMAT is non-NULL. * gdbtypes.c (verify_floatformat): Require non-NULL format. * dwarf2read.c (dwarf2_init_float_type): New function. (read_base_type): Use it. * stabsread.c (dbx_init_float_type): New function. (read_sun_floating_type): Use it. (read_range_type): Likewise. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:31:53 +02:00
const struct floatformat **format;
struct type *type;
format = gdbarch_floatformat_for_type (gdbarch, NULL, bits);
if (format)
type = init_float_type (objfile, bits, NULL, format);
else
Make init_type/arch_type take a size in bits This changes the interfaces to init_type and arch_type to take the type length in bits as input (instead of as bytes). The routines assert that the length is a multiple of TARGET_CHAR_BIT. For consistency, arch_flags_type is changed likewise, so that now all type creation interfaces always use length in bits. All callers are updated in the straightforward manner. The assert actually found a bug in read_range_type, where the init_integer_type routine was called with a wrong argument (probably a bug introduced with the conversion to use init_integer_type). gdb/ChangeLog 2017-09-27 Ulrich Weigand <uweigand@de.ibm.com> * gdbtypes.c (init_type): Change incoming argument from length-in-bytes to length-in-bits. Assert length is a multiple of TARGET_CHAR_BITS. (arch_type, arch_flags_type): Likewise. (init_integer_type): Update call to init_type. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (objfile_type): Likewise. (arch_integer_type): Update call to arch_type. (arch_character_type): Likewise. (arch_boolean_type): Likewise. (arch_float_type): Likewise. (arch_decfloat_type): Likewise. (arch_complex_type): Likewise. (arch_pointer_type): Likewise. (gdbtypes_post_init): Likewise. * dwarf2read.c (dwarf2_init_float_type): Update call to init_type. (read_base_type): Likewise. * mdebugread.c (basic_type): Likewise. * stabsread.c (dbx_init_float_type): Likewise. (rs6000_builtin_type): Likewise. (read_range_type): Likewise. Also, fix call to init_integer_type with erroneous length argument. * ada-lang.c (ada_language_arch_info): Update call to arch_type. * d-lang.c (build_d_types): Likewise. * f-lang.c (build_fortran_types): Likewise. * go-lang.c (build_go_types): Likewise. * opencl-lang.c (build_opencl_types): Likewise. * jit.c (finalize_symtab): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * target-descriptions.c (tdesc_gdb_type): Likewise. Also, update call to arch_flags_type. * linux-tdep.c (linux_get_siginfo_type_with_fields): Update call to arch_type. * fbsd-tdep.c (fbsd_get_siginfo_type): Likewise. * windows-tdep.c (windows_get_tlb_type): Likewise. * avr-tdep.c (avr_gdbarch_init): Update call to arch_type. * ft32-tdep.c (ft32_gdbarch_init): Likewise. * m32c-tdep.c (make_types): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. (rl78_psw_type): Update call to arch_flags_type. * m68k-tdep.c (m68k_ps_type): Update call to arch_flags_type. * rx-tdep.c (rx_psw_type): Likewise. (rx_fpsw_type): Likewise. * sparc-tdep.c (sparc_psr_type): Likewise. (sparc_fsr_type): Likewise. * sparc64-tdep.c (sparc64_pstate_type): Likewise. (sparc64_ccr_type): Likewise. (sparc64_fsr_type): Likewise. (sparc64_fprs_type): Likewise.
2017-09-27 19:02:00 +02:00
type = init_type (objfile, TYPE_CODE_ERROR, bits, NULL);
Add gdbarch callback to provide formats for debug info float types At this point, all TYPE_CODE_FLT types carry their floating-point format, except for those creating from reading DWARF or stabs debug info. Those will be addressed by this commit. The main issue here is that we actually have to determine which floating- point format to use. Currently, we only have the type length as input to this decision. In the future, we may hopefully get --at least in DWARF-- additional information to help disambiguate multiple different formats of the same length. For now, we can still look at the type name as a hint. This decision logic is encapsulated in a gdbarch callback to allow platform-specific overrides. The default implementation use the same logic (compare type length against the various gdbarch_..._bit sizes) that is currently implemented in floatformat_from_length. With this commit, all platforms still use the default logic, so there should be no actual change in behavior. A follow-on commit will add support for __float128 on Intel and Power. Once dwarf2read.c and stabsread.c make use of the new callback to determine floating-point formats, we're now sure every TYPE_CODE_FLT type will always carry its format. The commit therefore adds asserts to verify_floatformat to ensure new code will continue to always provide formats, and removes the code in floatformat_from_type that used to handle types with a NULL TYPE_FLOATFORMAT. gdb/ChangeLog: * gdbarch.sh (floatformat_for_type): New gdbarch callback. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.h (default_floatformat_for_type): New prototype. * arch-utils.c (default_floatformat_for_type): New function. * doublest.c (floatformat_from_length): Remove. (floatformat_from_type): Assume TYPE_FLOATFORMAT is non-NULL. * gdbtypes.c (verify_floatformat): Require non-NULL format. * dwarf2read.c (dwarf2_init_float_type): New function. (read_base_type): Use it. * stabsread.c (dbx_init_float_type): New function. (read_sun_floating_type): Use it. (read_range_type): Likewise. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:31:53 +02:00
return type;
}
/* for all the stabs in a given stab vector, build appropriate types
and fix their symbols in given symbol vector. */
static void
2000-07-30 03:48:28 +02:00
patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
struct objfile *objfile)
{
int ii;
char *name;
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *pp;
struct symbol *sym;
if (stabs)
{
/* for all the stab entries, find their corresponding symbols and
patch their types! */
1999-07-07 22:19:36 +02:00
for (ii = 0; ii < stabs->count; ++ii)
{
name = stabs->stab[ii];
1999-07-07 22:19:36 +02:00
pp = (char *) strchr (name, ':');
gdb_assert (pp); /* Must find a ':' or game's over. */
while (pp[1] == ':')
{
1999-07-07 22:19:36 +02:00
pp += 2;
pp = (char *) strchr (pp, ':');
}
1999-07-07 22:19:36 +02:00
sym = find_symbol_in_list (symbols, name, pp - name);
if (!sym)
{
/* FIXME-maybe: it would be nice if we noticed whether
1999-07-07 22:19:36 +02:00
the variable was defined *anywhere*, not just whether
it is defined in this compilation unit. But neither
xlc or GCC seem to need such a definition, and until
we do psymtabs (so that the minimal symbols from all
compilation units are available now), I'm not sure
how to get the information. */
/* On xcoff, if a global is defined and never referenced,
1999-07-07 22:19:36 +02:00
ld will remove it from the executable. There is then
a N_GSYM stab for it, but no regular (C_EXT) symbol. */
sym = allocate_symbol (objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
sym->set_linkage_name
(obstack_strndup (&objfile->objfile_obstack, name, pp - name));
pp += 2;
1999-07-07 22:19:36 +02:00
if (*(pp - 1) == 'F' || *(pp - 1) == 'f')
{
/* I don't think the linker does this with functions,
so as far as I know this is never executed.
But it doesn't hurt to check. */
SYMBOL_TYPE (sym) =
lookup_function_type (read_type (&pp, objfile));
}
else
{
SYMBOL_TYPE (sym) = read_type (&pp, objfile);
}
add_symbol_to_list (sym, get_global_symbols ());
}
else
{
pp += 2;
1999-07-07 22:19:36 +02:00
if (*(pp - 1) == 'F' || *(pp - 1) == 'f')
{
SYMBOL_TYPE (sym) =
lookup_function_type (read_type (&pp, objfile));
}
else
{
SYMBOL_TYPE (sym) = read_type (&pp, objfile);
}
}
}
}
}
1999-07-07 22:19:36 +02:00
/* Read a number by which a type is referred to in dbx data,
or perhaps read a pair (FILENUM, TYPENUM) in parentheses.
Just a single number N is equivalent to (0,N).
Return the two numbers by storing them in the vector TYPENUMS.
TYPENUMS will then be used as an argument to dbx_lookup_type.
Returns 0 for success, -1 for error. */
static int
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_type_number (const char **pp, int *typenums)
{
int nbits;
if (**pp == '(')
{
(*pp)++;
typenums[0] = read_huge_number (pp, ',', &nbits, 0);
1999-07-07 22:19:36 +02:00
if (nbits != 0)
return -1;
typenums[1] = read_huge_number (pp, ')', &nbits, 0);
1999-07-07 22:19:36 +02:00
if (nbits != 0)
return -1;
}
else
{
typenums[0] = 0;
typenums[1] = read_huge_number (pp, 0, &nbits, 0);
1999-07-07 22:19:36 +02:00
if (nbits != 0)
return -1;
}
return 0;
}
1999-07-07 22:19:36 +02:00
#define VISIBILITY_PRIVATE '0' /* Stabs character for private field */
#define VISIBILITY_PROTECTED '1' /* Stabs character for protected fld */
#define VISIBILITY_PUBLIC '2' /* Stabs character for public field */
#define VISIBILITY_IGNORE '9' /* Optimized out or zero length */
/* Structure for storing pointers to reference definitions for fast lookup
during "process_later". */
struct ref_map
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *stabs;
CORE_ADDR value;
struct symbol *sym;
};
#define MAX_CHUNK_REFS 100
#define REF_CHUNK_SIZE (MAX_CHUNK_REFS * sizeof (struct ref_map))
#define REF_MAP_SIZE(ref_chunk) ((ref_chunk) * REF_CHUNK_SIZE)
1999-07-07 22:19:36 +02:00
static struct ref_map *ref_map;
/* Ptr to free cell in chunk's linked list. */
1999-07-07 22:19:36 +02:00
static int ref_count = 0;
/* Number of chunks malloced. */
static int ref_chunk = 0;
1999-08-16 21:57:19 +02:00
/* This file maintains a cache of stabs aliases found in the symbol
table. If the symbol table changes, this cache must be cleared
or we are left holding onto data in invalid obstacks. */
1999-08-16 21:57:19 +02:00
void
2000-07-30 03:48:28 +02:00
stabsread_clear_cache (void)
1999-08-16 21:57:19 +02:00
{
ref_count = 0;
ref_chunk = 0;
}
/* Create array of pointers mapping refids to symbols and stab strings.
Add pointers to reference definition symbols and/or their values as we
find them, using their reference numbers as our index.
These will be used later when we resolve references. */
void
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
ref_add (int refnum, struct symbol *sym, const char *stabs, CORE_ADDR value)
{
if (ref_count == 0)
ref_chunk = 0;
if (refnum >= ref_count)
ref_count = refnum + 1;
if (ref_count > ref_chunk * MAX_CHUNK_REFS)
{
1999-07-07 22:19:36 +02:00
int new_slots = ref_count - ref_chunk * MAX_CHUNK_REFS;
int new_chunks = new_slots / MAX_CHUNK_REFS + 1;
ref_map = (struct ref_map *)
xrealloc (ref_map, REF_MAP_SIZE (ref_chunk + new_chunks));
memset (ref_map + ref_chunk * MAX_CHUNK_REFS, 0,
new_chunks * REF_CHUNK_SIZE);
ref_chunk += new_chunks;
}
ref_map[refnum].stabs = stabs;
ref_map[refnum].sym = sym;
ref_map[refnum].value = value;
}
/* Return defined sym for the reference REFNUM. */
struct symbol *
2000-07-30 03:48:28 +02:00
ref_search (int refnum)
{
if (refnum < 0 || refnum > ref_count)
return 0;
return ref_map[refnum].sym;
}
/* Parse a reference id in STRING and return the resulting
reference number. Move STRING beyond the reference id. */
1999-07-07 22:19:36 +02:00
static int
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
process_reference (const char **string)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p;
int refnum = 0;
1999-07-07 22:19:36 +02:00
if (**string != '#')
return 0;
/* Advance beyond the initial '#'. */
p = *string + 1;
/* Read number as reference id. */
while (*p && isdigit (*p))
{
refnum = refnum * 10 + *p - '0';
p++;
}
*string = p;
return refnum;
}
/* If STRING defines a reference, store away a pointer to the reference
definition for later use. Return the reference number. */
int
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
symbol_reference_defined (const char **string)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p = *string;
int refnum = 0;
refnum = process_reference (&p);
/* Defining symbols end in '='. */
1999-07-07 22:19:36 +02:00
if (*p == '=')
{
/* Symbol is being defined here. */
*string = p + 1;
return refnum;
}
else
{
/* Must be a reference. Either the symbol has already been defined,
or this is a forward reference to it. */
*string = p;
return -1;
}
}
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
static int
stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
{
int regno = gdbarch_stab_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
Introduce gdbarch_num_cooked_regs The expression gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch) is used quite often to find the number of cooked registers (raw + pseudo registers). This patch introduces gdbarch_num_cooked_regs, which does the equivalent. It substantially reduces required wrapping in some places, so should improve readability. There is a for loop in m68hc11_frame_unwind_cache that had iterated until (the equivalent of) gdbarch_num_cooked_regs (gdbarch) - 1. During review, we concluded that this is most likely an off-by-one mistake, so I replaced it with gdbarch_num_cooked_regs (gdbarch). gdb/ChangeLog: * gdbarch.sh (gdbarch_num_cooked_regs): New. * gdbarch.h: Re-generate. * ax-gdb.c (gen_expr): Use gdbarch_num_cooked_regs. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * findvar.c (value_of_register): Likewise. (value_of_register_lazy): Likewise. (address_from_register): Likewise. * frame.c (get_frame_register_bytes): Likewise. * gdbarch-selftests.c (register_to_value_test): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * i386-tdep.c (i386_dbx_reg_to_regnum): Likewise. (i386_svr4_reg_to_regnum): Likewise. * infcmd.c (default_print_registers_info): Likewise. (registers_info): Likewise. (print_vector_info): Likewise. (default_print_float_info): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * mdebugread.c (mdebug_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names): Likewise. (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_list_register_values): Likewise. (mi_cmd_data_write_register_values): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mips-tdep.c (print_gp_register_row): Likewise. (mips_print_registers_info): Likewise. * nds32-tdep.c (nds32_gdbarch_init): Likewise. * regcache.c (init_regcache_descr): Likewise. (register_size): Likewise. (register_dump::dump): Likewise. (cooked_read_test): Likewise. (cooked_write_test): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. (rs6000_gdbarch_init): Likewise. * stabsread.c (stab_reg_to_regnum): Likewise. * stack.c (info_frame_command): Likewise. * target-descriptions.c (tdesc_register_name): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * tui/tui-regs.c (tui_show_register_group): Likewise. * user-regs.c (user_reg_map_name_to_regnum): Likewise. (user_reg_map_regnum_to_name): Likewise. (value_of_user_reg): Likewise. (maintenance_print_user_registers): Likewise. * xtensa-tdep.c (xtensa_find_register_by_name): Likewise. (xtensa_register_name): Likewise. (xtensa_register_type): Likewise. (xtensa_reg_to_regnum): Likewise. (xtensa_pseudo_register_read): Likewise. (xtensa_pseudo_register_write): Likewise.
2018-10-22 04:29:21 +02:00
if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
{
Introduce gdbarch_num_cooked_regs The expression gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch) is used quite often to find the number of cooked registers (raw + pseudo registers). This patch introduces gdbarch_num_cooked_regs, which does the equivalent. It substantially reduces required wrapping in some places, so should improve readability. There is a for loop in m68hc11_frame_unwind_cache that had iterated until (the equivalent of) gdbarch_num_cooked_regs (gdbarch) - 1. During review, we concluded that this is most likely an off-by-one mistake, so I replaced it with gdbarch_num_cooked_regs (gdbarch). gdb/ChangeLog: * gdbarch.sh (gdbarch_num_cooked_regs): New. * gdbarch.h: Re-generate. * ax-gdb.c (gen_expr): Use gdbarch_num_cooked_regs. * dwarf2-frame.c (dwarf2_frame_cache): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * findvar.c (value_of_register): Likewise. (value_of_register_lazy): Likewise. (address_from_register): Likewise. * frame.c (get_frame_register_bytes): Likewise. * gdbarch-selftests.c (register_to_value_test): Likewise. * h8300-tdep.c (h8300_register_type): Likewise. * i386-tdep.c (i386_dbx_reg_to_regnum): Likewise. (i386_svr4_reg_to_regnum): Likewise. * infcmd.c (default_print_registers_info): Likewise. (registers_info): Likewise. (print_vector_info): Likewise. (default_print_float_info): Likewise. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. * mdebugread.c (mdebug_reg_to_regnum): Likewise. * mi/mi-main.c (mi_cmd_data_list_register_names): Likewise. (mi_cmd_data_list_changed_registers): Likewise. (mi_cmd_data_list_register_values): Likewise. (mi_cmd_data_write_register_values): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mips-tdep.c (print_gp_register_row): Likewise. (mips_print_registers_info): Likewise. * nds32-tdep.c (nds32_gdbarch_init): Likewise. * regcache.c (init_regcache_descr): Likewise. (register_size): Likewise. (register_dump::dump): Likewise. (cooked_read_test): Likewise. (cooked_write_test): Likewise. * rs6000-tdep.c (rs6000_register_sim_regno): Likewise. (rs6000_gdbarch_init): Likewise. * stabsread.c (stab_reg_to_regnum): Likewise. * stack.c (info_frame_command): Likewise. * target-descriptions.c (tdesc_register_name): Likewise. * trad-frame.c (trad_frame_alloc_saved_regs): Likewise. * tui/tui-regs.c (tui_show_register_group): Likewise. * user-regs.c (user_reg_map_name_to_regnum): Likewise. (user_reg_map_regnum_to_name): Likewise. (value_of_user_reg): Likewise. (maintenance_print_user_registers): Likewise. * xtensa-tdep.c (xtensa_find_register_by_name): Likewise. (xtensa_register_name): Likewise. (xtensa_register_type): Likewise. (xtensa_reg_to_regnum): Likewise. (xtensa_pseudo_register_read): Likewise. (xtensa_pseudo_register_write): Likewise.
2018-10-22 04:29:21 +02:00
reg_value_complaint (regno, gdbarch_num_cooked_regs (gdbarch),
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
sym->print_name ());
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
}
return regno;
}
static const struct symbol_register_ops stab_register_funcs = {
stab_reg_to_regnum
};
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
/* The "aclass" indices for computed symbols. */
static int stab_register_index;
static int stab_regparm_index;
struct symbol *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
2000-07-30 03:48:28 +02:00
struct objfile *objfile)
{
Change get_objfile_arch to a method on objfile This changes get_objfile_arch to be a new inline method, objfile::arch. To my surprise, this function came up while profiling DWARF psymbol reading. Making this change improved performance from 1.986 seconds to 1.869 seconds. Both measurements were done by taking the mean of 10 runs on a fixed copy of the gdb executable. gdb/ChangeLog 2020-04-18 Tom Tromey <tom@tromey.com> * xcoffread.c (enter_line_range, scan_xcoff_symtab): Update. * value.c (value_fn_field): Update. * valops.c (find_function_in_inferior) (value_allocate_space_in_inferior): Update. * tui/tui-winsource.c (tui_update_source_windows_with_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * symtab.c (lookup_global_or_static_symbol) (find_function_start_sal_1, skip_prologue_sal) (print_msymbol_info, find_gnu_ifunc, symbol_arch): Update. * symmisc.c (dump_msymbols, dump_symtab_1) (maintenance_print_one_line_table): Update. * symfile.c (init_entry_point_info, section_is_mapped) (list_overlays_command, simple_read_overlay_table) (simple_overlay_update_1): Update. * stap-probe.c (handle_stap_probe): Update. * stabsread.c (dbx_init_float_type, define_symbol) (read_one_struct_field, read_enum_type, read_range_type): Update. * source.c (info_line_command): Update. * python/python.c (gdbpy_source_objfile_script) (gdbpy_execute_objfile_script): Update. * python/py-type.c (save_objfile_types): Update. * python/py-objfile.c (py_free_objfile): Update. * python/py-inferior.c (python_new_objfile): Update. * psymtab.c (psym_find_pc_sect_compunit_symtab, dump_psymtab) (dump_psymtab_addrmap_1, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * printcmd.c (info_address_command): Update. * objfiles.h (struct objfile) <arch>: New method, from get_objfile_arch. (get_objfile_arch): Don't declare. * objfiles.c (get_objfile_arch): Remove. (filter_overlapping_sections): Update. * minsyms.c (msymbol_is_function): Update. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines) (output_nondebug_symbol): Update. * mdebugread.c (parse_symbol, basic_type, parse_partial_symbols) (mdebug_expand_psymtab): Update. * machoread.c (macho_add_oso_symfile): Update. * linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap): Update. * linux-fork.c (checkpoint_command): Update. * linespec.c (convert_linespec_to_sals): Update. * jit.c (finalize_symtab): Update. * infrun.c (insert_exception_resume_from_probe): Update. * ia64-tdep.c (ia64_find_unwind_table): Update. * hppa-tdep.c (internalize_unwinds): Update. * gdbtypes.c (get_type_arch, init_float_type, objfile_type): Update. * gcore.c (call_target_sbrk): Update. * elfread.c (record_minimal_symbol, elf_symtab_read) (elf_rel_plt_read, elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Update. * dwarf2/read.c (create_addrmap_from_index) (create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab) (read_debug_names_from_section) (process_psymtab_comp_unit_reader, add_partial_symbol) (add_partial_subprogram, process_full_comp_unit) (read_file_scope, read_func_scope, read_lexical_block_scope) (read_call_site_scope, dwarf2_ranges_read) (dwarf2_record_block_ranges, dwarf2_add_field) (mark_common_block_symbol_computed, read_tag_pointer_type) (read_tag_string_type, dwarf2_init_float_type) (dwarf2_init_complex_target_type, read_base_type) (partial_die_info::read, partial_die_info::read) (read_attribute_value, dwarf_decode_lines_1, new_symbol) (dwarf2_fetch_die_loc_sect_off): Update. * dwarf2/loc.c (dwarf2_find_location_expression) (class dwarf_evaluate_loc_desc, rw_pieced_value) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval) (dwarf2_loc_desc_get_symbol_read_needs) (locexpr_describe_location_piece, locexpr_describe_location_1) (loclist_describe_location): Update. * dwarf2/index-write.c (write_debug_names): Update. * dwarf2/frame.c (dwarf2_build_frame_info): Update. * dtrace-probe.c (dtrace_process_dof): Update. * dbxread.c (read_dbx_symtab, dbx_end_psymtab) (process_one_symbol): Update. * ctfread.c (ctf_init_float_type, read_base_type): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_base_type) (coff_read_enum_type): Update. * cli/cli-cmds.c (edit_command, list_command): Update. * buildsym.c (buildsym_compunit::finish_block_internal): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint, get_sal_arch): Update. * block.c (block_gdbarch): Update. * annotate.c (annotate_source_line): Update.
2020-04-18 16:35:04 +02:00
struct gdbarch *gdbarch = objfile->arch ();
struct symbol *sym;
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p = find_name_end (string);
int deftype;
int synonym = 0;
int i;
/* We would like to eliminate nameless symbols, but keep their types.
E.g. stab entry ":t10=*2" should produce a type 10, which is a pointer
to type 2, but, should not create a symbol to address that type. Since
the symbol will be nameless, there is no way any user can refer to it. */
int nameless;
/* Ignore syms with empty names. */
if (string[0] == 0)
return 0;
/* Ignore old-style symbols from cc -go. */
if (p == 0)
return 0;
while (p[1] == ':')
{
1999-07-07 22:19:36 +02:00
p += 2;
p = strchr (p, ':');
if (p == NULL)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (
_("Bad stabs string '%s'"), string);
return NULL;
}
}
/* If a nameless stab entry, all we need is the type, not the symbol.
e.g. ":t10=*2" or a nameless enum like " :T16=ered:0,green:1,blue:2,;" */
nameless = (p == string || ((string[0] == ' ') && (string[1] == ':')));
current_symbol = sym = allocate_symbol (objfile);
if (processing_gcc_compilation)
{
/* GCC 2.x puts the line number in desc. SunOS apparently puts in the
1999-07-07 22:19:36 +02:00
number of bytes occupied by a type or object, which we ignore. */
SYMBOL_LINE (sym) = desc;
}
else
{
1999-07-07 22:19:36 +02:00
SYMBOL_LINE (sym) = 0; /* unknown */
}
sym->set_language (get_current_subfile ()->language,
&objfile->objfile_obstack);
if (is_cplus_marker (string[0]))
{
/* Special GNU C++ names. */
switch (string[1])
{
1999-07-07 22:19:36 +02:00
case 't':
sym->set_linkage_name ("this");
1999-07-07 22:19:36 +02:00
break;
1999-07-07 22:19:36 +02:00
case 'v': /* $vtbl_ptr_type */
goto normal;
1999-07-07 22:19:36 +02:00
case 'e':
sym->set_linkage_name ("eh_throw");
1999-07-07 22:19:36 +02:00
break;
1999-07-07 22:19:36 +02:00
case '_':
/* This was an anonymous type that was never fixed up. */
goto normal;
1999-07-07 22:19:36 +02:00
case 'X':
/* SunPRO (3.0 at least) static variable encoding. */
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
if (gdbarch_static_transform_name_p (gdbarch))
goto normal;
Fix "fall through" comments This patch updates existing "fall through" comments so that they can be recognized by gcc's -Wimplicit-fallthrough comment-parsing heuristic. ChangeLog 2018-05-04 Tom Tromey <tom@tromey.com> * s390-tdep.c (s390_process_record): Fix fall-through comments. * xcoffread.c (scan_xcoff_symtab): Move comment later. * symfile.c (section_is_mapped): Fix fall-through comment. * stabsread.c (define_symbol, read_member_functions): Fix fall-through comment. * s390-linux-tdep.c (s390_process_record): Fix fall-through comment. * remote.c (remote_wait_as): Fix fall-through comment. * p-exp.y (yylex): Fix fall-through comment. * nat/x86-dregs.c (x86_length_and_rw_bits): Fix fall-through comment. * msp430-tdep.c (msp430_gdbarch_init): Fix fall-through comment. * mdebugread.c (parse_partial_symbols): Fix fall-through comment. * jv-exp.y (yylex): Fix fall-through comment. * go-exp.y (lex_one_token): Fix fall-through comment. * gdbtypes.c (get_discrete_bounds, rank_one_type): Fix fall-through comment. * f-exp.y (yylex): Fix fall-through comment. * dwarf2read.c (process_die): Fix fall-through comments. * dbxread.c (process_one_symbol): Fix fall-through comment. * d-exp.y (lex_one_token): Fix fall-through comment. * cp-name-parser.y (yylex): Fix fall-through comment. * coffread.c (coff_symtab_read): Fix fall-through comment. * c-exp.y (lex_one_token): Fix fall-through comment. * arm-tdep.c (arm_decode_miscellaneous): Fix fall-through comment. * arch/arm.c (arm_instruction_changes_pc): Fix fall-through comment.
2016-09-27 19:18:04 +02:00
/* fall through */
1999-07-07 22:19:36 +02:00
default:
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Unknown C++ symbol name `%s'"),
2002-12-17 01:39:08 +01:00
string);
goto normal; /* Do *something* with it. */
}
}
else
{
normal:
Use ui_file_as_string throughout more This replaces most of the remaining ui_file_xstrdup calls with ui_file_as_string calls. Whenever a call was replaced, that led to a cascade of other necessary adjustments throughout, to make the code use std::string instead of raw pointers. And then whenever I added a std::string as member of a struct, I needed to adjust allocation/destruction of said struct to use new/delete instead of xmalloc/xfree. The stopping point was once gdb built again. These doesn't seem to be a way to reasonably split this out further. Maybe-not-obvious changes: - demangle_for_lookup returns a cleanup today. To get rid of that, and avoid unnecessary string dupping/copying, this introduces a demangle_result_storage type that the caller instantiates and passes to demangle_for_lookup. - Many methods returned a "char *" to indicate that the caller owns the memory and must free it. Those are switched to return a std::string instead. Methods that return a "view" into some internal string return a "const char *" instead. I.e., we only copy/allocate when necessary. gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_name_for_lookup, type_as_string): Use and return std::string. (type_as_string_and_cleanup): Delete. (ada_lookup_struct_elt_type): Use type_as_string. * ada-lang.h (ada_name_for_lookup): Now returns std::string. * ada-varobj.c (ada_varobj_scalar_image): Return a std::string. (ada_varobj_describe_child): Make 'child_name' and 'child_path_expr' parameters std::string pointers. (ada_varobj_describe_struct_child, ada_varobj_describe_ptr_child): Likewise, and use string_printf. (ada_varobj_describe_simple_array_child) (ada_varobj_describe_child): Likewise. (ada_varobj_get_name_of_child, ada_varobj_get_path_expr_of_child) (ada_varobj_get_value_image) (ada_varobj_get_value_of_array_variable) (ada_varobj_get_value_of_variable, ada_name_of_variable) (ada_name_of_child, ada_path_expr_of_child) (ada_value_of_variable): Now returns std::string. Use string_printf. (ada_value_of_child): Adjust. * break-catch-throw.c (check_status_exception_catchpoint): Adjust to use std::string. * breakpoint.c (watch_command_1): Adjust to use std::string. * c-lang.c (c_get_string): Adjust to use std::string. * c-typeprint.c (print_name_maybe_canonical): Use std::string. * c-varobj.c (varobj_is_anonymous_child): Use ==/!= std::string operators. (c_name_of_variable): Now returns a std::string. (c_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (c_name_of_child, c_path_expr_of_child, c_value_of_variable) (cplus_number_of_children): Adjust to use std::string and string_printf. (cplus_name_of_variable): Now returns a std::string. (cplus_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (cplus_name_of_child, cplus_path_expr_of_child) (cplus_value_of_variable): Now returns a std::string. * cp-abi.c (cplus_typename_from_type_info): Return std::string. * cp-abi.h (cplus_typename_from_type_info): Return std::string. (struct cp_abi_ops) <get_typename_from_type_info>: Return std::string. * cp-support.c (inspect_type): Use std::string. (cp_canonicalize_string_full, cp_canonicalize_string_no_typedefs) (cp_canonicalize_string): Return std::string and adjust. * cp-support.h (cp_canonicalize_string) (cp_canonicalize_string_no_typedefs, cp_canonicalize_string_full): Return std::string. * dbxread.c (read_dbx_symtab): Use std::string. * dwarf2read.c (dwarf2_canonicalize_name): Adjust to use std::string. * gdbcmd.h (lookup_struct_elt_type): Adjust to use std::string. * gnu-v3-abi.c (gnuv3_get_typeid): Use std::string. (gnuv3_get_typename_from_type_info): Return a std::string and adjust. (gnuv3_get_type_from_type_info): Adjust to use std::string. * guile/guile.c (gdbscm_execute_gdb_command): Adjust to use std::string. * infcmd.c (print_return_value_1): Adjust to use std::string. * linespec.c (find_linespec_symbols): Adjust to demangle_for_lookup API change. Use std::string. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_set_format) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_evaluate_expression) (mi_cmd_var_assign, varobj_update_one): Adjust to use std::string. * minsyms.c (lookup_minimal_symbol): Use std::string. * python/py-varobj.c (py_varobj_iter_next): Use new instead of XNEW. vitem->name is a std::string now, adjust. * rust-exp.y (convert_ast_to_type, convert_name): Adjust to use std::string. * stabsread.c (define_symbol): Adjust to use std::string. * symtab.c (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. Use it for storage. (lookup_symbol_in_language) (lookup_symbol_in_objfile_from_linkage_name): Adjust to new demangle_for_lookup API. * symtab.h (struct demangle_result_storage): New type. (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. * typeprint.c (type_to_string): Return std::string and use ui_file_as_string. * value.h (type_to_string): Change return type to std::string. * varobj-iter.h (struct varobj_item) <name>: Now a std::string. (varobj_iter_delete): Use delete instead of xfree. * varobj.c (create_child): Return std::string instead of char * in output parameter. (name_of_variable, name_of_child, my_value_of_variable): Return std::string instead of char *. (varobj_create, varobj_get_handle): Constify 'objname' parameter. Adjust to std::string fields. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression): Return a std::string. (varobj_list_children): Adjust to use std::string. (varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. Adjust to std::string fields. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Change type of 'expression' parameter to std::string. Use std::string. (install_new_value): Use std::string. (delete_variable_1): Adjust to use std::string. (create_child): Change the 'name' parameter to a std::string reference. Swap it into the new item's name. (create_child_with_value): Swap item's name into the new child's name. Use string_printf. (new_variable): Use new instead of XNEW. (free_variable): Don't xfree fields that are now std::string. (name_of_variable, name_of_child): Now returns std::string. (value_of_root): Adjust to use std::string. (my_value_of_variable, varobj_value_get_print_value): Return and use std::string. (varobj_value_get_print_value): Adjust to use ui_file_as_string and std::string. * varobj.h (struct varobj) <name, path_expr, obj_name, print_value>: Now std::string's. <name_of_variable, name_of_child, path_expr_of_child, value_of_variable>: Return std::string. (varobj_create, varobj_get_handle): Constify 'objname' parameter. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression, varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Constify 'expression' parameter. (varobj_value_get_print_value): Return a std::string.
2016-11-08 16:26:47 +01:00
std::string new_name;
Use an accessor function for general_symbol_info::language Also renames the member variable to m_language to make code easier to read when more functions become member functions. I was originally hoping to eventually make m_language private (after a few more patches), but unfortunately then it no longer counts as a POD type, which means gdbsupport/poison.h won't let us use memset to initialize this type, which psymtabs rely on to clear padding bytes so that bcache can work properly. gdb/ChangeLog: 2019-12-15 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. * ax-gdb.c (gen_expr): Update. * block.c (block_lookup_symbol): Update. (block_lookup_symbol_primary): Update. (block_find_symbol): Update. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Update. * dbxread.c (process_one_symbol): Update. * dictionary.c (insert_symbol_hashed): Update. (collate_pending_symbols_by_language): Update. (mdict_add_symbol): Update. * dwarf-index-write.c (write_psymbols): Update. * dwarf2read.c (fixup_go_packaging): Update. * findvar.c (read_var_value): Update. * ft32-tdep.c (ft32_skip_prologue): Update. * go-lang.c (go_symbol_package_name): Update. * language.h (scoped_switch_to_sym_language_if_auto:: scoped_switch_to_sym_language_if_auto): Update. * linespec.c (find_method): Update. (find_label_symbols_in_block): Update. * mdebugread.c (parse_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. * minsyms.c (add_minsym_to_demangled_hash_table): Update. (minimal_symbol_reader::install): Update. * moxie-tdep.c (moxie_skip_prologue): Update. * parse.c (parse_exp_in_context): Update. * psymtab.c (psymbol_name_matches): Update. (match_partial_symbol): Update. (lookup_partial_symbol): Update. (psymbol_hash): Update. (psymbol_compare): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * stabsread.c (define_symbol): Update. * stack.c (print_frame_arg): Update. (find_frame_funname): Update. (info_frame_command_core): Update. * symfile.c (set_initial_language): Update. * symtab.c (symbol_set_demangled_name): Update. (symbol_get_demangled_name): Update. (symbol_set_language): Update. (symbol_find_demangled_name): Update. (symbol_set_names): Update. (general_symbol_info::natural_name): Update. (general_symbol_info::demangled_name): Update. (general_symbol_info::search_name): Update. (symbol_matches_search_name): Update. (eq_symbol_entry): Update. (iterate_over_symbols): Update. (completion_list_add_symbol): Update. (completion_list_add_msymbol): Update. (completion_list_add_fields): Update. * symtab.h (struct general_symbol_info) <language>: New function. <language>: Rename to... <m_language>: ...this. (SYMBOL_LANGUAGE): Remove. (MSYMBOL_LANGUAGE): Remove. (struct symbol) <ctor>: Update. * xstormy16-tdep.c (xstormy16_skip_prologue): Update. Change-Id: I6464d477457e61639c63ddf8b145e407a35c235a
2019-12-04 00:10:32 +01:00
if (sym->language () == language_cplus)
{
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
char *name = (char *) alloca (p - string + 1);
memcpy (name, string, p - string);
name[p - string] = '\0';
new_name = cp_canonicalize_string (name);
}
Use ui_file_as_string throughout more This replaces most of the remaining ui_file_xstrdup calls with ui_file_as_string calls. Whenever a call was replaced, that led to a cascade of other necessary adjustments throughout, to make the code use std::string instead of raw pointers. And then whenever I added a std::string as member of a struct, I needed to adjust allocation/destruction of said struct to use new/delete instead of xmalloc/xfree. The stopping point was once gdb built again. These doesn't seem to be a way to reasonably split this out further. Maybe-not-obvious changes: - demangle_for_lookup returns a cleanup today. To get rid of that, and avoid unnecessary string dupping/copying, this introduces a demangle_result_storage type that the caller instantiates and passes to demangle_for_lookup. - Many methods returned a "char *" to indicate that the caller owns the memory and must free it. Those are switched to return a std::string instead. Methods that return a "view" into some internal string return a "const char *" instead. I.e., we only copy/allocate when necessary. gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_name_for_lookup, type_as_string): Use and return std::string. (type_as_string_and_cleanup): Delete. (ada_lookup_struct_elt_type): Use type_as_string. * ada-lang.h (ada_name_for_lookup): Now returns std::string. * ada-varobj.c (ada_varobj_scalar_image): Return a std::string. (ada_varobj_describe_child): Make 'child_name' and 'child_path_expr' parameters std::string pointers. (ada_varobj_describe_struct_child, ada_varobj_describe_ptr_child): Likewise, and use string_printf. (ada_varobj_describe_simple_array_child) (ada_varobj_describe_child): Likewise. (ada_varobj_get_name_of_child, ada_varobj_get_path_expr_of_child) (ada_varobj_get_value_image) (ada_varobj_get_value_of_array_variable) (ada_varobj_get_value_of_variable, ada_name_of_variable) (ada_name_of_child, ada_path_expr_of_child) (ada_value_of_variable): Now returns std::string. Use string_printf. (ada_value_of_child): Adjust. * break-catch-throw.c (check_status_exception_catchpoint): Adjust to use std::string. * breakpoint.c (watch_command_1): Adjust to use std::string. * c-lang.c (c_get_string): Adjust to use std::string. * c-typeprint.c (print_name_maybe_canonical): Use std::string. * c-varobj.c (varobj_is_anonymous_child): Use ==/!= std::string operators. (c_name_of_variable): Now returns a std::string. (c_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (c_name_of_child, c_path_expr_of_child, c_value_of_variable) (cplus_number_of_children): Adjust to use std::string and string_printf. (cplus_name_of_variable): Now returns a std::string. (cplus_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (cplus_name_of_child, cplus_path_expr_of_child) (cplus_value_of_variable): Now returns a std::string. * cp-abi.c (cplus_typename_from_type_info): Return std::string. * cp-abi.h (cplus_typename_from_type_info): Return std::string. (struct cp_abi_ops) <get_typename_from_type_info>: Return std::string. * cp-support.c (inspect_type): Use std::string. (cp_canonicalize_string_full, cp_canonicalize_string_no_typedefs) (cp_canonicalize_string): Return std::string and adjust. * cp-support.h (cp_canonicalize_string) (cp_canonicalize_string_no_typedefs, cp_canonicalize_string_full): Return std::string. * dbxread.c (read_dbx_symtab): Use std::string. * dwarf2read.c (dwarf2_canonicalize_name): Adjust to use std::string. * gdbcmd.h (lookup_struct_elt_type): Adjust to use std::string. * gnu-v3-abi.c (gnuv3_get_typeid): Use std::string. (gnuv3_get_typename_from_type_info): Return a std::string and adjust. (gnuv3_get_type_from_type_info): Adjust to use std::string. * guile/guile.c (gdbscm_execute_gdb_command): Adjust to use std::string. * infcmd.c (print_return_value_1): Adjust to use std::string. * linespec.c (find_linespec_symbols): Adjust to demangle_for_lookup API change. Use std::string. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_set_format) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_evaluate_expression) (mi_cmd_var_assign, varobj_update_one): Adjust to use std::string. * minsyms.c (lookup_minimal_symbol): Use std::string. * python/py-varobj.c (py_varobj_iter_next): Use new instead of XNEW. vitem->name is a std::string now, adjust. * rust-exp.y (convert_ast_to_type, convert_name): Adjust to use std::string. * stabsread.c (define_symbol): Adjust to use std::string. * symtab.c (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. Use it for storage. (lookup_symbol_in_language) (lookup_symbol_in_objfile_from_linkage_name): Adjust to new demangle_for_lookup API. * symtab.h (struct demangle_result_storage): New type. (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. * typeprint.c (type_to_string): Return std::string and use ui_file_as_string. * value.h (type_to_string): Change return type to std::string. * varobj-iter.h (struct varobj_item) <name>: Now a std::string. (varobj_iter_delete): Use delete instead of xfree. * varobj.c (create_child): Return std::string instead of char * in output parameter. (name_of_variable, name_of_child, my_value_of_variable): Return std::string instead of char *. (varobj_create, varobj_get_handle): Constify 'objname' parameter. Adjust to std::string fields. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression): Return a std::string. (varobj_list_children): Adjust to use std::string. (varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. Adjust to std::string fields. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Change type of 'expression' parameter to std::string. Use std::string. (install_new_value): Use std::string. (delete_variable_1): Adjust to use std::string. (create_child): Change the 'name' parameter to a std::string reference. Swap it into the new item's name. (create_child_with_value): Swap item's name into the new child's name. Use string_printf. (new_variable): Use new instead of XNEW. (free_variable): Don't xfree fields that are now std::string. (name_of_variable, name_of_child): Now returns std::string. (value_of_root): Adjust to use std::string. (my_value_of_variable, varobj_value_get_print_value): Return and use std::string. (varobj_value_get_print_value): Adjust to use ui_file_as_string and std::string. * varobj.h (struct varobj) <name, path_expr, obj_name, print_value>: Now std::string's. <name_of_variable, name_of_child, path_expr_of_child, value_of_variable>: Return std::string. (varobj_create, varobj_get_handle): Constify 'objname' parameter. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression, varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Constify 'expression' parameter. (varobj_value_get_print_value): Return a std::string.
2016-11-08 16:26:47 +01:00
if (!new_name.empty ())
Make symbol_set_names a member function This also renames it to make it clearer that this is not a cheap function (to compute_and_set_names). Also renames name to m_name to make the implementation of the renamed function more readable. Most of the places that access sym->m_name directly were also changed to call linkage_name () instead, to make it clearer which name they are accessing. gdb/ChangeLog: 2019-12-26 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_decode_symbol): Update. * buildsym.c (add_symbol_to_list): Update. * coffread.c (process_coff_symbol): Update. * ctfread.c (ctf_add_enum_member_cb): Update. (new_symbol): Update. (ctf_add_var_cb): Update. * dwarf2read.c (fixup_go_packaging): Update. (dwarf2_compute_name): Update. (new_symbol): Update. * jit.c (finalize_symtab): Update. * language.c (language_alloc_type_symbol): Update. * mdebugread.c (new_symbol): Update. * minsyms.c (minimal_symbol_reader::record_full): Update. (minimal_symbol_reader::install): Update. * psymtab.c (print_partial_symbols): Update. (psymbol_hash): Update. (psymbol_compare): Update. (add_psymbol_to_bcache): Update. (maintenance_check_psymtabs): Update. * stabsread.c (define_symbol): Update. * symtab.c (symbol_set_names): Rename to... (general_symbol_info::compute_and_set_names): ...this. (general_symbol_info::natural_name): Update. (general_symbol_info::search_name): Update. (fixup_section): Update. * symtab.h (struct general_symbol_info) <name>: Rename to... <m_name>: ...this. <compute_and_set_names>: Rename from... (symbol_set_names): ...this. (SYMBOL_SET_NAMES): Remove. (struct symbol) <ctor>: Update. Change-Id: I8da1f10cab4e0b89f19d5750fa4e6e2ac8d2b24f
2019-11-28 03:52:35 +01:00
sym->compute_and_set_names (new_name, true, objfile->per_bfd);
else
Make symbol_set_names a member function This also renames it to make it clearer that this is not a cheap function (to compute_and_set_names). Also renames name to m_name to make the implementation of the renamed function more readable. Most of the places that access sym->m_name directly were also changed to call linkage_name () instead, to make it clearer which name they are accessing. gdb/ChangeLog: 2019-12-26 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_decode_symbol): Update. * buildsym.c (add_symbol_to_list): Update. * coffread.c (process_coff_symbol): Update. * ctfread.c (ctf_add_enum_member_cb): Update. (new_symbol): Update. (ctf_add_var_cb): Update. * dwarf2read.c (fixup_go_packaging): Update. (dwarf2_compute_name): Update. (new_symbol): Update. * jit.c (finalize_symtab): Update. * language.c (language_alloc_type_symbol): Update. * mdebugread.c (new_symbol): Update. * minsyms.c (minimal_symbol_reader::record_full): Update. (minimal_symbol_reader::install): Update. * psymtab.c (print_partial_symbols): Update. (psymbol_hash): Update. (psymbol_compare): Update. (add_psymbol_to_bcache): Update. (maintenance_check_psymtabs): Update. * stabsread.c (define_symbol): Update. * symtab.c (symbol_set_names): Rename to... (general_symbol_info::compute_and_set_names): ...this. (general_symbol_info::natural_name): Update. (general_symbol_info::search_name): Update. (fixup_section): Update. * symtab.h (struct general_symbol_info) <name>: Rename to... <m_name>: ...this. <compute_and_set_names>: Rename from... (symbol_set_names): ...this. (SYMBOL_SET_NAMES): Remove. (struct symbol) <ctor>: Update. Change-Id: I8da1f10cab4e0b89f19d5750fa4e6e2ac8d2b24f
2019-11-28 03:52:35 +01:00
sym->compute_and_set_names (gdb::string_view (string, p - string), true,
objfile->per_bfd);
Use an accessor function for general_symbol_info::language Also renames the member variable to m_language to make code easier to read when more functions become member functions. I was originally hoping to eventually make m_language private (after a few more patches), but unfortunately then it no longer counts as a POD type, which means gdbsupport/poison.h won't let us use memset to initialize this type, which psymtabs rely on to clear padding bytes so that bcache can work properly. gdb/ChangeLog: 2019-12-15 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. * ax-gdb.c (gen_expr): Update. * block.c (block_lookup_symbol): Update. (block_lookup_symbol_primary): Update. (block_find_symbol): Update. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Update. * dbxread.c (process_one_symbol): Update. * dictionary.c (insert_symbol_hashed): Update. (collate_pending_symbols_by_language): Update. (mdict_add_symbol): Update. * dwarf-index-write.c (write_psymbols): Update. * dwarf2read.c (fixup_go_packaging): Update. * findvar.c (read_var_value): Update. * ft32-tdep.c (ft32_skip_prologue): Update. * go-lang.c (go_symbol_package_name): Update. * language.h (scoped_switch_to_sym_language_if_auto:: scoped_switch_to_sym_language_if_auto): Update. * linespec.c (find_method): Update. (find_label_symbols_in_block): Update. * mdebugread.c (parse_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. * minsyms.c (add_minsym_to_demangled_hash_table): Update. (minimal_symbol_reader::install): Update. * moxie-tdep.c (moxie_skip_prologue): Update. * parse.c (parse_exp_in_context): Update. * psymtab.c (psymbol_name_matches): Update. (match_partial_symbol): Update. (lookup_partial_symbol): Update. (psymbol_hash): Update. (psymbol_compare): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * stabsread.c (define_symbol): Update. * stack.c (print_frame_arg): Update. (find_frame_funname): Update. (info_frame_command_core): Update. * symfile.c (set_initial_language): Update. * symtab.c (symbol_set_demangled_name): Update. (symbol_get_demangled_name): Update. (symbol_set_language): Update. (symbol_find_demangled_name): Update. (symbol_set_names): Update. (general_symbol_info::natural_name): Update. (general_symbol_info::demangled_name): Update. (general_symbol_info::search_name): Update. (symbol_matches_search_name): Update. (eq_symbol_entry): Update. (iterate_over_symbols): Update. (completion_list_add_symbol): Update. (completion_list_add_msymbol): Update. (completion_list_add_fields): Update. * symtab.h (struct general_symbol_info) <language>: New function. <language>: Rename to... <m_language>: ...this. (SYMBOL_LANGUAGE): Remove. (MSYMBOL_LANGUAGE): Remove. (struct symbol) <ctor>: Update. * xstormy16-tdep.c (xstormy16_skip_prologue): Update. Change-Id: I6464d477457e61639c63ddf8b145e407a35c235a
2019-12-04 00:10:32 +01:00
if (sym->language () == language_cplus)
cp_scan_for_anonymous_namespaces (get_buildsym_compunit (), sym,
objfile);
}
p++;
/* Determine the type of name being defined. */
#if 0
/* Getting GDB to correctly skip the symbol on an undefined symbol
descriptor and not ever dump core is a very dodgy proposition if
we do things this way. I say the acorn RISC machine can just
fix their compiler. */
/* The Acorn RISC machine's compiler can put out locals that don't
start with "234=" or "(3,4)=", so assume anything other than the
deftypes we know how to handle is a local. */
if (!strchr ("cfFGpPrStTvVXCR", *p))
#else
if (isdigit (*p) || *p == '(' || *p == '-')
#endif
deftype = 'l';
else
deftype = *p++;
switch (deftype)
{
case 'c':
/* c is a special case, not followed by a type-number.
1999-07-07 22:19:36 +02:00
SYMBOL:c=iVALUE for an integer constant symbol.
SYMBOL:c=rVALUE for a floating constant symbol.
SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
e.g. "b:c=e6,0" for "const b = blob1"
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
if (*p != '=')
{
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = error_type (&p, objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
return sym;
}
++p;
switch (*p++)
{
case 'r':
{
gdb_byte *dbl_valu;
* coffread.c (decode_type): Use builtin_type_int32 instead of FT_INTEGER fundamental type for array range index type. (decode_base_type): Use builtin types of current_gdbarch instead of fundamental types. * dwarf2read.c (struct dwarf2_cu): Remove ftypes member. (read_file_scope): Do not initialize ftypes member. (dwarf_base_type, dwarf2_fundamental_types): Remove functions. (read_array_type): Use builtin_type_int32 instead of FT_INTEGER fundamental type for array range index type. (read_tag_string_type): Likewise for string range index type. Also, do not overwrite FT_CHAR type with new string type. (read_base_type): If DW_AT_name is missing, create unnamed type with given properties instead of looking for a fundamental type. Create new types as TYPE_TARGET_TYPE for DW_ATE_address and DW_ATE_complex_float types. (read_subrange_type): Create new type to represent missing DW_AT_type instead of looking for a fundamental type. (die_type): Use builtin type to represent "void" instead of looking for a fundamental type. * stabsread.c (define_symbol): Use builtin types to represent 'r' and 'i' floating-point and integer constants. * gdbtypes.c (lookup_fundamental_type): Remove. * gdbtypes.h (lookup_fundamental_type): Remove prototype. (FT_VOID, FT_BOOLEAN, FT_CHAR, FT_SIGNED_CHAR, FT_UNSIGNED_CHAR, FT_SHORT, FT_SIGNED_SHORT, FT_UNSIGNED_SHORT, FT_INTEGER, FT_SIGNED_INTEGER, FT_UNSIGNED_INTEGER, FT_LONG, FT_SIGNED_LONG, FT_UNSIGNED_LONG, FT_LONG_LONG, FT_SIGNED_LONG_LONG, FT_UNSIGNED_LONG_LONG, FT_FLOAT, FT_DBL_PREC_FLOAT, FT_EXT_PREC_FLOAT, FT_COMPLEX, FT_DBL_PREC_COMPLEX, FT_EXT_PREC_COMPLEX, FT_STRING, FT_FIXED_DECIMAL, FT_FLOAT_DECIMAL, FT_BYTE, FT_UNSIGNED_BYTE, FT_TEMPLATE_ARG, FT_DECFLOAT, FT_DBL_PREC_DECFLOAT, FT_EXT_PREC_DECFLOAT, FT_NUM_MEMBERS): Remove macros. * objfiles.c (struct objfile): Remove fundamental_types member. * symfile.c (reread_symbols): Do not clear fundamental_types. * language.h (struct language_defn): Remove la_fund_type member. (create_fundamental_type): Remove. * language.c (unk_lang_create_fundamental_type): Remove. (unknown_language_defn, auto_language_defn, local_language_defn): Adapt initializer. * ada-lang.c (ada_create_fundamental_type): Remove. (ada_language_defn): Adapt initializer. * c-lang.h (c_create_fundamental_type): Remove prototype. * c-lang.c (c_create_fundamental_type): Remove. (c_language_defn, cplus_language_defn, asm_language_defn, minimal_language_defn): Adapt initializer. * f-lang.c (f_create_fundamental_type): Remove. (f_language_defn): Adapt initializer. * jv-lang.c (java_create_fundamental_type): Remove. (java_language_defn): Adapt initializer. * m2-lang.c (m2_create_fundamental_type): Remove. (m2_language_defn): Adapt initializer. * objc-lang.c (objc_create_fundamental_type): Remove. (objc_language_defn): Adapt initializer. * p-lang.h (pascal_create_fundamental_type): Remove prototype. * p-lang.c (pascal_create_fundamental_type): Remove. (pascal_language_defn): Adapt initializer. * scm-lang.c (scm_language_defn): Adapt initializer.
2007-12-05 00:33:00 +01:00
struct type *dbl_type;
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
dbl_type = objfile_type (objfile)->builtin_double;
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
dbl_valu
= (gdb_byte *) obstack_alloc (&objfile->objfile_obstack,
TYPE_LENGTH (dbl_type));
Target FP: Add string routines to target-float.{c,h} This adds target_float_to_string and target_float_from_string, which dispatch to the corresponding floatformat_ or decimal_ routines. Existing users of those routines are changed to use the new target-float routines instead (most of those places already handle both binary and decimal FP). In addition, two other places are changes to use target_float_from_string: - define_symbol in stabsread.c, when parsing a floating-point literal from stabs debug info - gdbarch-selftest.c when initializing a target format values (to eliminate use of DOUBLEST there). gdb/ChangeLog: 2017-11-06 Ulrich Weigand <uweigand@de.ibm.com> * target-float.c (target_float_to_string): New function. (target_float_from_string): New function. * target-float.h (target_float_to_string): Add prototype. (target_float_from_string): Add prototype. * valprint.c: Include "target-float.h". Do not include "doublest.h" and "dfp.h". (print_floating): Use target_float_to_string. * printcmd.c: Include "target-float.h". Do not include "dfp.h". (printf_floating): Use target_float_to_string. * i387-tdep.c: Include "target-float.h". Do not include "doublest.h". (print_i387_value): Use target_float_to_string. * mips-tdep.c: Include "target-float.h". (mips_print_fp_register): Use target_float_to_string. * sh64-tdep.c: Include "target-float.h". (sh64_do_fp_register): Use target_float_to_string. * parse.c: Include "target-float.h". Do not include "doublest.h" and "dfp.h". (parse_float): Use target_float_from_string. * stabsread.c: Include "target-float.h". Do not include "doublest.h". (define_symbol): Use target_float_from_string. * gdbarch-selftests.c: Include "target-float.h". (register_to_value_test): Use target_float_from_string.
2017-11-06 15:56:35 +01:00
target_float_from_string (dbl_valu, dbl_type, std::string (p));
* coffread.c (decode_type): Use builtin_type_int32 instead of FT_INTEGER fundamental type for array range index type. (decode_base_type): Use builtin types of current_gdbarch instead of fundamental types. * dwarf2read.c (struct dwarf2_cu): Remove ftypes member. (read_file_scope): Do not initialize ftypes member. (dwarf_base_type, dwarf2_fundamental_types): Remove functions. (read_array_type): Use builtin_type_int32 instead of FT_INTEGER fundamental type for array range index type. (read_tag_string_type): Likewise for string range index type. Also, do not overwrite FT_CHAR type with new string type. (read_base_type): If DW_AT_name is missing, create unnamed type with given properties instead of looking for a fundamental type. Create new types as TYPE_TARGET_TYPE for DW_ATE_address and DW_ATE_complex_float types. (read_subrange_type): Create new type to represent missing DW_AT_type instead of looking for a fundamental type. (die_type): Use builtin type to represent "void" instead of looking for a fundamental type. * stabsread.c (define_symbol): Use builtin types to represent 'r' and 'i' floating-point and integer constants. * gdbtypes.c (lookup_fundamental_type): Remove. * gdbtypes.h (lookup_fundamental_type): Remove prototype. (FT_VOID, FT_BOOLEAN, FT_CHAR, FT_SIGNED_CHAR, FT_UNSIGNED_CHAR, FT_SHORT, FT_SIGNED_SHORT, FT_UNSIGNED_SHORT, FT_INTEGER, FT_SIGNED_INTEGER, FT_UNSIGNED_INTEGER, FT_LONG, FT_SIGNED_LONG, FT_UNSIGNED_LONG, FT_LONG_LONG, FT_SIGNED_LONG_LONG, FT_UNSIGNED_LONG_LONG, FT_FLOAT, FT_DBL_PREC_FLOAT, FT_EXT_PREC_FLOAT, FT_COMPLEX, FT_DBL_PREC_COMPLEX, FT_EXT_PREC_COMPLEX, FT_STRING, FT_FIXED_DECIMAL, FT_FLOAT_DECIMAL, FT_BYTE, FT_UNSIGNED_BYTE, FT_TEMPLATE_ARG, FT_DECFLOAT, FT_DBL_PREC_DECFLOAT, FT_EXT_PREC_DECFLOAT, FT_NUM_MEMBERS): Remove macros. * objfiles.c (struct objfile): Remove fundamental_types member. * symfile.c (reread_symbols): Do not clear fundamental_types. * language.h (struct language_defn): Remove la_fund_type member. (create_fundamental_type): Remove. * language.c (unk_lang_create_fundamental_type): Remove. (unknown_language_defn, auto_language_defn, local_language_defn): Adapt initializer. * ada-lang.c (ada_create_fundamental_type): Remove. (ada_language_defn): Adapt initializer. * c-lang.h (c_create_fundamental_type): Remove prototype. * c-lang.c (c_create_fundamental_type): Remove. (c_language_defn, cplus_language_defn, asm_language_defn, minimal_language_defn): Adapt initializer. * f-lang.c (f_create_fundamental_type): Remove. (f_language_defn): Adapt initializer. * jv-lang.c (java_create_fundamental_type): Remove. (java_language_defn): Adapt initializer. * m2-lang.c (m2_create_fundamental_type): Remove. (m2_language_defn): Adapt initializer. * objc-lang.c (objc_create_fundamental_type): Remove. (objc_language_defn): Adapt initializer. * p-lang.h (pascal_create_fundamental_type): Remove prototype. * p-lang.c (pascal_create_fundamental_type): Remove. (pascal_language_defn): Adapt initializer. * scm-lang.c (scm_language_defn): Adapt initializer.
2007-12-05 00:33:00 +01:00
SYMBOL_TYPE (sym) = dbl_type;
SYMBOL_VALUE_BYTES (sym) = dbl_valu;
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST_BYTES;
}
break;
case 'i':
{
/* Defining integer constants this way is kind of silly,
since 'e' constants allows the compiler to give not
only the value, but the type as well. C has at least
int, long, unsigned int, and long long as constant
types; other languages probably should have at least
unsigned as well as signed constants. */
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_long;
SYMBOL_VALUE (sym) = atoi (p);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
}
break;
case 'c':
{
SYMBOL_TYPE (sym) = objfile_type (objfile)->builtin_char;
SYMBOL_VALUE (sym) = atoi (p);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
}
break;
case 's':
{
struct type *range_type;
int ind = 0;
char quote = *p++;
gdb_byte *string_local = (gdb_byte *) alloca (strlen (p));
gdb_byte *string_value;
if (quote != '\'' && quote != '"')
{
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = error_type (&p, objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
return sym;
}
/* Find matching quote, rejecting escaped quotes. */
while (*p && *p != quote)
{
if (*p == '\\' && p[1] == quote)
{
string_local[ind] = (gdb_byte) quote;
ind++;
p += 2;
}
else if (*p)
{
string_local[ind] = (gdb_byte) (*p);
ind++;
p++;
}
}
if (*p != quote)
{
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = error_type (&p, objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
return sym;
}
/* NULL terminate the string. */
string_local[ind] = 0;
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_type
= create_static_range_type (NULL,
objfile_type (objfile)->builtin_int,
0, ind);
SYMBOL_TYPE (sym) = create_array_type (NULL,
objfile_type (objfile)->builtin_char,
range_type);
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
string_value
= (gdb_byte *) obstack_alloc (&objfile->objfile_obstack, ind + 1);
memcpy (string_value, string_local, ind + 1);
p++;
SYMBOL_VALUE_BYTES (sym) = string_value;
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST_BYTES;
}
break;
case 'e':
/* SYMBOL:c=eTYPE,INTVALUE for a constant symbol whose value
can be represented as integral.
e.g. "b:c=e6,0" for "const b = blob1"
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
{
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = read_type (&p, objfile);
if (*p != ',')
{
SYMBOL_TYPE (sym) = error_type (&p, objfile);
break;
}
++p;
/* If the value is too big to fit in an int (perhaps because
it is unsigned), or something like that, we silently get
a bogus value. The type and everything else about it is
correct. Ideally, we should be using whatever we have
available for parsing unsigned and long long values,
however. */
SYMBOL_VALUE (sym) = atoi (p);
}
break;
default:
{
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = error_type (&p, objfile);
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
return sym;
case 'C':
/* The name of a caught exception. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_LABEL;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
add_symbol_to_list (sym, get_local_symbols ());
break;
case 'f':
/* A static function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
/* fall into process_function_types. */
process_function_types:
/* Function result types are described as the result type in stabs.
1999-07-07 22:19:36 +02:00
We need to convert this to the function-returning-type-X type
in GDB. E.g. "int" is converted to "function returning int". */
if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_FUNC)
SYMBOL_TYPE (sym) = lookup_function_type (SYMBOL_TYPE (sym));
gdb/ * buildsym.h (processing_hp_compilation): Remove obsolete variable. * gdbarch.sh Remove include of "value.h" in gdbarch.h. (COERCE_FLOAT_TO_DOUBLE): Remove. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * Makefile.in: Remove value_h from gdbarch_h. * valops.c (coerce_float_to_double): New variable. (default_coerce_float_to_double): Remove. (standard_coerce_float_to_double): Remove. (value_arg_coerce): Use coerce_float_to_double. (_initialize_valops): Add "set coerce-float-to-double". * value.h (default_coerce_float_to_double): Remove prototype. (standard_coerce_float_to_double): Remove prototype. * hpread.c (hpread_process_one_debug_symbol): Mark C++ functions as prototyped. * mdebugread.c (parse_symbol): Likewise. * stabsread.c (define_symbol): Mark all functions as prototyped. * hppa-tdep.c (hppa_coerce_float_to_double): Remove. * alpha-tdep.c (alpha_gdbarch_init): Remove call to set_gdbarch_coerce_float_to_double. * arm-tdep.c (arm_gdbarch_init): Likewise. * frv-tdep.c (frv_gdbarch_init): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise (commented out). * i386-sol2-tdep.c (i386_sol2_init_abi): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. (mips_coerce_float_to_double): Remove. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. (rs6000_coerce_float_to_double): Remove. * s390-tdep.c (s390_gdbarch_init): Likewise. * sh-tdep.c (sh_gdbarch_init): Likewise. (sh_coerce_float_to_double): Remove. * sparc-tdep.c (sparc_gdbarch_init): Likewise. (sparc_coerce_float_to_double): Remove. * v850-tdep.c (v850_gdbarch_init): Likewise. * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise. * config/m32r/tm-m32r.h (COERCE_FLOAT_TO_DOUBLE): Remove. * config/pa/tm-hppa.h: (COERCE_FLOAT_TO_DOUBLE): Remove. (hppa_coerce_float_to_double): Remove prototype. * config/sparc/tm-sparc.h (COERCE_FLOAT_TO_DOUBLE): Remove. doc/ * gdb.texinfo (Controlling GDB): Add ABI section. Document "set coerce-float-to-double". * gdbint.texinfo (COERCE_FLOAT_TO_DOUBLE): Remove documentation. testsuite/ * gdb.base/callfuncs.exp: Don't XFAIL unprototyped functions for stabs. * gdb.base/completion.exp: Allow marker1(void) as well as marker1(). * gdb.base/whatis.exp: Always allow (void) after function names.
2003-01-04 23:37:49 +01:00
/* All functions in C++ have prototypes. Stabs does not offer an
explicit way to identify prototyped or unprototyped functions,
but both GCC and Sun CC emit stabs for the "call-as" type rather
than the "declared-as" type for unprototyped functions, so
we treat all functions as if they were prototyped. This is used
primarily for promotion when calling the function from GDB. */
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_PROTOTYPED (SYMBOL_TYPE (sym)) = 1;
/* fall into process_prototype_types. */
process_prototype_types:
/* Sun acc puts declared types of arguments here. */
if (*p == ';')
{
struct type *ftype = SYMBOL_TYPE (sym);
int nsemi = 0;
int nparams = 0;
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p1 = p;
/* Obtain a worst case guess for the number of arguments
by counting the semicolons. */
while (*p1)
{
if (*p1++ == ';')
nsemi++;
}
/* Allocate parameter information fields and fill them in. */
TYPE_FIELDS (ftype) = (struct field *)
TYPE_ALLOC (ftype, nsemi * sizeof (struct field));
while (*p++ == ';')
{
struct type *ptype;
/* A type number of zero indicates the start of varargs.
1999-07-07 22:19:36 +02:00
FIXME: GDB currently ignores vararg functions. */
if (p[0] == '0' && p[1] == '\0')
break;
ptype = read_type (&p, objfile);
/* The Sun compilers mark integer arguments, which should
1999-07-07 22:19:36 +02:00
be promoted to the width of the calling conventions, with
a type which references itself. This type is turned into
1999-07-07 22:19:36 +02:00
a TYPE_CODE_VOID type by read_type, and we have to turn
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
it back into builtin_int here.
FIXME: Do we need a new builtin_promoted_int_arg ? */
if (TYPE_CODE (ptype) == TYPE_CODE_VOID)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
ptype = objfile_type (objfile)->builtin_int;
TYPE_FIELD_TYPE (ftype, nparams) = ptype;
TYPE_FIELD_ARTIFICIAL (ftype, nparams++) = 0;
}
TYPE_NFIELDS (ftype) = nparams;
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_PROTOTYPED (ftype) = 1;
}
break;
case 'F':
/* A global function definition. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_global_symbols ());
goto process_function_types;
case 'G':
/* For a class G (global) symbol, it appears that the
1999-07-07 22:19:36 +02:00
value is not correct. It is necessary to search for the
corresponding linker definition to find the value.
These definitions appear at the end of the namelist. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* Don't add symbol references to global_sym_chain.
1999-07-07 22:19:36 +02:00
Symbol references don't have valid names and wont't match up with
minimal symbols when the global_sym_chain is relocated.
We'll fixup symbol references when we fixup the defining symbol. */
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
if (sym->linkage_name () && sym->linkage_name ()[0] != '#')
{
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
i = hashname (sym->linkage_name ());
1999-07-07 22:19:36 +02:00
SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym;
}
add_symbol_to_list (sym, get_global_symbols ());
break;
/* This case is faked by a conditional above,
1999-07-07 22:19:36 +02:00
when there is no code letter in the dbx data.
Dbx data never actually contains 'l'. */
case 's':
case 'l':
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
break;
case 'p':
if (*p == 'F')
/* pF is a two-letter code that means a function parameter in Fortran.
The type-number specifies the type of the return value.
Translate it into a pointer-to-function type. */
{
p++;
SYMBOL_TYPE (sym)
= lookup_pointer_type
1999-07-07 22:19:36 +02:00
(lookup_function_type (read_type (&p, objfile)));
}
else
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_ARG;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_IS_ARGUMENT (sym) = 1;
add_symbol_to_list (sym, get_local_symbols ());
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
if (gdbarch_byte_order (gdbarch) != BFD_ENDIAN_BIG)
{
/* On little-endian machines, this crud is never necessary,
and, if the extra bytes contain garbage, is harmful. */
break;
}
/* If it's gcc-compiled, if it says `short', believe it. */
if (processing_gcc_compilation
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
|| gdbarch_believe_pcc_promotion (gdbarch))
break;
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
if (!gdbarch_believe_pcc_promotion (gdbarch))
1999-04-26 20:34:20 +02:00
{
/* If PCC says a parameter is a short or a char, it is
really an int. */
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
if (TYPE_LENGTH (SYMBOL_TYPE (sym))
< gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT
&& TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
1999-04-26 20:34:20 +02:00
{
SYMBOL_TYPE (sym) =
TYPE_UNSIGNED (SYMBOL_TYPE (sym))
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
? objfile_type (objfile)->builtin_unsigned_int
: objfile_type (objfile)->builtin_int;
1999-04-26 20:34:20 +02:00
}
break;
1999-04-26 20:34:20 +02:00
}
/* Fall through. */
case 'P':
/* acc seems to use P to declare the prototypes of functions that
are referenced by this file. gdb is not prepared to deal
with this extra information. FIXME, it ought to. */
if (type == N_FUN)
{
SYMBOL_TYPE (sym) = read_type (&p, objfile);
goto process_prototype_types;
}
1999-07-07 22:19:36 +02:00
/*FALLTHROUGH */
case 'R':
/* Parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = stab_register_index;
SYMBOL_IS_ARGUMENT (sym) = 1;
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
break;
case 'r':
/* Register variable (either global or local). */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = stab_register_index;
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
if (within_function)
{
/* Sun cc uses a pair of symbols, one 'p' and one 'r', with
the same name to represent an argument passed in a
register. GCC uses 'P' for the same case. So if we find
such a symbol pair we combine it into one 'P' symbol.
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
For Sun cc we need to do this regardless of stabs_argument_has_addr, because the compiler puts out
the 'p' symbol even if it never saves the argument onto
the stack.
On most machines, we want to preserve both symbols, so
that we can still get information about what is going on
with the stack (VAX for computing args_printed, using
stack slots instead of saved registers in backtraces,
etc.).
Note that this code illegally combines
1999-07-07 22:19:36 +02:00
main(argc) struct foo argc; { register struct foo argc; }
but this case is considered pathological and causes a warning
from a decent compiler. */
struct pending *local_symbols = *get_local_symbols ();
if (local_symbols
&& local_symbols->nsyms > 0
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
&& gdbarch_stabs_argument_has_addr (gdbarch, SYMBOL_TYPE (sym)))
{
struct symbol *prev_sym;
prev_sym = local_symbols->symbol[local_symbols->nsyms - 1];
if ((SYMBOL_CLASS (prev_sym) == LOC_REF_ARG
|| SYMBOL_CLASS (prev_sym) == LOC_ARG)
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
&& strcmp (prev_sym->linkage_name (),
sym->linkage_name ()) == 0)
{
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (prev_sym) = stab_register_index;
/* Use the type from the LOC_REGISTER; that is the type
that is actually in that register. */
SYMBOL_TYPE (prev_sym) = SYMBOL_TYPE (sym);
SYMBOL_VALUE (prev_sym) = SYMBOL_VALUE (sym);
sym = prev_sym;
break;
}
}
add_symbol_to_list (sym, get_local_symbols ());
}
else
add_symbol_to_list (sym, get_file_symbols ());
break;
case 'S':
/* Static symbol at top level of file. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
if (gdbarch_static_transform_name_p (gdbarch)
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
&& gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
!= sym->linkage_name ())
1999-07-07 22:19:36 +02:00
{
use bound_minsym as result for lookup_minimal_symbol et al This patch changes a few minimal symbol lookup functions to return a bound_minimal_symbol rather than a pointer to the minsym. This change helps prepare gdb for computing a minimal symbol's address at the point of use. Note that this changes even those functions that ostensibly search a single objfile. That was necessary because, in fact, those functions can search an objfile and its separate debug objfiles; and it is important for the caller to know in which objfile the minimal symbol was actually found. The bulk of this patch is mechanical. 2014-02-26 Tom Tromey <tromey@redhat.com> * ada-lang.c (ada_update_initial_language): Update. (ada_main_name, ada_has_this_exception_support): Update. * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * arm-tdep.c (arm_skip_stub): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * breakpoint.c (struct breakpoint_objfile_data) <overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change type to bound_minimal_symbol. (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * c-exp.y (classify_name): Update. * coffread.c (coff_symfile_read): Update. * common/agent.c (agent_look_up_symbols): Update. * d-lang.c (d_main_name): Update. * dbxread.c (find_stab_function_addr, end_psymtab): Update. * dec-thread.c (enable_dec_thread): Update. * dwarf2loc.c (call_site_to_target_addr): Update. * elfread.c (elf_gnu_ifunc_resolve_by_got): Update. * eval.c (evaluate_subexp_standard): Update. * findvar.c (struct minsym_lookup_data) <result>: Change type to bound_minimal_symbol. <objfile>: Remove. (minsym_lookup_iterator_cb, default_read_var_value): Update. * frame.c (inside_main_func): Update. * frv-tdep.c (frv_frame_this_id): Update. * gcore.c (call_target_sbrk): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline): Update. * go-lang.c (go_main_name): Update. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code) (hppa_hpux_find_import_stub_for_addr): Update. * hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol): Update. Change return type. * hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return type. * jit.c (jit_breakpoint_re_set_internal): Update. * linux-fork.c (inferior_call_waitpid, checkpoint_command): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update * m32c-tdep.c (m32c_return_value) (m32c_m16c_address_to_pointer): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * minsyms.c (lookup_minimal_symbol_internal): Rename to lookup_minimal_symbol. Change return type. (lookup_minimal_symbol): Remove. (lookup_bound_minimal_symbol): Update. (lookup_minimal_symbol_text): Change return type. (lookup_minimal_symbol_solib_trampoline): Change return type. * minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text) (lookup_minimal_symbol_solib_trampoline): Change return type. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (value_nsstring, find_imps): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-lang.c (pascal_main_name): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * proc-service.c (ps_pglobal_lookup): Update. * ravenscar-thread.c (get_running_thread_msymbol): Change return type. (has_ravenscar_runtime, get_running_thread_id): Update. * remote.c (remote_check_symbols): Update. * sol-thread.c (ps_pglobal_lookup): Update. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base, frv_relocate_section_addresses): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook) (som_solib_desire_dynamic_linker_symbols, link_map_start): Update. * solib-spu.c (spu_enable_break): Update. * solib-svr4.c (elf_locate_base, enable_break): Update. * spu-tdep.c (spu_get_overlay_table, spu_catch_start) (flush_ea_cache): Update. * stabsread.c (define_symbol): Update. * symfile.c (simple_read_overlay_table): Update. * symtab.c (find_pc_sect_line): Update. * tracepoint.c (scope_info): Update. * tui-disasm.c (tui_get_begin_asm_address): Update. * value.c (value_static_field): Update.
2013-10-15 03:53:29 +02:00
struct bound_minimal_symbol msym;
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
use bound_minsym as result for lookup_minimal_symbol et al This patch changes a few minimal symbol lookup functions to return a bound_minimal_symbol rather than a pointer to the minsym. This change helps prepare gdb for computing a minimal symbol's address at the point of use. Note that this changes even those functions that ostensibly search a single objfile. That was necessary because, in fact, those functions can search an objfile and its separate debug objfiles; and it is important for the caller to know in which objfile the minimal symbol was actually found. The bulk of this patch is mechanical. 2014-02-26 Tom Tromey <tromey@redhat.com> * ada-lang.c (ada_update_initial_language): Update. (ada_main_name, ada_has_this_exception_support): Update. * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * arm-tdep.c (arm_skip_stub): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * breakpoint.c (struct breakpoint_objfile_data) <overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change type to bound_minimal_symbol. (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * c-exp.y (classify_name): Update. * coffread.c (coff_symfile_read): Update. * common/agent.c (agent_look_up_symbols): Update. * d-lang.c (d_main_name): Update. * dbxread.c (find_stab_function_addr, end_psymtab): Update. * dec-thread.c (enable_dec_thread): Update. * dwarf2loc.c (call_site_to_target_addr): Update. * elfread.c (elf_gnu_ifunc_resolve_by_got): Update. * eval.c (evaluate_subexp_standard): Update. * findvar.c (struct minsym_lookup_data) <result>: Change type to bound_minimal_symbol. <objfile>: Remove. (minsym_lookup_iterator_cb, default_read_var_value): Update. * frame.c (inside_main_func): Update. * frv-tdep.c (frv_frame_this_id): Update. * gcore.c (call_target_sbrk): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline): Update. * go-lang.c (go_main_name): Update. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code) (hppa_hpux_find_import_stub_for_addr): Update. * hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol): Update. Change return type. * hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return type. * jit.c (jit_breakpoint_re_set_internal): Update. * linux-fork.c (inferior_call_waitpid, checkpoint_command): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update * m32c-tdep.c (m32c_return_value) (m32c_m16c_address_to_pointer): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * minsyms.c (lookup_minimal_symbol_internal): Rename to lookup_minimal_symbol. Change return type. (lookup_minimal_symbol): Remove. (lookup_bound_minimal_symbol): Update. (lookup_minimal_symbol_text): Change return type. (lookup_minimal_symbol_solib_trampoline): Change return type. * minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text) (lookup_minimal_symbol_solib_trampoline): Change return type. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (value_nsstring, find_imps): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-lang.c (pascal_main_name): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * proc-service.c (ps_pglobal_lookup): Update. * ravenscar-thread.c (get_running_thread_msymbol): Change return type. (has_ravenscar_runtime, get_running_thread_id): Update. * remote.c (remote_check_symbols): Update. * sol-thread.c (ps_pglobal_lookup): Update. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base, frv_relocate_section_addresses): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook) (som_solib_desire_dynamic_linker_symbols, link_map_start): Update. * solib-spu.c (spu_enable_break): Update. * solib-svr4.c (elf_locate_base, enable_break): Update. * spu-tdep.c (spu_get_overlay_table, spu_catch_start) (flush_ea_cache): Update. * stabsread.c (define_symbol): Update. * symfile.c (simple_read_overlay_table): Update. * symtab.c (find_pc_sect_line): Update. * tracepoint.c (scope_info): Update. * tui-disasm.c (tui_get_begin_asm_address): Update. * value.c (value_static_field): Update.
2013-10-15 03:53:29 +02:00
if (msym.minsym != NULL)
1999-07-07 22:19:36 +02:00
{
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
const char *new_name = gdbarch_static_transform_name
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
(gdbarch, sym->linkage_name ());
sym->set_linkage_name (new_name);
SET_SYMBOL_VALUE_ADDRESS (sym,
BMSYMBOL_VALUE_ADDRESS (msym));
1999-07-07 22:19:36 +02:00
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
break;
case 't':
/* In Ada, there is no distinction between typedef and non-typedef;
any type declaration implicitly has the equivalent of a typedef,
and thus 't' is in fact equivalent to 'Tt'.
Therefore, for Ada units, we check the character immediately
before the 't', and if we do not find a 'T', then make sure to
create the associated symbol in the STRUCT_DOMAIN ('t' definitions
will be stored in the VAR_DOMAIN). If the symbol was indeed
defined as 'Tt' then the STRUCT_DOMAIN symbol will be created
elsewhere, so we don't need to take care of that.
This is important to do, because of forward references:
The cleanup of undefined types stored in undef_types only uses
STRUCT_DOMAIN symbols to perform the replacement. */
Use an accessor function for general_symbol_info::language Also renames the member variable to m_language to make code easier to read when more functions become member functions. I was originally hoping to eventually make m_language private (after a few more patches), but unfortunately then it no longer counts as a POD type, which means gdbsupport/poison.h won't let us use memset to initialize this type, which psymtabs rely on to clear padding bytes so that bcache can work properly. gdb/ChangeLog: 2019-12-15 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. * ax-gdb.c (gen_expr): Update. * block.c (block_lookup_symbol): Update. (block_lookup_symbol_primary): Update. (block_find_symbol): Update. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Update. * dbxread.c (process_one_symbol): Update. * dictionary.c (insert_symbol_hashed): Update. (collate_pending_symbols_by_language): Update. (mdict_add_symbol): Update. * dwarf-index-write.c (write_psymbols): Update. * dwarf2read.c (fixup_go_packaging): Update. * findvar.c (read_var_value): Update. * ft32-tdep.c (ft32_skip_prologue): Update. * go-lang.c (go_symbol_package_name): Update. * language.h (scoped_switch_to_sym_language_if_auto:: scoped_switch_to_sym_language_if_auto): Update. * linespec.c (find_method): Update. (find_label_symbols_in_block): Update. * mdebugread.c (parse_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. * minsyms.c (add_minsym_to_demangled_hash_table): Update. (minimal_symbol_reader::install): Update. * moxie-tdep.c (moxie_skip_prologue): Update. * parse.c (parse_exp_in_context): Update. * psymtab.c (psymbol_name_matches): Update. (match_partial_symbol): Update. (lookup_partial_symbol): Update. (psymbol_hash): Update. (psymbol_compare): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * stabsread.c (define_symbol): Update. * stack.c (print_frame_arg): Update. (find_frame_funname): Update. (info_frame_command_core): Update. * symfile.c (set_initial_language): Update. * symtab.c (symbol_set_demangled_name): Update. (symbol_get_demangled_name): Update. (symbol_set_language): Update. (symbol_find_demangled_name): Update. (symbol_set_names): Update. (general_symbol_info::natural_name): Update. (general_symbol_info::demangled_name): Update. (general_symbol_info::search_name): Update. (symbol_matches_search_name): Update. (eq_symbol_entry): Update. (iterate_over_symbols): Update. (completion_list_add_symbol): Update. (completion_list_add_msymbol): Update. (completion_list_add_fields): Update. * symtab.h (struct general_symbol_info) <language>: New function. <language>: Rename to... <m_language>: ...this. (SYMBOL_LANGUAGE): Remove. (MSYMBOL_LANGUAGE): Remove. (struct symbol) <ctor>: Update. * xstormy16-tdep.c (xstormy16_skip_prologue): Update. Change-Id: I6464d477457e61639c63ddf8b145e407a35c235a
2019-12-04 00:10:32 +01:00
synonym = (sym->language () == language_ada && p[-2] != 'T');
/* Typedef */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
/* For a nameless type, we don't want a create a symbol, thus we
did not use `sym'. Return without further processing. */
1999-07-07 22:19:36 +02:00
if (nameless)
return NULL;
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
/* C++ vagaries: we may have a type which is derived from
1999-07-07 22:19:36 +02:00
a base type which did not have its name defined when the
derived class was output. We fill in the derived class's
base part member's name here in that case. */
if (TYPE_NAME (SYMBOL_TYPE (sym)) != NULL)
if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
|| TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION)
&& TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)))
{
int j;
for (j = TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)) - 1; j >= 0; j--)
if (TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) == 0)
TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) =
Remove type_name_no_tag and rename type_name_no_tag_or_error type_name_no_tag is just a plain wrapper for TYPE_NAME now, so this patch removes it. And, because tag names no longer exist, this renames type_name_no_tag_or_error to type_name_or_error. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (value_cast_structs, destructor_name_p): Update. * symtab.c (gdb_mangle_name): Update. * stabsread.c (define_symbol, read_cpp_abbrev, read_baseclasses): Update. * p-valprint.c (pascal_object_is_vtbl_ptr_type) (pascal_object_print_value_fields, pascal_object_print_value): Update. * p-typeprint.c (pascal_type_print_derivation_info): Update. * linespec.c (find_methods): Update. * gdbtypes.h (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. * gdbtypes.c (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. (lookup_struct_elt_type, check_typedef): Update. * expprint.c (print_subexp_standard): Update. * dwarf2read.c (dwarf2_add_field, load_partial_dies): Update. * d-namespace.c (d_lookup_nested_symbol): Update. * cp-valprint.c (cp_is_vtbl_ptr_type, cp_print_value_fields) (cp_print_class_member): Update. * cp-namespace.c (cp_lookup_nested_symbol): Update. * completer.c (add_struct_fields): Update. * c-typeprint.c (cp_type_print_derivation_info) (c_type_print_varspec_prefix, c_type_print_base_struct_union): Update. * ada-lang.c (parse_old_style_renaming, xget_renaming_scope) (ada_prefer_type, ada_is_exception_sym): Update.
2018-04-17 21:51:25 +02:00
TYPE_NAME (TYPE_BASECLASS (SYMBOL_TYPE (sym), j));
}
if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL)
{
if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
&& strcmp (sym->linkage_name (), vtbl_ptr_name))
|| TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
{
/* If we are giving a name to a type such as "pointer to
1999-07-07 22:19:36 +02:00
foo" or "function returning foo", we better not set
the TYPE_NAME. If the program contains "typedef char
*caddr_t;", we don't want all variables of type char
* to print as caddr_t. This is not just a
consequence of GDB's type management; PCC and GCC (at
least through version 2.4) both output variables of
either type char * or caddr_t with the type number
defined in the 't' symbol for caddr_t. If a future
compiler cleans this up it GDB is not ready for it
yet, but if it becomes ready we somehow need to
disable this check (without breaking the PCC/GCC2.4
case).
Sigh.
Fortunately, this check seems not to be necessary
for anything except pointers or functions. */
/* ezannoni: 2000-10-26. This seems to apply for
versions of gcc older than 2.8. This was the original
problem: with the following code gdb would tell that
the type for name1 is caddr_t, and func is char().
typedef char *caddr_t;
char *name2;
struct x
{
char *name1;
} xx;
char *func()
{
}
main () {}
*/
/* Pascal accepts names for pointer types. */
if (get_current_subfile ()->language == language_pascal)
{
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name ();
}
}
else
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
TYPE_NAME (SYMBOL_TYPE (sym)) = sym->linkage_name ();
}
add_symbol_to_list (sym, get_file_symbols ());
if (synonym)
{
/* Create the STRUCT_DOMAIN clone. */
struct symbol *struct_sym = allocate_symbol (objfile);
*struct_sym = *sym;
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (struct_sym) = LOC_TYPEDEF;
SYMBOL_VALUE (struct_sym) = valu;
SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
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
TYPE_NAME (SYMBOL_TYPE (sym))
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
= obconcat (&objfile->objfile_obstack, sym->linkage_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
(char *) NULL);
add_symbol_to_list (struct_sym, get_file_symbols ());
}
break;
case 'T':
/* Struct, union, or enum tag. For GNU C++, this can be be followed
1999-07-07 22:19:36 +02:00
by 't' which means we are typedef'ing it as well. */
synonym = *p == 't';
if (synonym)
p++;
SYMBOL_TYPE (sym) = read_type (&p, objfile);
/* For a nameless type, we don't want a create a symbol, thus we
did not use `sym'. Return without further processing. */
1999-07-07 22:19:36 +02:00
if (nameless)
return NULL;
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
Remove TYPE_TAG_NAME TYPE_TAG_NAME has been an occasional source of confusion and bugs. It seems to me that it is only useful for C and C++ -- but even there, not so much, because at least with DWARF there doesn't seem to be any way to wind up with a type where the name and the tag name are both non-NULL and different. So, this patch removes TYPE_TAG_NAME entirely. This should save a little memory, but more importantly, it simplifies this part of gdb. A few minor test suite adjustments were needed. In some situations the new code does not yield identical output to the old code. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (enum_constant_from_type, value_namespace_elt) (value_maybe_namespace_elt): Update. * valarith.c (find_size_for_pointer_math): Update. * target-descriptions.c (make_gdb_type): Update. * symmisc.c (print_symbol): Update. * stabsread.c (define_symbol, read_type) (complain_about_struct_wipeout, add_undefined_type) (cleanup_undefined_types_1): Update. * rust-lang.c (rust_tuple_type_p, rust_slice_type_p) (rust_range_type_p, val_print_struct, rust_print_struct_def) (rust_internal_print_type, rust_composite_type) (rust_evaluate_funcall, rust_evaluate_subexp) (rust_inclusive_range_type_p): Update. * python/py-type.c (typy_get_tag): Update. * p-typeprint.c (pascal_type_print_base): Update. * mdebugread.c (parse_symbol, parse_type): Update. * m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum): Update. * guile/scm-type.c (gdbscm_type_tag): Update. * go-lang.c (sixg_string_p): Update. * gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type): Update. * gdbtypes.h (struct main_type) <tag_name>: Remove. (TYPE_TAG_NAME): Remove. * gdbtypes.c (type_name_no_tag): Simplify. (check_typedef, check_types_equal, recursive_dump_type) (copy_type_recursive, arch_composite_type): Update. * f-typeprint.c (f_type_print_base): Update. Print "Type" prefix in summary mode when needed. * eval.c (evaluate_funcall): Update. * dwarf2read.c (fixup_go_packaging, read_structure_type) (process_structure_scope, read_enumeration_type) (read_namespace_type, read_module_type, determine_prefix): Update. * cp-support.c (inspect_type): Update. * coffread.c (process_coff_symbol, decode_base_type): Update. * c-varobj.c (c_is_path_expr_parent): Update. * c-typeprint.c (c_type_print_base_struct_union): Update. (c_type_print_base_1): Update. Print struct/class/union/enum in summary when using C language. * ax-gdb.c (gen_struct_ref, gen_namespace_elt) (gen_maybe_namespace_elt): Update. * ada-lang.c (ada_type_name): Simplify. (empty_record, ada_template_to_fixed_record_type_1) (template_to_static_fixed_type) (to_record_with_fixed_variant_part, ada_check_typedef): Update. gdb/testsuite/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * gdb.xml/tdesc-regs.exp (load_description): Update expected results. * gdb.dwarf2/method-ptr.exp: Set language to C++. * gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++. * gdb.cp/typeid.exp (do_typeid_tests): Update type_re. * gdb.base/maint.exp (maint_pass_if): Update.
2018-04-17 21:51:24 +02:00
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
TYPE_NAME (SYMBOL_TYPE (sym))
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
= obconcat (&objfile->objfile_obstack, sym->linkage_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
(char *) NULL);
add_symbol_to_list (sym, get_file_symbols ());
if (synonym)
{
/* Clone the sym and then modify it. */
struct symbol *typedef_sym = allocate_symbol (objfile);
*typedef_sym = *sym;
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (typedef_sym) = LOC_TYPEDEF;
SYMBOL_VALUE (typedef_sym) = valu;
SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN;
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
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
TYPE_NAME (SYMBOL_TYPE (sym))
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
= obconcat (&objfile->objfile_obstack, sym->linkage_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
(char *) NULL);
add_symbol_to_list (typedef_sym, get_file_symbols ());
}
break;
case 'V':
/* Static symbol of local scope. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
if (gdbarch_static_transform_name_p (gdbarch)
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
&& gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
!= sym->linkage_name ())
1999-07-07 22:19:36 +02:00
{
use bound_minsym as result for lookup_minimal_symbol et al This patch changes a few minimal symbol lookup functions to return a bound_minimal_symbol rather than a pointer to the minsym. This change helps prepare gdb for computing a minimal symbol's address at the point of use. Note that this changes even those functions that ostensibly search a single objfile. That was necessary because, in fact, those functions can search an objfile and its separate debug objfiles; and it is important for the caller to know in which objfile the minimal symbol was actually found. The bulk of this patch is mechanical. 2014-02-26 Tom Tromey <tromey@redhat.com> * ada-lang.c (ada_update_initial_language): Update. (ada_main_name, ada_has_this_exception_support): Update. * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * arm-tdep.c (arm_skip_stub): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * breakpoint.c (struct breakpoint_objfile_data) <overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change type to bound_minimal_symbol. (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * c-exp.y (classify_name): Update. * coffread.c (coff_symfile_read): Update. * common/agent.c (agent_look_up_symbols): Update. * d-lang.c (d_main_name): Update. * dbxread.c (find_stab_function_addr, end_psymtab): Update. * dec-thread.c (enable_dec_thread): Update. * dwarf2loc.c (call_site_to_target_addr): Update. * elfread.c (elf_gnu_ifunc_resolve_by_got): Update. * eval.c (evaluate_subexp_standard): Update. * findvar.c (struct minsym_lookup_data) <result>: Change type to bound_minimal_symbol. <objfile>: Remove. (minsym_lookup_iterator_cb, default_read_var_value): Update. * frame.c (inside_main_func): Update. * frv-tdep.c (frv_frame_this_id): Update. * gcore.c (call_target_sbrk): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline): Update. * go-lang.c (go_main_name): Update. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code) (hppa_hpux_find_import_stub_for_addr): Update. * hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol): Update. Change return type. * hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return type. * jit.c (jit_breakpoint_re_set_internal): Update. * linux-fork.c (inferior_call_waitpid, checkpoint_command): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update * m32c-tdep.c (m32c_return_value) (m32c_m16c_address_to_pointer): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * minsyms.c (lookup_minimal_symbol_internal): Rename to lookup_minimal_symbol. Change return type. (lookup_minimal_symbol): Remove. (lookup_bound_minimal_symbol): Update. (lookup_minimal_symbol_text): Change return type. (lookup_minimal_symbol_solib_trampoline): Change return type. * minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text) (lookup_minimal_symbol_solib_trampoline): Change return type. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (value_nsstring, find_imps): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-lang.c (pascal_main_name): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * proc-service.c (ps_pglobal_lookup): Update. * ravenscar-thread.c (get_running_thread_msymbol): Change return type. (has_ravenscar_runtime, get_running_thread_id): Update. * remote.c (remote_check_symbols): Update. * sol-thread.c (ps_pglobal_lookup): Update. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base, frv_relocate_section_addresses): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook) (som_solib_desire_dynamic_linker_symbols, link_map_start): Update. * solib-spu.c (spu_enable_break): Update. * solib-svr4.c (elf_locate_base, enable_break): Update. * spu-tdep.c (spu_get_overlay_table, spu_catch_start) (flush_ea_cache): Update. * stabsread.c (define_symbol): Update. * symfile.c (simple_read_overlay_table): Update. * symtab.c (find_pc_sect_line): Update. * tracepoint.c (scope_info): Update. * tui-disasm.c (tui_get_begin_asm_address): Update. * value.c (value_static_field): Update.
2013-10-15 03:53:29 +02:00
struct bound_minimal_symbol msym;
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
use bound_minsym as result for lookup_minimal_symbol et al This patch changes a few minimal symbol lookup functions to return a bound_minimal_symbol rather than a pointer to the minsym. This change helps prepare gdb for computing a minimal symbol's address at the point of use. Note that this changes even those functions that ostensibly search a single objfile. That was necessary because, in fact, those functions can search an objfile and its separate debug objfiles; and it is important for the caller to know in which objfile the minimal symbol was actually found. The bulk of this patch is mechanical. 2014-02-26 Tom Tromey <tromey@redhat.com> * ada-lang.c (ada_update_initial_language): Update. (ada_main_name, ada_has_this_exception_support): Update. * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * arm-tdep.c (arm_skip_stub): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * breakpoint.c (struct breakpoint_objfile_data) <overlay_msym, longjmp_msym, terminate_msym, exception_msym>: Change type to bound_minimal_symbol. (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * c-exp.y (classify_name): Update. * coffread.c (coff_symfile_read): Update. * common/agent.c (agent_look_up_symbols): Update. * d-lang.c (d_main_name): Update. * dbxread.c (find_stab_function_addr, end_psymtab): Update. * dec-thread.c (enable_dec_thread): Update. * dwarf2loc.c (call_site_to_target_addr): Update. * elfread.c (elf_gnu_ifunc_resolve_by_got): Update. * eval.c (evaluate_subexp_standard): Update. * findvar.c (struct minsym_lookup_data) <result>: Change type to bound_minimal_symbol. <objfile>: Remove. (minsym_lookup_iterator_cb, default_read_var_value): Update. * frame.c (inside_main_func): Update. * frv-tdep.c (frv_frame_this_id): Update. * gcore.c (call_target_sbrk): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline): Update. * go-lang.c (go_main_name): Update. * hppa-hpux-tdep.c (hppa_hpux_skip_trampoline_code) (hppa_hpux_find_import_stub_for_addr): Update. * hppa-tdep.c (hppa_extract_17, hppa_lookup_stub_minimal_symbol): Update. Change return type. * hppa-tdep.h (hppa_lookup_stub_minimal_symbol): Change return type. * jit.c (jit_breakpoint_re_set_internal): Update. * linux-fork.c (inferior_call_waitpid, checkpoint_command): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update * m32c-tdep.c (m32c_return_value) (m32c_m16c_address_to_pointer): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * minsyms.c (lookup_minimal_symbol_internal): Rename to lookup_minimal_symbol. Change return type. (lookup_minimal_symbol): Remove. (lookup_bound_minimal_symbol): Update. (lookup_minimal_symbol_text): Change return type. (lookup_minimal_symbol_solib_trampoline): Change return type. * minsyms.h (lookup_minimal_symbol, lookup_minimal_symbol_text) (lookup_minimal_symbol_solib_trampoline): Change return type. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (value_nsstring, find_imps): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-lang.c (pascal_main_name): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_lookup): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * proc-service.c (ps_pglobal_lookup): Update. * ravenscar-thread.c (get_running_thread_msymbol): Change return type. (has_ravenscar_runtime, get_running_thread_id): Update. * remote.c (remote_check_symbols): Update. * sol-thread.c (ps_pglobal_lookup): Update. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base, frv_relocate_section_addresses): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook) (som_solib_desire_dynamic_linker_symbols, link_map_start): Update. * solib-spu.c (spu_enable_break): Update. * solib-svr4.c (elf_locate_base, enable_break): Update. * spu-tdep.c (spu_get_overlay_table, spu_catch_start) (flush_ea_cache): Update. * stabsread.c (define_symbol): Update. * symfile.c (simple_read_overlay_table): Update. * symtab.c (find_pc_sect_line): Update. * tracepoint.c (scope_info): Update. * tui-disasm.c (tui_get_begin_asm_address): Update. * value.c (value_static_field): Update.
2013-10-15 03:53:29 +02:00
if (msym.minsym != NULL)
1999-07-07 22:19:36 +02:00
{
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
const char *new_name = gdbarch_static_transform_name
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
(gdbarch, sym->linkage_name ());
sym->set_linkage_name (new_name);
SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
1999-07-07 22:19:36 +02:00
}
}
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
break;
case 'v':
/* Reference parameter */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_REF_ARG;
SYMBOL_IS_ARGUMENT (sym) = 1;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
break;
case 'a':
/* Reference parameter which is in a register. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = stab_regparm_index;
SYMBOL_IS_ARGUMENT (sym) = 1;
* symtab.h: Rename SYMBOL_OPS to SYMBOL_COMPUTED_OPS. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value, symbol_read_needs_frame): Likewise. * printcmd.c (address_info): Likewise. * dwarf2loc.c (dwarf_expr_frame_base): Likewise. * dwarf2read.c (dwarf2_symbol_mark_computed): Likewise. * symtab.h: Rename struct symbol_ops to struct symbol_computed_ops. * dwarf2loc.h: Likewise. * dwarf2loc.c (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Likewise. * symtab.h: (struct symbol_register_ops): New struct definition. (struct symbol): Make "ops" member a union of symbol_computed_ops and symbol_register_ops callback pointers. (SYMBOL_REGISTER_OPS): New macro. * tracepoint.c: Include "objfiles.h". (scope_info, collect_symbol): Use SYMBOL_REGISTER_OPS register_number callback to retrieve register numbers. * ax-gdb.c (gen_var_ref): Likewise. * findvar.c (read_var_value): Likewise. * printcmd.c (address_info): Likewise. * coffread.c (coff_reg_to_regnum): New function. (coff_register_funcs): New static variable. (process_coff_symbol): Do not call gdbarch_sdb_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * mdebugread.c (mdebug_reg_to_regnum): New function. (mdebug_register_funcs): New static variable. (parse_symbol): Do not call gdbarch_ecoff_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks. * stabsread.c (stab_reg_to_regnum): New function. (stab_register_funcs): New static variable. (define_symbol): Do not call gdbarch_stab_reg_to_regnum. Install SYMBOL_REGISTER_OPS callbacks.
2009-06-04 14:28:39 +02:00
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
break;
case 'X':
/* This is used by Sun FORTRAN for "function result value".
1999-07-07 22:19:36 +02:00
Sun claims ("dbx and dbxtool interfaces", 2nd ed)
that Pascal uses it too, but when I tried it Pascal used
"x:3" (local symbol) instead. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_LOCAL;
SYMBOL_VALUE (sym) = valu;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_local_symbols ());
break;
default:
SYMBOL_TYPE (sym) = error_type (&p, objfile);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_VALUE (sym) = 0;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
add_symbol_to_list (sym, get_file_symbols ());
break;
}
/* Some systems pass variables of certain types by reference instead
of by value, i.e. they will pass the address of a structure (in a
register or on the stack) instead of the structure itself. */
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
if (gdbarch_stabs_argument_has_addr (gdbarch, SYMBOL_TYPE (sym))
&& SYMBOL_IS_ARGUMENT (sym))
{
/* We have to convert LOC_REGISTER to LOC_REGPARM_ADDR (for
variables passed in a register). */
if (SYMBOL_CLASS (sym) == LOC_REGISTER)
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_REGPARM_ADDR;
/* Likewise for converting LOC_ARG to LOC_REF_ARG (for the 7th
and subsequent arguments on SPARC, for example). */
else if (SYMBOL_CLASS (sym) == LOC_ARG)
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_REF_ARG;
}
return sym;
}
/* Skip rest of this symbol and return an error type.
General notes on error recovery: error_type always skips to the
end of the symbol (modulo cretinous dbx symbol name continuation).
Thus code like this:
if (*(*pp)++ != ';')
1999-07-07 22:19:36 +02:00
return error_type (pp, objfile);
is wrong because if *pp starts out pointing at '\0' (typically as the
result of an earlier error), it will be incremented to point to the
start of the next symbol, which might produce strange results, at least
if you run off the end of the string table. Instead use
if (**pp != ';')
1999-07-07 22:19:36 +02:00
return error_type (pp, objfile);
++*pp;
or
if (**pp != ';')
1999-07-07 22:19:36 +02:00
foo = error_type (pp, objfile);
else
1999-07-07 22:19:36 +02:00
++*pp;
And in case it isn't obvious, the point of all this hair is so the compiler
can define new types and new syntaxes, and old versions of the
debugger will be able to read the new symbol tables. */
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
error_type (const char **pp, struct objfile *objfile)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("couldn't parse type; debugger out of date?"));
while (1)
{
/* Skip to end of symbol. */
while (**pp != '\0')
{
(*pp)++;
}
/* Check for and handle cretinous dbx symbol name continuation! */
if ((*pp)[-1] == '\\' || (*pp)[-1] == '?')
{
*pp = next_symbol_text (objfile);
}
else
{
break;
}
}
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
return objfile_type (objfile)->builtin_error;
}
1999-07-07 22:19:36 +02:00
/* Read type information or a type definition; return the type. Even
though this routine accepts either type information or a type
definition, the distinction is relevant--some parts of stabsread.c
assume that type information starts with a digit, '-', or '(' in
deciding whether to call read_type. */
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_type (const char **pp, struct objfile *objfile)
{
struct type *type = 0;
struct type *type1;
int typenums[2];
char type_descriptor;
/* Size in bits of type if specified by a type attribute, or -1 if
there is no size attribute. */
int type_size = -1;
/* Used to distinguish string and bitstring from char-array and set. */
int is_string = 0;
/* Used to distinguish vector from array. */
int is_vector = 0;
/* Read type number if present. The type number may be omitted.
for instance in a two-dimensional array declared with type
"ar1;1;10;ar1;1;10;4". */
if ((**pp >= '0' && **pp <= '9')
|| **pp == '('
|| **pp == '-')
{
if (read_type_number (pp, typenums) != 0)
return error_type (pp, objfile);
1999-07-07 22:19:36 +02:00
if (**pp != '=')
{
/* Type is not being defined here. Either it already
exists, or this is a forward reference to it.
dbx_alloc_type handles both cases. */
type = dbx_alloc_type (typenums, objfile);
/* If this is a forward reference, arrange to complain if it
doesn't get patched up by the time we're done
reading. */
if (TYPE_CODE (type) == TYPE_CODE_UNDEF)
add_undefined_type (type, typenums);
return type;
}
/* Type is being defined here. */
/* Skip the '='.
1999-07-07 22:19:36 +02:00
Also skip the type descriptor - we get it below with (*pp)[-1]. */
(*pp) += 2;
}
else
{
/* 'typenums=' not present, type is anonymous. Read and return
1999-07-07 22:19:36 +02:00
the definition, but don't put it in the type vector. */
typenums[0] = typenums[1] = -1;
(*pp)++;
}
1999-07-07 22:19:36 +02:00
again:
type_descriptor = (*pp)[-1];
switch (type_descriptor)
{
case 'x':
{
enum type_code code;
/* Used to index through file_symbols. */
struct pending *ppt;
int i;
1999-07-07 22:19:36 +02:00
/* Name including "struct", etc. */
char *type_name;
1999-07-07 22:19:36 +02:00
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *from, *p, *q1, *q2;
1999-07-07 22:19:36 +02:00
/* Set the type code according to the following letter. */
switch ((*pp)[0])
{
case 's':
code = TYPE_CODE_STRUCT;
break;
case 'u':
code = TYPE_CODE_UNION;
break;
case 'e':
code = TYPE_CODE_ENUM;
break;
default:
{
/* Complain and keep going, so compilers can invent new
cross-reference types. */
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Unrecognized cross-reference type `%c'"),
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
(*pp)[0]);
code = TYPE_CODE_STRUCT;
break;
}
}
1999-07-07 22:19:36 +02:00
q1 = strchr (*pp, '<');
p = strchr (*pp, ':');
if (p == NULL)
return error_type (pp, objfile);
if (q1 && p > q1 && p[1] == ':')
{
int nesting_level = 0;
for (q2 = q1; *q2; q2++)
{
if (*q2 == '<')
nesting_level++;
else if (*q2 == '>')
nesting_level--;
else if (*q2 == ':' && nesting_level == 0)
break;
}
p = q2;
if (*p != ':')
return error_type (pp, objfile);
}
type_name = NULL;
if (get_current_subfile ()->language == language_cplus)
{
Use ui_file_as_string throughout more This replaces most of the remaining ui_file_xstrdup calls with ui_file_as_string calls. Whenever a call was replaced, that led to a cascade of other necessary adjustments throughout, to make the code use std::string instead of raw pointers. And then whenever I added a std::string as member of a struct, I needed to adjust allocation/destruction of said struct to use new/delete instead of xmalloc/xfree. The stopping point was once gdb built again. These doesn't seem to be a way to reasonably split this out further. Maybe-not-obvious changes: - demangle_for_lookup returns a cleanup today. To get rid of that, and avoid unnecessary string dupping/copying, this introduces a demangle_result_storage type that the caller instantiates and passes to demangle_for_lookup. - Many methods returned a "char *" to indicate that the caller owns the memory and must free it. Those are switched to return a std::string instead. Methods that return a "view" into some internal string return a "const char *" instead. I.e., we only copy/allocate when necessary. gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_name_for_lookup, type_as_string): Use and return std::string. (type_as_string_and_cleanup): Delete. (ada_lookup_struct_elt_type): Use type_as_string. * ada-lang.h (ada_name_for_lookup): Now returns std::string. * ada-varobj.c (ada_varobj_scalar_image): Return a std::string. (ada_varobj_describe_child): Make 'child_name' and 'child_path_expr' parameters std::string pointers. (ada_varobj_describe_struct_child, ada_varobj_describe_ptr_child): Likewise, and use string_printf. (ada_varobj_describe_simple_array_child) (ada_varobj_describe_child): Likewise. (ada_varobj_get_name_of_child, ada_varobj_get_path_expr_of_child) (ada_varobj_get_value_image) (ada_varobj_get_value_of_array_variable) (ada_varobj_get_value_of_variable, ada_name_of_variable) (ada_name_of_child, ada_path_expr_of_child) (ada_value_of_variable): Now returns std::string. Use string_printf. (ada_value_of_child): Adjust. * break-catch-throw.c (check_status_exception_catchpoint): Adjust to use std::string. * breakpoint.c (watch_command_1): Adjust to use std::string. * c-lang.c (c_get_string): Adjust to use std::string. * c-typeprint.c (print_name_maybe_canonical): Use std::string. * c-varobj.c (varobj_is_anonymous_child): Use ==/!= std::string operators. (c_name_of_variable): Now returns a std::string. (c_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (c_name_of_child, c_path_expr_of_child, c_value_of_variable) (cplus_number_of_children): Adjust to use std::string and string_printf. (cplus_name_of_variable): Now returns a std::string. (cplus_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (cplus_name_of_child, cplus_path_expr_of_child) (cplus_value_of_variable): Now returns a std::string. * cp-abi.c (cplus_typename_from_type_info): Return std::string. * cp-abi.h (cplus_typename_from_type_info): Return std::string. (struct cp_abi_ops) <get_typename_from_type_info>: Return std::string. * cp-support.c (inspect_type): Use std::string. (cp_canonicalize_string_full, cp_canonicalize_string_no_typedefs) (cp_canonicalize_string): Return std::string and adjust. * cp-support.h (cp_canonicalize_string) (cp_canonicalize_string_no_typedefs, cp_canonicalize_string_full): Return std::string. * dbxread.c (read_dbx_symtab): Use std::string. * dwarf2read.c (dwarf2_canonicalize_name): Adjust to use std::string. * gdbcmd.h (lookup_struct_elt_type): Adjust to use std::string. * gnu-v3-abi.c (gnuv3_get_typeid): Use std::string. (gnuv3_get_typename_from_type_info): Return a std::string and adjust. (gnuv3_get_type_from_type_info): Adjust to use std::string. * guile/guile.c (gdbscm_execute_gdb_command): Adjust to use std::string. * infcmd.c (print_return_value_1): Adjust to use std::string. * linespec.c (find_linespec_symbols): Adjust to demangle_for_lookup API change. Use std::string. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_set_format) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_evaluate_expression) (mi_cmd_var_assign, varobj_update_one): Adjust to use std::string. * minsyms.c (lookup_minimal_symbol): Use std::string. * python/py-varobj.c (py_varobj_iter_next): Use new instead of XNEW. vitem->name is a std::string now, adjust. * rust-exp.y (convert_ast_to_type, convert_name): Adjust to use std::string. * stabsread.c (define_symbol): Adjust to use std::string. * symtab.c (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. Use it for storage. (lookup_symbol_in_language) (lookup_symbol_in_objfile_from_linkage_name): Adjust to new demangle_for_lookup API. * symtab.h (struct demangle_result_storage): New type. (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. * typeprint.c (type_to_string): Return std::string and use ui_file_as_string. * value.h (type_to_string): Change return type to std::string. * varobj-iter.h (struct varobj_item) <name>: Now a std::string. (varobj_iter_delete): Use delete instead of xfree. * varobj.c (create_child): Return std::string instead of char * in output parameter. (name_of_variable, name_of_child, my_value_of_variable): Return std::string instead of char *. (varobj_create, varobj_get_handle): Constify 'objname' parameter. Adjust to std::string fields. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression): Return a std::string. (varobj_list_children): Adjust to use std::string. (varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. Adjust to std::string fields. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Change type of 'expression' parameter to std::string. Use std::string. (install_new_value): Use std::string. (delete_variable_1): Adjust to use std::string. (create_child): Change the 'name' parameter to a std::string reference. Swap it into the new item's name. (create_child_with_value): Swap item's name into the new child's name. Use string_printf. (new_variable): Use new instead of XNEW. (free_variable): Don't xfree fields that are now std::string. (name_of_variable, name_of_child): Now returns std::string. (value_of_root): Adjust to use std::string. (my_value_of_variable, varobj_value_get_print_value): Return and use std::string. (varobj_value_get_print_value): Adjust to use ui_file_as_string and std::string. * varobj.h (struct varobj) <name, path_expr, obj_name, print_value>: Now std::string's. <name_of_variable, name_of_child, path_expr_of_child, value_of_variable>: Return std::string. (varobj_create, varobj_get_handle): Constify 'objname' parameter. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression, varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Constify 'expression' parameter. (varobj_value_get_print_value): Return a std::string.
2016-11-08 16:26:47 +01:00
char *name = (char *) alloca (p - *pp + 1);
memcpy (name, *pp, p - *pp);
name[p - *pp] = '\0';
Use ui_file_as_string throughout more This replaces most of the remaining ui_file_xstrdup calls with ui_file_as_string calls. Whenever a call was replaced, that led to a cascade of other necessary adjustments throughout, to make the code use std::string instead of raw pointers. And then whenever I added a std::string as member of a struct, I needed to adjust allocation/destruction of said struct to use new/delete instead of xmalloc/xfree. The stopping point was once gdb built again. These doesn't seem to be a way to reasonably split this out further. Maybe-not-obvious changes: - demangle_for_lookup returns a cleanup today. To get rid of that, and avoid unnecessary string dupping/copying, this introduces a demangle_result_storage type that the caller instantiates and passes to demangle_for_lookup. - Many methods returned a "char *" to indicate that the caller owns the memory and must free it. Those are switched to return a std::string instead. Methods that return a "view" into some internal string return a "const char *" instead. I.e., we only copy/allocate when necessary. gdb/ChangeLog: 2016-11-08 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_name_for_lookup, type_as_string): Use and return std::string. (type_as_string_and_cleanup): Delete. (ada_lookup_struct_elt_type): Use type_as_string. * ada-lang.h (ada_name_for_lookup): Now returns std::string. * ada-varobj.c (ada_varobj_scalar_image): Return a std::string. (ada_varobj_describe_child): Make 'child_name' and 'child_path_expr' parameters std::string pointers. (ada_varobj_describe_struct_child, ada_varobj_describe_ptr_child): Likewise, and use string_printf. (ada_varobj_describe_simple_array_child) (ada_varobj_describe_child): Likewise. (ada_varobj_get_name_of_child, ada_varobj_get_path_expr_of_child) (ada_varobj_get_value_image) (ada_varobj_get_value_of_array_variable) (ada_varobj_get_value_of_variable, ada_name_of_variable) (ada_name_of_child, ada_path_expr_of_child) (ada_value_of_variable): Now returns std::string. Use string_printf. (ada_value_of_child): Adjust. * break-catch-throw.c (check_status_exception_catchpoint): Adjust to use std::string. * breakpoint.c (watch_command_1): Adjust to use std::string. * c-lang.c (c_get_string): Adjust to use std::string. * c-typeprint.c (print_name_maybe_canonical): Use std::string. * c-varobj.c (varobj_is_anonymous_child): Use ==/!= std::string operators. (c_name_of_variable): Now returns a std::string. (c_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (c_name_of_child, c_path_expr_of_child, c_value_of_variable) (cplus_number_of_children): Adjust to use std::string and string_printf. (cplus_name_of_variable): Now returns a std::string. (cplus_describe_child): The 'cname' and 'cfull_expression' output parameters are now std::string pointers. Adjust. (cplus_name_of_child, cplus_path_expr_of_child) (cplus_value_of_variable): Now returns a std::string. * cp-abi.c (cplus_typename_from_type_info): Return std::string. * cp-abi.h (cplus_typename_from_type_info): Return std::string. (struct cp_abi_ops) <get_typename_from_type_info>: Return std::string. * cp-support.c (inspect_type): Use std::string. (cp_canonicalize_string_full, cp_canonicalize_string_no_typedefs) (cp_canonicalize_string): Return std::string and adjust. * cp-support.h (cp_canonicalize_string) (cp_canonicalize_string_no_typedefs, cp_canonicalize_string_full): Return std::string. * dbxread.c (read_dbx_symtab): Use std::string. * dwarf2read.c (dwarf2_canonicalize_name): Adjust to use std::string. * gdbcmd.h (lookup_struct_elt_type): Adjust to use std::string. * gnu-v3-abi.c (gnuv3_get_typeid): Use std::string. (gnuv3_get_typename_from_type_info): Return a std::string and adjust. (gnuv3_get_type_from_type_info): Adjust to use std::string. * guile/guile.c (gdbscm_execute_gdb_command): Adjust to use std::string. * infcmd.c (print_return_value_1): Adjust to use std::string. * linespec.c (find_linespec_symbols): Adjust to demangle_for_lookup API change. Use std::string. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_set_format) (mi_cmd_var_info_type, mi_cmd_var_info_path_expression) (mi_cmd_var_info_expression, mi_cmd_var_evaluate_expression) (mi_cmd_var_assign, varobj_update_one): Adjust to use std::string. * minsyms.c (lookup_minimal_symbol): Use std::string. * python/py-varobj.c (py_varobj_iter_next): Use new instead of XNEW. vitem->name is a std::string now, adjust. * rust-exp.y (convert_ast_to_type, convert_name): Adjust to use std::string. * stabsread.c (define_symbol): Adjust to use std::string. * symtab.c (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. Use it for storage. (lookup_symbol_in_language) (lookup_symbol_in_objfile_from_linkage_name): Adjust to new demangle_for_lookup API. * symtab.h (struct demangle_result_storage): New type. (demangle_for_lookup): Now returns 'const char *'. Add a demangle_result_storage parameter. * typeprint.c (type_to_string): Return std::string and use ui_file_as_string. * value.h (type_to_string): Change return type to std::string. * varobj-iter.h (struct varobj_item) <name>: Now a std::string. (varobj_iter_delete): Use delete instead of xfree. * varobj.c (create_child): Return std::string instead of char * in output parameter. (name_of_variable, name_of_child, my_value_of_variable): Return std::string instead of char *. (varobj_create, varobj_get_handle): Constify 'objname' parameter. Adjust to std::string fields. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression): Return a std::string. (varobj_list_children): Adjust to use std::string. (varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. Adjust to std::string fields. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Change type of 'expression' parameter to std::string. Use std::string. (install_new_value): Use std::string. (delete_variable_1): Adjust to use std::string. (create_child): Change the 'name' parameter to a std::string reference. Swap it into the new item's name. (create_child_with_value): Swap item's name into the new child's name. Use string_printf. (new_variable): Use new instead of XNEW. (free_variable): Don't xfree fields that are now std::string. (name_of_variable, name_of_child): Now returns std::string. (value_of_root): Adjust to use std::string. (my_value_of_variable, varobj_value_get_print_value): Return and use std::string. (varobj_value_get_print_value): Adjust to use ui_file_as_string and std::string. * varobj.h (struct varobj) <name, path_expr, obj_name, print_value>: Now std::string's. <name_of_variable, name_of_child, path_expr_of_child, value_of_variable>: Return std::string. (varobj_create, varobj_get_handle): Constify 'objname' parameter. (varobj_get_objname): Return a const char * instead of a char *. (varobj_get_expression, varobj_get_type): Return a std::string. (varobj_get_path_expr): Return a const char * instead of a char *. (varobj_get_formatted_value, varobj_get_value): Return a std::string. (varobj_set_value): Constify 'expression' parameter. (varobj_value_get_print_value): Return a std::string.
2016-11-08 16:26:47 +01:00
std::string new_name = cp_canonicalize_string (name);
if (!new_name.empty ())
type_name = obstack_strdup (&objfile->objfile_obstack,
new_name);
}
if (type_name == NULL)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
char *to = type_name = (char *)
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
obstack_alloc (&objfile->objfile_obstack, p - *pp + 1);
/* Copy the name. */
from = *pp + 1;
while (from < p)
*to++ = *from++;
*to = '\0';
}
1999-07-07 22:19:36 +02:00
/* Set the pointer ahead of the name which we just read, and
the colon. */
*pp = p + 1;
}
/* If this type has already been declared, then reuse the same
type, rather than allocating a new one. This saves some
memory. */
for (ppt = *get_file_symbols (); ppt; ppt = ppt->next)
for (i = 0; i < ppt->nsyms; i++)
{
struct symbol *sym = ppt->symbol[i];
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == code)
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
&& strcmp (sym->linkage_name (), type_name) == 0)
{
obstack_free (&objfile->objfile_obstack, type_name);
type = SYMBOL_TYPE (sym);
if (typenums[0] != -1)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
*dbx_lookup_type (typenums, objfile) = type;
return type;
}
}
/* Didn't find the type to which this refers, so we must
be dealing with a forward reference. Allocate a type
structure for it, and keep track of it so we can
fill in the rest of the fields when we get the full
type. */
type = dbx_alloc_type (typenums, objfile);
TYPE_CODE (type) = code;
Remove TYPE_TAG_NAME TYPE_TAG_NAME has been an occasional source of confusion and bugs. It seems to me that it is only useful for C and C++ -- but even there, not so much, because at least with DWARF there doesn't seem to be any way to wind up with a type where the name and the tag name are both non-NULL and different. So, this patch removes TYPE_TAG_NAME entirely. This should save a little memory, but more importantly, it simplifies this part of gdb. A few minor test suite adjustments were needed. In some situations the new code does not yield identical output to the old code. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (enum_constant_from_type, value_namespace_elt) (value_maybe_namespace_elt): Update. * valarith.c (find_size_for_pointer_math): Update. * target-descriptions.c (make_gdb_type): Update. * symmisc.c (print_symbol): Update. * stabsread.c (define_symbol, read_type) (complain_about_struct_wipeout, add_undefined_type) (cleanup_undefined_types_1): Update. * rust-lang.c (rust_tuple_type_p, rust_slice_type_p) (rust_range_type_p, val_print_struct, rust_print_struct_def) (rust_internal_print_type, rust_composite_type) (rust_evaluate_funcall, rust_evaluate_subexp) (rust_inclusive_range_type_p): Update. * python/py-type.c (typy_get_tag): Update. * p-typeprint.c (pascal_type_print_base): Update. * mdebugread.c (parse_symbol, parse_type): Update. * m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum): Update. * guile/scm-type.c (gdbscm_type_tag): Update. * go-lang.c (sixg_string_p): Update. * gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type): Update. * gdbtypes.h (struct main_type) <tag_name>: Remove. (TYPE_TAG_NAME): Remove. * gdbtypes.c (type_name_no_tag): Simplify. (check_typedef, check_types_equal, recursive_dump_type) (copy_type_recursive, arch_composite_type): Update. * f-typeprint.c (f_type_print_base): Update. Print "Type" prefix in summary mode when needed. * eval.c (evaluate_funcall): Update. * dwarf2read.c (fixup_go_packaging, read_structure_type) (process_structure_scope, read_enumeration_type) (read_namespace_type, read_module_type, determine_prefix): Update. * cp-support.c (inspect_type): Update. * coffread.c (process_coff_symbol, decode_base_type): Update. * c-varobj.c (c_is_path_expr_parent): Update. * c-typeprint.c (c_type_print_base_struct_union): Update. (c_type_print_base_1): Update. Print struct/class/union/enum in summary when using C language. * ax-gdb.c (gen_struct_ref, gen_namespace_elt) (gen_maybe_namespace_elt): Update. * ada-lang.c (ada_type_name): Simplify. (empty_record, ada_template_to_fixed_record_type_1) (template_to_static_fixed_type) (to_record_with_fixed_variant_part, ada_check_typedef): Update. gdb/testsuite/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * gdb.xml/tdesc-regs.exp (load_description): Update expected results. * gdb.dwarf2/method-ptr.exp: Set language to C++. * gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++. * gdb.cp/typeid.exp (do_typeid_tests): Update type_re. * gdb.base/maint.exp (maint_pass_if): Update.
2018-04-17 21:51:24 +02:00
TYPE_NAME (type) = type_name;
1999-07-07 22:19:36 +02:00
INIT_CPLUS_SPECIFIC (type);
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_STUB (type) = 1;
add_undefined_type (type, typenums);
return type;
}
1999-07-07 22:19:36 +02:00
case '-': /* RS/6000 built-in type */
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case '(':
(*pp)--;
/* We deal with something like t(1,2)=(3,4)=... which
the Lucid compiler and recent gcc versions (post 2.7.3) use. */
/* Allocate and enter the typedef type first.
This handles recursive types. */
type = dbx_alloc_type (typenums, objfile);
TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
1999-07-07 22:19:36 +02:00
{
struct type *xtype = read_type (pp, objfile);
if (type == xtype)
{
/* It's being defined as itself. That means it is "void". */
TYPE_CODE (type) = TYPE_CODE_VOID;
TYPE_LENGTH (type) = 1;
}
else if (type_size >= 0 || is_string)
{
/* This is the absolute wrong way to construct types. Every
other debug format has found a way around this problem and
the related problems with unnecessarily stubbed types;
someone motivated should attempt to clean up the issue
here as well. Once a type pointed to has been created it
should not be modified.
Well, it's not *absolutely* wrong. Constructing recursive
types (trees, linked lists) necessarily entails modifying
types after creating them. Constructing any loop structure
entails side effects. The Dwarf 2 reader does handle this
more gracefully (it never constructs more than once
instance of a type object, so it doesn't have to copy type
objects wholesale), but it still mutates type objects after
other folks have references to them.
Keep in mind that this circularity/mutation issue shows up
at the source language level, too: C's "incomplete types",
for example. So the proper cleanup, I think, would be to
limit GDB's type smashing to match exactly those required
by the source language. So GDB could have a
"complete_this_type" function, but never create unnecessary
copies of a type otherwise. */
replace_type (type, xtype);
TYPE_NAME (type) = NULL;
}
else
{
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_TARGET_STUB (type) = 1;
TYPE_TARGET_TYPE (type) = xtype;
}
}
break;
1999-07-07 22:19:36 +02:00
/* In the following types, we must be sure to overwrite any existing
type that the typenums refer to, rather than allocating a new one
and making the typenums point to the new one. This is because there
may already be pointers to the existing type (if it had been
forward-referenced), and we must change it to a pointer, function,
reference, or whatever, *in-place*. */
case '*': /* Pointer to another type */
type1 = read_type (pp, objfile);
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
type = make_pointer_type (type1, dbx_lookup_type (typenums, objfile));
break;
1999-07-07 22:19:36 +02:00
case '&': /* Reference to another type */
type1 = read_type (pp, objfile);
Change {lookup,make}_reference_type API Parameterize lookup_reference_type() and make_reference_type() by the kind of reference type we want to look up. Create two wrapper functions lookup_{lvalue,rvalue}_reference_type() for lookup_reference_type() to simplify the API. Change all callers to use the new API. gdb/Changelog PR gdb/14441 * dwarf2read.c (read_tag_reference_type): Use lookup_lvalue_reference_type() instead of lookup_reference_type(). * eval.c (evaluate_subexp_standard): Likewise. * f-exp.y: Likewise. * gdbtypes.c (make_reference_type, lookup_reference_type): Generalize with rvalue reference types. (lookup_lvalue_reference_type, lookup_rvalue_reference_type): New convenience wrappers for lookup_reference_type(). * gdbtypes.h (make_reference_type, lookup_reference_type): Add a reference kind parameter. (lookup_lvalue_reference_type, lookup_rvalue_reference_type): Add wrappers for lookup_reference_type(). * guile/scm-type.c (gdbscm_type_reference): Use lookup_lvalue_reference_type() instead of lookup_reference_type(). * guile/scm-value.c (gdbscm_value_dynamic_type): Likewise. * parse.c (follow_types): Likewise. * python/py-type.c (typy_reference, typy_lookup_type): Likewise. * python/py-value.c (valpy_get_dynamic_type, valpy_getitem): Likewise. * python/py-xmethods.c (gdbpy_get_xmethod_result_type) (gdbpy_invoke_xmethod): Likewise. * stabsread.c: Provide extra argument to make_reference_type() call. * valops.c (value_ref, value_rtti_indirect_type): Use lookup_lvalue_reference_type() instead of lookup_reference_type().
2017-03-20 21:47:39 +01:00
type = make_reference_type (type1, dbx_lookup_type (typenums, objfile),
TYPE_CODE_REF);
break;
1999-07-07 22:19:36 +02:00
case 'f': /* Function returning another type */
type1 = read_type (pp, objfile);
type = make_function_type (type1, dbx_lookup_type (typenums, objfile));
break;
case 'g': /* Prototyped function. (Sun) */
{
/* Unresolved questions:
- According to Sun's ``STABS Interface Manual'', for 'f'
and 'F' symbol descriptors, a `0' in the argument type list
indicates a varargs function. But it doesn't say how 'g'
type descriptors represent that info. Someone with access
to Sun's toolchain should try it out.
- According to the comment in define_symbol (search for
`process_prototype_types:'), Sun emits integer arguments as
types which ref themselves --- like `void' types. Do we
have to deal with that here, too? Again, someone with
access to Sun's toolchain should try it out and let us
know. */
const char *type_start = (*pp) - 1;
struct type *return_type = read_type (pp, objfile);
struct type *func_type
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
= make_function_type (return_type,
dbx_lookup_type (typenums, objfile));
struct type_list {
struct type *type;
struct type_list *next;
} *arg_types = 0;
int num_args = 0;
while (**pp && **pp != '#')
{
struct type *arg_type = read_type (pp, objfile);
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
struct type_list *newobj = XALLOCA (struct type_list);
newobj->type = arg_type;
newobj->next = arg_types;
arg_types = newobj;
num_args++;
}
if (**pp == '#')
++*pp;
else
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Prototyped function type didn't "
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
"end arguments with `#':\n%s"),
2002-12-17 01:39:08 +01:00
type_start);
}
/* If there is just one argument whose type is `void', then
that's just an empty argument list. */
if (arg_types
&& ! arg_types->next
&& TYPE_CODE (arg_types->type) == TYPE_CODE_VOID)
num_args = 0;
TYPE_FIELDS (func_type)
= (struct field *) TYPE_ALLOC (func_type,
num_args * sizeof (struct field));
memset (TYPE_FIELDS (func_type), 0, num_args * sizeof (struct field));
{
int i;
struct type_list *t;
/* We stuck each argument type onto the front of the list
when we read it, so the list is reversed. Build the
fields array right-to-left. */
for (t = arg_types, i = num_args - 1; t; t = t->next, i--)
TYPE_FIELD_TYPE (func_type, i) = t->type;
}
TYPE_NFIELDS (func_type) = num_args;
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_PROTOTYPED (func_type) = 1;
type = func_type;
break;
}
1999-07-07 22:19:36 +02:00
case 'k': /* Const qualifier on some type (Sun) */
type = read_type (pp, objfile);
type = make_cv_type (1, TYPE_VOLATILE (type), type,
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
dbx_lookup_type (typenums, objfile));
break;
1999-07-07 22:19:36 +02:00
case 'B': /* Volatile qual on some type (Sun) */
type = read_type (pp, objfile);
type = make_cv_type (TYPE_CONST (type), 1, type,
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
dbx_lookup_type (typenums, objfile));
break;
case '@':
1999-07-07 22:19:36 +02:00
if (isdigit (**pp) || **pp == '(' || **pp == '-')
{ /* Member (class & variable) type */
/* FIXME -- we should be doing smash_to_XXX types here. */
struct type *domain = read_type (pp, objfile);
struct type *memtype;
if (**pp != ',')
/* Invalid member type data format. */
return error_type (pp, objfile);
++*pp;
memtype = read_type (pp, objfile);
type = dbx_alloc_type (typenums, objfile);
* NEWS: Mention pointer to member improvements. * Makefile.in (gnu-v3-abi.o): Delete special rule. (eval.o, gnu-v3-abi.o, ia64-tdep.o): Update. * ada-valprint.c (ada_print_scalar): Update for new type codes. * c-typeprint.c (c_print_type): Update for new type codes. (c_type_print_varspec_prefix, c_type_print_varspec_suffix) (c_type_print_base): Likewise. (c_type_print_args): Rewrite. * c-valprint.c (c_val_print): Update for new type codes. Remove support for references to members. Treat methods like functions. * cp-abi.c (cplus_print_method_ptr, cplus_method_ptr_size) (cplus_make_method_ptr, cplus_method_ptr_to_value): New. * cp-abi.h (cplus_print_method_ptr, cplus_method_ptr_size) (cplus_make_method_ptr, cplus_method_ptr_to_value): New prototypes. (struct cp_abi_ops): Add corresponding members. * cp-valprint.c (cp_print_class_method): Delete. (cp_find_class_member): New function. (cp_print_class_member): Use it. Simplify support for bogus member pointers. * dwarf2read.c (quirk_gcc_member_function_pointer): Use lookup_methodptr_type. (read_tag_ptr_to_member_type): Likewise, and lookup_memberptr_type. * eval.c (evaluate_subexp_standard): Implement EVAL_SKIP for OP_SCOPE. Update call to value_aggregate_elt. Rewrite member pointer support. (evaluate_subexp_for_address): Handle OP_SCOPE explicitly. Handle references returned by user defined operators. * f-typeprint.c (f_print_type, f_type_print_varspec_prefix) (f_type_print_varspec_suffix): Remove support for member pointers. * gdbtypes.c (lookup_memberptr_type): Renamed from lookup_member_type and adjusted. (smash_to_memberptr_type): Likewise, from smash_to_member_type. (lookup_methodptr_type): New. (rank_one_type): Adjust for TYPE_CODE_MEMBERPTR. (recursive_dump_type): Update for new types. * gdbtypes.h (enum type_code): Replace TYPE_CODE_MEMBER with TYPE_CODE_MEMBERPTR and TYPE_CODE_METHODPTR. (lookup_memberptr_type, lookup_methodptr_type) (smash_to_memberptr_type): New prototypes. (smash_to_method_type): Formatting fix. (lookup_member_type, smash_to_member_type): Delete prototypes. * gnu-v3-abi.c (gnuv3_get_vtable, gnuv3_get_virtual_fn): New. Do not rely on debug information for the vptr or the method's enclosing type. Handle function descriptors for IA64. (gnuv3_virtual_fn_field): Rewrite using the new functions. (gnuv3_find_method_in, gnuv3_print_method_ptr) (gnuv3_method_ptr_size, gnuv3_make_method_ptr) (gnuv3_method_ptr_to_value): New. (init_gnuv3_ops): Set new members of gnu_v3_abi_ops. * hpread.c (hpread_type_lookup): Update for new types. * infcall.c (value_arg_coerce): Likewise. * m2-typeprint.c (m2_print_type): Remove explicit support for member pointers. * m2-valprint.c (m2_val_print): Likewise. * p-typeprint.c (pascal_type_print_varspec_prefix) (pascal_type_print_varspec_suffix, pascal_type_print_base): Likewise. * p-valprint.c (pascal_val_print): Likewise. (pascal_object_print_class_method, pascal_object_print_class_member): Delete. * p-lang.h (pascal_object_print_class_method) (pascal_object_print_class_member): Delete prototypes. * stabsread.c (read_type): Update for new types. * typeprint.c (print_type_scalar): Likewise. * valops.c (value_struct_elt_for_reference, value_namespace_elt) (value_maybe_namespace_elt, value_aggregate_elt): Add want_address argument. Construct a pointer to member if the address of a function or data member is requested. (value_cast_pointers): Don't modify the input value. (value_cast): Adjust pointer to member handling for new types. Allow null pointer to member constants. Don't modify the input value. (value_ind): Remove pointer to member check. Handle function descriptors for function pointers. (value_struct_elt, value_find_oload_method_list, check_field): Remove pointer to member checks. * value.c (unpack_long): Allow pointers to data members. (value_from_longest): Allow member pointers. * value.h (value_aggregate_elt): Add want_address. * varobj.c (c_variable_editable): Remove check for members. * gdbarch.sh: Add vtable_function_descriptors and vbit_in_delta. * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Handle descriptors in virtual tables. (ia64_gdbarch_init): Call set_gdbarch_vtable_function_descriptors. * c-lang.h (cp_print_class_method): Delete prototype. * arm-tdep.c (arm_gdbarch_init): Call set_gdbarch_vbit_in_delta. * mips-tdep.c (mips_gdbarch_init): Likewise. * gdbarch.c, gdbarch.h: Regenerated. * gdb.cp/classes.exp (test_pointers_to_class_members): Update expected output. Test the types of members and member pointers. * gdb.cp/inherit.exp (test_print_mi_member_types): Remove KFAILs for gdb/2092. * gdb.cp/member-ptr.exp: Search for a comment instead of a statement. Enable for GCC. Update expected output for some tests and add new tests. Remove obsolete GCC KFAILs. Allow GCC's class layout. * gdb.cp/member-ptr.cc (Padding, Padding::vspacer, Base, Base::get_x) (Base::vget_base, Left, Left::vget, Right, Right::vget, Diamond) (Diamond::vget_base): New. (main): Add new tests. * gdb.cp/printmethod.exp: Update expected output for member functions. * gdb.cp/virtfunc.exp (test_virtual_calls): Add a KFAIL for print pEe->D::vg().
2007-01-03 19:05:45 +01:00
smash_to_memberptr_type (type, domain, memtype);
}
1999-07-07 22:19:36 +02:00
else
/* type attribute */
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *attr = *pp;
/* Skip to the semicolon. */
while (**pp != ';' && **pp != '\0')
++(*pp);
if (**pp == '\0')
return error_type (pp, objfile);
else
1999-07-07 22:19:36 +02:00
++ * pp; /* Skip the semicolon. */
switch (*attr)
{
case 's': /* Size attribute */
type_size = atoi (attr + 1);
if (type_size <= 0)
type_size = -1;
break;
case 'S': /* String attribute */
/* FIXME: check to see if following type is array? */
is_string = 1;
break;
case 'V': /* Vector attribute */
/* FIXME: check to see if following type is array? */
is_vector = 1;
break;
default:
/* Ignore unrecognized type attributes, so future compilers
1999-07-07 22:19:36 +02:00
can invent new ones. */
break;
}
++*pp;
goto again;
}
break;
1999-07-07 22:19:36 +02:00
case '#': /* Method (class & fn) type */
if ((*pp)[0] == '#')
{
/* We'll get the parameter types from the name. */
struct type *return_type;
(*pp)++;
return_type = read_type (pp, objfile);
if (*(*pp)++ != ';')
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("invalid (minimal) member type "
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
"data format at symtab pos %d."),
2002-12-17 01:39:08 +01:00
symnum);
type = allocate_stub_method (return_type);
if (typenums[0] != -1)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
*dbx_lookup_type (typenums, objfile) = type;
}
else
{
struct type *domain = read_type (pp, objfile);
struct type *return_type;
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
struct field *args;
int nargs, varargs;
if (**pp != ',')
/* Invalid member type data format. */
return error_type (pp, objfile);
else
++(*pp);
return_type = read_type (pp, objfile);
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
args = read_args (pp, ';', objfile, &nargs, &varargs);
if (args == NULL)
return error_type (pp, objfile);
type = dbx_alloc_type (typenums, objfile);
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
smash_to_method_type (type, domain, return_type, args,
nargs, varargs);
}
break;
1999-07-07 22:19:36 +02:00
case 'r': /* Range type */
type = read_range_type (pp, typenums, type_size, objfile);
if (typenums[0] != -1)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
*dbx_lookup_type (typenums, objfile) = type;
break;
case 'b':
{
/* Sun ACC builtin int type */
type = read_sun_builtin_type (pp, typenums, objfile);
if (typenums[0] != -1)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
*dbx_lookup_type (typenums, objfile) = type;
}
break;
1999-07-07 22:19:36 +02:00
case 'R': /* Sun ACC builtin float type */
type = read_sun_floating_type (pp, typenums, objfile);
if (typenums[0] != -1)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
*dbx_lookup_type (typenums, objfile) = type;
break;
1999-07-07 22:19:36 +02:00
case 'e': /* Enumeration type */
type = dbx_alloc_type (typenums, objfile);
type = read_enum_type (pp, type, objfile);
if (typenums[0] != -1)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
*dbx_lookup_type (typenums, objfile) = type;
break;
1999-07-07 22:19:36 +02:00
case 's': /* Struct type */
case 'u': /* Union type */
{
enum type_code type_code = TYPE_CODE_UNDEF;
type = dbx_alloc_type (typenums, objfile);
switch (type_descriptor)
{
case 's':
type_code = TYPE_CODE_STRUCT;
break;
case 'u':
type_code = TYPE_CODE_UNION;
break;
}
type = read_struct_type (pp, type, type_code, objfile);
break;
}
1999-07-07 22:19:36 +02:00
case 'a': /* Array type */
if (**pp != 'r')
return error_type (pp, objfile);
++*pp;
1999-07-07 22:19:36 +02:00
type = dbx_alloc_type (typenums, objfile);
type = read_array_type (pp, type, objfile);
if (is_string)
TYPE_CODE (type) = TYPE_CODE_STRING;
if (is_vector)
make_vector_type (type);
break;
case 'S': /* Set type */
type1 = read_type (pp, objfile);
Remove unnecessary casts of NULL I noticed some unnecessary casts of NULL. This removes all the unnecessary ones, leaving only ones where we must ensure that NULL has pointer type for passing through varargs. I removed a couple of useless casts of 0 that I noticed while writing this. Tested by rebuilding. gdb/ChangeLog 2019-06-16 Tom Tromey <tom@tromey.com> * valops.c (value_cast, value_slice): Remove unnecessary cast. * breakpoint.c (stopin_command, stopat_command) (until_break_command, decode_location_default): Remove unnecessary cast. * utils.c (subset_compare): Remove unnecessary cast. * ada-lang.c (ada_update_initial_language): Remove unnecessary cast. * linespec.c (decode_line_with_last_displayed): Remove unnecessary cast. * infcmd.c (path_command): Remove unnecessary cast. * coffread.c (decode_type): Remove unnecessary cast. * xcoffread.c (read_xcoff_symtab): Remove unnecessary cast. * mipsread.c (mipscoff_symfile_read): Remove unnecessary cast. * tui/tui-stack.c (tui_show_locator_content) (tui_show_frame_info): Remove unnecessary cast. * tui/tui-win.c (tui_scroll_forward_command) (tui_scroll_backward_command, tui_set_focus, tui_set_win_height) (parse_scrolling_args): Remove unnecessary cast. * tui/tui-data.c (init_win_info, tui_del_window) (tui_free_window, tui_del_data_windows, tui_free_data_content) (free_content_elements): Remove unnecessary cast. * tui/tui-windata.c (tui_first_data_item_displayed): Remove unnecessary cast. * tui/tui-source.c (tui_set_source_content) (tui_vertical_source_scroll): Remove unnecessary cast. * tui/tui-layout.c (tui_default_win_height): Remove unnecessary cast. * tui/tui-io.c (tui_initialize_io): Remove unnecessary cast. * tui/tui-regs.c (tui_display_registers_from) (tui_display_register): Remove unnecessary cast. * tui/tui-wingeneral.c (tui_refresh_win, tui_delete_win) (tui_unhighlight_win, tui_highlight_win, tui_make_window) (make_visible): Remove unnecessary cast. * tui/tui-winsource.c (tui_erase_source_content) (tui_update_breakpoint_info, tui_set_exec_info_content): Remove unnecessary cast. * ax-gdb.c (agent_command_1): Remove unnecessary cast. * cli/cli-setshow.c (cmd_show_list): Remove unnecessary cast. * stabsread.c (read_type, read_array_type, read_range_type): Remove unnecessary cast. * mdebugread.c (mdebug_build_psymtabs): Remove unnecessary cast. (parse_symbol, parse_type, upgrade_type, parse_external) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref): Remove unnecessary cast. * gdb_bfd.c (gdb_bfd_map_section): Remove unnecessary cast.
2019-06-16 17:56:35 +02:00
type = create_set_type (NULL, type1);
if (typenums[0] != -1)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
*dbx_lookup_type (typenums, objfile) = type;
break;
default:
--*pp; /* Go back to the symbol in error. */
/* Particularly important if it was \0! */
return error_type (pp, objfile);
}
if (type == 0)
{
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
warning (_("GDB internal error, type is NULL in stabsread.c."));
return error_type (pp, objfile);
}
/* Size specified in a type attribute overrides any other size. */
if (type_size != -1)
TYPE_LENGTH (type) = (type_size + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
return type;
}
/* RS/6000 xlc/dbx combination uses a set of builtin types, starting from -1.
Return the proper type node for a given builtin type number. */
static const struct objfile_key<struct type *,
gdb::noop_deleter<struct type *>>
rs6000_builtin_type_data;
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
static struct type *
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
rs6000_builtin_type (int typenum, struct objfile *objfile)
{
struct type **negative_types = rs6000_builtin_type_data.get (objfile);
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
/* We recognize types numbered from -NUMBER_RECOGNIZED to -1. */
#define NUMBER_RECOGNIZED 34
struct type *rettype = NULL;
if (typenum >= 0 || typenum < -NUMBER_RECOGNIZED)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Unknown builtin type %d"), typenum);
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
return objfile_type (objfile)->builtin_error;
}
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
if (!negative_types)
{
/* This includes an empty slot for type number -0. */
negative_types = OBSTACK_CALLOC (&objfile->objfile_obstack,
NUMBER_RECOGNIZED + 1, struct type *);
rs6000_builtin_type_data.set (objfile, negative_types);
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
}
if (negative_types[-typenum] != NULL)
return negative_types[-typenum];
#if TARGET_CHAR_BIT != 8
1999-07-07 22:19:36 +02:00
#error This code wrong for TARGET_CHAR_BIT not 8
/* These definitions all assume that TARGET_CHAR_BIT is 8. I think
that if that ever becomes not true, the correct fix will be to
make the size in the struct type to be in bits, not in units of
TARGET_CHAR_BIT. */
#endif
switch (-typenum)
{
case 1:
/* The size of this and all the other types are fixed, defined
1999-07-07 22:19:36 +02:00
by the debugging format. If there is a type called "int" which
is other than 32 bits, then it should use a new negative type
number (or avoid negative type numbers for that case).
See stabs.texinfo. */
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 32, 0, "int");
break;
case 2:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 8, 0, "char");
TYPE_NOSIGN (rettype) = 1;
break;
case 3:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 16, 0, "short");
break;
case 4:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 32, 0, "long");
break;
case 5:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 8, 1, "unsigned char");
break;
case 6:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 8, 0, "signed char");
break;
case 7:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 16, 1, "unsigned short");
break;
case 8:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 32, 1, "unsigned int");
break;
case 9:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 32, 1, "unsigned");
break;
case 10:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 32, 1, "unsigned long");
break;
case 11:
Make init_type/arch_type take a size in bits This changes the interfaces to init_type and arch_type to take the type length in bits as input (instead of as bytes). The routines assert that the length is a multiple of TARGET_CHAR_BIT. For consistency, arch_flags_type is changed likewise, so that now all type creation interfaces always use length in bits. All callers are updated in the straightforward manner. The assert actually found a bug in read_range_type, where the init_integer_type routine was called with a wrong argument (probably a bug introduced with the conversion to use init_integer_type). gdb/ChangeLog 2017-09-27 Ulrich Weigand <uweigand@de.ibm.com> * gdbtypes.c (init_type): Change incoming argument from length-in-bytes to length-in-bits. Assert length is a multiple of TARGET_CHAR_BITS. (arch_type, arch_flags_type): Likewise. (init_integer_type): Update call to init_type. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (objfile_type): Likewise. (arch_integer_type): Update call to arch_type. (arch_character_type): Likewise. (arch_boolean_type): Likewise. (arch_float_type): Likewise. (arch_decfloat_type): Likewise. (arch_complex_type): Likewise. (arch_pointer_type): Likewise. (gdbtypes_post_init): Likewise. * dwarf2read.c (dwarf2_init_float_type): Update call to init_type. (read_base_type): Likewise. * mdebugread.c (basic_type): Likewise. * stabsread.c (dbx_init_float_type): Likewise. (rs6000_builtin_type): Likewise. (read_range_type): Likewise. Also, fix call to init_integer_type with erroneous length argument. * ada-lang.c (ada_language_arch_info): Update call to arch_type. * d-lang.c (build_d_types): Likewise. * f-lang.c (build_fortran_types): Likewise. * go-lang.c (build_go_types): Likewise. * opencl-lang.c (build_opencl_types): Likewise. * jit.c (finalize_symtab): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * target-descriptions.c (tdesc_gdb_type): Likewise. Also, update call to arch_flags_type. * linux-tdep.c (linux_get_siginfo_type_with_fields): Update call to arch_type. * fbsd-tdep.c (fbsd_get_siginfo_type): Likewise. * windows-tdep.c (windows_get_tlb_type): Likewise. * avr-tdep.c (avr_gdbarch_init): Update call to arch_type. * ft32-tdep.c (ft32_gdbarch_init): Likewise. * m32c-tdep.c (make_types): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. (rl78_psw_type): Update call to arch_flags_type. * m68k-tdep.c (m68k_ps_type): Update call to arch_flags_type. * rx-tdep.c (rx_psw_type): Likewise. (rx_fpsw_type): Likewise. * sparc-tdep.c (sparc_psr_type): Likewise. (sparc_fsr_type): Likewise. * sparc64-tdep.c (sparc64_pstate_type): Likewise. (sparc64_ccr_type): Likewise. (sparc64_fsr_type): Likewise. (sparc64_fprs_type): Likewise.
2017-09-27 19:02:00 +02:00
rettype = init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
break;
case 12:
/* IEEE single precision (32 bit). */
rettype = init_float_type (objfile, 32, "float",
floatformats_ieee_single);
break;
case 13:
/* IEEE double precision (64 bit). */
rettype = init_float_type (objfile, 64, "double",
floatformats_ieee_double);
break;
case 14:
/* This is an IEEE double on the RS/6000, and different machines with
1999-07-07 22:19:36 +02:00
different sizes for "long double" should use different negative
type numbers. See stabs.texinfo. */
rettype = init_float_type (objfile, 64, "long double",
floatformats_ieee_double);
break;
case 15:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 32, 0, "integer");
break;
case 16:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_boolean_type (objfile, 32, 1, "boolean");
break;
case 17:
rettype = init_float_type (objfile, 32, "short real",
floatformats_ieee_single);
break;
case 18:
rettype = init_float_type (objfile, 64, "real",
floatformats_ieee_double);
break;
case 19:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_type (objfile, TYPE_CODE_ERROR, 0, "stringptr");
break;
case 20:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_character_type (objfile, 8, 1, "character");
break;
case 21:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_boolean_type (objfile, 8, 1, "logical*1");
break;
case 22:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_boolean_type (objfile, 16, 1, "logical*2");
break;
case 23:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_boolean_type (objfile, 32, 1, "logical*4");
break;
case 24:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_boolean_type (objfile, 32, 1, "logical");
break;
case 25:
/* Complex type consisting of two IEEE single precision values. */
rettype = init_complex_type ("complex",
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rs6000_builtin_type (12, objfile));
break;
case 26:
/* Complex type consisting of two IEEE double precision values. */
rettype = init_complex_type ("double complex",
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rs6000_builtin_type (13, objfile));
break;
case 27:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 8, 0, "integer*1");
break;
case 28:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 16, 0, "integer*2");
break;
case 29:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 32, 0, "integer*4");
break;
case 30:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_character_type (objfile, 16, 0, "wchar");
break;
case 31:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 64, 0, "long long");
break;
case 32:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 64, 1, "unsigned long long");
break;
case 33:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 64, 1, "logical*8");
break;
case 34:
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
rettype = init_integer_type (objfile, 64, 0, "integer*8");
break;
}
negative_types[-typenum] = rettype;
return rettype;
}
/* This page contains subroutines of read_type. */
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
/* Wrapper around method_name_from_physname to flag a complaint
if there is an error. */
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
static char *
stabs_method_name_from_physname (const char *physname)
{
char *method_name;
method_name = method_name_from_physname (physname);
if (method_name == NULL)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Method has bad physname %s\n"), physname);
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
return NULL;
}
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
return method_name;
}
/* Read member function stabs info for C++ classes. The form of each member
function data is:
1999-07-07 22:19:36 +02:00
NAME :: TYPENUM[=type definition] ARGS : PHYSNAME ;
An example with two member functions is:
1999-07-07 22:19:36 +02:00
afunc1::20=##15;:i;2A.;afunc2::20:i;2A.;
For the case of overloaded operators, the format is op$::*.funcs, where
$ is the CPLUS_MARKER (usually '$'), `*' holds the place for an operator
name (such as `+=') and `.' marks the end of the operator name.
Returns 1 for success, 0 for failure. */
static int
read_member_functions (struct stab_field_info *fip, const char **pp,
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
struct type *type, struct objfile *objfile)
{
int nfn_fields = 0;
int length = 0;
int i;
struct next_fnfield
{
struct next_fnfield *next;
struct fn_field fn_field;
1999-07-07 22:19:36 +02:00
}
*sublist;
struct type *look_ahead_type;
struct next_fnfieldlist *new_fnlist;
struct next_fnfield *new_sublist;
char *main_fn_name;
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p;
1999-07-07 22:19:36 +02:00
/* Process each list until we find something that is not a member function
or find the end of the functions. */
while (**pp != ';')
{
/* We should be positioned at the start of the function name.
1999-07-07 22:19:36 +02:00
Scan forward to find the first ':' and if it is not the
first of a "::" delimiter, then this is not a member function. */
p = *pp;
while (*p != ':')
{
p++;
}
if (p[1] != ':')
{
break;
}
sublist = NULL;
look_ahead_type = NULL;
length = 0;
1999-07-07 22:19:36 +02:00
new_fnlist = OBSTACK_ZALLOC (&fip->obstack, struct next_fnfieldlist);
1999-07-07 22:19:36 +02:00
if ((*pp)[0] == 'o' && (*pp)[1] == 'p' && is_cplus_marker ((*pp)[2]))
{
/* This is a completely wierd case. In order to stuff in the
names that might contain colons (the usual name delimiter),
Mike Tiemann defined a different name format which is
signalled if the identifier is "op$". In that case, the
format is "op$::XXXX." where XXXX is the name. This is
used for names like "+" or "=". YUUUUUUUK! FIXME! */
/* This lets the user type "break operator+".
We could just put in "+" as the name, but that wouldn't
work for "*". */
* c-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * cp-valprint.c (vtbl_ptr_name_old): Delete. (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old. * demangle.c (cplus_markers): Update comment. Put '$' first. Remove CPLUS_MARKER. (_initialize_demangler): Don't call set_cplus_marker_for_demangling. * jv-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER. * objc-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * p-exp.y (yylex): Remove reference to CPLUS_MARKER. * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'. (read_member_functions): Likewise for opname. (read_tilde_fields): Use is_cplus_marker. * defs.h (CPLUS_MARKER): Don't define. * config/tm-sysv4.h (CPLUS_MARKER): Likewise. * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise. * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise. * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise. * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise. * config/i386/tm-i386v4.h: Delete file. * config/djgpp/fnchange.lst: Delete tm-i386v4.h. * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead. * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead. * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead. * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h. * config/i386/i386sco5.mt (TM_FILE): Likewise. * config/i386/i386v4.mt (TM_FILE): Likewise. * config/i386/ncr3000.mt (TM_FILE): Likewise.
2002-10-11 16:02:39 +02:00
static char opname[32] = "op$";
char *o = opname + 3;
1999-07-07 22:19:36 +02:00
/* Skip past '::'. */
*pp = p + 2;
STABS_CONTINUE (pp, objfile);
p = *pp;
while (*p != '.')
{
*o++ = *p++;
}
main_fn_name = savestring (opname, o - opname);
/* Skip past '.' */
*pp = p + 1;
}
else
{
main_fn_name = savestring (*pp, p - *pp);
/* Skip past '::'. */
*pp = p + 2;
}
1999-07-07 22:19:36 +02:00
new_fnlist->fn_fieldlist.name = main_fn_name;
do
{
new_sublist = OBSTACK_ZALLOC (&fip->obstack, struct next_fnfield);
1999-07-07 22:19:36 +02:00
/* Check for and handle cretinous dbx symbol name continuation! */
if (look_ahead_type == NULL)
{
/* Normal case. */
STABS_CONTINUE (pp, objfile);
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.type = read_type (pp, objfile);
if (**pp != ':')
{
/* Invalid symtab info for member function. */
return 0;
}
}
else
{
/* g++ version 1 kludge */
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.type = look_ahead_type;
look_ahead_type = NULL;
}
1999-07-07 22:19:36 +02:00
(*pp)++;
p = *pp;
while (*p != ';')
{
p++;
}
1999-07-07 22:19:36 +02:00
Move TYPE_SELF_TYPE into new field type_specific. This patch moves TYPE_SELF_TYPE into new field type_specific.self_type for MEMBERPTR,METHODPTR types, and into type_specific.func_stuff for METHODs, and then updates everything to use that. TYPE_CODE_METHOD could share some things with TYPE_CODE_FUNC (e.g. TYPE_NO_RETURN) and it seemed simplest to keep them together. Moving TYPE_SELF_TYPE into type_specific.func_stuff for TYPE_CODE_METHOD is also nice because when we allocate space for function types we assume they're TYPE_CODE_FUNCs. If TYPE_CODE_METHODs don't need or use that space then that space would be wasted, and cleaning that up would involve more invasive changes. In order to catch errant uses I've added accessor functions that do some checking. One can no longer assign to TYPE_SELF_TYPE like this: TYPE_SELF_TYPE (foo) = bar; One instead has to do: set_type_self_type (foo, bar); But I've left reading of the type to the macro: bar = TYPE_SELF_TYPE (foo); In order to discourage bypassing the TYPE_SELF_TYPE macro I've named the underlying function that implements it internal_type_self_type. While testing this I found the stabs reader leaving methods as TYPE_CODE_FUNCs, hitting my newly added asserts. Since the dwarf reader smashes functions to methods (via smash_to_method) I've done a similar thing for stabs. gdb/ChangeLog: * cp-valprint.c (cp_find_class_member): Rename parameter domain_p to self_p. (cp_print_class_member): Rename local domain to self_type. * dwarf2read.c (quirk_gcc_member_function_pointer): Rename local domain_type to self_type. (set_die_type) <need_gnat_info>: Handle TYPE_CODE_METHODPTR, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD. * gdb-gdb.py (StructMainTypePrettyPrinter): Handle TYPE_SPECIFIC_SELF_TYPE. * gdbtypes.c (internal_type_self_type): New function. (set_type_self_type): New function. (smash_to_memberptr_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (smash_to_methodptr_type): Update setting of TYPE_SELF_TYPE. (smash_to_method_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (check_stub_method): Call smash_to_method_type. (recursive_dump_type): Handle TYPE_SPECIFIC_SELF_TYPE. (copy_type_recursive): Ditto. * gdbtypes.h (enum type_specific_kind): New value TYPE_SPECIFIC_SELF_TYPE. (struct main_type) <type_specific>: New member self_type. (struct cplus_struct_type) <fn_field.type>: Update comment. (TYPE_SELF_TYPE): Rewrite. (internal_type_self_type, set_type_self_type): Declare. * gnu-v3-abi.c (gnuv3_print_method_ptr): Rename local domain to self_type. (gnuv3_method_ptr_to_value): Rename local domain_type to self_type. * m2-typeprint.c (m2_range): Replace TYPE_SELF_TYPE with TYPE_TARGET_TYPE. * stabsread.c (read_member_functions): Mark methods with TYPE_CODE_METHOD, not TYPE_CODE_FUNC. Update setting of TYPE_SELF_TYPE.
2015-02-01 06:21:01 +01:00
/* These are methods, not functions. */
if (TYPE_CODE (new_sublist->fn_field.type) == TYPE_CODE_FUNC)
TYPE_CODE (new_sublist->fn_field.type) = TYPE_CODE_METHOD;
else
gdb_assert (TYPE_CODE (new_sublist->fn_field.type)
== TYPE_CODE_METHOD);
Move TYPE_SELF_TYPE into new field type_specific. This patch moves TYPE_SELF_TYPE into new field type_specific.self_type for MEMBERPTR,METHODPTR types, and into type_specific.func_stuff for METHODs, and then updates everything to use that. TYPE_CODE_METHOD could share some things with TYPE_CODE_FUNC (e.g. TYPE_NO_RETURN) and it seemed simplest to keep them together. Moving TYPE_SELF_TYPE into type_specific.func_stuff for TYPE_CODE_METHOD is also nice because when we allocate space for function types we assume they're TYPE_CODE_FUNCs. If TYPE_CODE_METHODs don't need or use that space then that space would be wasted, and cleaning that up would involve more invasive changes. In order to catch errant uses I've added accessor functions that do some checking. One can no longer assign to TYPE_SELF_TYPE like this: TYPE_SELF_TYPE (foo) = bar; One instead has to do: set_type_self_type (foo, bar); But I've left reading of the type to the macro: bar = TYPE_SELF_TYPE (foo); In order to discourage bypassing the TYPE_SELF_TYPE macro I've named the underlying function that implements it internal_type_self_type. While testing this I found the stabs reader leaving methods as TYPE_CODE_FUNCs, hitting my newly added asserts. Since the dwarf reader smashes functions to methods (via smash_to_method) I've done a similar thing for stabs. gdb/ChangeLog: * cp-valprint.c (cp_find_class_member): Rename parameter domain_p to self_p. (cp_print_class_member): Rename local domain to self_type. * dwarf2read.c (quirk_gcc_member_function_pointer): Rename local domain_type to self_type. (set_die_type) <need_gnat_info>: Handle TYPE_CODE_METHODPTR, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD. * gdb-gdb.py (StructMainTypePrettyPrinter): Handle TYPE_SPECIFIC_SELF_TYPE. * gdbtypes.c (internal_type_self_type): New function. (set_type_self_type): New function. (smash_to_memberptr_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (smash_to_methodptr_type): Update setting of TYPE_SELF_TYPE. (smash_to_method_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (check_stub_method): Call smash_to_method_type. (recursive_dump_type): Handle TYPE_SPECIFIC_SELF_TYPE. (copy_type_recursive): Ditto. * gdbtypes.h (enum type_specific_kind): New value TYPE_SPECIFIC_SELF_TYPE. (struct main_type) <type_specific>: New member self_type. (struct cplus_struct_type) <fn_field.type>: Update comment. (TYPE_SELF_TYPE): Rewrite. (internal_type_self_type, set_type_self_type): Declare. * gnu-v3-abi.c (gnuv3_print_method_ptr): Rename local domain to self_type. (gnuv3_method_ptr_to_value): Rename local domain_type to self_type. * m2-typeprint.c (m2_range): Replace TYPE_SELF_TYPE with TYPE_TARGET_TYPE. * stabsread.c (read_member_functions): Mark methods with TYPE_CODE_METHOD, not TYPE_CODE_FUNC. Update setting of TYPE_SELF_TYPE.
2015-02-01 06:21:01 +01:00
/* If this is just a stub, then we don't have the real name here. */
if (TYPE_STUB (new_sublist->fn_field.type))
{
if (!TYPE_SELF_TYPE (new_sublist->fn_field.type))
Move TYPE_SELF_TYPE into new field type_specific. This patch moves TYPE_SELF_TYPE into new field type_specific.self_type for MEMBERPTR,METHODPTR types, and into type_specific.func_stuff for METHODs, and then updates everything to use that. TYPE_CODE_METHOD could share some things with TYPE_CODE_FUNC (e.g. TYPE_NO_RETURN) and it seemed simplest to keep them together. Moving TYPE_SELF_TYPE into type_specific.func_stuff for TYPE_CODE_METHOD is also nice because when we allocate space for function types we assume they're TYPE_CODE_FUNCs. If TYPE_CODE_METHODs don't need or use that space then that space would be wasted, and cleaning that up would involve more invasive changes. In order to catch errant uses I've added accessor functions that do some checking. One can no longer assign to TYPE_SELF_TYPE like this: TYPE_SELF_TYPE (foo) = bar; One instead has to do: set_type_self_type (foo, bar); But I've left reading of the type to the macro: bar = TYPE_SELF_TYPE (foo); In order to discourage bypassing the TYPE_SELF_TYPE macro I've named the underlying function that implements it internal_type_self_type. While testing this I found the stabs reader leaving methods as TYPE_CODE_FUNCs, hitting my newly added asserts. Since the dwarf reader smashes functions to methods (via smash_to_method) I've done a similar thing for stabs. gdb/ChangeLog: * cp-valprint.c (cp_find_class_member): Rename parameter domain_p to self_p. (cp_print_class_member): Rename local domain to self_type. * dwarf2read.c (quirk_gcc_member_function_pointer): Rename local domain_type to self_type. (set_die_type) <need_gnat_info>: Handle TYPE_CODE_METHODPTR, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD. * gdb-gdb.py (StructMainTypePrettyPrinter): Handle TYPE_SPECIFIC_SELF_TYPE. * gdbtypes.c (internal_type_self_type): New function. (set_type_self_type): New function. (smash_to_memberptr_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (smash_to_methodptr_type): Update setting of TYPE_SELF_TYPE. (smash_to_method_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (check_stub_method): Call smash_to_method_type. (recursive_dump_type): Handle TYPE_SPECIFIC_SELF_TYPE. (copy_type_recursive): Ditto. * gdbtypes.h (enum type_specific_kind): New value TYPE_SPECIFIC_SELF_TYPE. (struct main_type) <type_specific>: New member self_type. (struct cplus_struct_type) <fn_field.type>: Update comment. (TYPE_SELF_TYPE): Rewrite. (internal_type_self_type, set_type_self_type): Declare. * gnu-v3-abi.c (gnuv3_print_method_ptr): Rename local domain to self_type. (gnuv3_method_ptr_to_value): Rename local domain_type to self_type. * m2-typeprint.c (m2_range): Replace TYPE_SELF_TYPE with TYPE_TARGET_TYPE. * stabsread.c (read_member_functions): Mark methods with TYPE_CODE_METHOD, not TYPE_CODE_FUNC. Update setting of TYPE_SELF_TYPE.
2015-02-01 06:21:01 +01:00
set_type_self_type (new_sublist->fn_field.type, type);
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.is_stub = 1;
}
Move TYPE_SELF_TYPE into new field type_specific. This patch moves TYPE_SELF_TYPE into new field type_specific.self_type for MEMBERPTR,METHODPTR types, and into type_specific.func_stuff for METHODs, and then updates everything to use that. TYPE_CODE_METHOD could share some things with TYPE_CODE_FUNC (e.g. TYPE_NO_RETURN) and it seemed simplest to keep them together. Moving TYPE_SELF_TYPE into type_specific.func_stuff for TYPE_CODE_METHOD is also nice because when we allocate space for function types we assume they're TYPE_CODE_FUNCs. If TYPE_CODE_METHODs don't need or use that space then that space would be wasted, and cleaning that up would involve more invasive changes. In order to catch errant uses I've added accessor functions that do some checking. One can no longer assign to TYPE_SELF_TYPE like this: TYPE_SELF_TYPE (foo) = bar; One instead has to do: set_type_self_type (foo, bar); But I've left reading of the type to the macro: bar = TYPE_SELF_TYPE (foo); In order to discourage bypassing the TYPE_SELF_TYPE macro I've named the underlying function that implements it internal_type_self_type. While testing this I found the stabs reader leaving methods as TYPE_CODE_FUNCs, hitting my newly added asserts. Since the dwarf reader smashes functions to methods (via smash_to_method) I've done a similar thing for stabs. gdb/ChangeLog: * cp-valprint.c (cp_find_class_member): Rename parameter domain_p to self_p. (cp_print_class_member): Rename local domain to self_type. * dwarf2read.c (quirk_gcc_member_function_pointer): Rename local domain_type to self_type. (set_die_type) <need_gnat_info>: Handle TYPE_CODE_METHODPTR, TYPE_CODE_MEMBERPTR, TYPE_CODE_METHOD. * gdb-gdb.py (StructMainTypePrettyPrinter): Handle TYPE_SPECIFIC_SELF_TYPE. * gdbtypes.c (internal_type_self_type): New function. (set_type_self_type): New function. (smash_to_memberptr_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (smash_to_methodptr_type): Update setting of TYPE_SELF_TYPE. (smash_to_method_type): Rename parameter domain to self_type. Update setting of TYPE_SELF_TYPE. (check_stub_method): Call smash_to_method_type. (recursive_dump_type): Handle TYPE_SPECIFIC_SELF_TYPE. (copy_type_recursive): Ditto. * gdbtypes.h (enum type_specific_kind): New value TYPE_SPECIFIC_SELF_TYPE. (struct main_type) <type_specific>: New member self_type. (struct cplus_struct_type) <fn_field.type>: Update comment. (TYPE_SELF_TYPE): Rewrite. (internal_type_self_type, set_type_self_type): Declare. * gnu-v3-abi.c (gnuv3_print_method_ptr): Rename local domain to self_type. (gnuv3_method_ptr_to_value): Rename local domain_type to self_type. * m2-typeprint.c (m2_range): Replace TYPE_SELF_TYPE with TYPE_TARGET_TYPE. * stabsread.c (read_member_functions): Mark methods with TYPE_CODE_METHOD, not TYPE_CODE_FUNC. Update setting of TYPE_SELF_TYPE.
2015-02-01 06:21:01 +01:00
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.physname = savestring (*pp, p - *pp);
*pp = p + 1;
1999-07-07 22:19:36 +02:00
/* Set this member function's visibility fields. */
switch (*(*pp)++)
{
1999-07-07 22:19:36 +02:00
case VISIBILITY_PRIVATE:
new_sublist->fn_field.is_private = 1;
break;
case VISIBILITY_PROTECTED:
new_sublist->fn_field.is_protected = 1;
break;
}
1999-07-07 22:19:36 +02:00
STABS_CONTINUE (pp, objfile);
switch (**pp)
{
case 'A': /* Normal functions. */
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.is_const = 0;
new_sublist->fn_field.is_volatile = 0;
(*pp)++;
break;
case 'B': /* `const' member functions. */
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.is_const = 1;
new_sublist->fn_field.is_volatile = 0;
(*pp)++;
break;
case 'C': /* `volatile' member function. */
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.is_const = 0;
new_sublist->fn_field.is_volatile = 1;
(*pp)++;
break;
case 'D': /* `const volatile' member function. */
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.is_const = 1;
new_sublist->fn_field.is_volatile = 1;
(*pp)++;
break;
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
case '*': /* File compiled with g++ version 1 --
no info. */
1999-07-07 22:19:36 +02:00
case '?':
case '.':
break;
default:
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("const/volatile indicator missing, got '%c'"),
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
**pp);
1999-07-07 22:19:36 +02:00
break;
}
1999-07-07 22:19:36 +02:00
switch (*(*pp)++)
{
1999-07-07 22:19:36 +02:00
case '*':
{
int nbits;
1999-07-07 22:19:36 +02:00
/* virtual member function, followed by index.
The sign bit is set to distinguish pointers-to-methods
from virtual function indicies. Since the array is
in words, the quantity must be shifted left by 1
on 16 bit machine, and by 2 on 32 bit machine, forcing
the sign bit out, and usable as a valid index into
the array. Remove the sign bit here. */
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.voffset =
(0x7fffffff & read_huge_number (pp, ';', &nbits, 0)) + 2;
if (nbits != 0)
return 0;
1999-07-07 22:19:36 +02:00
STABS_CONTINUE (pp, objfile);
if (**pp == ';' || **pp == '\0')
{
/* Must be g++ version 1. */
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.fcontext = 0;
}
else
{
/* Figure out from whence this virtual function came.
It may belong to virtual function table of
one of its baseclasses. */
look_ahead_type = read_type (pp, objfile);
if (**pp == ':')
{
/* g++ version 1 overloaded methods. */
}
else
{
1999-07-07 22:19:36 +02:00
new_sublist->fn_field.fcontext = look_ahead_type;
if (**pp != ';')
{
return 0;
}
else
{
++*pp;
}
look_ahead_type = NULL;
}
}
break;
}
1999-07-07 22:19:36 +02:00
case '?':
/* static member function. */
{
int slen = strlen (main_fn_name);
new_sublist->fn_field.voffset = VOFFSET_STATIC;
/* For static member functions, we can't tell if they
are stubbed, as they are put out as functions, and not as
methods.
GCC v2 emits the fully mangled name if
dbxout.c:flag_minimal_debug is not set, so we have to
detect a fully mangled physname here and set is_stub
accordingly. Fully mangled physnames in v2 start with
the member function name, followed by two underscores.
GCC v3 currently always emits stubbed member functions,
but with fully mangled physnames, which start with _Z. */
if (!(strncmp (new_sublist->fn_field.physname,
main_fn_name, slen) == 0
&& new_sublist->fn_field.physname[slen] == '_'
&& new_sublist->fn_field.physname[slen + 1] == '_'))
{
new_sublist->fn_field.is_stub = 1;
}
break;
}
1999-07-07 22:19:36 +02:00
default:
/* error */
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("member function type missing, got '%c'"),
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
(*pp)[-1]);
Fix "fall through" comments This patch updates existing "fall through" comments so that they can be recognized by gcc's -Wimplicit-fallthrough comment-parsing heuristic. ChangeLog 2018-05-04 Tom Tromey <tom@tromey.com> * s390-tdep.c (s390_process_record): Fix fall-through comments. * xcoffread.c (scan_xcoff_symtab): Move comment later. * symfile.c (section_is_mapped): Fix fall-through comment. * stabsread.c (define_symbol, read_member_functions): Fix fall-through comment. * s390-linux-tdep.c (s390_process_record): Fix fall-through comment. * remote.c (remote_wait_as): Fix fall-through comment. * p-exp.y (yylex): Fix fall-through comment. * nat/x86-dregs.c (x86_length_and_rw_bits): Fix fall-through comment. * msp430-tdep.c (msp430_gdbarch_init): Fix fall-through comment. * mdebugread.c (parse_partial_symbols): Fix fall-through comment. * jv-exp.y (yylex): Fix fall-through comment. * go-exp.y (lex_one_token): Fix fall-through comment. * gdbtypes.c (get_discrete_bounds, rank_one_type): Fix fall-through comment. * f-exp.y (yylex): Fix fall-through comment. * dwarf2read.c (process_die): Fix fall-through comments. * dbxread.c (process_one_symbol): Fix fall-through comment. * d-exp.y (lex_one_token): Fix fall-through comment. * cp-name-parser.y (yylex): Fix fall-through comment. * coffread.c (coff_symtab_read): Fix fall-through comment. * c-exp.y (lex_one_token): Fix fall-through comment. * arm-tdep.c (arm_decode_miscellaneous): Fix fall-through comment. * arch/arm.c (arm_instruction_changes_pc): Fix fall-through comment.
2016-09-27 19:18:04 +02:00
/* Normal member function. */
/* Fall through. */
1999-07-07 22:19:36 +02:00
case '.':
/* normal member function. */
new_sublist->fn_field.voffset = 0;
new_sublist->fn_field.fcontext = 0;
break;
}
1999-07-07 22:19:36 +02:00
new_sublist->next = sublist;
sublist = new_sublist;
length++;
STABS_CONTINUE (pp, objfile);
}
while (**pp != ';' && **pp != '\0');
1999-07-07 22:19:36 +02:00
(*pp)++;
STABS_CONTINUE (pp, objfile);
1999-07-07 22:19:36 +02:00
/* Skip GCC 3.X member functions which are duplicates of the callable
constructor/destructor. */
if (strcmp_iw (main_fn_name, "__base_ctor ") == 0
|| strcmp_iw (main_fn_name, "__base_dtor ") == 0
|| strcmp (main_fn_name, "__deleting_dtor") == 0)
{
xfree (main_fn_name);
}
else
{
int has_destructor = 0, has_other = 0;
int is_v3 = 0;
struct next_fnfield *tmp_sublist;
/* Various versions of GCC emit various mostly-useless
strings in the name field for special member functions.
For stub methods, we need to defer correcting the name
until we are ready to unstub the method, because the current
name string is used by gdb_mangle_name. The only stub methods
of concern here are GNU v2 operators; other methods have their
names correct (see caveat below).
For non-stub methods, in GNU v3, we have a complete physname.
Therefore we can safely correct the name now. This primarily
affects constructors and destructors, whose name will be
__comp_ctor or __comp_dtor instead of Foo or ~Foo. Cast
operators will also have incorrect names; for instance,
"operator int" will be named "operator i" (i.e. the type is
mangled).
For non-stub methods in GNU v2, we have no easy way to
know if we have a complete physname or not. For most
methods the result depends on the platform (if CPLUS_MARKER
can be `$' or `.', it will use minimal debug information, or
otherwise the full physname will be included).
Rather than dealing with this, we take a different approach.
For v3 mangled names, we can use the full physname; for v2,
we use cplus_demangle_opname (which is actually v2 specific),
because the only interesting names are all operators - once again
barring the caveat below. Skip this process if any method in the
group is a stub, to prevent our fouling up the workings of
gdb_mangle_name.
The caveat: GCC 2.95.x (and earlier?) put constructors and
destructors in the same method group. We need to split this
into two groups, because they should have different names.
So for each method group we check whether it contains both
routines whose physname appears to be a destructor (the physnames
for and destructors are always provided, due to quirks in v2
mangling) and routines whose physname does not appear to be a
destructor. If so then we break up the list into two halves.
Even if the constructors and destructors aren't in the same group
the destructor will still lack the leading tilde, so that also
needs to be fixed.
So, to summarize what we expect and handle here:
Given Given Real Real Action
method name physname physname method name
__opi [none] __opi__3Foo operator int opname
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
[now or later]
Foo _._3Foo _._3Foo ~Foo separate and
rename
operator i _ZN3FoocviEv _ZN3FoocviEv operator int demangle
__comp_ctor _ZN3FooC1ERKS_ _ZN3FooC1ERKS_ Foo demangle
*/
tmp_sublist = sublist;
while (tmp_sublist != NULL)
{
if (tmp_sublist->fn_field.physname[0] == '_'
&& tmp_sublist->fn_field.physname[1] == 'Z')
is_v3 = 1;
if (is_destructor_name (tmp_sublist->fn_field.physname))
has_destructor++;
else
has_other++;
tmp_sublist = tmp_sublist->next;
}
if (has_destructor && has_other)
{
struct next_fnfieldlist *destr_fnlist;
struct next_fnfield *last_sublist;
/* Create a new fn_fieldlist for the destructors. */
destr_fnlist = OBSTACK_ZALLOC (&fip->obstack,
struct next_fnfieldlist);
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
destr_fnlist->fn_fieldlist.name
= obconcat (&objfile->objfile_obstack, "~",
new_fnlist->fn_fieldlist.name, (char *) NULL);
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
destr_fnlist->fn_fieldlist.fn_fields =
XOBNEWVEC (&objfile->objfile_obstack,
struct fn_field, has_destructor);
memset (destr_fnlist->fn_fieldlist.fn_fields, 0,
sizeof (struct fn_field) * has_destructor);
tmp_sublist = sublist;
last_sublist = NULL;
i = 0;
while (tmp_sublist != NULL)
{
if (!is_destructor_name (tmp_sublist->fn_field.physname))
{
tmp_sublist = tmp_sublist->next;
continue;
}
destr_fnlist->fn_fieldlist.fn_fields[i++]
= tmp_sublist->fn_field;
if (last_sublist)
last_sublist->next = tmp_sublist->next;
else
sublist = tmp_sublist->next;
last_sublist = tmp_sublist;
tmp_sublist = tmp_sublist->next;
}
destr_fnlist->fn_fieldlist.length = has_destructor;
destr_fnlist->next = fip->fnlist;
fip->fnlist = destr_fnlist;
nfn_fields++;
length -= has_destructor;
}
else if (is_v3)
{
/* v3 mangling prevents the use of abbreviated physnames,
so we can do this here. There are stubbed methods in v3
only:
- in -gstabs instead of -gstabs+
- or for static methods, which are output as a function type
instead of a method type. */
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
char *new_method_name =
stabs_method_name_from_physname (sublist->fn_field.physname);
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
if (new_method_name != NULL
&& strcmp (new_method_name,
new_fnlist->fn_fieldlist.name) != 0)
{
new_fnlist->fn_fieldlist.name = new_method_name;
xfree (main_fn_name);
}
else
xfree (new_method_name);
}
else if (has_destructor && new_fnlist->fn_fieldlist.name[0] != '~')
{
new_fnlist->fn_fieldlist.name =
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
obconcat (&objfile->objfile_obstack,
"~", main_fn_name, (char *)NULL);
xfree (main_fn_name);
}
new_fnlist->fn_fieldlist.fn_fields
= OBSTACK_CALLOC (&objfile->objfile_obstack, length, fn_field);
for (i = length; (i--, sublist); sublist = sublist->next)
{
new_fnlist->fn_fieldlist.fn_fields[i] = sublist->fn_field;
}
1999-07-07 22:19:36 +02:00
new_fnlist->fn_fieldlist.length = length;
new_fnlist->next = fip->fnlist;
fip->fnlist = new_fnlist;
nfn_fields++;
}
}
if (nfn_fields)
{
ALLOCATE_CPLUS_STRUCT_TYPE (type);
TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
TYPE_ALLOC (type, sizeof (struct fn_fieldlist) * nfn_fields);
memset (TYPE_FN_FIELDLISTS (type), 0,
sizeof (struct fn_fieldlist) * nfn_fields);
TYPE_NFN_FIELDS (type) = nfn_fields;
}
return 1;
}
/* Special GNU C++ name.
Returns 1 for success, 0 for failure. "failure" means that we can't
keep parsing and it's time for error_type(). */
static int
read_cpp_abbrev (struct stab_field_info *fip, const char **pp,
struct type *type, struct objfile *objfile)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p;
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
const char *name;
char cpp_abbrev;
struct type *context;
p = *pp;
if (*++p == 'v')
{
name = NULL;
cpp_abbrev = *++p;
*pp = p + 1;
/* At this point, *pp points to something like "22:23=*22...",
1999-07-07 22:19:36 +02:00
where the type number before the ':' is the "context" and
everything after is a regular type definition. Lookup the
type, find it's name, and construct the field name. */
context = read_type (pp, objfile);
switch (cpp_abbrev)
{
1999-07-07 22:19:36 +02:00
case 'f': /* $vf -- a virtual function table pointer */
Remove type_name_no_tag and rename type_name_no_tag_or_error type_name_no_tag is just a plain wrapper for TYPE_NAME now, so this patch removes it. And, because tag names no longer exist, this renames type_name_no_tag_or_error to type_name_or_error. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (value_cast_structs, destructor_name_p): Update. * symtab.c (gdb_mangle_name): Update. * stabsread.c (define_symbol, read_cpp_abbrev, read_baseclasses): Update. * p-valprint.c (pascal_object_is_vtbl_ptr_type) (pascal_object_print_value_fields, pascal_object_print_value): Update. * p-typeprint.c (pascal_type_print_derivation_info): Update. * linespec.c (find_methods): Update. * gdbtypes.h (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. * gdbtypes.c (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. (lookup_struct_elt_type, check_typedef): Update. * expprint.c (print_subexp_standard): Update. * dwarf2read.c (dwarf2_add_field, load_partial_dies): Update. * d-namespace.c (d_lookup_nested_symbol): Update. * cp-valprint.c (cp_is_vtbl_ptr_type, cp_print_value_fields) (cp_print_class_member): Update. * cp-namespace.c (cp_lookup_nested_symbol): Update. * completer.c (add_struct_fields): Update. * c-typeprint.c (cp_type_print_derivation_info) (c_type_print_varspec_prefix, c_type_print_base_struct_union): Update. * ada-lang.c (parse_old_style_renaming, xget_renaming_scope) (ada_prefer_type, ada_is_exception_sym): Update.
2018-04-17 21:51:25 +02:00
name = TYPE_NAME (context);
if (name == NULL)
{
name = "";
}
fip->list->field.name = obconcat (&objfile->objfile_obstack,
vptr_name, name, (char *) NULL);
1999-07-07 22:19:36 +02:00
break;
1999-07-07 22:19:36 +02:00
case 'b': /* $vb -- a virtual bsomethingorother */
Remove type_name_no_tag and rename type_name_no_tag_or_error type_name_no_tag is just a plain wrapper for TYPE_NAME now, so this patch removes it. And, because tag names no longer exist, this renames type_name_no_tag_or_error to type_name_or_error. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (value_cast_structs, destructor_name_p): Update. * symtab.c (gdb_mangle_name): Update. * stabsread.c (define_symbol, read_cpp_abbrev, read_baseclasses): Update. * p-valprint.c (pascal_object_is_vtbl_ptr_type) (pascal_object_print_value_fields, pascal_object_print_value): Update. * p-typeprint.c (pascal_type_print_derivation_info): Update. * linespec.c (find_methods): Update. * gdbtypes.h (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. * gdbtypes.c (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. (lookup_struct_elt_type, check_typedef): Update. * expprint.c (print_subexp_standard): Update. * dwarf2read.c (dwarf2_add_field, load_partial_dies): Update. * d-namespace.c (d_lookup_nested_symbol): Update. * cp-valprint.c (cp_is_vtbl_ptr_type, cp_print_value_fields) (cp_print_class_member): Update. * cp-namespace.c (cp_lookup_nested_symbol): Update. * completer.c (add_struct_fields): Update. * c-typeprint.c (cp_type_print_derivation_info) (c_type_print_varspec_prefix, c_type_print_base_struct_union): Update. * ada-lang.c (parse_old_style_renaming, xget_renaming_scope) (ada_prefer_type, ada_is_exception_sym): Update.
2018-04-17 21:51:25 +02:00
name = TYPE_NAME (context);
1999-07-07 22:19:36 +02:00
if (name == NULL)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("C++ abbreviated type 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
"unknown at symtab pos %d"),
2002-12-17 01:39:08 +01:00
symnum);
1999-07-07 22:19:36 +02:00
name = "FOO";
}
fip->list->field.name = obconcat (&objfile->objfile_obstack, vb_name,
name, (char *) NULL);
1999-07-07 22:19:36 +02:00
break;
1999-07-07 22:19:36 +02:00
default:
2002-12-17 01:39:08 +01:00
invalid_cpp_abbrev_complaint (*pp);
fip->list->field.name = obconcat (&objfile->objfile_obstack,
"INVALID_CPLUSPLUS_ABBREV",
(char *) NULL);
1999-07-07 22:19:36 +02:00
break;
}
/* At this point, *pp points to the ':'. Skip it and read the
field type. */
p = ++(*pp);
if (p[-1] != ':')
{
2002-12-17 01:39:08 +01:00
invalid_cpp_abbrev_complaint (*pp);
return 0;
}
fip->list->field.type = read_type (pp, objfile);
if (**pp == ',')
1999-07-07 22:19:36 +02:00
(*pp)++; /* Skip the comma. */
else
return 0;
{
int nbits;
SET_FIELD_BITPOS (fip->list->field,
read_huge_number (pp, ';', &nbits, 0));
if (nbits != 0)
return 0;
}
/* This field is unpacked. */
FIELD_BITSIZE (fip->list->field) = 0;
fip->list->visibility = VISIBILITY_PRIVATE;
}
else
{
2002-12-17 01:39:08 +01:00
invalid_cpp_abbrev_complaint (*pp);
/* We have no idea what syntax an unrecognized abbrev would have, so
1999-07-07 22:19:36 +02:00
better return 0. If we returned 1, we would need to at least advance
*pp to avoid an infinite loop. */
return 0;
}
return 1;
}
static void
read_one_struct_field (struct stab_field_info *fip, const char **pp,
const char *p, struct type *type,
struct objfile *objfile)
{
Change get_objfile_arch to a method on objfile This changes get_objfile_arch to be a new inline method, objfile::arch. To my surprise, this function came up while profiling DWARF psymbol reading. Making this change improved performance from 1.986 seconds to 1.869 seconds. Both measurements were done by taking the mean of 10 runs on a fixed copy of the gdb executable. gdb/ChangeLog 2020-04-18 Tom Tromey <tom@tromey.com> * xcoffread.c (enter_line_range, scan_xcoff_symtab): Update. * value.c (value_fn_field): Update. * valops.c (find_function_in_inferior) (value_allocate_space_in_inferior): Update. * tui/tui-winsource.c (tui_update_source_windows_with_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * symtab.c (lookup_global_or_static_symbol) (find_function_start_sal_1, skip_prologue_sal) (print_msymbol_info, find_gnu_ifunc, symbol_arch): Update. * symmisc.c (dump_msymbols, dump_symtab_1) (maintenance_print_one_line_table): Update. * symfile.c (init_entry_point_info, section_is_mapped) (list_overlays_command, simple_read_overlay_table) (simple_overlay_update_1): Update. * stap-probe.c (handle_stap_probe): Update. * stabsread.c (dbx_init_float_type, define_symbol) (read_one_struct_field, read_enum_type, read_range_type): Update. * source.c (info_line_command): Update. * python/python.c (gdbpy_source_objfile_script) (gdbpy_execute_objfile_script): Update. * python/py-type.c (save_objfile_types): Update. * python/py-objfile.c (py_free_objfile): Update. * python/py-inferior.c (python_new_objfile): Update. * psymtab.c (psym_find_pc_sect_compunit_symtab, dump_psymtab) (dump_psymtab_addrmap_1, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * printcmd.c (info_address_command): Update. * objfiles.h (struct objfile) <arch>: New method, from get_objfile_arch. (get_objfile_arch): Don't declare. * objfiles.c (get_objfile_arch): Remove. (filter_overlapping_sections): Update. * minsyms.c (msymbol_is_function): Update. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines) (output_nondebug_symbol): Update. * mdebugread.c (parse_symbol, basic_type, parse_partial_symbols) (mdebug_expand_psymtab): Update. * machoread.c (macho_add_oso_symfile): Update. * linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap): Update. * linux-fork.c (checkpoint_command): Update. * linespec.c (convert_linespec_to_sals): Update. * jit.c (finalize_symtab): Update. * infrun.c (insert_exception_resume_from_probe): Update. * ia64-tdep.c (ia64_find_unwind_table): Update. * hppa-tdep.c (internalize_unwinds): Update. * gdbtypes.c (get_type_arch, init_float_type, objfile_type): Update. * gcore.c (call_target_sbrk): Update. * elfread.c (record_minimal_symbol, elf_symtab_read) (elf_rel_plt_read, elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Update. * dwarf2/read.c (create_addrmap_from_index) (create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab) (read_debug_names_from_section) (process_psymtab_comp_unit_reader, add_partial_symbol) (add_partial_subprogram, process_full_comp_unit) (read_file_scope, read_func_scope, read_lexical_block_scope) (read_call_site_scope, dwarf2_ranges_read) (dwarf2_record_block_ranges, dwarf2_add_field) (mark_common_block_symbol_computed, read_tag_pointer_type) (read_tag_string_type, dwarf2_init_float_type) (dwarf2_init_complex_target_type, read_base_type) (partial_die_info::read, partial_die_info::read) (read_attribute_value, dwarf_decode_lines_1, new_symbol) (dwarf2_fetch_die_loc_sect_off): Update. * dwarf2/loc.c (dwarf2_find_location_expression) (class dwarf_evaluate_loc_desc, rw_pieced_value) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval) (dwarf2_loc_desc_get_symbol_read_needs) (locexpr_describe_location_piece, locexpr_describe_location_1) (loclist_describe_location): Update. * dwarf2/index-write.c (write_debug_names): Update. * dwarf2/frame.c (dwarf2_build_frame_info): Update. * dtrace-probe.c (dtrace_process_dof): Update. * dbxread.c (read_dbx_symtab, dbx_end_psymtab) (process_one_symbol): Update. * ctfread.c (ctf_init_float_type, read_base_type): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_base_type) (coff_read_enum_type): Update. * cli/cli-cmds.c (edit_command, list_command): Update. * buildsym.c (buildsym_compunit::finish_block_internal): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint, get_sal_arch): Update. * block.c (block_gdbarch): Update. * annotate.c (annotate_source_line): Update.
2020-04-18 16:35:04 +02:00
struct gdbarch *gdbarch = objfile->arch ();
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
Add casts to memory allocation related calls Most allocation functions (if not all) return a void* pointing to the allocated memory. In C++, we need to add an explicit cast when assigning the result to a pointer to another type (which is the case more often than not). The content of this patch is taken from Pedro's branch, from commit "(mostly) auto-generated patch to insert casts needed for C++". I validated that the changes make sense and manually reflowed the code to make it respect the coding style. I also found multiple places where I could use XNEW/XNEWVEC/XRESIZEVEC/etc. Thanks a lot to whoever did that automated script to insert casts, doing it completely by hand would have taken a ridiculous amount of time. Only files built on x86 with --enable-targets=all are modified. This means that all other -nat.c files are untouched and will have to be dealt with later by using appropiate compilers. Or maybe we can try to build them with a regular g++ just to know where to add casts, I don't know. I built-tested this with --enable-targets=all and reg-tested. Here's the changelog entry, which was not too bad to make despite the size, thanks to David Malcom's script. I fixed some bits by hand, but there might be some wrong parts left (hopefully not). gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Add cast to allocation result assignment. * ada-exp.y (write_object_renaming): Likewise. (write_ambiguous_var): Likewise. (ada_nget_field_index): Likewise. (write_var_or_type): Likewise. * ada-lang.c (ada_decode_symbol): Likewise. (ada_value_assign): Likewise. (value_pointer): Likewise. (cache_symbol): Likewise. (add_nonlocal_symbols): Likewise. (ada_name_for_lookup): Likewise. (symbol_completion_add): Likewise. (ada_to_fixed_type_1): Likewise. (ada_get_next_arg): Likewise. (defns_collected): Likewise. * ada-lex.l (processId): Likewise. (processString): Likewise. * ada-tasks.c (read_known_tasks_array): Likewise. (read_known_tasks_list): Likewise. * ada-typeprint.c (decoded_type_name): Likewise. * addrmap.c (addrmap_mutable_create_fixed): Likewise. * amd64-tdep.c (amd64_push_arguments): Likewise. (amd64_displaced_step_copy_insn): Likewise. (amd64_classify_insn_at): Likewise. (amd64_relocate_instruction): Likewise. * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Likewise. * arch-utils.c (simple_displaced_step_copy_insn): Likewise. (initialize_current_architecture): Likewise. * arm-linux-tdep.c (arm_stap_parse_special_token): Likewise. * arm-symbian-tdep.c (arm_symbian_osabi_sniffer): Likewise. * arm-tdep.c (arm_exidx_new_objfile): Likewise. (arm_push_dummy_call): Likewise. (extend_buffer_earlier): Likewise. (arm_adjust_breakpoint_address): Likewise. (arm_skip_stub): Likewise. * auto-load.c (filename_is_in_pattern): Likewise. (maybe_add_script_file): Likewise. (maybe_add_script_text): Likewise. (auto_load_objfile_script_1): Likewise. * auxv.c (ld_so_xfer_auxv): Likewise. * ax-general.c (new_agent_expr): Likewise. (grow_expr): Likewise. (ax_reg_mask): Likewise. * bcache.c (bcache_full): Likewise. * breakpoint.c (program_breakpoint_here_p): Likewise. * btrace.c (parse_xml_raw): Likewise. * build-id.c (build_id_to_debug_bfd): Likewise. * buildsym.c (end_symtab_with_blockvector): Likewise. * c-exp.y (string_exp): Likewise. (qualified_name): Likewise. (write_destructor_name): Likewise. (operator_stoken): Likewise. (parse_number): Likewise. (scan_macro_expansion): Likewise. (yylex): Likewise. (c_print_token): Likewise. * c-lang.c (c_get_string): Likewise. (emit_numeric_character): Likewise. * charset.c (wchar_iterate): Likewise. * cli/cli-cmds.c (complete_command): Likewise. (make_command): Likewise. * cli/cli-dump.c (restore_section_callback): Likewise. (restore_binary_file): Likewise. * cli/cli-interp.c (cli_interpreter_exec): Likewise. * cli/cli-script.c (execute_control_command): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (add_pe_forwarded_sym): Likewise. (read_pe_exported_syms): Likewise. * coffread.c (coff_read_struct_type): Likewise. (coff_read_enum_type): Likewise. * common/btrace-common.c (btrace_data_append): Likewise. * common/buffer.c (buffer_grow): Likewise. * common/filestuff.c (gdb_fopen_cloexec): Likewise. * common/format.c (parse_format_string): Likewise. * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append): Likewise. * common/xml-utils.c (xml_escape_text): Likewise. * compile/compile-object-load.c (copy_sections): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * completer.c (filename_completer): Likewise. * corefile.c (read_memory_typed_address): Likewise. (write_memory_unsigned_integer): Likewise. (write_memory_signed_integer): Likewise. (complete_set_gnutarget): Likewise. * corelow.c (get_core_register_section): Likewise. * cp-name-parser.y (d_grab): Likewise. (allocate_info): Likewise. (cp_new_demangle_parse_info): Likewise. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Likewise. (cp_lookup_symbol_in_namespace): Likewise. (lookup_namespace_scope): Likewise. (find_symbol_in_baseclass): Likewise. (cp_lookup_nested_symbol): Likewise. (cp_lookup_transparent_type_loop): Likewise. * cp-support.c (copy_string_to_obstack): Likewise. (make_symbol_overload_list): Likewise. (make_symbol_overload_list_namespace): Likewise. (make_symbol_overload_list_adl_namespace): Likewise. (first_component_command): Likewise. * cp-valprint.c (cp_print_value): Likewise. * ctf.c (ctf_xfer_partial): Likewise. * d-exp.y (StringExp): Likewise. * d-namespace.c (d_lookup_symbol_in_module): Likewise. (lookup_module_scope): Likewise. (find_symbol_in_baseclass): Likewise. (d_lookup_nested_symbol): Likewise. * dbxread.c (find_stab_function_addr): Likewise. (read_dbx_symtab): Likewise. (dbx_end_psymtab): Likewise. (cp_set_block_scope): Likewise. * dcache.c (dcache_alloc): Likewise. * demangle.c (_initialize_demangler): Likewise. * dicos-tdep.c (dicos_load_module_p): Likewise. * dictionary.c (dict_create_hashed_expandable): Likewise. (dict_create_linear_expandable): Likewise. (expand_hashtable): Likewise. (add_symbol_linear_expandable): Likewise. * dwarf2-frame.c (add_cie): Likewise. (add_fde): Likewise. (dwarf2_build_frame_info): Likewise. * dwarf2expr.c (dwarf_expr_grow_stack): Likewise. (dwarf_expr_fetch_address): Likewise. (add_piece): Likewise. (execute_stack_op): Likewise. * dwarf2loc.c (chain_candidate): Likewise. (dwarf_entry_parameter_to_value): Likewise. (read_pieced_value): Likewise. (write_pieced_value): Likewise. * dwarf2read.c (dwarf2_read_section): Likewise. (add_type_unit): Likewise. (read_comp_units_from_section): Likewise. (fixup_go_packaging): Likewise. (dwarf2_compute_name): Likewise. (dwarf2_physname): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (read_call_site_scope): Likewise. (dwarf2_attach_fields_to_type): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (read_common_block): Likewise. (abbrev_table_read_table): Likewise. (guess_partial_die_structure_name): Likewise. (fixup_partial_die): Likewise. (add_file_name): Likewise. (dwarf2_const_value_data): Likewise. (dwarf2_const_value_attr): Likewise. (build_error_marker_type): Likewise. (guess_full_die_structure_name): Likewise. (anonymous_struct_prefix): Likewise. (typename_concat): Likewise. (dwarf2_canonicalize_name): Likewise. (dwarf2_name): Likewise. (write_constant_as_bytes): Likewise. (dwarf2_fetch_constant_bytes): Likewise. (copy_string): Likewise. (parse_macro_definition): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_rel_plt_read): Likewise. (elf_gnu_ifunc_resolve_by_cache): Likewise. (elf_gnu_ifunc_resolve_by_got): Likewise. (elf_read_minimal_symbols): Likewise. (elf_gnu_ifunc_record_cache): Likewise. * event-top.c (top_level_prompt): Likewise. (command_line_handler): Likewise. * exec.c (resize_section_table): Likewise. * expprint.c (print_subexp_standard): Likewise. * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise. * findcmd.c (parse_find_args): Likewise. * findvar.c (address_from_register): Likewise. * frame.c (get_prev_frame_always): Likewise. * gdb_bfd.c (gdb_bfd_ref): Likewise. (get_section_descriptor): Likewise. * gdb_obstack.c (obconcat): Likewise. (obstack_strdup): Likewise. * gdbtypes.c (lookup_function_type_with_arguments): Likewise. (create_set_type): Likewise. (lookup_unsigned_typename): Likewise. (lookup_signed_typename): Likewise. (resolve_dynamic_union): Likewise. (resolve_dynamic_struct): Likewise. (add_dyn_prop): Likewise. (copy_dynamic_prop_list): Likewise. (arch_flags_type): Likewise. (append_composite_type_field_raw): Likewise. * gdbtypes.h (INIT_FUNC_SPECIFIC): Likewise. * gnu-v3-abi.c (gnuv3_rtti_type): Likewise. * go-exp.y (string_exp): Likewise. * go-lang.c (go_demangle): Likewise. * guile/guile.c (compute_scheme_string): Likewise. * guile/scm-cmd.c (gdbscm_parse_command_name): Likewise. (gdbscm_canonicalize_command_name): Likewise. * guile/scm-ports.c (ioscm_init_stdio_buffers): Likewise. (ioscm_init_memory_port): Likewise. (ioscm_reinit_memory_port): Likewise. * guile/scm-utils.c (gdbscm_gc_xstrdup): Likewise. (gdbscm_gc_dup_argv): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Likewise. * hppa-tdep.c (internalize_unwinds): Likewise. (read_unwind_info): Likewise. * i386-cygwin-tdep.c (core_process_module_section): Likewise. (windows_core_xfer_shared_libraries): Likewise. * i386-tdep.c (i386_displaced_step_copy_insn): Likewise. (i386_stap_parse_special_token_triplet): Likewise. (i386_stap_parse_special_token_three_arg_disp): Likewise. * i386obsd-tdep.c (i386obsd_sigtramp_p): Likewise. * inf-child.c (inf_child_fileio_readlink): Likewise. * inf-ptrace.c (inf_ptrace_fetch_register): Likewise. (inf_ptrace_store_register): Likewise. * infrun.c (follow_exec): Likewise. (displaced_step_prepare_throw): Likewise. (save_stop_context): Likewise. (save_infcall_suspend_state): Likewise. * jit.c (jit_read_descriptor): Likewise. (jit_read_code_entry): Likewise. (jit_symtab_line_mapping_add_impl): Likewise. (finalize_symtab): Likewise. (jit_unwind_reg_get_impl): Likewise. * jv-exp.y (QualifiedName): Likewise. * jv-lang.c (get_java_utf8_name): Likewise. (type_from_class): Likewise. (java_demangle_type_signature): Likewise. (java_class_name_from_physname): Likewise. * jv-typeprint.c (java_type_print_base): Likewise. * jv-valprint.c (java_value_print): Likewise. * language.c (add_language): Likewise. * linespec.c (add_sal_to_sals_basic): Likewise. (add_sal_to_sals): Likewise. (decode_objc): Likewise. (find_linespec_symbols): Likewise. * linux-fork.c (fork_save_infrun_state): Likewise. * linux-nat.c (linux_nat_detach): Likewise. (linux_nat_fileio_readlink): Likewise. * linux-record.c (record_linux_sockaddr): Likewise. (record_linux_msghdr): Likewise. (Do): Likewise. * linux-tdep.c (linux_core_info_proc_mappings): Likewise. (linux_collect_regset_section_cb): Likewise. (linux_get_siginfo_data): Likewise. * linux-thread-db.c (try_thread_db_load_from_pdir_1): Likewise. (try_thread_db_load_from_dir): Likewise. (thread_db_load_search): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_m16c_address_to_pointer): Likewise. (m32c_m16c_pointer_to_address): Likewise. * m68hc11-tdep.c (m68hc11_pseudo_register_write): Likewise. * m68k-tdep.c (m68k_get_longjmp_target): Likewise. * machoread.c (macho_check_dsym): Likewise. * macroexp.c (resize_buffer): Likewise. (gather_arguments): Likewise. (maybe_expand): Likewise. * macrotab.c (new_macro_key): Likewise. (new_source_file): Likewise. (new_macro_definition): Likewise. * mdebugread.c (parse_symbol): Likewise. (parse_type): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. * mem-break.c (default_memory_insert_breakpoint): Likewise. * mi/mi-cmd-break.c (mi_argv_to_format): Likewise. * mi/mi-main.c (mi_cmd_data_read_memory): Likewise. (mi_cmd_data_read_memory_bytes): Likewise. (mi_cmd_data_write_memory_bytes): Likewise. (mi_cmd_trace_frame_collected): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. (mi_parse): Likewise. * minidebug.c (lzma_open): Likewise. (lzma_pread): Likewise. * mips-tdep.c (mips_read_fp_register_single): Likewise. (mips_print_fp_register): Likewise. * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Likewise. * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. * mt-tdep.c (mt_register_name): Likewise. (mt_registers_info): Likewise. (mt_push_dummy_call): Likewise. * namespace.c (add_using_directive): Likewise. * nat/linux-btrace.c (perf_event_read): Likewise. (linux_enable_bts): Likewise. * nat/linux-osdata.c (linux_common_core_of_thread): Likewise. * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Likewise. * nto-tdep.c (nto_find_and_open_solib): Likewise. (nto_parse_redirection): Likewise. * objc-lang.c (objc_demangle): Likewise. (find_methods): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (set_objfile_main_name): Likewise. (allocate_objfile): Likewise. (objfile_relocate): Likewise. (update_section_map): Likewise. * osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Likewise. * p-exp.y (exp): Likewise. (yylex): Likewise. * p-valprint.c (pascal_object_print_value): Likewise. * parse.c (initialize_expout): Likewise. (mark_completion_tag): Likewise. (copy_name): Likewise. (parse_float): Likewise. (type_stack_reserve): Likewise. * ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise. (ppu2spu_prev_register): Likewise. * ppc-ravenscar-thread.c (supply_register_at_address): Likewise. * printcmd.c (printf_wide_c_string): Likewise. (printf_pointer): Likewise. * probe.c (parse_probes): Likewise. * python/py-cmd.c (gdbpy_parse_command_name): Likewise. (cmdpy_init): Likewise. * python/py-gdb-readline.c (gdbpy_readline_wrapper): Likewise. * python/py-symtab.c (set_sal): Likewise. * python/py-unwind.c (pyuw_sniffer): Likewise. * python/python.c (python_interactive_command): Likewise. (compute_python_string): Likewise. * ravenscar-thread.c (get_running_thread_id): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_core_open_1): Likewise. * regcache.c (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. * remote-fileio.c (remote_fileio_func_open): Likewise. (remote_fileio_func_rename): Likewise. (remote_fileio_func_unlink): Likewise. (remote_fileio_func_stat): Likewise. (remote_fileio_func_system): Likewise. * remote-mips.c (mips_xfer_memory): Likewise. (mips_load_srec): Likewise. (pmon_end_download): Likewise. * remote.c (new_remote_state): Likewise. (map_regcache_remote_table): Likewise. (remote_register_number_and_offset): Likewise. (init_remote_state): Likewise. (get_memory_packet_size): Likewise. (remote_pass_signals): Likewise. (remote_program_signals): Likewise. (remote_start_remote): Likewise. (remote_check_symbols): Likewise. (remote_query_supported): Likewise. (extended_remote_attach): Likewise. (process_g_packet): Likewise. (store_registers_using_G): Likewise. (putpkt_binary): Likewise. (read_frame): Likewise. (compare_sections_command): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_readlink): Likewise. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_pid_to_exec_file): Likewise. (_initialize_remote): Likewise. * rs6000-aix-tdep.c (rs6000_aix_ld_info_to_xml): Likewise. (rs6000_aix_core_xfer_shared_libraries_aix): Likewise. * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise. (bfd_uses_spe_extensions): Likewise. * s390-linux-tdep.c (s390_displaced_step_copy_insn): Likewise. * score-tdep.c (score7_malloc_and_get_memblock): Likewise. * solib-dsbt.c (decode_loadmap): Likewise. (fetch_loadmap): Likewise. (scan_dyntag): Likewise. (enable_break): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (fetch_loadmap): Likewise. (enable_break2): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_relocate_main_executable): Likewise. (spu_bfd_open): Likewise. * solib-svr4.c (lm_info_read): Likewise. (read_program_header): Likewise. (find_program_interpreter): Likewise. (scan_dyntag): Likewise. (elf_locate_base): Likewise. (open_symbol_file_object): Likewise. (read_program_headers_from_bfd): Likewise. (svr4_relocate_main_executable): Likewise. * solib-target.c (solib_target_relocate_section_addresses): Likewise. * solib.c (solib_find_1): Likewise. (exec_file_find): Likewise. (solib_find): Likewise. * source.c (openp): Likewise. (print_source_lines_base): Likewise. (forward_search_command): Likewise. * sparc-ravenscar-thread.c (supply_register_at_address): Likewise. * spu-tdep.c (spu2ppu_prev_register): Likewise. (spu_get_overlay_table): Likewise. * stabsread.c (patch_block_stabs): Likewise. (define_symbol): Likewise. (again:): Likewise. (read_member_functions): Likewise. (read_one_struct_field): Likewise. (read_enum_type): Likewise. (common_block_start): Likewise. * stack.c (read_frame_arg): Likewise. (backtrace_command): Likewise. * stap-probe.c (stap_parse_register_operand): Likewise. * symfile.c (syms_from_objfile_1): Likewise. (find_separate_debug_file): Likewise. (load_command): Likewise. (load_progress): Likewise. (load_section_callback): Likewise. (reread_symbols): Likewise. (add_filename_language): Likewise. (allocate_compunit_symtab): Likewise. (read_target_long_array): Likewise. (simple_read_overlay_table): Likewise. * symtab.c (symbol_set_names): Likewise. (resize_symbol_cache): Likewise. (rbreak_command): Likewise. (completion_list_add_name): Likewise. (completion_list_objc_symbol): Likewise. (add_filename_to_list): Likewise. * target-descriptions.c (maint_print_c_tdesc_cmd): Likewise. * target-memory.c (target_write_memory_blocks): Likewise. * target.c (target_read_string): Likewise. (read_whatever_is_readable): Likewise. (target_read_alloc_1): Likewise. (simple_search_memory): Likewise. (target_fileio_read_alloc_1): Likewise. * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. * top.c (command_line_input): Likewise. * tracefile-tfile.c (tfile_fetch_registers): Likewise. * tracefile.c (tracefile_fetch_registers): Likewise. * tracepoint.c (add_memrange): Likewise. (init_collection_list): Likewise. (add_aexpr): Likewise. (trace_dump_actions): Likewise. (parse_trace_status): Likewise. (parse_tracepoint_definition): Likewise. (parse_tsv_definition): Likewise. (parse_static_tracepoint_marker_definition): Likewise. * tui/tui-file.c (tui_sfileopen): Likewise. (tui_file_adjust_strbuf): Likewise. * tui/tui-io.c (tui_expand_tabs): Likewise. * tui/tui-source.c (tui_set_source_content): Likewise. * typeprint.c (find_global_typedef): Likewise. * ui-file.c (do_ui_file_xstrdup): Likewise. (ui_file_obsavestring): Likewise. (mem_file_write): Likewise. * utils.c (make_hex_string): Likewise. (get_regcomp_error): Likewise. (puts_filtered_tabular): Likewise. (gdb_realpath_keepfile): Likewise. (ldirname): Likewise. (gdb_bfd_errmsg): Likewise. (substitute_path_component): Likewise. * valops.c (search_struct_method): Likewise. (find_oload_champ_namespace_loop): Likewise. * valprint.c (print_decimal_chars): Likewise. (read_string): Likewise. (generic_emit_char): Likewise. * varobj.c (varobj_delete): Likewise. (varobj_value_get_print_value): Likewise. * vaxobsd-tdep.c (vaxobsd_sigtramp_sniffer): Likewise. * windows-tdep.c (display_one_tib): Likewise. * xcoffread.c (read_xcoff_symtab): Likewise. (process_xcoff_symbol): Likewise. (swap_sym): Likewise. (scan_xcoff_symtab): Likewise. (xcoff_initial_scan): Likewise. * xml-support.c (gdb_xml_end_element): Likewise. (xml_process_xincludes): Likewise. (xml_fetch_content_from_file): Likewise. * xml-syscall.c (xml_list_of_syscalls): Likewise. * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Add cast to allocation result assignment. (gdb_unparse_agent_expr): Likewise. * hostio.c (require_data): Likewise. (handle_pread): Likewise. * linux-low.c (disable_regset): Likewise. (fetch_register): Likewise. (store_register): Likewise. (get_dynamic): Likewise. (linux_qxfer_libraries_svr4): Likewise. * mem-break.c (delete_fast_tracepoint_jump): Likewise. (set_fast_tracepoint_jump): Likewise. (uninsert_fast_tracepoint_jumps_at): Likewise. (reinsert_fast_tracepoint_jumps_at): Likewise. (validate_inserted_breakpoint): Likewise. (clone_agent_expr): Likewise. * regcache.c (init_register_cache): Likewise. * remote-utils.c (putpkt_binary_1): Likewise. (decode_M_packet): Likewise. (decode_X_packet): Likewise. (look_up_one_symbol): Likewise. (relocate_instruction): Likewise. (monitor_output): Likewise. * server.c (handle_search_memory): Likewise. (handle_qxfer_exec_file): Likewise. (handle_qxfer_libraries): Likewise. (handle_qxfer): Likewise. (handle_query): Likewise. (handle_v_cont): Likewise. (handle_v_run): Likewise. (captured_main): Likewise. * target.c (write_inferior_memory): Likewise. * thread-db.c (try_thread_db_load_from_dir): Likewise. * tracepoint.c (init_trace_buffer): Likewise. (add_tracepoint_action): Likewise. (add_traceframe): Likewise. (add_traceframe_block): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtdv): Likewise. (cmd_qtstatus): Likewise. (response_source): Likewise. (response_tsv): Likewise. (cmd_qtnotes): Likewise. (gdb_collect): Likewise. (initialize_tracepoint): Likewise.
2015-09-25 20:08:06 +02:00
fip->list->field.name
= obstack_strndup (&objfile->objfile_obstack, *pp, p - *pp);
*pp = p + 1;
/* This means we have a visibility for a field coming. */
if (**pp == '/')
{
(*pp)++;
1999-07-07 22:19:36 +02:00
fip->list->visibility = *(*pp)++;
}
else
{
/* normal dbx-style format, no explicit visibility */
1999-07-07 22:19:36 +02:00
fip->list->visibility = VISIBILITY_PUBLIC;
}
1999-07-07 22:19:36 +02:00
fip->list->field.type = read_type (pp, objfile);
if (**pp == ':')
{
p = ++(*pp);
#if 0
/* Possible future hook for nested types. */
if (**pp == '!')
{
1999-07-07 22:19:36 +02:00
fip->list->field.bitpos = (long) -2; /* nested type */
p = ++(*pp);
}
1999-07-07 22:19:36 +02:00
else
...;
#endif
1999-07-07 22:19:36 +02:00
while (*p != ';')
{
p++;
}
/* Static class member. */
SET_FIELD_PHYSNAME (fip->list->field, savestring (*pp, p - *pp));
*pp = p + 1;
return;
}
else if (**pp != ',')
{
/* Bad structure-type format. */
2002-12-17 01:39:08 +01:00
stabs_general_complaint ("bad structure-type format");
return;
}
(*pp)++; /* Skip the comma. */
{
int nbits;
SET_FIELD_BITPOS (fip->list->field,
read_huge_number (pp, ',', &nbits, 0));
if (nbits != 0)
{
2002-12-17 01:39:08 +01:00
stabs_general_complaint ("bad structure-type format");
return;
}
FIELD_BITSIZE (fip->list->field) = read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
{
2002-12-17 01:39:08 +01:00
stabs_general_complaint ("bad structure-type format");
return;
}
}
if (FIELD_BITPOS (fip->list->field) == 0
&& FIELD_BITSIZE (fip->list->field) == 0)
{
/* This can happen in two cases: (1) at least for gcc 2.4.5 or so,
1999-07-07 22:19:36 +02:00
it is a field which has been optimized out. The correct stab for
this case is to use VISIBILITY_IGNORE, but that is a recent
invention. (2) It is a 0-size array. For example
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
union { int num; char str[0]; } foo. Printing _("<no value>" for
1999-07-07 22:19:36 +02:00
str in "p foo" is OK, since foo.str (and thus foo.str[3])
will continue to work, and a 0-size array as a whole doesn't
have any contents to print.
I suspect this probably could also happen with gcc -gstabs (not
-gstabs+) for static fields, and perhaps other C++ extensions.
Hopefully few people use -gstabs with gdb, since it is intended
for dbx compatibility. */
/* Ignore this field. */
1999-07-07 22:19:36 +02:00
fip->list->visibility = VISIBILITY_IGNORE;
}
else
{
/* Detect an unpacked field and mark it as such.
1999-07-07 22:19:36 +02:00
dbx gives a bit size for all fields.
Note that forward refs cannot be packed,
and treat enums as if they had the width of ints. */
struct type *field_type = check_typedef (FIELD_TYPE (fip->list->field));
if (TYPE_CODE (field_type) != TYPE_CODE_INT
&& TYPE_CODE (field_type) != TYPE_CODE_RANGE
&& TYPE_CODE (field_type) != TYPE_CODE_BOOL
&& TYPE_CODE (field_type) != TYPE_CODE_ENUM)
{
FIELD_BITSIZE (fip->list->field) = 0;
}
1999-07-07 22:19:36 +02:00
if ((FIELD_BITSIZE (fip->list->field)
== TARGET_CHAR_BIT * TYPE_LENGTH (field_type)
|| (TYPE_CODE (field_type) == TYPE_CODE_ENUM
2007-06-12 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (TARGET_SHORT_BIT): Replace by gdbarch_int_bit. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise. * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * gdbarch.sh (TARGET_INT_BIT): Replace by gdbarch_int_bit. * c-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * ada-lex.l (processInt): Likewise. * f-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * ada-lang.c (ada_create_fundamental_type, ada_language_arch_info) (gdbtypes_post_init, build_gdbtypes): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * parse.c (build_parse): Likewise. * xcoffread.c (_initialize_xcoffread): Likewise. * stabsread.c (define_symbol, read_one_struct_field, read_enum_type) (read_range_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * f-lang.c (build_fortran_types, f_create_fundamental_type): Likewise. * m2-lang.c (m2_create_fundamental_type, _initialize_m2_language) (m2_create_fundamental_type): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * coffread.c (coff_read_enum_type): Likewise. * mdebugread.c (parse_symbol, _initialize_mdebugread): Likewise. * dwarf2read.c (new_symbol): Likewise. * gdbarch.sh (TARGET_LONG_BIT): Replace by gdbarch_long_bit. * c-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * ada-lex.l (processInt): Likewise. * f-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * valarith.c (value_binop): Likewise. * symfile.c (read_target_long_array, simple_overlay_update_1): Likewise. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise. * symfile.c (TARGET_LONG_BYTES): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * f-lang.c (f_create_fundamental_type): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * coffread.c (decode_base_type): Likewise. * gdbarch.sh (TARGET_LONG_LONG_BIT): Replace by gdbarch_long_long_bit. * c-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * gdbtypes.c (gdbtypes_post_init, build_gdbtypes): Likewise. * stabsread.c (read_range_type): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * f-lang.c (f_create_fundamental_type): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * gdbarch.c, gdbarch.h: Regenerate.
2007-06-12 17:33:04 +02:00
&& FIELD_BITSIZE (fip->list->field)
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
== gdbarch_int_bit (gdbarch))
1999-07-07 22:19:36 +02:00
)
&&
FIELD_BITPOS (fip->list->field) % 8 == 0)
{
FIELD_BITSIZE (fip->list->field) = 0;
}
}
}
/* Read struct or class data fields. They have the form:
1999-07-07 22:19:36 +02:00
NAME : [VISIBILITY] TYPENUM , BITPOS , BITSIZE ;
At the end, we see a semicolon instead of a field.
In C++, this may wind up being NAME:?TYPENUM:PHYSNAME; for
a static field.
The optional VISIBILITY is one of:
1999-07-07 22:19:36 +02:00
'/0' (VISIBILITY_PRIVATE)
'/1' (VISIBILITY_PROTECTED)
'/2' (VISIBILITY_PUBLIC)
'/9' (VISIBILITY_IGNORE)
or nothing, for C style fields with public visibility.
Returns 1 for success, 0 for failure. */
static int
read_struct_fields (struct stab_field_info *fip, const char **pp,
struct type *type, struct objfile *objfile)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p;
struct nextfield *newobj;
/* We better set p right now, in case there are no fields at all... */
p = *pp;
/* Read each data member type until we find the terminating ';' at the end of
the data member list, or break for some other reason such as finding the
start of the member function list. */
/* Stab string for structure/union does not end with two ';' in
SUN C compiler 5.3 i.e. F6U2, hence check for end of string. */
while (**pp != ';' && **pp != '\0')
{
STABS_CONTINUE (pp, objfile);
/* Get space to record the next field's data. */
newobj = OBSTACK_ZALLOC (&fip->obstack, struct nextfield);
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
newobj->next = fip->list;
fip->list = newobj;
/* Get the field name. */
p = *pp;
/* If is starts with CPLUS_MARKER it is a special abbreviation,
1999-07-07 22:19:36 +02:00
unless the CPLUS_MARKER is followed by an underscore, in
which case it is just the name of an anonymous type, which we
should handle like any other type name. */
if (is_cplus_marker (p[0]) && p[1] != '_')
{
if (!read_cpp_abbrev (fip, pp, type, objfile))
return 0;
continue;
}
/* Look for the ':' that separates the field name from the field
1999-07-07 22:19:36 +02:00
values. Data members are delimited by a single ':', while member
functions are delimited by a pair of ':'s. When we hit the member
functions (if any), terminate scan loop and return. */
1999-07-07 22:19:36 +02:00
while (*p != ':' && *p != '\0')
{
p++;
}
if (*p == '\0')
return 0;
/* Check to see if we have hit the member functions yet. */
if (p[1] == ':')
{
break;
}
read_one_struct_field (fip, pp, p, type, objfile);
}
if (p[0] == ':' && p[1] == ':')
{
2003-01-02 Andrew Cagney <ac131313@redhat.com> * valarith.c (value_binop): Delete obsolete code and comments. * configure.host: Ditto. * buildsym.h (make_blockvector): Ditto. * buildsym.c (make_blockvector): Ditto. * defs.h (enum language): Ditto. (chill_demangle): Ditto. * elfread.c (elf_symtab_read): Ditto. * dwarfread.c (CHILL_PRODUCER): Ditto. (set_cu_language): Ditto. (handle_producer): Ditto. * expprint.c (print_subexp): Ditto. * gdbtypes.c (chill_varying_type): Ditto. * gdbtypes.h (builtin_type_chill_bool): Ditto. (builtin_type_chill_char, builtin_type_chill_long): Ditto. (builtin_type_chill_ulong, builtin_type_chill_real): Ditto. (chill_varying_type): Ditto. * language.h (_LANG_chill): Ditto. * language.c (binop_result_type, integral_type): Ditto. (character_type, string_type, structured_type): Ditto. (lang_bool_type, binop_type_check): Ditto. * stabsread.h (os9k_stabs): Ditto. * stabsread.c (os9k_type_vector, dbx_lookup_type): Ditto. (define_symbol, read_type, read_struct_fields): Ditto. (read_array_type, read_enum_type, read_huge_number): Ditto. (read_range_type, start_stabs): Ditto. * symfile.c (init_filename_language_table): Ditto. (add_psymbol_with_dem_name_to_list): Ditto. * symtab.c (symbol_init_language_specific): Ditto. (symbol_init_demangled_name, symbol_demangled_name): Ditto. * symtab.h (struct general_symbol_info): Ditto. (SYMBOL_CHILL_DEMANGLED_NAME): Ditto. * typeprint.c (typedef_print): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * valops.c (value_cast, search_struct_field, value_slice): Delete obsolete code. (varying_to_slice): Delete function. * value.h (COERCE_VARYING_ARRAY): Delete obsolete macro contents. (varying_to_slice): Delete declaration. * MAINTAINERS: Update.
2003-01-02 15:27:27 +01:00
/* (the deleted) chill the list of fields: the last entry (at
the head) is a partially constructed entry which we now
scrub. */
1999-07-07 22:19:36 +02:00
fip->list = fip->list->next;
}
return 1;
}
1999-07-07 19:31:57 +02:00
/* *INDENT-OFF* */
/* The stabs for C++ derived classes contain baseclass information which
is marked by a '!' character after the total size. This function is
called when we encounter the baseclass marker, and slurps up all the
baseclass information.
Immediately following the '!' marker is the number of base classes that
the class is derived from, followed by information for each base class.
For each base class, there are two visibility specifiers, a bit offset
to the base class information within the derived class, a reference to
the type for the base class, and a terminating semicolon.
A typical example, with two base classes, would be "!2,020,19;0264,21;".
^^ ^ ^ ^ ^ ^ ^
Baseclass information marker __________________|| | | | | | |
Number of baseclasses __________________________| | | | | | |
Visibility specifiers (2) ________________________| | | | | |
Offset in bits from start of class _________________| | | | |
Type number for base class ___________________________| | | |
Visibility specifiers (2) _______________________________| | |
Offset in bits from start of class ________________________| |
Type number of base class ____________________________________|
Return 1 for success, 0 for (error-type-inducing) failure. */
1999-07-07 19:31:57 +02:00
/* *INDENT-ON* */
1999-07-07 22:19:36 +02:00
static int
read_baseclasses (struct stab_field_info *fip, const char **pp,
struct type *type, struct objfile *objfile)
{
int i;
struct nextfield *newobj;
if (**pp != '!')
{
return 1;
}
else
{
/* Skip the '!' baseclass information marker. */
(*pp)++;
}
ALLOCATE_CPLUS_STRUCT_TYPE (type);
{
int nbits;
TYPE_N_BASECLASSES (type) = read_huge_number (pp, ',', &nbits, 0);
if (nbits != 0)
return 0;
}
#if 0
/* Some stupid compilers have trouble with the following, so break
it up into simpler expressions. */
TYPE_FIELD_VIRTUAL_BITS (type) = (B_TYPE *)
TYPE_ALLOC (type, B_BYTES (TYPE_N_BASECLASSES (type)));
#else
{
int num_bytes = B_BYTES (TYPE_N_BASECLASSES (type));
char *pointer;
pointer = (char *) TYPE_ALLOC (type, num_bytes);
TYPE_FIELD_VIRTUAL_BITS (type) = (B_TYPE *) pointer;
}
#endif /* 0 */
B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), TYPE_N_BASECLASSES (type));
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
newobj = OBSTACK_ZALLOC (&fip->obstack, struct nextfield);
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
newobj->next = fip->list;
fip->list = newobj;
FIELD_BITSIZE (newobj->field) = 0; /* This should be an unpacked
field! */
STABS_CONTINUE (pp, objfile);
switch (**pp)
{
1999-07-07 22:19:36 +02:00
case '0':
/* Nothing to do. */
1999-07-07 22:19:36 +02:00
break;
case '1':
SET_TYPE_FIELD_VIRTUAL (type, i);
break;
default:
/* Unknown character. Complain and treat it as non-virtual. */
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Unknown virtual character `%c' for baseclass"),
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
**pp);
1999-07-07 22:19:36 +02:00
}
}
++(*pp);
newobj->visibility = *(*pp)++;
switch (newobj->visibility)
{
1999-07-07 22:19:36 +02:00
case VISIBILITY_PRIVATE:
case VISIBILITY_PROTECTED:
case VISIBILITY_PUBLIC:
break;
default:
/* Bad visibility format. Complain and treat it as
public. */
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Unknown visibility `%c' for baseclass"),
newobj->visibility);
newobj->visibility = VISIBILITY_PUBLIC;
1999-07-07 22:19:36 +02:00
}
}
{
int nbits;
1999-07-07 22:19:36 +02:00
/* The remaining value is the bit offset of the portion of the object
corresponding to this baseclass. Always zero in the absence of
multiple inheritance. */
SET_FIELD_BITPOS (newobj->field, read_huge_number (pp, ',', &nbits, 0));
if (nbits != 0)
return 0;
}
/* The last piece of baseclass information is the type of the
1999-07-07 22:19:36 +02:00
base class. Read it, and remember it's type name as this
field's name. */
newobj->field.type = read_type (pp, objfile);
Remove type_name_no_tag and rename type_name_no_tag_or_error type_name_no_tag is just a plain wrapper for TYPE_NAME now, so this patch removes it. And, because tag names no longer exist, this renames type_name_no_tag_or_error to type_name_or_error. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (value_cast_structs, destructor_name_p): Update. * symtab.c (gdb_mangle_name): Update. * stabsread.c (define_symbol, read_cpp_abbrev, read_baseclasses): Update. * p-valprint.c (pascal_object_is_vtbl_ptr_type) (pascal_object_print_value_fields, pascal_object_print_value): Update. * p-typeprint.c (pascal_type_print_derivation_info): Update. * linespec.c (find_methods): Update. * gdbtypes.h (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. * gdbtypes.c (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. (lookup_struct_elt_type, check_typedef): Update. * expprint.c (print_subexp_standard): Update. * dwarf2read.c (dwarf2_add_field, load_partial_dies): Update. * d-namespace.c (d_lookup_nested_symbol): Update. * cp-valprint.c (cp_is_vtbl_ptr_type, cp_print_value_fields) (cp_print_class_member): Update. * cp-namespace.c (cp_lookup_nested_symbol): Update. * completer.c (add_struct_fields): Update. * c-typeprint.c (cp_type_print_derivation_info) (c_type_print_varspec_prefix, c_type_print_base_struct_union): Update. * ada-lang.c (parse_old_style_renaming, xget_renaming_scope) (ada_prefer_type, ada_is_exception_sym): Update.
2018-04-17 21:51:25 +02:00
newobj->field.name = TYPE_NAME (newobj->field.type);
/* Skip trailing ';' and bump count of number of fields seen. */
if (**pp == ';')
(*pp)++;
else
return 0;
}
return 1;
}
/* The tail end of stabs for C++ classes that contain a virtual function
pointer contains a tilde, a %, and a type number.
The type number refers to the base class (possibly this class itself) which
contains the vtable pointer for the current class.
This function is called when we have parsed all the method declarations,
so we can look for the vptr base class info. */
static int
read_tilde_fields (struct stab_field_info *fip, const char **pp,
struct type *type, struct objfile *objfile)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p;
STABS_CONTINUE (pp, objfile);
/* If we are positioned at a ';', then skip it. */
if (**pp == ';')
{
(*pp)++;
}
if (**pp == '~')
{
(*pp)++;
if (**pp == '=' || **pp == '+' || **pp == '-')
{
/* Obsolete flags that used to indicate the presence
of constructors and/or destructors. */
(*pp)++;
}
/* Read either a '%' or the final ';'. */
if (*(*pp)++ == '%')
{
/* The next number is the type number of the base class
(possibly our own class) which supplies the vtable for
this class. Parse it out, and search that class to find
its vtable pointer, and install those into TYPE_VPTR_BASETYPE
and TYPE_VPTR_FIELDNO. */
struct type *t;
int i;
t = read_type (pp, objfile);
p = (*pp)++;
while (*p != '\0' && *p != ';')
{
p++;
}
if (*p == '\0')
{
/* Premature end of symbol. */
return 0;
}
1999-07-07 22:19:36 +02:00
set_type_vptr_basetype (type, t);
if (type == t) /* Our own class provides vtbl ptr. */
{
for (i = TYPE_NFIELDS (t) - 1;
i >= TYPE_N_BASECLASSES (t);
--i)
{
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
const char *name = TYPE_FIELD_NAME (t, i);
* c-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * cp-valprint.c (vtbl_ptr_name_old): Delete. (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old. * demangle.c (cplus_markers): Update comment. Put '$' first. Remove CPLUS_MARKER. (_initialize_demangler): Don't call set_cplus_marker_for_demangling. * jv-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER. * objc-exp.y (THIS): Delete token and grammar rule. (yylex): Don't return THIS. * p-exp.y (yylex): Remove reference to CPLUS_MARKER. * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'. (read_member_functions): Likewise for opname. (read_tilde_fields): Use is_cplus_marker. * defs.h (CPLUS_MARKER): Don't define. * config/tm-sysv4.h (CPLUS_MARKER): Likewise. * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise. * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise. * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise. * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise. * config/i386/tm-i386v4.h: Delete file. * config/djgpp/fnchange.lst: Delete tm-i386v4.h. * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead. * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead. * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead. * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h. * config/i386/i386sco5.mt (TM_FILE): Likewise. * config/i386/i386v4.mt (TM_FILE): Likewise. * config/i386/ncr3000.mt (TM_FILE): Likewise.
2002-10-11 16:02:39 +02:00
if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2)
&& is_cplus_marker (name[sizeof (vptr_name) - 2]))
{
set_type_vptr_fieldno (type, i);
goto gotit;
}
}
/* Virtual function table field not found. */
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("virtual function table pointer "
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
"not found when defining class `%s'"),
2002-12-17 01:39:08 +01:00
TYPE_NAME (type));
return 0;
}
else
{
set_type_vptr_fieldno (type, TYPE_VPTR_FIELDNO (t));
}
1999-07-07 22:19:36 +02:00
gotit:
*pp = p + 1;
}
}
return 1;
}
static int
attach_fn_fields_to_type (struct stab_field_info *fip, struct type *type)
{
int n;
for (n = TYPE_NFN_FIELDS (type);
1999-07-07 22:19:36 +02:00
fip->fnlist != NULL;
fip->fnlist = fip->fnlist->next)
{
--n; /* Circumvent Sun3 compiler bug. */
1999-07-07 22:19:36 +02:00
TYPE_FN_FIELDLISTS (type)[n] = fip->fnlist->fn_fieldlist;
}
return 1;
}
/* Create the vector of fields, and record how big it is.
We need this info to record proper virtual function table information
for this class's virtual functions. */
static int
attach_fields_to_type (struct stab_field_info *fip, struct type *type,
2000-07-30 03:48:28 +02:00
struct objfile *objfile)
{
int nfields = 0;
int non_public_fields = 0;
struct nextfield *scan;
/* Count up the number of fields that we have, as well as taking note of
whether or not there are any non-public fields, which requires us to
allocate and build the private_field_bits and protected_field_bits
bitfields. */
1999-07-07 22:19:36 +02:00
for (scan = fip->list; scan != NULL; scan = scan->next)
{
nfields++;
1999-07-07 22:19:36 +02:00
if (scan->visibility != VISIBILITY_PUBLIC)
{
non_public_fields++;
}
}
/* Now we know how many fields there are, and whether or not there are any
non-public fields. Record the field count, allocate space for the
array of fields, and create blank visibility bitfields if necessary. */
TYPE_NFIELDS (type) = nfields;
TYPE_FIELDS (type) = (struct field *)
TYPE_ALLOC (type, sizeof (struct field) * nfields);
memset (TYPE_FIELDS (type), 0, sizeof (struct field) * nfields);
if (non_public_fields)
{
ALLOCATE_CPLUS_STRUCT_TYPE (type);
TYPE_FIELD_PRIVATE_BITS (type) =
(B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
B_CLRALL (TYPE_FIELD_PRIVATE_BITS (type), nfields);
TYPE_FIELD_PROTECTED_BITS (type) =
(B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
B_CLRALL (TYPE_FIELD_PROTECTED_BITS (type), nfields);
TYPE_FIELD_IGNORE_BITS (type) =
(B_TYPE *) TYPE_ALLOC (type, B_BYTES (nfields));
B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields);
}
/* Copy the saved-up fields into the field vector. Start from the
head of the list, adding to the tail of the field array, so that
they end up in the same order in the array in which they were
added to the list. */
while (nfields-- > 0)
{
1999-07-07 22:19:36 +02:00
TYPE_FIELD (type, nfields) = fip->list->field;
switch (fip->list->visibility)
{
1999-07-07 22:19:36 +02:00
case VISIBILITY_PRIVATE:
SET_TYPE_FIELD_PRIVATE (type, nfields);
break;
1999-07-07 22:19:36 +02:00
case VISIBILITY_PROTECTED:
SET_TYPE_FIELD_PROTECTED (type, nfields);
break;
1999-07-07 22:19:36 +02:00
case VISIBILITY_IGNORE:
SET_TYPE_FIELD_IGNORE (type, nfields);
break;
1999-07-07 22:19:36 +02:00
case VISIBILITY_PUBLIC:
break;
1999-07-07 22:19:36 +02:00
default:
/* Unknown visibility. Complain and treat it as public. */
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Unknown visibility `%c' for field"),
2002-12-17 01:39:08 +01:00
fip->list->visibility);
1999-07-07 22:19:36 +02:00
}
break;
}
1999-07-07 22:19:36 +02:00
fip->list = fip->list->next;
}
return 1;
}
/* Complain that the compiler has emitted more than one definition for the
structure type TYPE. */
static void
complain_about_struct_wipeout (struct type *type)
{
* gdbtypes.h (struct main_type): Change type of name,tag_name, and fields.name members from char * to const char *. All uses updated. (struct cplus_struct_type): Change type of fn_fieldlists.name member from char * to const char *. All uses updated. (type_name_no_tag): Update. (lookup_unsigned_typename, lookup_signed_typename): Update. * gdbtypes.c (type_name_no_tag): Change result type from char * to const char *. All callers updated. (lookup_unsigned_typename, lookup_signed_typename): Change type of name parameter from char * to const char *. * symtab.h (struct cplus_specific): Change type of demangled_name member from char * to const char *. All uses updated. (struct general_symbol_info): Change type of name and mangled_lang.demangled_name members from char * to const char *. All uses updated. (symbol_get_demangled_name, symbol_natural_name): Update. (symbol_demangled_name, symbol_search_name): Update. * symtab.c (symbol_get_demangled_name): Change result type from char * to const char *. All callers updated. (symbol_natural_name, symbol_demangled_name): Ditto. (symbol_search_name): Ditto. (completion_list_add_name): Change type of symname,sym_text, text,word parameters from char * to const char *. (completion_list_objc_symbol): Change type of sym_text, text,word parameters from char * to const char *. * ada-lang.c (find_struct_field): Change type of name parameter from char * to const char *. (encoded_ordered_before): Similarly for N0,N1 parameters. (old_renaming_is_invisible): Similarly for function_name parameter. (ada_type_name): Change result type from char * to const char *. All callers updated. * ada-lang.h (ada_type_name): Update. * buildsym.c (hashname): Change type of name parameter from char * to const char *. * buildsym.h (hashname): Update. * dbxread.c (end_psymtab): Change type of include_list parameter from char ** to const char **. * dwarf2read.c (determine_prefix): Change result type from char * to const char *. All callers updated. * f-lang.c (find_common_for_function): Change type of name, funcname parameters from char * to const char *. * f-lang.c (find_common_for_function): Update. * f-valprint.c (list_all_visible_commons): Change type of funcname parameters from char * to const char *. * gdbarch.sh (static_transform_name): Change type of name parameter and result from char * to const char *. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type of name parameter from char * to const char *. * jv-lang.c (java_primitive_type_from_name): Ditto. (java_demangled_signature_length): Similarly for signature parameter. (java_demangled_signature_copy): Ditto. (java_demangle_type_signature): Ditto. * jv-lang.h (java_primitive_type_from_name): Update. (java_demangle_type_signature): Update. * objc-lang.c (specialcmp): Change type of a,b parameters from char * to const char *. * p-lang.c (is_pascal_string_type): Change type of arrayname parameter from char * to const char *. All callers updated. * p-lang.h (is_pascal_string_type): Update. * solib-frv.c (find_canonical_descriptor_in_load_object): Change type of name parameter from char * to const char *. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * defs.h (fprintf_symbol_filtered): Update. * sparc-tdep.h (sparc_sol2_static_transform_name): Update. * stabsread.h (end_psymtab): Update. * stack.c (find_frame_funname): Change type of funname parameter from char ** to const char **. * stack.h (find_frame_funname): Update. * typeprint.c (type_print): Change type of varstring parameter from char * to const char *. * value.h (type_print): Update. * xcoffread.c (xcoff_start_psymtab): Change type of filename parameter from char * to const char *. All callers updated. (xcoff_end_psymtab): Change type of include_list parameter from char ** to const char **. All callers updated. (swap_sym): Similarly for name parameter. All callers updated. * coffread.c (patch_type): Add (char*) cast to xfree parameter. Use xstrdup. (process_coff_symbol): Use xstrdup. * stabsread.c (stabs_method_name_from_physname): Renamed from update_method_name_from_physname. Change result type from void to char *. All callers updated. (read_member_functions): In has_destructor case, store name in objfile obstack instead of malloc space. In !has_stub case, fix mem leak.
2012-02-07 05:48:23 +01:00
const char *name = "";
const char *kind = "";
Remove TYPE_TAG_NAME TYPE_TAG_NAME has been an occasional source of confusion and bugs. It seems to me that it is only useful for C and C++ -- but even there, not so much, because at least with DWARF there doesn't seem to be any way to wind up with a type where the name and the tag name are both non-NULL and different. So, this patch removes TYPE_TAG_NAME entirely. This should save a little memory, but more importantly, it simplifies this part of gdb. A few minor test suite adjustments were needed. In some situations the new code does not yield identical output to the old code. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (enum_constant_from_type, value_namespace_elt) (value_maybe_namespace_elt): Update. * valarith.c (find_size_for_pointer_math): Update. * target-descriptions.c (make_gdb_type): Update. * symmisc.c (print_symbol): Update. * stabsread.c (define_symbol, read_type) (complain_about_struct_wipeout, add_undefined_type) (cleanup_undefined_types_1): Update. * rust-lang.c (rust_tuple_type_p, rust_slice_type_p) (rust_range_type_p, val_print_struct, rust_print_struct_def) (rust_internal_print_type, rust_composite_type) (rust_evaluate_funcall, rust_evaluate_subexp) (rust_inclusive_range_type_p): Update. * python/py-type.c (typy_get_tag): Update. * p-typeprint.c (pascal_type_print_base): Update. * mdebugread.c (parse_symbol, parse_type): Update. * m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum): Update. * guile/scm-type.c (gdbscm_type_tag): Update. * go-lang.c (sixg_string_p): Update. * gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type): Update. * gdbtypes.h (struct main_type) <tag_name>: Remove. (TYPE_TAG_NAME): Remove. * gdbtypes.c (type_name_no_tag): Simplify. (check_typedef, check_types_equal, recursive_dump_type) (copy_type_recursive, arch_composite_type): Update. * f-typeprint.c (f_type_print_base): Update. Print "Type" prefix in summary mode when needed. * eval.c (evaluate_funcall): Update. * dwarf2read.c (fixup_go_packaging, read_structure_type) (process_structure_scope, read_enumeration_type) (read_namespace_type, read_module_type, determine_prefix): Update. * cp-support.c (inspect_type): Update. * coffread.c (process_coff_symbol, decode_base_type): Update. * c-varobj.c (c_is_path_expr_parent): Update. * c-typeprint.c (c_type_print_base_struct_union): Update. (c_type_print_base_1): Update. Print struct/class/union/enum in summary when using C language. * ax-gdb.c (gen_struct_ref, gen_namespace_elt) (gen_maybe_namespace_elt): Update. * ada-lang.c (ada_type_name): Simplify. (empty_record, ada_template_to_fixed_record_type_1) (template_to_static_fixed_type) (to_record_with_fixed_variant_part, ada_check_typedef): Update. gdb/testsuite/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * gdb.xml/tdesc-regs.exp (load_description): Update expected results. * gdb.dwarf2/method-ptr.exp: Set language to C++. * gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++. * gdb.cp/typeid.exp (do_typeid_tests): Update type_re. * gdb.base/maint.exp (maint_pass_if): Update.
2018-04-17 21:51:24 +02:00
if (TYPE_NAME (type))
{
Remove TYPE_TAG_NAME TYPE_TAG_NAME has been an occasional source of confusion and bugs. It seems to me that it is only useful for C and C++ -- but even there, not so much, because at least with DWARF there doesn't seem to be any way to wind up with a type where the name and the tag name are both non-NULL and different. So, this patch removes TYPE_TAG_NAME entirely. This should save a little memory, but more importantly, it simplifies this part of gdb. A few minor test suite adjustments were needed. In some situations the new code does not yield identical output to the old code. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (enum_constant_from_type, value_namespace_elt) (value_maybe_namespace_elt): Update. * valarith.c (find_size_for_pointer_math): Update. * target-descriptions.c (make_gdb_type): Update. * symmisc.c (print_symbol): Update. * stabsread.c (define_symbol, read_type) (complain_about_struct_wipeout, add_undefined_type) (cleanup_undefined_types_1): Update. * rust-lang.c (rust_tuple_type_p, rust_slice_type_p) (rust_range_type_p, val_print_struct, rust_print_struct_def) (rust_internal_print_type, rust_composite_type) (rust_evaluate_funcall, rust_evaluate_subexp) (rust_inclusive_range_type_p): Update. * python/py-type.c (typy_get_tag): Update. * p-typeprint.c (pascal_type_print_base): Update. * mdebugread.c (parse_symbol, parse_type): Update. * m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum): Update. * guile/scm-type.c (gdbscm_type_tag): Update. * go-lang.c (sixg_string_p): Update. * gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type): Update. * gdbtypes.h (struct main_type) <tag_name>: Remove. (TYPE_TAG_NAME): Remove. * gdbtypes.c (type_name_no_tag): Simplify. (check_typedef, check_types_equal, recursive_dump_type) (copy_type_recursive, arch_composite_type): Update. * f-typeprint.c (f_type_print_base): Update. Print "Type" prefix in summary mode when needed. * eval.c (evaluate_funcall): Update. * dwarf2read.c (fixup_go_packaging, read_structure_type) (process_structure_scope, read_enumeration_type) (read_namespace_type, read_module_type, determine_prefix): Update. * cp-support.c (inspect_type): Update. * coffread.c (process_coff_symbol, decode_base_type): Update. * c-varobj.c (c_is_path_expr_parent): Update. * c-typeprint.c (c_type_print_base_struct_union): Update. (c_type_print_base_1): Update. Print struct/class/union/enum in summary when using C language. * ax-gdb.c (gen_struct_ref, gen_namespace_elt) (gen_maybe_namespace_elt): Update. * ada-lang.c (ada_type_name): Simplify. (empty_record, ada_template_to_fixed_record_type_1) (template_to_static_fixed_type) (to_record_with_fixed_variant_part, ada_check_typedef): Update. gdb/testsuite/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * gdb.xml/tdesc-regs.exp (load_description): Update expected results. * gdb.dwarf2/method-ptr.exp: Set language to C++. * gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++. * gdb.cp/typeid.exp (do_typeid_tests): Update type_re. * gdb.base/maint.exp (maint_pass_if): Update.
2018-04-17 21:51:24 +02:00
name = TYPE_NAME (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_STRUCT: kind = "struct "; break;
case TYPE_CODE_UNION: kind = "union "; break;
case TYPE_CODE_ENUM: kind = "enum "; break;
default: kind = "";
}
}
else
{
name = "<unknown>";
kind = "";
}
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("struct/union type gets multiply defined: %s%s"), kind, name);
}
/* Set the length for all variants of a same main_type, which are
connected in the closed chain.
This is something that needs to be done when a type is defined *after*
some cross references to this type have already been read. Consider
for instance the following scenario where we have the following two
stabs entries:
.stabs "t:p(0,21)=*(0,22)=k(0,23)=xsdummy:",160,0,28,-24
.stabs "dummy:T(0,23)=s16x:(0,1),0,3[...]"
A stubbed version of type dummy is created while processing the first
stabs entry. The length of that type is initially set to zero, since
it is unknown at this point. Also, a "constant" variation of type
"dummy" is created as well (this is the "(0,22)=k(0,23)" section of
the stabs line).
The second stabs entry allows us to replace the stubbed definition
with the real definition. However, we still need to adjust the length
of the "constant" variation of that type, as its length was left
untouched during the main type replacement... */
static void
set_length_in_type_chain (struct type *type)
{
struct type *ntype = TYPE_CHAIN (type);
while (ntype != type)
{
if (TYPE_LENGTH(ntype) == 0)
TYPE_LENGTH (ntype) = TYPE_LENGTH (type);
else
complain_about_struct_wipeout (ntype);
ntype = TYPE_CHAIN (ntype);
}
}
/* Read the description of a structure (or union type) and return an object
describing the type.
PP points to a character pointer that points to the next unconsumed token
in the stabs string. For example, given stabs "A:T4=s4a:1,0,32;;",
*PP will point to "4a:1,0,32;;".
TYPE points to an incomplete type that needs to be filled in.
OBJFILE points to the current objfile from which the stabs information is
being read. (Note that it is redundant in that TYPE also contains a pointer
to this same objfile, so it might be a good idea to eliminate it. FIXME).
1999-07-07 22:19:36 +02:00
*/
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_struct_type (const char **pp, struct type *type, enum type_code type_code,
struct objfile *objfile)
{
struct stab_field_info fi;
/* When describing struct/union/class types in stabs, G++ always drops
all qualifications from the name. So if you've got:
struct A { ... struct B { ... }; ... };
then G++ will emit stabs for `struct A::B' that call it simply
`struct B'. Obviously, if you've got a real top-level definition for
`struct B', or other nested definitions, this is going to cause
problems.
Obviously, GDB can't fix this by itself, but it can at least avoid
scribbling on existing structure type objects when new definitions
appear. */
if (! (TYPE_CODE (type) == TYPE_CODE_UNDEF
|| TYPE_STUB (type)))
{
complain_about_struct_wipeout (type);
/* It's probably best to return the type unchanged. */
return type;
}
INIT_CPLUS_SPECIFIC (type);
TYPE_CODE (type) = type_code;
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_STUB (type) = 0;
/* First comes the total size in bytes. */
{
int nbits;
TYPE_LENGTH (type) = read_huge_number (pp, 0, &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
set_length_in_type_chain (type);
}
/* Now read the baseclasses, if any, read the regular C struct or C++
class member fields, attach the fields to the type, read the C++
member functions, attach them to the type, and then read any tilde
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
field (baseclass specifier for the class holding the main vtable). */
if (!read_baseclasses (&fi, pp, type, objfile)
|| !read_struct_fields (&fi, pp, type, objfile)
|| !attach_fields_to_type (&fi, type, objfile)
|| !read_member_functions (&fi, pp, type, objfile)
|| !attach_fn_fields_to_type (&fi, type)
|| !read_tilde_fields (&fi, pp, type, objfile))
{
type = error_type (pp, objfile);
}
return (type);
}
/* Read a definition of an array type,
and create and return a suitable type object.
Also creates a range type which represents the bounds of that
array. */
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_array_type (const char **pp, struct type *type,
2000-07-30 03:48:28 +02:00
struct objfile *objfile)
{
struct type *index_type, *element_type, *range_type;
int lower, upper;
int adjustable = 0;
int nbits;
/* Format of an array type:
"ar<index type>;lower;upper;<array_contents_type>".
OS9000: "arlower,upper;<array_contents_type>".
Fortran adjustable arrays use Adigits or Tdigits for lower or upper;
for these, produce a type like float[][]. */
{
index_type = read_type (pp, objfile);
if (**pp != ';')
/* Improper format of array type decl. */
return error_type (pp, objfile);
++*pp;
}
if (!(**pp >= '0' && **pp <= '9') && **pp != '-')
{
(*pp)++;
adjustable = 1;
}
lower = read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
if (!(**pp >= '0' && **pp <= '9') && **pp != '-')
{
(*pp)++;
adjustable = 1;
}
upper = read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
1999-07-07 22:19:36 +02:00
element_type = read_type (pp, objfile);
if (adjustable)
{
lower = 0;
upper = -1;
}
range_type =
Remove unnecessary casts of NULL I noticed some unnecessary casts of NULL. This removes all the unnecessary ones, leaving only ones where we must ensure that NULL has pointer type for passing through varargs. I removed a couple of useless casts of 0 that I noticed while writing this. Tested by rebuilding. gdb/ChangeLog 2019-06-16 Tom Tromey <tom@tromey.com> * valops.c (value_cast, value_slice): Remove unnecessary cast. * breakpoint.c (stopin_command, stopat_command) (until_break_command, decode_location_default): Remove unnecessary cast. * utils.c (subset_compare): Remove unnecessary cast. * ada-lang.c (ada_update_initial_language): Remove unnecessary cast. * linespec.c (decode_line_with_last_displayed): Remove unnecessary cast. * infcmd.c (path_command): Remove unnecessary cast. * coffread.c (decode_type): Remove unnecessary cast. * xcoffread.c (read_xcoff_symtab): Remove unnecessary cast. * mipsread.c (mipscoff_symfile_read): Remove unnecessary cast. * tui/tui-stack.c (tui_show_locator_content) (tui_show_frame_info): Remove unnecessary cast. * tui/tui-win.c (tui_scroll_forward_command) (tui_scroll_backward_command, tui_set_focus, tui_set_win_height) (parse_scrolling_args): Remove unnecessary cast. * tui/tui-data.c (init_win_info, tui_del_window) (tui_free_window, tui_del_data_windows, tui_free_data_content) (free_content_elements): Remove unnecessary cast. * tui/tui-windata.c (tui_first_data_item_displayed): Remove unnecessary cast. * tui/tui-source.c (tui_set_source_content) (tui_vertical_source_scroll): Remove unnecessary cast. * tui/tui-layout.c (tui_default_win_height): Remove unnecessary cast. * tui/tui-io.c (tui_initialize_io): Remove unnecessary cast. * tui/tui-regs.c (tui_display_registers_from) (tui_display_register): Remove unnecessary cast. * tui/tui-wingeneral.c (tui_refresh_win, tui_delete_win) (tui_unhighlight_win, tui_highlight_win, tui_make_window) (make_visible): Remove unnecessary cast. * tui/tui-winsource.c (tui_erase_source_content) (tui_update_breakpoint_info, tui_set_exec_info_content): Remove unnecessary cast. * ax-gdb.c (agent_command_1): Remove unnecessary cast. * cli/cli-setshow.c (cmd_show_list): Remove unnecessary cast. * stabsread.c (read_type, read_array_type, read_range_type): Remove unnecessary cast. * mdebugread.c (mdebug_build_psymtabs): Remove unnecessary cast. (parse_symbol, parse_type, upgrade_type, parse_external) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref): Remove unnecessary cast. * gdb_bfd.c (gdb_bfd_map_section): Remove unnecessary cast.
2019-06-16 17:56:35 +02:00
create_static_range_type (NULL, index_type, lower, upper);
type = create_array_type (type, element_type, range_type);
return type;
}
/* Read a definition of an enumeration type,
and create and return a suitable type object.
Also defines the symbols that represent the values of the type. */
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_enum_type (const char **pp, struct type *type,
2000-07-30 03:48:28 +02:00
struct objfile *objfile)
{
Change get_objfile_arch to a method on objfile This changes get_objfile_arch to be a new inline method, objfile::arch. To my surprise, this function came up while profiling DWARF psymbol reading. Making this change improved performance from 1.986 seconds to 1.869 seconds. Both measurements were done by taking the mean of 10 runs on a fixed copy of the gdb executable. gdb/ChangeLog 2020-04-18 Tom Tromey <tom@tromey.com> * xcoffread.c (enter_line_range, scan_xcoff_symtab): Update. * value.c (value_fn_field): Update. * valops.c (find_function_in_inferior) (value_allocate_space_in_inferior): Update. * tui/tui-winsource.c (tui_update_source_windows_with_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * symtab.c (lookup_global_or_static_symbol) (find_function_start_sal_1, skip_prologue_sal) (print_msymbol_info, find_gnu_ifunc, symbol_arch): Update. * symmisc.c (dump_msymbols, dump_symtab_1) (maintenance_print_one_line_table): Update. * symfile.c (init_entry_point_info, section_is_mapped) (list_overlays_command, simple_read_overlay_table) (simple_overlay_update_1): Update. * stap-probe.c (handle_stap_probe): Update. * stabsread.c (dbx_init_float_type, define_symbol) (read_one_struct_field, read_enum_type, read_range_type): Update. * source.c (info_line_command): Update. * python/python.c (gdbpy_source_objfile_script) (gdbpy_execute_objfile_script): Update. * python/py-type.c (save_objfile_types): Update. * python/py-objfile.c (py_free_objfile): Update. * python/py-inferior.c (python_new_objfile): Update. * psymtab.c (psym_find_pc_sect_compunit_symtab, dump_psymtab) (dump_psymtab_addrmap_1, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * printcmd.c (info_address_command): Update. * objfiles.h (struct objfile) <arch>: New method, from get_objfile_arch. (get_objfile_arch): Don't declare. * objfiles.c (get_objfile_arch): Remove. (filter_overlapping_sections): Update. * minsyms.c (msymbol_is_function): Update. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines) (output_nondebug_symbol): Update. * mdebugread.c (parse_symbol, basic_type, parse_partial_symbols) (mdebug_expand_psymtab): Update. * machoread.c (macho_add_oso_symfile): Update. * linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap): Update. * linux-fork.c (checkpoint_command): Update. * linespec.c (convert_linespec_to_sals): Update. * jit.c (finalize_symtab): Update. * infrun.c (insert_exception_resume_from_probe): Update. * ia64-tdep.c (ia64_find_unwind_table): Update. * hppa-tdep.c (internalize_unwinds): Update. * gdbtypes.c (get_type_arch, init_float_type, objfile_type): Update. * gcore.c (call_target_sbrk): Update. * elfread.c (record_minimal_symbol, elf_symtab_read) (elf_rel_plt_read, elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Update. * dwarf2/read.c (create_addrmap_from_index) (create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab) (read_debug_names_from_section) (process_psymtab_comp_unit_reader, add_partial_symbol) (add_partial_subprogram, process_full_comp_unit) (read_file_scope, read_func_scope, read_lexical_block_scope) (read_call_site_scope, dwarf2_ranges_read) (dwarf2_record_block_ranges, dwarf2_add_field) (mark_common_block_symbol_computed, read_tag_pointer_type) (read_tag_string_type, dwarf2_init_float_type) (dwarf2_init_complex_target_type, read_base_type) (partial_die_info::read, partial_die_info::read) (read_attribute_value, dwarf_decode_lines_1, new_symbol) (dwarf2_fetch_die_loc_sect_off): Update. * dwarf2/loc.c (dwarf2_find_location_expression) (class dwarf_evaluate_loc_desc, rw_pieced_value) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval) (dwarf2_loc_desc_get_symbol_read_needs) (locexpr_describe_location_piece, locexpr_describe_location_1) (loclist_describe_location): Update. * dwarf2/index-write.c (write_debug_names): Update. * dwarf2/frame.c (dwarf2_build_frame_info): Update. * dtrace-probe.c (dtrace_process_dof): Update. * dbxread.c (read_dbx_symtab, dbx_end_psymtab) (process_one_symbol): Update. * ctfread.c (ctf_init_float_type, read_base_type): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_base_type) (coff_read_enum_type): Update. * cli/cli-cmds.c (edit_command, list_command): Update. * buildsym.c (buildsym_compunit::finish_block_internal): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint, get_sal_arch): Update. * block.c (block_gdbarch): Update. * annotate.c (annotate_source_line): Update.
2020-04-18 16:35:04 +02:00
struct gdbarch *gdbarch = objfile->arch ();
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p;
char *name;
long n;
struct symbol *sym;
int nsyms = 0;
struct pending **symlist;
struct pending *osyms, *syms;
int o_nsyms;
int nbits;
int unsigned_enum = 1;
#if 0
/* FIXME! The stabs produced by Sun CC merrily define things that ought
to be file-scope, between N_FN entries, using N_LSYM. What's a mother
to do? For now, force all enum values to file scope. */
if (within_function)
symlist = get_local_symbols ();
else
#endif
symlist = get_file_symbols ();
osyms = *symlist;
o_nsyms = osyms ? osyms->nsyms : 0;
/* The aix4 compiler emits an extra field before the enum members;
my guess is it's a type of some sort. Just ignore it. */
if (**pp == '-')
{
/* Skip over the type. */
while (**pp != ':')
1999-07-07 22:19:36 +02:00
(*pp)++;
/* Skip over the colon. */
(*pp)++;
}
/* Read the value-names and their values.
The input syntax is NAME:VALUE,NAME:VALUE, and so on.
A semicolon or comma instead of a NAME means the end. */
while (**pp && **pp != ';' && **pp != ',')
{
STABS_CONTINUE (pp, objfile);
p = *pp;
1999-07-07 22:19:36 +02:00
while (*p != ':')
p++;
name = obstack_strndup (&objfile->objfile_obstack, *pp, p - *pp);
*pp = p + 1;
n = read_huge_number (pp, ',', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
sym = allocate_symbol (objfile);
sym->set_linkage_name (name);
sym->set_language (get_current_subfile ()->language,
&objfile->objfile_obstack);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = n;
if (n < 0)
unsigned_enum = 0;
add_symbol_to_list (sym, symlist);
nsyms++;
}
if (**pp == ';')
(*pp)++; /* Skip the semicolon. */
/* Now fill in the fields of the type-structure. */
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT;
set_length_in_type_chain (type);
TYPE_CODE (type) = TYPE_CODE_ENUM;
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_STUB (type) = 0;
if (unsigned_enum)
gdb: * xml-tdesc.c (tdesc_end_union): Update. * stabsread.c (define_symbol): Update. (read_type): Update. (read_struct_type): Update. (read_enum_type): Update. * spu-tdep.c (spu_builtin_type_vec128): Update. * sh-tdep.c (sh_push_dummy_call_fpu): Update. (sh_push_dummy_call_nofpu): Update. * mdebugread.c (parse_symbol): Update. (parse_symbol): Update. (parse_symbol): Update. (upgrade_type): Update. * jv-lang.c (java_lookup_class): Update. * iq2000-tdep.c (iq2000_pointer_to_address): Update. * i386-tdep.c (i386_mmx_type): Update. (i386_sse_type): Update. * gdbtypes.h (enum type_flag_value): New enum. (enum type_instance_flag_value): New enum. (TYPE_FLAG_UNSIGNED, TYPE_FLAG_NOSIGN, TYPE_FLAG_STUB, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, TYPE_FLAG_PROTOTYPED, TYPE_FLAG_INCOMPLETE, TYPE_FLAG_VARARGS, TYPE_FLAG_VECTOR, TYPE_FLAG_FIXED_INSTANCE, TYPE_FLAG_STUB_SUPPORTED, TYPE_FLAG_NOTTEXT): Now enum constants. (TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, TYPE_FLAG_ADDRESS_CLASS_1, TYPE_FLAG_ADDRESS_CLASS_2): Remove. (TYPE_INSTANCE_FLAG_CONST, TYPE_INSTANCE_FLAG_VOLATILE, TYPE_INSTANCE_FLAG_CODE_SPACE, TYPE_INSTANCE_FLAG_DATA_SPACE, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1, TYPE_INSTANCE_FLAG_ADDRESS_CLASS_2): New constants. (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB, TYPE_TARGET_STUB, TYPE_STATIC, TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_VARARGS, TYPE_VECTOR, TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, TYPE_NOTTEXT): Update. (TYPE_FLAG_ADDRESS_CLASS_ALL): Remove. (TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL): New define. (TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE, TYPE_ADDRESS_CLASS_1, TYPE_ADDRESS_CLASS_2, TYPE_ADDRESS_CLASS_ALL): Update. (struct main_type) <flags>: Remove. <flag_unsigned, flag_nosign, flag_stub, flag_target_stub, flag_static, flag_prototyped, flag_incomplete, flag_varargs, flag_vector, flag_stub_supported, flag_nottext, flag_fixed_instance>: New fields. <nfields, vptr_fieldno>: Move earlier. (TYPE_FLAGS): Remove. * gdbtypes.c (make_pointer_type): Update. (address_space_name_to_int): Update. (address_space_int_to_name): Update. (make_type_with_address_space): Update. (make_cv_type): Update. (create_range_type): Update. (get_discrete_bounds): Update. (create_set_type): Update. (make_vector_type): Update. (smash_to_method_type): Update. (check_typedef): Update. (check_stub_method): Update. (init_type): Individually assign flag fields. (recursive_dump_type): Don't print entire TYPE_FLAGS field. Do print TYPE_FIXED_INSTANCE, TYPE_STUB_SUPPORTED, and TYPE_NOTTEXT. (copy_type_recursive): Copy the entire main type. Don't use TYPE_FLAGS. * features/rs6000/powerpc-altivec64l.c (initialize_tdesc_powerpc_altivec64l): Update. * features/rs6000/powerpc-altivec64.c (initialize_tdesc_powerpc_altivec64): Update. * features/rs6000/powerpc-altivec32l.c (initialize_tdesc_powerpc_altivec32l): Update. * features/rs6000/powerpc-altivec32.c (initialize_tdesc_powerpc_altivec32): Update. * features/rs6000/powerpc-7400.c (initialize_tdesc_powerpc_7400): Update. * features/arm-with-iwmmxt.c (initialize_tdesc_arm_with_iwmmxt): Update. * dwarf2read.c (read_structure_type): Update. (read_enumeration_type): Likewise. (process_enumeration_scope): Likewise. (read_tag_pointer_type): Likewise. (read_subroutine_type): Likewise. (read_subroutine_type): Likewise. (read_base_type): Likewise. * coffread.c (coff_read_enum_type): Update. * ada-valprint.c (adjust_type_signedness): Update. * ada-typeprint.c (print_record_field_types): Update. * ada-lang.c (packed_array_type): Update. (empty_record): Don't reset TYPE_FLAGS. (ada_template_to_fixed_record_type_1): Update. (ada_template_to_fixed_record_type_1): Likewise. (template_to_static_fixed_type): Likewise. (to_record_with_fixed_variant_part): Likewise. (to_fixed_record_type): Likewise. (to_fixed_array_type): Likewise. (to_static_fixed_type): Likewise. gdb/testsuite: * gdb.base/maint.exp: Update "maint print type".
2008-08-24 18:39:57 +02:00
TYPE_UNSIGNED (type) = 1;
TYPE_NFIELDS (type) = nsyms;
TYPE_FIELDS (type) = (struct field *)
TYPE_ALLOC (type, sizeof (struct field) * nsyms);
memset (TYPE_FIELDS (type), 0, sizeof (struct field) * nsyms);
/* Find the symbols for the values and put them into the type.
The symbols can be found in the symlist that we put them on
to cause them to be defined. osyms contains the old value
of that symlist; everything up to there was defined by us. */
/* Note that we preserve the order of the enum constants, so
that in something like "enum {FOO, LAST_THING=FOO}" we print
FOO, not LAST_THING. */
for (syms = *symlist, n = nsyms - 1; syms; syms = syms->next)
{
int last = syms == osyms ? o_nsyms : 0;
int j = syms->nsyms;
for (; --j >= last; --n)
{
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
TYPE_FIELD_NAME (type, n) = xsym->linkage_name ();
gdb/ PR symtab/7259: * ada-exp.y (convert_char_literal): Use TYPE_FIELD_ENUMVAL. * ada-lang.c (ada_discrete_type_high_bound) (ada_discrete_type_low_bound): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. (ada_identical_enum_types_p): Use TYPE_FIELD_ENUMVAL. (pos_atr, value_val_atr): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. * ada-typeprint.c (print_enum_type): Change variable lastval to LONGEST. Use TYPE_FIELD_ENUMVAL. * ada-valprint.c (print_optional_low_bound, ada_print_scalar) (ada_val_print_1): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. * c-typeprint.c (c_type_print_base): Move variable lastval to inner block, change it to LONGEST. Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. * coffread.c (coff_read_enum_type): Use SET_FIELD_ENUMVAL. * dwarf2read.c (process_enumeration_scope): Likewise. * gdb-gdb.py (TypeFlagsPrinter): Use field.enumval instead of field.bitpos. (class StructMainTypePrettyPrinter): Support also FIELD_LOC_KIND_ENUMVAL. * gdbtypes.c (get_discrete_bounds): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. (recursive_dump_type): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. (copy_type_recursive): Support also FIELD_LOC_KIND_ENUMVAL. * gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL. (struct main_type.flds_bnds.fields.loc): Adjust bitpos comment. New field enumval. (struct main_type.flds_bnds.bields): Adjust loc_kind and bitsize to accommodate enumval. (struct call_site): Adjust loc_kind to accommodate enumval. (FIELD_ENUMVAL, FIELD_ENUMVAL_LVAL, SET_FIELD_ENUMVAL) (TYPE_FIELD_ENUMVAL): New macros. * m2-typeprint.c (m2_enum): Use TYPE_FIELD_ENUMVAL. * mdebugread.c (parse_symbol): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. * p-typeprint.c (pascal_type_print_base): Likewise. * python/lib/gdb/printing.py (class FlagEnumerationPrinter): Use enumval. * python/lib/gdb/types.py (make_enum_dict): Likewise. * python/py-type.c (convert_field): New variable addrstring. Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. (check_types_equal): Support also FIELD_LOC_KIND_ENUMVAL. * stabsread.c (read_enum_type): Use SET_FIELD_ENUMVAL. * typepint.c (print_type_scalar): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. * valprint.c (generic_val_print): Likewise. gdb/testsuite/ PR symtab/7259: * gdb.base/enumval.c: New test case. * gdb.base/enumval.exp: New test case. * gdb.python/py-type.exp (test_enums): Use field.enumval instead of field.bitpos.
2012-04-18 08:46:47 +02:00
SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
TYPE_FIELD_BITSIZE (type, n) = 0;
}
if (syms == osyms)
break;
}
return type;
}
/* Sun's ACC uses a somewhat saner method for specifying the builtin
typedefs in every file (for int, long, etc):
1999-07-07 22:19:36 +02:00
type = b <signed> <width> <format type>; <offset>; <nbits>
signed = u or s.
optional format type = c or b for char or boolean.
offset = offset from high order bit to start bit of type.
width is # bytes in object of this type, nbits is # bits in type.
The width/offset stuff appears to be for small objects stored in
larger ones (e.g. `shorts' in `int' registers). We ignore it for now,
FIXME. */
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_sun_builtin_type (const char **pp, int typenums[2], struct objfile *objfile)
{
int type_bits;
int nbits;
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
int unsigned_type;
int boolean_type = 0;
switch (**pp)
{
1999-07-07 22:19:36 +02:00
case 's':
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
unsigned_type = 0;
1999-07-07 22:19:36 +02:00
break;
case 'u':
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
unsigned_type = 1;
1999-07-07 22:19:36 +02:00
break;
default:
return error_type (pp, objfile);
}
(*pp)++;
/* For some odd reason, all forms of char put a c here. This is strange
because no other type has this honor. We can safely ignore this because
we actually determine 'char'acterness by the number of bits specified in
the descriptor.
Boolean forms, e.g Fortran logical*X, put a b here. */
if (**pp == 'c')
(*pp)++;
else if (**pp == 'b')
{
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
boolean_type = 1;
(*pp)++;
}
/* The first number appears to be the number of bytes occupied
by this type, except that unsigned short is 4 instead of 2.
Since this information is redundant with the third number,
we will ignore it. */
read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
/* The second number is always 0, so ignore it too. */
read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
/* The third number is the number of bits for this type. */
type_bits = read_huge_number (pp, 0, &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
/* The type *should* end with a semicolon. If it are embedded
in a larger type the semicolon may be the only way to know where
the type ends. If this type is at the end of the stabstring we
can deal with the omitted semicolon (but we don't have to like
it). Don't bother to complain(), Sun's compiler omits the semicolon
for "void". */
if (**pp == ';')
++(*pp);
if (type_bits == 0)
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
{
Make init_type/arch_type take a size in bits This changes the interfaces to init_type and arch_type to take the type length in bits as input (instead of as bytes). The routines assert that the length is a multiple of TARGET_CHAR_BIT. For consistency, arch_flags_type is changed likewise, so that now all type creation interfaces always use length in bits. All callers are updated in the straightforward manner. The assert actually found a bug in read_range_type, where the init_integer_type routine was called with a wrong argument (probably a bug introduced with the conversion to use init_integer_type). gdb/ChangeLog 2017-09-27 Ulrich Weigand <uweigand@de.ibm.com> * gdbtypes.c (init_type): Change incoming argument from length-in-bytes to length-in-bits. Assert length is a multiple of TARGET_CHAR_BITS. (arch_type, arch_flags_type): Likewise. (init_integer_type): Update call to init_type. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (objfile_type): Likewise. (arch_integer_type): Update call to arch_type. (arch_character_type): Likewise. (arch_boolean_type): Likewise. (arch_float_type): Likewise. (arch_decfloat_type): Likewise. (arch_complex_type): Likewise. (arch_pointer_type): Likewise. (gdbtypes_post_init): Likewise. * dwarf2read.c (dwarf2_init_float_type): Update call to init_type. (read_base_type): Likewise. * mdebugread.c (basic_type): Likewise. * stabsread.c (dbx_init_float_type): Likewise. (rs6000_builtin_type): Likewise. (read_range_type): Likewise. Also, fix call to init_integer_type with erroneous length argument. * ada-lang.c (ada_language_arch_info): Update call to arch_type. * d-lang.c (build_d_types): Likewise. * f-lang.c (build_fortran_types): Likewise. * go-lang.c (build_go_types): Likewise. * opencl-lang.c (build_opencl_types): Likewise. * jit.c (finalize_symtab): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * target-descriptions.c (tdesc_gdb_type): Likewise. Also, update call to arch_flags_type. * linux-tdep.c (linux_get_siginfo_type_with_fields): Update call to arch_type. * fbsd-tdep.c (fbsd_get_siginfo_type): Likewise. * windows-tdep.c (windows_get_tlb_type): Likewise. * avr-tdep.c (avr_gdbarch_init): Update call to arch_type. * ft32-tdep.c (ft32_gdbarch_init): Likewise. * m32c-tdep.c (make_types): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. (rl78_psw_type): Update call to arch_flags_type. * m68k-tdep.c (m68k_ps_type): Update call to arch_flags_type. * rx-tdep.c (rx_psw_type): Likewise. (rx_fpsw_type): Likewise. * sparc-tdep.c (sparc_psr_type): Likewise. (sparc_fsr_type): Likewise. * sparc64-tdep.c (sparc64_pstate_type): Likewise. (sparc64_ccr_type): Likewise. (sparc64_fsr_type): Likewise. (sparc64_fprs_type): Likewise.
2017-09-27 19:02:00 +02:00
struct type *type = init_type (objfile, TYPE_CODE_VOID,
TARGET_CHAR_BIT, NULL);
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
if (unsigned_type)
TYPE_UNSIGNED (type) = 1;
return type;
}
if (boolean_type)
return init_boolean_type (objfile, type_bits, unsigned_type, NULL);
else
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, type_bits, unsigned_type, NULL);
}
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_sun_floating_type (const char **pp, int typenums[2],
struct objfile *objfile)
{
int nbits;
int details;
int nbytes;
struct type *rettype;
/* The first number has more details about the type, for example
FN_COMPLEX. */
details = read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
/* The second number is the number of bytes occupied by this type. */
nbytes = read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
nbits = nbytes * TARGET_CHAR_BIT;
if (details == NF_COMPLEX || details == NF_COMPLEX16
|| details == NF_COMPLEX32)
{
Add gdbarch callback to provide formats for debug info float types At this point, all TYPE_CODE_FLT types carry their floating-point format, except for those creating from reading DWARF or stabs debug info. Those will be addressed by this commit. The main issue here is that we actually have to determine which floating- point format to use. Currently, we only have the type length as input to this decision. In the future, we may hopefully get --at least in DWARF-- additional information to help disambiguate multiple different formats of the same length. For now, we can still look at the type name as a hint. This decision logic is encapsulated in a gdbarch callback to allow platform-specific overrides. The default implementation use the same logic (compare type length against the various gdbarch_..._bit sizes) that is currently implemented in floatformat_from_length. With this commit, all platforms still use the default logic, so there should be no actual change in behavior. A follow-on commit will add support for __float128 on Intel and Power. Once dwarf2read.c and stabsread.c make use of the new callback to determine floating-point formats, we're now sure every TYPE_CODE_FLT type will always carry its format. The commit therefore adds asserts to verify_floatformat to ensure new code will continue to always provide formats, and removes the code in floatformat_from_type that used to handle types with a NULL TYPE_FLOATFORMAT. gdb/ChangeLog: * gdbarch.sh (floatformat_for_type): New gdbarch callback. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.h (default_floatformat_for_type): New prototype. * arch-utils.c (default_floatformat_for_type): New function. * doublest.c (floatformat_from_length): Remove. (floatformat_from_type): Assume TYPE_FLOATFORMAT is non-NULL. * gdbtypes.c (verify_floatformat): Require non-NULL format. * dwarf2read.c (dwarf2_init_float_type): New function. (read_base_type): Use it. * stabsread.c (dbx_init_float_type): New function. (read_sun_floating_type): Use it. (read_range_type): Likewise. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:31:53 +02:00
rettype = dbx_init_float_type (objfile, nbits / 2);
return init_complex_type (NULL, rettype);
}
Add gdbarch callback to provide formats for debug info float types At this point, all TYPE_CODE_FLT types carry their floating-point format, except for those creating from reading DWARF or stabs debug info. Those will be addressed by this commit. The main issue here is that we actually have to determine which floating- point format to use. Currently, we only have the type length as input to this decision. In the future, we may hopefully get --at least in DWARF-- additional information to help disambiguate multiple different formats of the same length. For now, we can still look at the type name as a hint. This decision logic is encapsulated in a gdbarch callback to allow platform-specific overrides. The default implementation use the same logic (compare type length against the various gdbarch_..._bit sizes) that is currently implemented in floatformat_from_length. With this commit, all platforms still use the default logic, so there should be no actual change in behavior. A follow-on commit will add support for __float128 on Intel and Power. Once dwarf2read.c and stabsread.c make use of the new callback to determine floating-point formats, we're now sure every TYPE_CODE_FLT type will always carry its format. The commit therefore adds asserts to verify_floatformat to ensure new code will continue to always provide formats, and removes the code in floatformat_from_type that used to handle types with a NULL TYPE_FLOATFORMAT. gdb/ChangeLog: * gdbarch.sh (floatformat_for_type): New gdbarch callback. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.h (default_floatformat_for_type): New prototype. * arch-utils.c (default_floatformat_for_type): New function. * doublest.c (floatformat_from_length): Remove. (floatformat_from_type): Assume TYPE_FLOATFORMAT is non-NULL. * gdbtypes.c (verify_floatformat): Require non-NULL format. * dwarf2read.c (dwarf2_init_float_type): New function. (read_base_type): Use it. * stabsread.c (dbx_init_float_type): New function. (read_sun_floating_type): Use it. (read_range_type): Likewise. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:31:53 +02:00
return dbx_init_float_type (objfile, nbits);
}
/* Read a number from the string pointed to by *PP.
The value of *PP is advanced over the number.
If END is nonzero, the character that ends the
number must match END, or an error happens;
and that character is skipped if it does match.
If END is zero, *PP is left pointing to that character.
If TWOS_COMPLEMENT_BITS is set to a strictly positive value and if
the number is represented in an octal representation, assume that
it is represented in a 2's complement representation with a size of
TWOS_COMPLEMENT_BITS.
If the number fits in a long, set *BITS to 0 and return the value.
If not, set *BITS to be the number of bits in the number and return 0.
If encounter garbage, set *BITS to -1 and return 0. */
1999-12-07 04:56:43 +01:00
static long
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_huge_number (const char **pp, int end, int *bits,
int twos_complement_bits)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p = *pp;
int sign = 1;
int sign_bit = 0;
1999-12-07 04:56:43 +01:00
long n = 0;
int radix = 10;
char overflow = 0;
int nbits = 0;
int c;
1999-12-07 04:56:43 +01:00
long upper_limit;
int twos_complement_representation = 0;
1999-07-07 22:19:36 +02:00
if (*p == '-')
{
sign = -1;
p++;
}
/* Leading zero means octal. GCC uses this to output values larger
than an int (because that would be hard in decimal). */
if (*p == '0')
{
radix = 8;
p++;
}
/* Skip extra zeros. */
while (*p == '0')
p++;
if (sign > 0 && radix == 8 && twos_complement_bits > 0)
{
/* Octal, possibly signed. Check if we have enough chars for a
negative number. */
size_t len;
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *p1 = p;
while ((c = *p1) >= '0' && c < '8')
p1++;
len = p1 - p;
if (len > twos_complement_bits / 3
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
|| (twos_complement_bits % 3 == 0
&& len == twos_complement_bits / 3))
{
/* Ok, we have enough characters for a signed value, check
[gdb] Fix more typos in comments Fix typos in comments. NFC. Tested on x86_64-linux. gdb/ChangeLog: 2019-10-18 Tom de Vries <tdevries@suse.de> * aarch64-tdep.c: Fix typos in comments. * ada-lang.c: Same. * ada-tasks.c: Same. * alpha-tdep.c: Same. * alpha-tdep.h: Same. * amd64-nat.c: Same. * amd64-windows-tdep.c: Same. * arc-tdep.c: Same. * arc-tdep.h: Same. * arch-utils.c: Same. * arm-nbsd-tdep.c: Same. * arm-tdep.c: Same. * ax-gdb.c: Same. * blockframe.c: Same. * btrace.c: Same. * c-varobj.c: Same. * coff-pe-read.c: Same. * coffread.c: Same. * cris-tdep.c: Same. * darwin-nat.c: Same. * dbxread.c: Same. * dcache.c: Same. * disasm.c: Same. * dtrace-probe.c: Same. * dwarf-index-write.c: Same. * dwarf2-frame-tailcall.c: Same. * dwarf2-frame.c: Same. * dwarf2read.c: Same. * eval.c: Same. * exceptions.c: Same. * fbsd-tdep.c: Same. * findvar.c: Same. * frame.c: Same. * frv-tdep.c: Same. * gnu-v3-abi.c: Same. * go32-nat.c: Same. * h8300-tdep.c: Same. * hppa-tdep.c: Same. * i386-linux-tdep.c: Same. * i386-tdep.c: Same. * ia64-libunwind-tdep.c: Same. * ia64-tdep.c: Same. * infcmd.c: Same. * infrun.c: Same. * linespec.c: Same. * linux-nat.c: Same. * linux-thread-db.c: Same. * machoread.c: Same. * mdebugread.c: Same. * mep-tdep.c: Same. * mn10300-tdep.c: Same. * namespace.c: Same. * objfiles.c: Same. * opencl-lang.c: Same. * or1k-tdep.c: Same. * osabi.c: Same. * ppc-linux-nat.c: Same. * ppc-linux-tdep.c: Same. * ppc-sysv-tdep.c: Same. * printcmd.c: Same. * procfs.c: Same. * record-btrace.c: Same. * record-full.c: Same. * remote-fileio.c: Same. * remote.c: Same. * rs6000-tdep.c: Same. * s12z-tdep.c: Same. * score-tdep.c: Same. * ser-base.c: Same. * ser-go32.c: Same. * skip.c: Same. * sol-thread.c: Same. * solib-svr4.c: Same. * solib.c: Same. * source.c: Same. * sparc-nat.c: Same. * sparc-sol2-tdep.c: Same. * sparc-tdep.c: Same. * sparc64-tdep.c: Same. * stabsread.c: Same. * stack.c: Same. * symfile.c: Same. * symtab.c: Same. * target-descriptions.c: Same. * target-float.c: Same. * thread.c: Same. * utils.c: Same. * valops.c: Same. * valprint.c: Same. * value.c: Same. * varobj.c: Same. * windows-nat.c: Same. * xcoffread.c: Same. * xstormy16-tdep.c: Same. * xtensa-tdep.c: Same. Change-Id: I5175f1b107bfa4e1cdd4a3361ccb4739e53c75c4
2019-10-18 02:48:08 +02:00
for signedness by testing if the sign bit is set. */
sign_bit = (twos_complement_bits % 3 + 2) % 3;
c = *p - '0';
if (c & (1 << sign_bit))
{
/* Definitely signed. */
twos_complement_representation = 1;
sign = -1;
}
}
}
2003-01-02 Andrew Cagney <ac131313@redhat.com> * valarith.c (value_binop): Delete obsolete code and comments. * configure.host: Ditto. * buildsym.h (make_blockvector): Ditto. * buildsym.c (make_blockvector): Ditto. * defs.h (enum language): Ditto. (chill_demangle): Ditto. * elfread.c (elf_symtab_read): Ditto. * dwarfread.c (CHILL_PRODUCER): Ditto. (set_cu_language): Ditto. (handle_producer): Ditto. * expprint.c (print_subexp): Ditto. * gdbtypes.c (chill_varying_type): Ditto. * gdbtypes.h (builtin_type_chill_bool): Ditto. (builtin_type_chill_char, builtin_type_chill_long): Ditto. (builtin_type_chill_ulong, builtin_type_chill_real): Ditto. (chill_varying_type): Ditto. * language.h (_LANG_chill): Ditto. * language.c (binop_result_type, integral_type): Ditto. (character_type, string_type, structured_type): Ditto. (lang_bool_type, binop_type_check): Ditto. * stabsread.h (os9k_stabs): Ditto. * stabsread.c (os9k_type_vector, dbx_lookup_type): Ditto. (define_symbol, read_type, read_struct_fields): Ditto. (read_array_type, read_enum_type, read_huge_number): Ditto. (read_range_type, start_stabs): Ditto. * symfile.c (init_filename_language_table): Ditto. (add_psymbol_with_dem_name_to_list): Ditto. * symtab.c (symbol_init_language_specific): Ditto. (symbol_init_demangled_name, symbol_demangled_name): Ditto. * symtab.h (struct general_symbol_info): Ditto. (SYMBOL_CHILL_DEMANGLED_NAME): Ditto. * typeprint.c (typedef_print): Ditto. * utils.c (fprintf_symbol_filtered): Ditto. * valops.c (value_cast, search_struct_field, value_slice): Delete obsolete code. (varying_to_slice): Delete function. * value.h (COERCE_VARYING_ARRAY): Delete obsolete macro contents. (varying_to_slice): Delete declaration. * MAINTAINERS: Update.
2003-01-02 15:27:27 +01:00
upper_limit = LONG_MAX / radix;
while ((c = *p++) >= '0' && c < ('0' + radix))
{
if (n <= upper_limit)
{
if (twos_complement_representation)
{
/* Octal, signed, twos complement representation. In
this case, n is the corresponding absolute value. */
if (n == 0)
{
long sn = c - '0' - ((2 * (c - '0')) | (2 << sign_bit));
n = -sn;
}
else
{
n *= radix;
n -= c - '0';
}
}
else
{
/* unsigned representation */
n *= radix;
n += c - '0'; /* FIXME this overflows anyway. */
}
}
else
overflow = 1;
1999-07-07 22:19:36 +02:00
/* This depends on large values being output in octal, which is
what GCC does. */
if (radix == 8)
{
if (nbits == 0)
{
if (c == '0')
/* Ignore leading zeroes. */
;
else if (c == '1')
nbits = 1;
else if (c == '2' || c == '3')
nbits = 2;
else
nbits = 3;
}
else
nbits += 3;
}
}
if (end)
{
if (c && c != end)
{
if (bits != NULL)
*bits = -1;
return 0;
}
}
else
--p;
if (radix == 8 && twos_complement_bits > 0 && nbits > twos_complement_bits)
{
/* We were supposed to parse a number with maximum
TWOS_COMPLEMENT_BITS bits, but something went wrong. */
if (bits != NULL)
*bits = -1;
return 0;
}
*pp = p;
if (overflow)
{
if (nbits == 0)
{
/* Large decimal constants are an error (because it is hard to
count how many bits are in them). */
if (bits != NULL)
*bits = -1;
return 0;
}
1999-07-07 22:19:36 +02:00
/* -0x7f is the same as 0x80. So deal with it by adding one to
the number of bits. Two's complement represention octals
can't have a '-' in front. */
if (sign == -1 && !twos_complement_representation)
++nbits;
if (bits)
*bits = nbits;
}
else
{
if (bits)
*bits = 0;
return n * sign;
}
/* It's *BITS which has the interesting information. */
return 0;
}
static struct type *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_range_type (const char **pp, int typenums[2], int type_size,
struct objfile *objfile)
{
Change get_objfile_arch to a method on objfile This changes get_objfile_arch to be a new inline method, objfile::arch. To my surprise, this function came up while profiling DWARF psymbol reading. Making this change improved performance from 1.986 seconds to 1.869 seconds. Both measurements were done by taking the mean of 10 runs on a fixed copy of the gdb executable. gdb/ChangeLog 2020-04-18 Tom Tromey <tom@tromey.com> * xcoffread.c (enter_line_range, scan_xcoff_symtab): Update. * value.c (value_fn_field): Update. * valops.c (find_function_in_inferior) (value_allocate_space_in_inferior): Update. * tui/tui-winsource.c (tui_update_source_windows_with_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * symtab.c (lookup_global_or_static_symbol) (find_function_start_sal_1, skip_prologue_sal) (print_msymbol_info, find_gnu_ifunc, symbol_arch): Update. * symmisc.c (dump_msymbols, dump_symtab_1) (maintenance_print_one_line_table): Update. * symfile.c (init_entry_point_info, section_is_mapped) (list_overlays_command, simple_read_overlay_table) (simple_overlay_update_1): Update. * stap-probe.c (handle_stap_probe): Update. * stabsread.c (dbx_init_float_type, define_symbol) (read_one_struct_field, read_enum_type, read_range_type): Update. * source.c (info_line_command): Update. * python/python.c (gdbpy_source_objfile_script) (gdbpy_execute_objfile_script): Update. * python/py-type.c (save_objfile_types): Update. * python/py-objfile.c (py_free_objfile): Update. * python/py-inferior.c (python_new_objfile): Update. * psymtab.c (psym_find_pc_sect_compunit_symtab, dump_psymtab) (dump_psymtab_addrmap_1, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * printcmd.c (info_address_command): Update. * objfiles.h (struct objfile) <arch>: New method, from get_objfile_arch. (get_objfile_arch): Don't declare. * objfiles.c (get_objfile_arch): Remove. (filter_overlapping_sections): Update. * minsyms.c (msymbol_is_function): Update. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines) (output_nondebug_symbol): Update. * mdebugread.c (parse_symbol, basic_type, parse_partial_symbols) (mdebug_expand_psymtab): Update. * machoread.c (macho_add_oso_symfile): Update. * linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap): Update. * linux-fork.c (checkpoint_command): Update. * linespec.c (convert_linespec_to_sals): Update. * jit.c (finalize_symtab): Update. * infrun.c (insert_exception_resume_from_probe): Update. * ia64-tdep.c (ia64_find_unwind_table): Update. * hppa-tdep.c (internalize_unwinds): Update. * gdbtypes.c (get_type_arch, init_float_type, objfile_type): Update. * gcore.c (call_target_sbrk): Update. * elfread.c (record_minimal_symbol, elf_symtab_read) (elf_rel_plt_read, elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Update. * dwarf2/read.c (create_addrmap_from_index) (create_addrmap_from_aranges, dw2_find_pc_sect_compunit_symtab) (read_debug_names_from_section) (process_psymtab_comp_unit_reader, add_partial_symbol) (add_partial_subprogram, process_full_comp_unit) (read_file_scope, read_func_scope, read_lexical_block_scope) (read_call_site_scope, dwarf2_ranges_read) (dwarf2_record_block_ranges, dwarf2_add_field) (mark_common_block_symbol_computed, read_tag_pointer_type) (read_tag_string_type, dwarf2_init_float_type) (dwarf2_init_complex_target_type, read_base_type) (partial_die_info::read, partial_die_info::read) (read_attribute_value, dwarf_decode_lines_1, new_symbol) (dwarf2_fetch_die_loc_sect_off): Update. * dwarf2/loc.c (dwarf2_find_location_expression) (class dwarf_evaluate_loc_desc, rw_pieced_value) (dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval) (dwarf2_loc_desc_get_symbol_read_needs) (locexpr_describe_location_piece, locexpr_describe_location_1) (loclist_describe_location): Update. * dwarf2/index-write.c (write_debug_names): Update. * dwarf2/frame.c (dwarf2_build_frame_info): Update. * dtrace-probe.c (dtrace_process_dof): Update. * dbxread.c (read_dbx_symtab, dbx_end_psymtab) (process_one_symbol): Update. * ctfread.c (ctf_init_float_type, read_base_type): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_base_type) (coff_read_enum_type): Update. * cli/cli-cmds.c (edit_command, list_command): Update. * buildsym.c (buildsym_compunit::finish_block_internal): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint, get_sal_arch): Update. * block.c (block_gdbarch): Update. * annotate.c (annotate_source_line): Update.
2020-04-18 16:35:04 +02:00
struct gdbarch *gdbarch = objfile->arch ();
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *orig_pp = *pp;
int rangenums[2];
1999-12-07 04:56:43 +01:00
long n2, n3;
int n2bits, n3bits;
int self_subrange;
struct type *result_type;
struct type *index_type = NULL;
/* First comes a type we are a subrange of.
In C it is usually 0, 1 or the type being defined. */
if (read_type_number (pp, rangenums) != 0)
return error_type (pp, objfile);
self_subrange = (rangenums[0] == typenums[0] &&
rangenums[1] == typenums[1]);
if (**pp == '=')
{
*pp = orig_pp;
index_type = read_type (pp, objfile);
}
/* A semicolon should now follow; skip it. */
if (**pp == ';')
(*pp)++;
/* The remaining two operands are usually lower and upper bounds
of the range. But in some special cases they mean something else. */
n2 = read_huge_number (pp, ';', &n2bits, type_size);
n3 = read_huge_number (pp, ';', &n3bits, type_size);
if (n2bits == -1 || n3bits == -1)
return error_type (pp, objfile);
if (index_type)
goto handle_true_range;
/* If limits are huge, must be large integral type. */
if (n2bits != 0 || n3bits != 0)
{
char got_signed = 0;
char got_unsigned = 0;
/* Number of bits in the type. */
int nbits = 0;
/* If a type size attribute has been specified, the bounds of
the range should fit in this size. If the lower bounds needs
more bits than the upper bound, then the type is signed. */
if (n2bits <= type_size && n3bits <= type_size)
{
if (n2bits == type_size && n2bits > n3bits)
got_signed = 1;
else
got_unsigned = 1;
nbits = type_size;
}
/* Range from 0 to <large number> is an unsigned large integral type. */
else if ((n2bits == 0 && n2 == 0) && n3bits != 0)
{
got_unsigned = 1;
nbits = n3bits;
}
/* Range from <large number> to <large number>-1 is a large signed
1999-07-07 22:19:36 +02:00
integral type. Take care of the case where <large number> doesn't
fit in a long but <large number>-1 does. */
else if ((n2bits != 0 && n3bits != 0 && n2bits == n3bits + 1)
|| (n2bits != 0 && n3bits == 0
1999-12-07 04:56:43 +01:00
&& (n2bits == sizeof (long) * HOST_CHAR_BIT)
&& n3 == LONG_MAX))
{
got_signed = 1;
nbits = n2bits;
}
if (got_signed || got_unsigned)
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, nbits, got_unsigned, NULL);
else
return error_type (pp, objfile);
}
/* A type defined as a subrange of itself, with bounds both 0, is void. */
if (self_subrange && n2 == 0 && n3 == 0)
Make init_type/arch_type take a size in bits This changes the interfaces to init_type and arch_type to take the type length in bits as input (instead of as bytes). The routines assert that the length is a multiple of TARGET_CHAR_BIT. For consistency, arch_flags_type is changed likewise, so that now all type creation interfaces always use length in bits. All callers are updated in the straightforward manner. The assert actually found a bug in read_range_type, where the init_integer_type routine was called with a wrong argument (probably a bug introduced with the conversion to use init_integer_type). gdb/ChangeLog 2017-09-27 Ulrich Weigand <uweigand@de.ibm.com> * gdbtypes.c (init_type): Change incoming argument from length-in-bytes to length-in-bits. Assert length is a multiple of TARGET_CHAR_BITS. (arch_type, arch_flags_type): Likewise. (init_integer_type): Update call to init_type. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (objfile_type): Likewise. (arch_integer_type): Update call to arch_type. (arch_character_type): Likewise. (arch_boolean_type): Likewise. (arch_float_type): Likewise. (arch_decfloat_type): Likewise. (arch_complex_type): Likewise. (arch_pointer_type): Likewise. (gdbtypes_post_init): Likewise. * dwarf2read.c (dwarf2_init_float_type): Update call to init_type. (read_base_type): Likewise. * mdebugread.c (basic_type): Likewise. * stabsread.c (dbx_init_float_type): Likewise. (rs6000_builtin_type): Likewise. (read_range_type): Likewise. Also, fix call to init_integer_type with erroneous length argument. * ada-lang.c (ada_language_arch_info): Update call to arch_type. * d-lang.c (build_d_types): Likewise. * f-lang.c (build_fortran_types): Likewise. * go-lang.c (build_go_types): Likewise. * opencl-lang.c (build_opencl_types): Likewise. * jit.c (finalize_symtab): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * target-descriptions.c (tdesc_gdb_type): Likewise. Also, update call to arch_flags_type. * linux-tdep.c (linux_get_siginfo_type_with_fields): Update call to arch_type. * fbsd-tdep.c (fbsd_get_siginfo_type): Likewise. * windows-tdep.c (windows_get_tlb_type): Likewise. * avr-tdep.c (avr_gdbarch_init): Update call to arch_type. * ft32-tdep.c (ft32_gdbarch_init): Likewise. * m32c-tdep.c (make_types): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. (rl78_psw_type): Update call to arch_flags_type. * m68k-tdep.c (m68k_ps_type): Update call to arch_flags_type. * rx-tdep.c (rx_psw_type): Likewise. (rx_fpsw_type): Likewise. * sparc-tdep.c (sparc_psr_type): Likewise. (sparc_fsr_type): Likewise. * sparc64-tdep.c (sparc64_pstate_type): Likewise. (sparc64_ccr_type): Likewise. (sparc64_fsr_type): Likewise. (sparc64_fprs_type): Likewise.
2017-09-27 19:02:00 +02:00
return init_type (objfile, TYPE_CODE_VOID, TARGET_CHAR_BIT, NULL);
/* If n3 is zero and n2 is positive, we want a floating type, and n2
is the width in bytes.
Fortran programs appear to use this for complex types also. To
distinguish between floats and complex, g77 (and others?) seem
to use self-subranges for the complexes, and subranges of int for
the floats.
Also note that for complexes, g77 sets n2 to the size of one of
the member floats, not the whole complex beast. My guess is that
this was to work well with pre-COMPLEX versions of gdb. */
if (n3 == 0 && n2 > 0)
{
struct type *float_type
Add gdbarch callback to provide formats for debug info float types At this point, all TYPE_CODE_FLT types carry their floating-point format, except for those creating from reading DWARF or stabs debug info. Those will be addressed by this commit. The main issue here is that we actually have to determine which floating- point format to use. Currently, we only have the type length as input to this decision. In the future, we may hopefully get --at least in DWARF-- additional information to help disambiguate multiple different formats of the same length. For now, we can still look at the type name as a hint. This decision logic is encapsulated in a gdbarch callback to allow platform-specific overrides. The default implementation use the same logic (compare type length against the various gdbarch_..._bit sizes) that is currently implemented in floatformat_from_length. With this commit, all platforms still use the default logic, so there should be no actual change in behavior. A follow-on commit will add support for __float128 on Intel and Power. Once dwarf2read.c and stabsread.c make use of the new callback to determine floating-point formats, we're now sure every TYPE_CODE_FLT type will always carry its format. The commit therefore adds asserts to verify_floatformat to ensure new code will continue to always provide formats, and removes the code in floatformat_from_type that used to handle types with a NULL TYPE_FLOATFORMAT. gdb/ChangeLog: * gdbarch.sh (floatformat_for_type): New gdbarch callback. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.h (default_floatformat_for_type): New prototype. * arch-utils.c (default_floatformat_for_type): New function. * doublest.c (floatformat_from_length): Remove. (floatformat_from_type): Assume TYPE_FLOATFORMAT is non-NULL. * gdbtypes.c (verify_floatformat): Require non-NULL format. * dwarf2read.c (dwarf2_init_float_type): New function. (read_base_type): Use it. * stabsread.c (dbx_init_float_type): New function. (read_sun_floating_type): Use it. (read_range_type): Likewise. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:31:53 +02:00
= dbx_init_float_type (objfile, n2 * TARGET_CHAR_BIT);
if (self_subrange)
return init_complex_type (NULL, float_type);
else
return float_type;
}
/* If the upper bound is -1, it must really be an unsigned integral. */
else if (n2 == 0 && n3 == -1)
{
int bits = type_size;
if (bits <= 0)
{
/* We don't know its size. It is unsigned int or unsigned
long. GCC 2.3.3 uses this for long long too, but that is
just a GDB 3.5 compatibility hack. */
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
bits = gdbarch_int_bit (gdbarch);
}
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, bits, 1, NULL);
}
/* Special case: char is defined (Who knows why) as a subrange of
itself with range 0-127. */
else if (self_subrange && n2 == 0 && n3 == 127)
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
{
Make init_type/arch_type take a size in bits This changes the interfaces to init_type and arch_type to take the type length in bits as input (instead of as bytes). The routines assert that the length is a multiple of TARGET_CHAR_BIT. For consistency, arch_flags_type is changed likewise, so that now all type creation interfaces always use length in bits. All callers are updated in the straightforward manner. The assert actually found a bug in read_range_type, where the init_integer_type routine was called with a wrong argument (probably a bug introduced with the conversion to use init_integer_type). gdb/ChangeLog 2017-09-27 Ulrich Weigand <uweigand@de.ibm.com> * gdbtypes.c (init_type): Change incoming argument from length-in-bytes to length-in-bits. Assert length is a multiple of TARGET_CHAR_BITS. (arch_type, arch_flags_type): Likewise. (init_integer_type): Update call to init_type. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (objfile_type): Likewise. (arch_integer_type): Update call to arch_type. (arch_character_type): Likewise. (arch_boolean_type): Likewise. (arch_float_type): Likewise. (arch_decfloat_type): Likewise. (arch_complex_type): Likewise. (arch_pointer_type): Likewise. (gdbtypes_post_init): Likewise. * dwarf2read.c (dwarf2_init_float_type): Update call to init_type. (read_base_type): Likewise. * mdebugread.c (basic_type): Likewise. * stabsread.c (dbx_init_float_type): Likewise. (rs6000_builtin_type): Likewise. (read_range_type): Likewise. Also, fix call to init_integer_type with erroneous length argument. * ada-lang.c (ada_language_arch_info): Update call to arch_type. * d-lang.c (build_d_types): Likewise. * f-lang.c (build_fortran_types): Likewise. * go-lang.c (build_go_types): Likewise. * opencl-lang.c (build_opencl_types): Likewise. * jit.c (finalize_symtab): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * target-descriptions.c (tdesc_gdb_type): Likewise. Also, update call to arch_flags_type. * linux-tdep.c (linux_get_siginfo_type_with_fields): Update call to arch_type. * fbsd-tdep.c (fbsd_get_siginfo_type): Likewise. * windows-tdep.c (windows_get_tlb_type): Likewise. * avr-tdep.c (avr_gdbarch_init): Update call to arch_type. * ft32-tdep.c (ft32_gdbarch_init): Likewise. * m32c-tdep.c (make_types): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. (rl78_psw_type): Update call to arch_flags_type. * m68k-tdep.c (m68k_ps_type): Update call to arch_flags_type. * rx-tdep.c (rx_psw_type): Likewise. (rx_fpsw_type): Likewise. * sparc-tdep.c (sparc_psr_type): Likewise. (sparc_fsr_type): Likewise. * sparc64-tdep.c (sparc64_pstate_type): Likewise. (sparc64_ccr_type): Likewise. (sparc64_fsr_type): Likewise. (sparc64_fprs_type): Likewise.
2017-09-27 19:02:00 +02:00
struct type *type = init_integer_type (objfile, TARGET_CHAR_BIT,
0, NULL);
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
TYPE_NOSIGN (type) = 1;
return type;
}
/* We used to do this only for subrange of self or subrange of int. */
else if (n2 == 0)
{
1999-08-03 01:48:37 +02:00
/* -1 is used for the upper bound of (4 byte) "unsigned int" and
"unsigned long", and we already checked for that,
so don't need to test for it here. */
if (n3 < 0)
/* n3 actually gives the size. */
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, -n3 * TARGET_CHAR_BIT, 1, NULL);
1999-08-16 21:57:19 +02:00
/* Is n3 == 2**(8n)-1 for some integer n? Then it's an
1999-08-03 01:48:37 +02:00
unsigned n-byte integer. But do require n to be a power of
two; we don't want 3- and 5-byte integers flying around. */
{
int bytes;
unsigned long bits;
bits = n3;
for (bytes = 0; (bits & 0xff) == 0xff; bytes++)
bits >>= 8;
if (bits == 0
&& ((bytes - 1) & bytes) == 0) /* "bytes is a power of two" */
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, bytes * TARGET_CHAR_BIT, 1, NULL);
1999-08-03 01:48:37 +02:00
}
}
/* I think this is for Convex "long long". Since I don't know whether
Convex sets self_subrange, I also accept that particular size regardless
of self_subrange. */
else if (n3 == 0 && n2 < 0
&& (self_subrange
2007-06-12 Markus Deuling <deuling@de.ibm.com> * gdbarch.sh (TARGET_SHORT_BIT): Replace by gdbarch_int_bit. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * f-lang.c (f_create_fundamental_type, build_fortran_types): Likewise. * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * gdbarch.sh (TARGET_INT_BIT): Replace by gdbarch_int_bit. * c-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * ada-lex.l (processInt): Likewise. * f-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * ada-lang.c (ada_create_fundamental_type, ada_language_arch_info) (gdbtypes_post_init, build_gdbtypes): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * parse.c (build_parse): Likewise. * xcoffread.c (_initialize_xcoffread): Likewise. * stabsread.c (define_symbol, read_one_struct_field, read_enum_type) (read_range_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * f-lang.c (build_fortran_types, f_create_fundamental_type): Likewise. * m2-lang.c (m2_create_fundamental_type, _initialize_m2_language) (m2_create_fundamental_type): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * coffread.c (coff_read_enum_type): Likewise. * mdebugread.c (parse_symbol, _initialize_mdebugread): Likewise. * dwarf2read.c (new_symbol): Likewise. * gdbarch.sh (TARGET_LONG_BIT): Replace by gdbarch_long_bit. * c-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * ada-lex.l (processInt): Likewise. * f-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * valarith.c (value_binop): Likewise. * symfile.c (read_target_long_array, simple_overlay_update_1): Likewise. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * gdbtypes.c (build_gdbtypes, gdbtypes_post_init): Likewise. * symfile.c (TARGET_LONG_BYTES): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * f-lang.c (f_create_fundamental_type): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * coffread.c (decode_base_type): Likewise. * gdbarch.sh (TARGET_LONG_LONG_BIT): Replace by gdbarch_long_long_bit. * c-exp.y (parse_number): Likewise. * objc-exp.y (parse_number): Likewise. * p-exp.y (parse_number): Likewise. * ada-lang.c (ada_create_fundamental_type) (ada_language_arch_info): Likewise. * gdbtypes.c (gdbtypes_post_init, build_gdbtypes): Likewise. * stabsread.c (read_range_type): Likewise. * p-lang.c (pascal_create_fundamental_type): Likewise. * objc-lang.c (objc_create_fundamental_type): Likewise. * m2-lang.c (m2_create_fundamental_type): Likewise. * f-lang.c (f_create_fundamental_type): Likewise. * c-lang.c (c_create_fundamental_type): Likewise. * gdbarch.c, gdbarch.h: Regenerate.
2007-06-12 17:33:04 +02:00
|| n2 == -gdbarch_long_long_bit
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
(gdbarch) / TARGET_CHAR_BIT))
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, -n2 * TARGET_CHAR_BIT, 0, NULL);
1999-07-07 22:19:36 +02:00
else if (n2 == -n3 - 1)
{
if (n3 == 0x7f)
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, 8, 0, NULL);
if (n3 == 0x7fff)
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, 16, 0, NULL);
if (n3 == 0x7fffffff)
Unify init_type and arch_type interface and helpers This adds a number of helper routines for creating objfile-owned types; these correspond 1:1 to the already existing helper routines for creating gdbarch-owned types, and are intended to be used instead of init_type. A shared fragment of init_float_type and arch_float_type is extracted into a separate subroutine verify_subroutine. The commit also brings the interface of init_type in line with the one for arch_type. In particular, this means removing the FLAGS argument; callers now set the required flags directly. (Since most callers use the new helper routines, very few callers actually need to set any additional flags directly any more.) Note that this means all the TYPE_FLAGS_... defined are no longer needed anywhere; they will be removed by a follow-on commit. All users of init_type are changed to use on of the new helpers where possible. No functional change intended. gdb/ChangeLog: * gdbtypes.h (init_type): Remove FLAGS argument. Move OBJFILE argument to first position. (init_integer_type): New prototype. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. * gdbtypes.c (verify_floatflormat): New function. (init_type): Remove FLAGS argument and processing. Move OBJFILE argument to first position. (init_integer_type): New function. (init_character_type): Likewise. (init_boolean_type): Likewise. (init_float_type): Likewise. (init_decfloat_type): Likewise. (init_complex_type): Likewise. (init_pointer_type): Likewise. (arch_float_type): Use verify_floatflormat. (objfile_type): Use init_..._type helpers instead of calling init_type directly. * dwarf2read.c (fixup_go_packaging): Update to changed init_type prototype. (read_namespace_type): Likewise. (read_module_type): Likewise. (read_typedef): Likewise. (read_unspecified_type): Likewise. (build_error_marker_type): Likewise. (read_base_type): Use init_..._type helpers. * mdebugread.c (basic_type): Use init_..._type helpers. (parse_type): Update to changed init_type prototype. (cross_ref): Likewise. * stabsread.c (rs6000_builtin_type): Use init_..._type helpers. (read_sun_builtin_type): Likewise. (read_sun_floating_type): Likewise. (read_range_type): Likewise. Also update to changed init_type prototype. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-06 17:27:55 +02:00
return init_integer_type (objfile, 32, 0, NULL);
}
/* We have a real range type on our hands. Allocate space and
return a real pointer. */
1999-07-07 22:19:36 +02:00
handle_true_range:
if (self_subrange)
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
index_type = objfile_type (objfile)->builtin_int;
else
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
index_type = *dbx_lookup_type (rangenums, objfile);
if (index_type == NULL)
{
/* Does this actually ever happen? Is that why we are worrying
about dealing with it rather than just calling error_type? */
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("base type %d of range type is not defined"), rangenums[1]);
* objfiles.h (struct objfile): New GDBARCH member. (get_objfile_arch): Add prototype. * objfiles.c: Include "arch-utils.h". (allocate_objfile): Look up gdbarch associated with bfd. (get_objfile_arch): New function. * Makefile (objfiles.o): Update dependencies. * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch by objfile arch. * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch by frame arch. (locexpr_describe_location): Replace current_gdbarch by objfile arch. * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch. (dwarf2_add_field): Likewise. (read_tag_pointer_type): Likewise. (read_base_type): Likewise. (new_symbol): Likewise. * coffread.c (decode_type): Add OBJFILE argument. Update callers. (decode_base_type, decode_function_type): Likewise. (coff_read_struct_type, coff_read_enum_type): Likewise. (coff_symtab_read): Replace current_gdbarch by objfile arch. (decode_base_type): Likewise. (coff_read_enum_type): Likewise. (coff_read_struct_type): Replace current_objfile by OBJFILE argument. (coff_read_enum_type): Likewise. * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch. (parse_procedure): Likewise. (parse_partial_symbols): Likewise. * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch. * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch. Replace static pcc_promotion_type and pcc_unsigned_promotion_type by built-in types. (read_range_type): Replace current_gdbarch by objfile arch. Replace static range_index_type by built-in type. (read_one_struct_field): Replace current_gdbarch by objfile arch. (read_enum_type): Likewise. * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by objfile arch.
2008-03-26 15:53:28 +01:00
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
index_type = objfile_type (objfile)->builtin_int;
}
result_type
Remove unnecessary casts of NULL I noticed some unnecessary casts of NULL. This removes all the unnecessary ones, leaving only ones where we must ensure that NULL has pointer type for passing through varargs. I removed a couple of useless casts of 0 that I noticed while writing this. Tested by rebuilding. gdb/ChangeLog 2019-06-16 Tom Tromey <tom@tromey.com> * valops.c (value_cast, value_slice): Remove unnecessary cast. * breakpoint.c (stopin_command, stopat_command) (until_break_command, decode_location_default): Remove unnecessary cast. * utils.c (subset_compare): Remove unnecessary cast. * ada-lang.c (ada_update_initial_language): Remove unnecessary cast. * linespec.c (decode_line_with_last_displayed): Remove unnecessary cast. * infcmd.c (path_command): Remove unnecessary cast. * coffread.c (decode_type): Remove unnecessary cast. * xcoffread.c (read_xcoff_symtab): Remove unnecessary cast. * mipsread.c (mipscoff_symfile_read): Remove unnecessary cast. * tui/tui-stack.c (tui_show_locator_content) (tui_show_frame_info): Remove unnecessary cast. * tui/tui-win.c (tui_scroll_forward_command) (tui_scroll_backward_command, tui_set_focus, tui_set_win_height) (parse_scrolling_args): Remove unnecessary cast. * tui/tui-data.c (init_win_info, tui_del_window) (tui_free_window, tui_del_data_windows, tui_free_data_content) (free_content_elements): Remove unnecessary cast. * tui/tui-windata.c (tui_first_data_item_displayed): Remove unnecessary cast. * tui/tui-source.c (tui_set_source_content) (tui_vertical_source_scroll): Remove unnecessary cast. * tui/tui-layout.c (tui_default_win_height): Remove unnecessary cast. * tui/tui-io.c (tui_initialize_io): Remove unnecessary cast. * tui/tui-regs.c (tui_display_registers_from) (tui_display_register): Remove unnecessary cast. * tui/tui-wingeneral.c (tui_refresh_win, tui_delete_win) (tui_unhighlight_win, tui_highlight_win, tui_make_window) (make_visible): Remove unnecessary cast. * tui/tui-winsource.c (tui_erase_source_content) (tui_update_breakpoint_info, tui_set_exec_info_content): Remove unnecessary cast. * ax-gdb.c (agent_command_1): Remove unnecessary cast. * cli/cli-setshow.c (cmd_show_list): Remove unnecessary cast. * stabsread.c (read_type, read_array_type, read_range_type): Remove unnecessary cast. * mdebugread.c (mdebug_build_psymtabs): Remove unnecessary cast. (parse_symbol, parse_type, upgrade_type, parse_external) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref): Remove unnecessary cast. * gdb_bfd.c (gdb_bfd_map_section): Remove unnecessary cast.
2019-06-16 17:56:35 +02:00
= create_static_range_type (NULL, index_type, n2, n3);
return (result_type);
}
/* Read in an argument list. This is a list of types, separated by commas
and terminated with END. Return the list of types read in, or NULL
if there is an error. */
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
static struct field *
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
read_args (const char **pp, int end, struct objfile *objfile, int *nargsp,
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
int *varargsp)
{
/* FIXME! Remove this arbitrary limit! */
struct type *types[1024]; /* Allow for fns of 1023 parameters. */
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
int n = 0, i;
struct field *rval;
while (**pp != end)
{
if (**pp != ',')
/* Invalid argument list: no ','. */
return NULL;
(*pp)++;
STABS_CONTINUE (pp, objfile);
types[n++] = read_type (pp, objfile);
}
(*pp)++; /* get past `end' (the ':' character). */
if (n == 0)
{
/* We should read at least the THIS parameter here. Some broken stabs
output contained `(0,41),(0,42)=@s8;-16;,(0,43),(0,1);' where should
have been present ";-16,(0,43)" reference instead. This way the
excessive ";" marker prematurely stops the parameters parsing. */
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Invalid (empty) method arguments"));
*varargsp = 0;
}
else if (TYPE_CODE (types[n - 1]) != TYPE_CODE_VOID)
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
*varargsp = 1;
else
{
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
n--;
*varargsp = 0;
}
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
rval = XCNEWVEC (struct field, n);
2002-06-14 Daniel Jacobowitz <drow@mvista.com> * gdbtypes.h (TYPE_FLAG_VARARGS): Update comment. (struct main_type): Remove arg_types member. Update comments for struct field. (TYPE_ARG_TYPES): Remove. (TYPE_FN_FIELD_ARGS): Update. (smash_to_method_type): Update prototype. * c-typeprint.c (cp_type_print_method_args): Take method type instead of argument list. Use new argument layout. Simplify. (c_type_print_args): Use new argument layout. Simplify. (c_type_print_base): Update call to cp_type_print_method_args. * dwarf2read.c (dwarf2_add_member_fn): Remove unneeded type argument; use die->type instead. Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. * gdbtypes.c (allocate_stub_method): Update comment. (smash_to_method_type): Take new NARGS and VARARGS arguments. Use new argument layout. (check_stub_method): Use new argument layout. Don't count void as an argument. (print_arg_types): Update comments. Use new argument layout. (recursive_dump_type): Don't print arg_types member. * hpread.c (hpread_read_struct_type): Use new argument layout. (fixup_class_method_type): Likewise. (hpread_type_lookup): Likewise. * stabsread.c (read_type): Update calls to read_args and smash_to_method_type. (read_args): Use new argument layout. Simplify. * valops.c (typecmp): Use new argument layout. Update parameters and comments. Simplify. (hand_function_call): Use new argument layout. (search_struct_method): Update call to typecmp. (find_overload_match): Use new argument layout.
2002-06-14 16:34:26 +02:00
for (i = 0; i < n; i++)
rval[i].type = types[i];
*nargsp = n;
return rval;
}
/* Common block handling. */
/* List of symbols declared since the last BCOMM. This list is a tail
of local_symbols. When ECOMM is seen, the symbols on the list
are noted so their proper addresses can be filled in later,
using the common block base address gotten from the assembler
stabs. */
static struct pending *common_block;
static int common_block_i;
/* Name of the current common block. We get it from the BCOMM instead of the
ECOMM to match IBM documentation (even though IBM puts the name both places
like everyone else). */
static char *common_block_name;
/* Process a N_BCOMM symbol. The storage for NAME is not guaranteed
to remain after this function returns. */
void
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
common_block_start (const char *name, struct objfile *objfile)
{
if (common_block_name != NULL)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("Invalid symbol data: common block within common block"));
}
common_block = *get_local_symbols ();
common_block_i = common_block ? common_block->nsyms : 0;
common_block_name = obstack_strdup (&objfile->objfile_obstack, name);
}
/* Process a N_ECOMM symbol. */
void
2000-07-30 03:48:28 +02:00
common_block_end (struct objfile *objfile)
{
/* Symbols declared since the BCOMM are to have the common block
start address added in when we know it. common_block and
common_block_i point to the first symbol after the BCOMM in
the local_symbols list; copy the list and hang it off the
symbol for the common block name for later fixup. */
int i;
struct symbol *sym;
struct pending *newobj = 0;
struct pending *next;
int j;
if (common_block_name == NULL)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("ECOMM symbol unmatched by BCOMM"));
return;
}
sym = allocate_symbol (objfile);
/* Note: common_block_name already saved on objfile_obstack. */
sym->set_linkage_name (common_block_name);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
/* Now we copy all the symbols which have been defined since the BCOMM. */
/* Copy all the struct pendings before common_block. */
for (next = *get_local_symbols ();
next != NULL && next != common_block;
next = next->next)
{
for (j = 0; j < next->nsyms; j++)
add_symbol_to_list (next->symbol[j], &newobj);
}
/* Copy however much of COMMON_BLOCK we need. If COMMON_BLOCK is
NULL, it means copy all the local symbols (which we already did
above). */
if (common_block != NULL)
for (j = common_block_i; j < common_block->nsyms; j++)
add_symbol_to_list (common_block->symbol[j], &newobj);
SYMBOL_TYPE (sym) = (struct type *) newobj;
/* Should we be putting local_symbols back to what it was?
Does it matter? */
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
i = hashname (sym->linkage_name ());
SYMBOL_VALUE_CHAIN (sym) = global_sym_chain[i];
global_sym_chain[i] = sym;
common_block_name = NULL;
}
/* Add a common block's start address to the offset of each symbol
declared to be in it (by being between a BCOMM/ECOMM pair that uses
the common block name). */
static void
fix_common_block (struct symbol *sym, CORE_ADDR valu)
{
struct pending *next = (struct pending *) SYMBOL_TYPE (sym);
1999-07-07 22:19:36 +02:00
for (; next; next = next->next)
{
int j;
for (j = next->nsyms - 1; j >= 0; j--)
SET_SYMBOL_VALUE_ADDRESS (next->symbol[j],
SYMBOL_VALUE_ADDRESS (next->symbol[j])
+ valu);
}
}
1999-07-07 22:19:36 +02:00
/* Add {TYPE, TYPENUMS} to the NONAME_UNDEFS vector.
See add_undefined_type for more details. */
static void
add_undefined_type_noname (struct type *type, int typenums[2])
{
struct nat nat;
nat.typenums[0] = typenums [0];
nat.typenums[1] = typenums [1];
nat.type = type;
if (noname_undefs_length == noname_undefs_allocated)
{
noname_undefs_allocated *= 2;
noname_undefs = (struct nat *)
xrealloc ((char *) noname_undefs,
noname_undefs_allocated * sizeof (struct nat));
}
noname_undefs[noname_undefs_length++] = nat;
}
/* Add TYPE to the UNDEF_TYPES vector.
See add_undefined_type for more details. */
static void
add_undefined_type_1 (struct type *type)
{
if (undef_types_length == undef_types_allocated)
{
undef_types_allocated *= 2;
undef_types = (struct type **)
xrealloc ((char *) undef_types,
undef_types_allocated * sizeof (struct type *));
}
undef_types[undef_types_length++] = type;
}
/* What about types defined as forward references inside of a small lexical
scope? */
/* Add a type to the list of undefined types to be checked through
once this file has been read in.
In practice, we actually maintain two such lists: The first list
(UNDEF_TYPES) is used for types whose name has been provided, and
concerns forward references (eg 'xs' or 'xu' forward references);
the second list (NONAME_UNDEFS) is used for types whose name is
unknown at creation time, because they were referenced through
their type number before the actual type was declared.
This function actually adds the given type to the proper list. */
static void
add_undefined_type (struct type *type, int typenums[2])
{
Remove TYPE_TAG_NAME TYPE_TAG_NAME has been an occasional source of confusion and bugs. It seems to me that it is only useful for C and C++ -- but even there, not so much, because at least with DWARF there doesn't seem to be any way to wind up with a type where the name and the tag name are both non-NULL and different. So, this patch removes TYPE_TAG_NAME entirely. This should save a little memory, but more importantly, it simplifies this part of gdb. A few minor test suite adjustments were needed. In some situations the new code does not yield identical output to the old code. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (enum_constant_from_type, value_namespace_elt) (value_maybe_namespace_elt): Update. * valarith.c (find_size_for_pointer_math): Update. * target-descriptions.c (make_gdb_type): Update. * symmisc.c (print_symbol): Update. * stabsread.c (define_symbol, read_type) (complain_about_struct_wipeout, add_undefined_type) (cleanup_undefined_types_1): Update. * rust-lang.c (rust_tuple_type_p, rust_slice_type_p) (rust_range_type_p, val_print_struct, rust_print_struct_def) (rust_internal_print_type, rust_composite_type) (rust_evaluate_funcall, rust_evaluate_subexp) (rust_inclusive_range_type_p): Update. * python/py-type.c (typy_get_tag): Update. * p-typeprint.c (pascal_type_print_base): Update. * mdebugread.c (parse_symbol, parse_type): Update. * m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum): Update. * guile/scm-type.c (gdbscm_type_tag): Update. * go-lang.c (sixg_string_p): Update. * gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type): Update. * gdbtypes.h (struct main_type) <tag_name>: Remove. (TYPE_TAG_NAME): Remove. * gdbtypes.c (type_name_no_tag): Simplify. (check_typedef, check_types_equal, recursive_dump_type) (copy_type_recursive, arch_composite_type): Update. * f-typeprint.c (f_type_print_base): Update. Print "Type" prefix in summary mode when needed. * eval.c (evaluate_funcall): Update. * dwarf2read.c (fixup_go_packaging, read_structure_type) (process_structure_scope, read_enumeration_type) (read_namespace_type, read_module_type, determine_prefix): Update. * cp-support.c (inspect_type): Update. * coffread.c (process_coff_symbol, decode_base_type): Update. * c-varobj.c (c_is_path_expr_parent): Update. * c-typeprint.c (c_type_print_base_struct_union): Update. (c_type_print_base_1): Update. Print struct/class/union/enum in summary when using C language. * ax-gdb.c (gen_struct_ref, gen_namespace_elt) (gen_maybe_namespace_elt): Update. * ada-lang.c (ada_type_name): Simplify. (empty_record, ada_template_to_fixed_record_type_1) (template_to_static_fixed_type) (to_record_with_fixed_variant_part, ada_check_typedef): Update. gdb/testsuite/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * gdb.xml/tdesc-regs.exp (load_description): Update expected results. * gdb.dwarf2/method-ptr.exp: Set language to C++. * gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++. * gdb.cp/typeid.exp (do_typeid_tests): Update type_re. * gdb.base/maint.exp (maint_pass_if): Update.
2018-04-17 21:51:24 +02:00
if (TYPE_NAME (type) == NULL)
add_undefined_type_noname (type, typenums);
else
add_undefined_type_1 (type);
}
/* Try to fix all undefined types pushed on the UNDEF_TYPES vector. */
2008-02-21 Pedro Alves <pedro@codesorcery.com> Silence a few -Wmissing-prototypes warnings. PR build/9877: * amd64-nat.c: Include "amd64-nat.h". * fork-child.c (_initialize_fork_child): Ditto. * gcore.c (_initialize_gcore): Ditto. * inf-ptrace.c: Include "inf-ptrace.h". (inf_ptrace_store_registers): Make it static. * linux-nat.c (linux_nat_terminal_ours): Make it static. (_initialize_linux_nat): Declare before definition. * linux-tdep.c: Include "linux-tdep.h". * linux-thread-db.c (_initialize_thread_db): Declare before definition. * proc-service.c (_initialize_proc_service): Ditto. * remote.c (remote_send_printf): Make it static. * solib.c: Include "solib.h". * symfile-mem.c (_initialize_symfile_mem): Declare before definition. * ada-lang.c (ada_la_decode, ada_match_name) (ada_suppress_symbol_printing, ada_is_array_type) (ada_value_ptr_subscript, ada_array_length) (ada_to_static_fixed_value): Make them static. (_initialize_ada_language): Declare before definition. * ada-tasks.c (ada_get_task_number, ada_get_environment_task) (ada_task_list_changed, ada_new_objfile_observer): Make them static. (_initialize_tasks): Declare before definition. * addrmap.c (_initialize_addrmap): Declare before definition. * auxv.c (default_auxv_parse): Make it static. * bfd-target.c (target_bfd_xfer_partial, target_bfd_xclose): Make them static. * breakpoint.c (remove_sal): Add line break. (expand_line_sal_maybe): Make it static. * cp-name-parser.y: Include "cp-support.h". * cp-valprint.c (cp_find_class_member): Make it static. * eval.c (value_f90_subarray): Ditto. * exceptions.c (print_any_exception): Ditto. * findcmd.c (_initialize_mem_search): Declare before definition. * frame.c (frame_observer_target_changed): Make it static. * gnu-v3-abi.c (gnuv3_find_method_in): Make it static. * inf-child.c: Include "inf-child.h". * inferior.h (valid_inferior_id): Rename to ... (valid_gdb_inferior_id): ... this. * infrun.c (infrun_thread_stop_requested, siginfo_make_value): Make them static. * jv-lang.c (java_language_arch_info): Make it static. * m2-typeprint.c (m2_get_discrete_bounds): Ditto. * osdata.c (info_osdata_command): Make it static. * regcache.c (regcache_observer_target_changed): Make it static. * reverse.c (_initialize_reverse): Declare before definition. * stabsread.c (cleanup_undefined_types_noname) (cleanup_undefined_types_1): Make them static. * symfile.c (place_section): Make it static. * symtab.c (find_pc_sect_psymtab_closer): Make it static. * target-descriptions.c (_initialize_target_descriptions): Declare before definition. * target.c (default_get_ada_task_ptid, find_default_can_async_p) (find_default_is_async_p, find_default_supports_non_stop): Make them static. (target_supports_non_stop): Add prototype. (dummy_pid_to_str): Make it static. * utils.c (_initialize_utils): Declare before definition. * ada-exp.y (_initialize_ada_exp): Declare before definition. * solib-svr4.c (HAS_LM_DYNAMIC_FROM_LINK_MAP): Add a prototype. * target.h (struct target_ops): Add a prototype to the to_can_execute_reverse callback. * macroscope.c (_initialize_macroscope): Declare before definition. * cp-namespace.c (_initialize_cp_namespace): Declare before definition. * python/python.c (_initialize_python): Declare before definition. * tui/tui-command.c: Include "tui/tui-command.h". * tui/tui-data.c (init_content_element, init_win_info): Make them static. * tui/tui-disasm.c: Include "tui/tui-disasm.h". * tui/tui-interp.c (_initialize_tui_interp): Declare before definition. * tui/tui-layout.c: Include "tui/tui-layout.h". (_initialize_tui_layout): Declare before definition. * tui/tui-regs.c: Include "tui/tui-regs.h". (tui_display_reg_element_at_line): Make it static. (_initialize_tui_regs): Declare before definition. * tui/tui-stack.c (_initialize_tui_stack): Declare before definition. * tui/tui-win.c: Include "tui/tui-win.h". (_initialize_tui_win): Declare before definition. (tui_sigwinch_handler): Make it static. Wrap in ifdef SIGWINCH. * tui/tui-win.h (tui_sigwinch_handler): Delete declaration. (tui_get_cmd_list): Add a prototype. * tui/tui-windata.c: Include tui-windata.h. * tui/tui-wingeneral.c (box_win): Make it static. * cli/cli-logging.c (show_logging_command): Make it static. (_initialize_cli_logging): Declare before definition. * mi/mi-common.c (_initialize_gdb_mi_common): Declare before definition.
2009-02-21 17:14:50 +01:00
static void
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
cleanup_undefined_types_noname (struct objfile *objfile)
{
int i;
for (i = 0; i < noname_undefs_length; i++)
{
struct nat nat = noname_undefs[i];
struct type **type;
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
type = dbx_lookup_type (nat.typenums, objfile);
if (nat.type != *type && TYPE_CODE (*type) != TYPE_CODE_UNDEF)
{
/* The instance flags of the undefined type are still unset,
and needs to be copied over from the reference type.
Since replace_type expects them to be identical, we need
to set these flags manually before hand. */
TYPE_INSTANCE_FLAGS (nat.type) = TYPE_INSTANCE_FLAGS (*type);
replace_type (nat.type, *type);
}
}
noname_undefs_length = 0;
}
/* Go through each undefined type, see if it's still undefined, and fix it
up if possible. We have two kinds of undefined types:
TYPE_CODE_ARRAY: Array whose target type wasn't defined yet.
1999-07-07 22:19:36 +02:00
Fix: update array length using the element bounds
and the target type's length.
TYPE_CODE_STRUCT, TYPE_CODE_UNION: Structure whose fields were not
1999-07-07 22:19:36 +02:00
yet defined at the time a pointer to it was made.
Fix: Do a full lookup on the struct/union tag. */
2008-02-21 Pedro Alves <pedro@codesorcery.com> Silence a few -Wmissing-prototypes warnings. PR build/9877: * amd64-nat.c: Include "amd64-nat.h". * fork-child.c (_initialize_fork_child): Ditto. * gcore.c (_initialize_gcore): Ditto. * inf-ptrace.c: Include "inf-ptrace.h". (inf_ptrace_store_registers): Make it static. * linux-nat.c (linux_nat_terminal_ours): Make it static. (_initialize_linux_nat): Declare before definition. * linux-tdep.c: Include "linux-tdep.h". * linux-thread-db.c (_initialize_thread_db): Declare before definition. * proc-service.c (_initialize_proc_service): Ditto. * remote.c (remote_send_printf): Make it static. * solib.c: Include "solib.h". * symfile-mem.c (_initialize_symfile_mem): Declare before definition. * ada-lang.c (ada_la_decode, ada_match_name) (ada_suppress_symbol_printing, ada_is_array_type) (ada_value_ptr_subscript, ada_array_length) (ada_to_static_fixed_value): Make them static. (_initialize_ada_language): Declare before definition. * ada-tasks.c (ada_get_task_number, ada_get_environment_task) (ada_task_list_changed, ada_new_objfile_observer): Make them static. (_initialize_tasks): Declare before definition. * addrmap.c (_initialize_addrmap): Declare before definition. * auxv.c (default_auxv_parse): Make it static. * bfd-target.c (target_bfd_xfer_partial, target_bfd_xclose): Make them static. * breakpoint.c (remove_sal): Add line break. (expand_line_sal_maybe): Make it static. * cp-name-parser.y: Include "cp-support.h". * cp-valprint.c (cp_find_class_member): Make it static. * eval.c (value_f90_subarray): Ditto. * exceptions.c (print_any_exception): Ditto. * findcmd.c (_initialize_mem_search): Declare before definition. * frame.c (frame_observer_target_changed): Make it static. * gnu-v3-abi.c (gnuv3_find_method_in): Make it static. * inf-child.c: Include "inf-child.h". * inferior.h (valid_inferior_id): Rename to ... (valid_gdb_inferior_id): ... this. * infrun.c (infrun_thread_stop_requested, siginfo_make_value): Make them static. * jv-lang.c (java_language_arch_info): Make it static. * m2-typeprint.c (m2_get_discrete_bounds): Ditto. * osdata.c (info_osdata_command): Make it static. * regcache.c (regcache_observer_target_changed): Make it static. * reverse.c (_initialize_reverse): Declare before definition. * stabsread.c (cleanup_undefined_types_noname) (cleanup_undefined_types_1): Make them static. * symfile.c (place_section): Make it static. * symtab.c (find_pc_sect_psymtab_closer): Make it static. * target-descriptions.c (_initialize_target_descriptions): Declare before definition. * target.c (default_get_ada_task_ptid, find_default_can_async_p) (find_default_is_async_p, find_default_supports_non_stop): Make them static. (target_supports_non_stop): Add prototype. (dummy_pid_to_str): Make it static. * utils.c (_initialize_utils): Declare before definition. * ada-exp.y (_initialize_ada_exp): Declare before definition. * solib-svr4.c (HAS_LM_DYNAMIC_FROM_LINK_MAP): Add a prototype. * target.h (struct target_ops): Add a prototype to the to_can_execute_reverse callback. * macroscope.c (_initialize_macroscope): Declare before definition. * cp-namespace.c (_initialize_cp_namespace): Declare before definition. * python/python.c (_initialize_python): Declare before definition. * tui/tui-command.c: Include "tui/tui-command.h". * tui/tui-data.c (init_content_element, init_win_info): Make them static. * tui/tui-disasm.c: Include "tui/tui-disasm.h". * tui/tui-interp.c (_initialize_tui_interp): Declare before definition. * tui/tui-layout.c: Include "tui/tui-layout.h". (_initialize_tui_layout): Declare before definition. * tui/tui-regs.c: Include "tui/tui-regs.h". (tui_display_reg_element_at_line): Make it static. (_initialize_tui_regs): Declare before definition. * tui/tui-stack.c (_initialize_tui_stack): Declare before definition. * tui/tui-win.c: Include "tui/tui-win.h". (_initialize_tui_win): Declare before definition. (tui_sigwinch_handler): Make it static. Wrap in ifdef SIGWINCH. * tui/tui-win.h (tui_sigwinch_handler): Delete declaration. (tui_get_cmd_list): Add a prototype. * tui/tui-windata.c: Include tui-windata.h. * tui/tui-wingeneral.c (box_win): Make it static. * cli/cli-logging.c (show_logging_command): Make it static. (_initialize_cli_logging): Declare before definition. * mi/mi-common.c (_initialize_gdb_mi_common): Declare before definition.
2009-02-21 17:14:50 +01:00
static void
cleanup_undefined_types_1 (void)
{
struct type **type;
/* Iterate over every undefined type, and look for a symbol whose type
matches our undefined type. The symbol matches if:
1. It is a typedef in the STRUCT domain;
2. It has the same name, and same type code;
3. The instance flags are identical.
It is important to check the instance flags, because we have seen
examples where the debug info contained definitions such as:
"foo_t:t30=B31=xefoo_t:"
In this case, we have created an undefined type named "foo_t" whose
instance flags is null (when processing "xefoo_t"), and then created
another type with the same name, but with different instance flags
('B' means volatile). I think that the definition above is wrong,
since the same type cannot be volatile and non-volatile at the same
time, but we need to be able to cope with it when it happens. The
approach taken here is to treat these two types as different. */
for (type = undef_types; type < undef_types + undef_types_length; type++)
{
switch (TYPE_CODE (*type))
{
1999-07-07 22:19:36 +02:00
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
case TYPE_CODE_ENUM:
{
/* Check if it has been defined since. Need to do this here
as well as in check_typedef to deal with the (legitimate in
C though not C++) case of several types with the same name
in different source files. */
if (TYPE_STUB (*type))
{
struct pending *ppt;
int i;
/* Name of the type, without "struct" or "union". */
Remove TYPE_TAG_NAME TYPE_TAG_NAME has been an occasional source of confusion and bugs. It seems to me that it is only useful for C and C++ -- but even there, not so much, because at least with DWARF there doesn't seem to be any way to wind up with a type where the name and the tag name are both non-NULL and different. So, this patch removes TYPE_TAG_NAME entirely. This should save a little memory, but more importantly, it simplifies this part of gdb. A few minor test suite adjustments were needed. In some situations the new code does not yield identical output to the old code. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (enum_constant_from_type, value_namespace_elt) (value_maybe_namespace_elt): Update. * valarith.c (find_size_for_pointer_math): Update. * target-descriptions.c (make_gdb_type): Update. * symmisc.c (print_symbol): Update. * stabsread.c (define_symbol, read_type) (complain_about_struct_wipeout, add_undefined_type) (cleanup_undefined_types_1): Update. * rust-lang.c (rust_tuple_type_p, rust_slice_type_p) (rust_range_type_p, val_print_struct, rust_print_struct_def) (rust_internal_print_type, rust_composite_type) (rust_evaluate_funcall, rust_evaluate_subexp) (rust_inclusive_range_type_p): Update. * python/py-type.c (typy_get_tag): Update. * p-typeprint.c (pascal_type_print_base): Update. * mdebugread.c (parse_symbol, parse_type): Update. * m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum): Update. * guile/scm-type.c (gdbscm_type_tag): Update. * go-lang.c (sixg_string_p): Update. * gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type): Update. * gdbtypes.h (struct main_type) <tag_name>: Remove. (TYPE_TAG_NAME): Remove. * gdbtypes.c (type_name_no_tag): Simplify. (check_typedef, check_types_equal, recursive_dump_type) (copy_type_recursive, arch_composite_type): Update. * f-typeprint.c (f_type_print_base): Update. Print "Type" prefix in summary mode when needed. * eval.c (evaluate_funcall): Update. * dwarf2read.c (fixup_go_packaging, read_structure_type) (process_structure_scope, read_enumeration_type) (read_namespace_type, read_module_type, determine_prefix): Update. * cp-support.c (inspect_type): Update. * coffread.c (process_coff_symbol, decode_base_type): Update. * c-varobj.c (c_is_path_expr_parent): Update. * c-typeprint.c (c_type_print_base_struct_union): Update. (c_type_print_base_1): Update. Print struct/class/union/enum in summary when using C language. * ax-gdb.c (gen_struct_ref, gen_namespace_elt) (gen_maybe_namespace_elt): Update. * ada-lang.c (ada_type_name): Simplify. (empty_record, ada_template_to_fixed_record_type_1) (template_to_static_fixed_type) (to_record_with_fixed_variant_part, ada_check_typedef): Update. gdb/testsuite/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * gdb.xml/tdesc-regs.exp (load_description): Update expected results. * gdb.dwarf2/method-ptr.exp: Set language to C++. * gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++. * gdb.cp/typeid.exp (do_typeid_tests): Update type_re. * gdb.base/maint.exp (maint_pass_if): Update.
2018-04-17 21:51:24 +02:00
const char *type_name = TYPE_NAME (*type);
if (type_name == NULL)
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("need a type name"));
break;
}
for (ppt = *get_file_symbols (); ppt; ppt = ppt->next)
{
for (i = 0; i < ppt->nsyms; i++)
{
struct symbol *sym = ppt->symbol[i];
1999-07-07 22:19:36 +02:00
if (SYMBOL_CLASS (sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN
&& (TYPE_CODE (SYMBOL_TYPE (sym)) ==
TYPE_CODE (*type))
&& (TYPE_INSTANCE_FLAGS (*type) ==
TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym)))
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
&& strcmp (sym->linkage_name (), type_name) == 0)
replace_type (*type, SYMBOL_TYPE (sym));
}
}
}
}
break;
default:
{
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("forward-referenced types left unresolved, "
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
"type code %d."),
2002-12-17 01:39:08 +01:00
TYPE_CODE (*type));
}
break;
}
}
undef_types_length = 0;
}
[gdb] Fix more typos in comments (2) Fix typos in comments. NFC. Tested on x86_64-linux. gdb/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * aarch64-linux-tdep.c: Fix typos in comments. * aarch64-tdep.c: Same. * ada-lang.c: Same. * amd64-nat.c: Same. * arc-tdep.c: Same. * arch/aarch64-insn.c: Same. * block.c: Same. * breakpoint.h: Same. * btrace.h: Same. * c-varobj.c: Same. * cli/cli-decode.c: Same. * cli/cli-script.c: Same. * cli/cli-utils.h: Same. * coff-pe-read.c: Same. * coffread.c: Same. * compile/compile-cplus-symbols.c: Same. * compile/compile-object-run.c: Same. * completer.c: Same. * corelow.c: Same. * cp-support.c: Same. * demangle.c: Same. * dwarf-index-write.c: Same. * dwarf2-frame.c: Same. * dwarf2-frame.h: Same. * eval.c: Same. * frame-base.h: Same. * frame.h: Same. * gdbcmd.h: Same. * gdbtypes.h: Same. * gnu-nat.c: Same. * guile/scm-objfile.c: Same. * i386-tdep.c: Same. * i386-tdep.h: Same. * infcall.c: Same. * infcall.h: Same. * linux-nat.c: Same. * m68k-tdep.c: Same. * macroexp.c: Same. * memattr.c: Same. * mi/mi-cmd-disas.c: Same. * mi/mi-getopt.h: Same. * mi/mi-main.c: Same. * minsyms.c: Same. * nat/aarch64-sve-linux-sigcontext.h: Same. * objfiles.h: Same. * ppc-linux-nat.c: Same. * ppc-linux-tdep.c: Same. * ppc-tdep.h: Same. * progspace.h: Same. * prologue-value.h: Same. * python/py-evtregistry.c: Same. * python/py-instruction.h: Same. * record-btrace.c: Same. * record-full.c: Same. * remote.c: Same. * rs6000-tdep.c: Same. * ser-tcp.c: Same. * sol-thread.c: Same. * sparc-sol2-tdep.c: Same. * sparc64-tdep.c: Same. * stabsread.c: Same. * symfile.c: Same. * symtab.h: Same. * target.c: Same. * tracepoint.c: Same. * tui/tui-data.h: Same. * tui/tui-io.c: Same. * tui/tui-win.c: Same. * tui/tui.c: Same. * unittests/rsp-low-selftests.c: Same. * user-regs.h: Same. * utils.c: Same. * utils.h: Same. * valarith.c: Same. * valops.c: Same. * valprint.c: Same. * valprint.h: Same. * value.c: Same. * value.h: Same. * varobj.c: Same. * x86-nat.h: Same. * xtensa-tdep.c: Same. gdb/gdbserver/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * linux-aarch64-low.c: Fix typos in comments. * linux-arm-low.c: Same. * linux-low.c: Same. * linux-ppc-low.c: Same. * proc-service.c: Same. * regcache.h: Same. * server.c: Same. * tracepoint.c: Same. * win32-low.c: Same. gdb/stubs/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * ia64vms-stub.c: Fix typos in comments. * m32r-stub.c: Same. * m68k-stub.c: Same. * sh-stub.c: Same. gdb/testsuite/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * gdb.base/bigcore.c: Fix typos in comments. * gdb.base/ctf-ptype.c: Same. * gdb.base/long_long.c: Same. * gdb.dwarf2/dw2-op-out-param.S: Same. * gdb.python/py-evthreads.c: Same. * gdb.reverse/i387-stack-reverse.c: Same. * gdb.trace/tfile.c: Same. * lib/compiler.c: Same. * lib/compiler.cc: Same. Change-Id: I8573d84a577894270179ae30f46c48d806fc1beb
2019-10-26 09:55:32 +02:00
/* Try to fix all the undefined types we encountered while processing
this unit. */
void
cleanup_undefined_stabs_types (struct objfile *objfile)
{
cleanup_undefined_types_1 ();
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr, nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
2009-06-29 15:18:37 +02:00
cleanup_undefined_types_noname (objfile);
}
/* See stabsread.h. */
void
2000-07-30 03:48:28 +02:00
scan_file_globals (struct objfile *objfile)
{
int hash;
struct symbol *sym, *prev;
struct objfile *resolve_objfile;
/* SVR4 based linkers copy referenced global symbols from shared
libraries to the main executable.
If we are scanning the symbols for a shared library, try to resolve
them from the minimal symbols of the main executable first. */
if (symfile_objfile && objfile != symfile_objfile)
resolve_objfile = symfile_objfile;
else
resolve_objfile = objfile;
while (1)
{
/* Avoid expensive loop through all minimal symbols if there are
1999-07-07 22:19:36 +02:00
no unresolved symbols. */
for (hash = 0; hash < HASHSIZE; hash++)
{
if (global_sym_chain[hash])
break;
}
if (hash >= HASHSIZE)
return;
for (minimal_symbol *msymbol : resolve_objfile->msymbols ())
{
QUIT;
/* Skip static symbols. */
switch (MSYMBOL_TYPE (msymbol))
{
case mst_file_text:
case mst_file_data:
case mst_file_bss:
continue;
default:
break;
}
prev = NULL;
/* Get the hash index and check all the symbols
under that hash index. */
Replace the MSYMBOL_*_NAME macros with member functions Improves readability. In the future, it will also allow making the name private, once the name setter functions become member functions. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_lookup_simple_minsym): Update. (ada_collect_symbol_completion_matches): Update. * ada-tasks.c (read_atcb): Update. * amd64-windows-tdep.c (amd64_skip_main_prologue): Update. (amd64_windows_skip_trampoline_code): Update. * arm-tdep.c (skip_prologue_function): Update. (arm_skip_stack_protector): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. (arm_wince_skip_main_prologue): Update. * ax-gdb.c (gen_expr): Update. * block.c (call_site_for_pc): Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (set_breakpoint_location_function): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * c-valprint.c (print_unpacked_pointer): Update. * coffread.c (coff_symfile_read): Update. * compile/compile-c-symbols.c (convert_symbol_bmsym): Update. * compile/compile-cplus-symbols.c (convert_symbol_bmsym): Update. * dwarf-index-write.c (write_psymbols): Update. * dwarf2loc.c (call_site_to_target_addr): Update. (func_verify_no_selftailcall): Update. (tailcall_dump): Update. (call_site_find_chain_1): Update. (dwarf_expr_reg_to_entry_parameter): Update. * elfread.c (elf_gnu_ifunc_record_cache): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. (evaluate_subexp_for_sizeof): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * frame.c (get_prev_frame_always_1): Update. * frv-tdep.c (frv_skip_main_prologue): Update. * gnu-v2-abi.c (gnuv2_value_rtti_type): Update. * gnu-v3-abi.c (gnuv3_rtti_type): Update. (gnuv3_get_typename_from_type_info): Update. (gnuv3_skip_trampoline): Update. * hppa-tdep.c (hppa_lookup_stub_minimal_symbol): Update. * i386-tdep.c (i386_skip_main_prologue): Update. (i386_pe_skip_trampoline_code): Update. * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Update. * infcall.c (get_function_name): Update. * linespec.c (minsym_found): Update. * linux-fork.c (info_checkpoints_command): Update. * m32c-tdep.c (m32c_m16c_address_to_pointer): Update. (m32c_m16c_pointer_to_address): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (add_minsym_to_hash_table): Update. (add_minsym_to_demangled_hash_table): Update. (lookup_minimal_symbol_mangled): Update. (lookup_minimal_symbol_demangled): Update. (lookup_minimal_symbol_linkage): Update. (lookup_minimal_symbol_text): Update. (lookup_minimal_symbol_by_pc_name): Update. (minimal_symbol_is_less_than): Update. (compact_minimal_symbols): Update. (build_minimal_symbol_hash_tables): Update. (find_solib_trampoline_target): Update. * mips-tdep.c (mips_stub_frame_sniffer): Update. (mips_skip_pic_trampoline_code): Update. * msp430-tdep.c (msp430_skip_trampoline_code): Update. * objc-lang.c (info_selectors_command): Update. (info_classes_command): Update. (find_methods): Update. (find_imps): Update. * p-valprint.c (pascal_val_print): Update. * ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * printcmd.c (build_address_symbolic): Update. (info_symbol_command): Update. * psymtab.c (psymbol_name_matches): Update. (match_partial_symbol): Update. (lookup_partial_symbol): Update. (print_partial_symbols): Update. (sort_pst_symbols): Update. (maintenance_check_psymtabs): Update. * python/py-framefilter.c (py_print_frame): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rs6000-tdep.c (rs6000_skip_main_prologue): Update. (rs6000_skip_trampoline_code): Update. * sol-thread.c (info_cb): Update. * stabsread.c (scan_file_globals): Update. * stack.c (find_frame_funname): Update. (info_frame_command_core): Update. * symmisc.c (dump_msymbols): Update. * symtab.c (symbol_natural_name): Rename to.., (general_symbol_info::natural_name): ...this. (symbol_demangled_name): Rename to... (general_symbol_info::demangled_name): ...this. (symbol_search_name): Rename to... (general_symbol_info::search_name): ...this. (symbol_matches_search_name): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (search_symbols): Update. (print_msymbol_info): Update. (rbreak_command): Update. (completion_list_add_msymbol): Update. (completion_list_objc_symbol): Update. (get_msymbol_address): Update. * symtab.h (struct general_symbol_info): Add member functions natural_name (), linkage_name (), print_name (), demangled_name (), and search_name (). (SYMBOL_NATURAL_NAME): Update. (symbol_natural_name): Move to a member function on general_symbol_info. (SYMBOL_DEMANGLED_NAME): Update. (symbol_demangled_name): Move to a member function on general_symbol_info. (SYMBOL_SEARCH_NAME): Update. (symbol_search_name): Move to a member function on general_symbol_info. (MSYMBOL_NATURAL_NAME): Remove. (MSYMBOL_LINKAGE_NAME): Remove. (MSYMBOL_PRINT_NAME): Remove. (MSYMBOL_DEMANGLED_NAME): Remove. (MSYMBOL_SEARCH_NAME): Remove. * x86-tdep.c (x86_in_indirect_branch_thunk): Update. Change-Id: I65aa529843a9903e174ce799037e41f954a9fcee
2019-11-22 19:05:14 +01:00
hash = hashname (msymbol->linkage_name ());
for (sym = global_sym_chain[hash]; sym;)
{
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
if (strcmp (msymbol->linkage_name (), sym->linkage_name ()) == 0)
{
/* Splice this symbol out of the hash chain and
assign the value we have to it. */
if (prev)
{
SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
}
else
{
global_sym_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
}
1999-07-07 22:19:36 +02:00
/* Check to see whether we need to fix up a common block. */
/* Note: this code might be executed several times for
the same symbol if there are multiple references. */
if (sym)
{
if (SYMBOL_CLASS (sym) == LOC_BLOCK)
{
fix_common_block (sym,
start change to progspace independence This patch starts changing minimal symbols to be independent of the program space. Specifically, it adds a new objfile parameter to MSYMBOL_VALUE_ADDRESS and changes all the code to use it. This is needed so we can change gdb to apply the section offset when a minsym's address is computed, as opposed to baking the offsets into the symbol itself. A few spots still need the unrelocated address. For these, we introduce MSYMBOL_VALUE_RAW_ADDRESS. As a convenience, we also add the new macro BMSYMBOL_VALUE_ADDRESS, which computes the address of a bound minimal symbol. This just does the obvious thing with the fields. Note that this change does not actually enable program space independence. That requires more changes to gdb. However, to ensure that these changes compile properly, this patch does add the needed section lookup code to MSYMBOL_VALUE_ADDRESS -- it just ensures it has no effect at runtime by multiplying the offset by 0. 2014-02-26 Tom Tromey <tromey@redhat.com> * ada-lang.c (ada_main_name): Update. (ada_add_standard_exceptions): Update. * ada-tasks.c (ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * arm-tdep.c (skip_prologue_function, arm_skip_stub): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * blockframe.c (get_pc_function_start) (find_pc_partial_function_gnu_ifunc): Update. * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * c-valprint.c (c_val_print): Update. * coff-pe-read.c (add_pe_forwarded_sym): Update. * common/agent.c (agent_look_up_symbols): Update. * dbxread.c (find_stab_function_addr, end_psymtab): Update. * dwarf2loc.c (call_site_to_target_addr): Update. * dwarf2read.c (dw2_find_pc_sect_symtab): Update. * elfread.c (elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Update. * findvar.c (default_read_var_value): Update. * frame.c (inside_main_func): Update. * frv-tdep.c (frv_frame_this_id): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v3-abi.c (gnuv3_get_typeid, gnuv3_skip_trampoline): Update. * hppa-hpux-tdep.c (hppa64_hpux_search_dummy_call_sequence) (hppa_hpux_find_dummy_bpaddr): Update. * hppa-tdep.c (hppa_symbol_address): Update. * infcmd.c (until_next_command): Update. * jit.c (jit_read_descriptor, jit_breakpoint_re_set_internal): Update. * linespec.c (minsym_found, add_minsym): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update. * m32c-tdep.c (m32c_return_value) (m32c_m16c_address_to_pointer): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (lookup_minimal_symbol_by_pc_name): Update. (frob_address): New function. (lookup_minimal_symbol_by_pc_section_1): Use raw addresses, frob_address. Rename parameter to "pc_in". (compare_minimal_symbols, compact_minimal_symbols): Use raw addresses. (find_solib_trampoline_target, minimal_symbol_upper_bound): Update. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * mips-tdep.c (mips_skip_pic_trampoline_code): Update. * objc-lang.c (find_objc_msgsend): Update. * objfiles.c (objfile_relocate1): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-valprint.c (pascal_val_print): Update. * parse.c (write_exp_msymbol): Update. * ppc-linux-tdep.c (ppc_linux_spe_context_lookup) (ppc_elfv2_skip_entrypoint): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * printcmd.c (build_address_symbolic, msym_info) (address_info): Update. * proc-service.c (ps_pglobal_lookup): Update. * psymtab.c (find_pc_sect_psymtab_closer) (find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Change msymbol parameter to bound_minimal_symbol. * ravenscar-thread.c (get_running_thread_id): Update. * remote.c (remote_check_symbols): Update. * sh64-tdep.c (sh64_elf_make_msymbol_special): Use raw address. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base, main_got): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook) (link_map_start): Update. * solib-spu.c (spu_enable_break, ocl_enable_break): Update. * solib-svr4.c (elf_locate_base, enable_break): Update. * spu-tdep.c (spu_get_overlay_table, spu_catch_start) (flush_ea_cache): Update. * stabsread.c (define_symbol, scan_file_globals): Update. * stack.c (find_frame_funname): Update. * symfile-debug.c (debug_qf_expand_symtabs_matching) (debug_qf_find_pc_sect_symtab): Update. * symfile.c (simple_read_overlay_table) (simple_overlay_update): Update. * symfile.h (struct quick_symbol_functions) <find_pc_sect_symtab>: Change type of msymbol to bound_minimal_symbol. * symmisc.c (dump_msymbols): Update. * symtab.c (find_pc_sect_symtab_via_partial) (find_pc_sect_psymtab, find_pc_sect_line, skip_prologue_sal) (search_symbols, print_msymbol_info): Update. * symtab.h (MSYMBOL_VALUE_RAW_ADDRESS): New macro. (MSYMBOL_VALUE_ADDRESS): Redefine. (BMSYMBOL_VALUE_ADDRESS): New macro. * tracepoint.c (scope_info): Update. * tui/tui-disasm.c (tui_find_disassembly_address) (tui_get_begin_asm_address): Update. * valops.c (find_function_in_inferior): Update. * value.c (value_static_field, value_fn_field): Update.
2013-08-15 16:46:35 +02:00
MSYMBOL_VALUE_ADDRESS (resolve_objfile,
msymbol));
}
else
{
SET_SYMBOL_VALUE_ADDRESS
(sym, MSYMBOL_VALUE_ADDRESS (resolve_objfile,
msymbol));
}
change minsym representation In a later patch we're going to change the minimal symbol address calculation to apply section offsets at the point of use. To make it simpler to catch potential problem spots, this patch changes the representation of minimal symbols and introduces new minimal-symbol-specific variants of the various accessors. This is necessary because it would be excessively ambitious to try to convert all the symbol types at once. The core of this change is just renaming a field in minimal_symbol; the rest is just a fairly mechanical rewording. 2014-02-26 Tom Tromey <tromey@redhat.com> * symtab.h (struct minimal_symbol) <mginfo>: Rename from ginfo. (MSYMBOL_VALUE, MSYMBOL_VALUE_ADDRESS, MSYMBOL_VALUE_BYTES) (MSYMBOL_BLOCK_VALUE, MSYMBOL_VALUE_CHAIN, MSYMBOL_LANGUAGE) (MSYMBOL_SECTION, MSYMBOL_OBJ_SECTION, MSYMBOL_NATURAL_NAME) (MSYMBOL_LINKAGE_NAME, MSYMBOL_PRINT_NAME, MSYMBOL_DEMANGLED_NAME) (MSYMBOL_SET_LANGUAGE, MSYMBOL_SEARCH_NAME) (MSYMBOL_MATCHES_SEARCH_NAME, MSYMBOL_SET_NAMES): New macros. * ada-lang.c (ada_main_name): Update. (ada_lookup_simple_minsym): Update. (ada_make_symbol_completion_list): Update. (ada_add_standard_exceptions): Update. * ada-tasks.c (read_atcb, ada_tasks_inferior_data_sniffer): Update. * aix-thread.c (pdc_symbol_addrs, pd_enable): Update. * amd64-windows-tdep.c (amd64_skip_main_prologue): Update. * arm-tdep.c (skip_prologue_function): Update. (arm_skip_stack_protector, arm_skip_stub): Update. * arm-wince-tdep.c (arm_pe_skip_trampoline_code): Update. (arm_wince_skip_main_prologue): Update. * auxv.c (ld_so_xfer_auxv): Update. * avr-tdep.c (avr_scan_prologue): Update. * ax-gdb.c (gen_var_ref): Update. * block.c (call_site_for_pc): Update. * blockframe.c (get_pc_function_start): Update. (find_pc_partial_function_gnu_ifunc): Update. * breakpoint.c (create_overlay_event_breakpoint): Update. (create_longjmp_master_breakpoint): Update. (create_std_terminate_master_breakpoint): Update. (create_exception_master_breakpoint): Update. (resolve_sal_pc): Update. * bsd-uthread.c (bsd_uthread_lookup_address): Update. * btrace.c (ftrace_print_function_name, ftrace_function_switched): Update. * c-valprint.c (c_val_print): Update. * coff-pe-read.c (add_pe_forwarded_sym): Update. * coffread.c (coff_symfile_read): Update. * common/agent.c (agent_look_up_symbols): Update. * dbxread.c (find_stab_function_addr): Update. (end_psymtab): Update. * dwarf2loc.c (call_site_to_target_addr): Update. (func_verify_no_selftailcall): Update. (tailcall_dump): Update. (call_site_find_chain_1): Update. (dwarf_expr_reg_to_entry_parameter): Update. * elfread.c (elf_gnu_ifunc_record_cache): Update. (elf_gnu_ifunc_resolve_by_got): Update. * f-valprint.c (info_common_command): Update. * findvar.c (read_var_value): Update. * frame.c (get_prev_frame_1): Update. (inside_main_func): Update. * frv-tdep.c (frv_skip_main_prologue): Update. (frv_frame_this_id): Update. * glibc-tdep.c (glibc_skip_solib_resolver): Update. * gnu-v2-abi.c (gnuv2_value_rtti_type): Update. * gnu-v3-abi.c (gnuv3_rtti_type): Update. (gnuv3_skip_trampoline): Update. * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline): Update. (hppa64_hpux_in_solib_call_trampoline): Update. (hppa_hpux_skip_trampoline_code): Update. (hppa64_hpux_search_dummy_call_sequence): Update. (hppa_hpux_find_import_stub_for_addr): Update. (hppa_hpux_find_dummy_bpaddr): Update. * hppa-tdep.c (hppa_symbol_address) (hppa_lookup_stub_minimal_symbol): Update. * i386-tdep.c (i386_skip_main_prologue): Update. (i386_pe_skip_trampoline_code): Update. * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Update. * infcall.c (get_function_name): Update. * infcmd.c (until_next_command): Update. * jit.c (jit_breakpoint_re_set_internal): Update. (jit_inferior_init): Update. * linespec.c (minsym_found): Update. (add_minsym): Update. * linux-fork.c (info_checkpoints_command): Update. * linux-nat.c (get_signo): Update. * linux-thread-db.c (inferior_has_bug): Update. * m32c-tdep.c (m32c_return_value): Update. (m32c_m16c_address_to_pointer): Update. (m32c_m16c_pointer_to_address): Update. * m32r-tdep.c (m32r_frame_this_id): Update. * m68hc11-tdep.c (m68hc11_get_register_info): Update. * machoread.c (macho_resolve_oso_sym_with_minsym): Update. * maint.c (maintenance_translate_address): Update. * minsyms.c (add_minsym_to_hash_table): Update. (add_minsym_to_demangled_hash_table): Update. (msymbol_objfile): Update. (lookup_minimal_symbol): Update. (iterate_over_minimal_symbols): Update. (lookup_minimal_symbol_text): Update. (lookup_minimal_symbol_by_pc_name): Update. (lookup_minimal_symbol_solib_trampoline): Update. (lookup_minimal_symbol_by_pc_section_1): Update. (lookup_minimal_symbol_and_objfile): Update. (prim_record_minimal_symbol_full): Update. (compare_minimal_symbols): Update. (compact_minimal_symbols): Update. (build_minimal_symbol_hash_tables): Update. (install_minimal_symbols): Update. (terminate_minimal_symbol_table): Update. (find_solib_trampoline_target): Update. (minimal_symbol_upper_bound): Update. * mips-linux-tdep.c (mips_linux_skip_resolver): Update. * mips-tdep.c (mips_stub_frame_sniffer): Update. (mips_skip_pic_trampoline_code): Update. * msp430-tdep.c (msp430_skip_trampoline_code): Update. * objc-lang.c (selectors_info): Update. (classes_info): Update. (find_methods): Update. (find_imps): Update. (find_objc_msgsend): Update. * objfiles.c (objfile_relocate1): Update. * objfiles.h (ALL_OBJFILE_MSYMBOLS): Update. * obsd-tdep.c (obsd_skip_solib_resolver): Update. * p-valprint.c (pascal_val_print): Update. * parse.c (write_exp_msymbol): Update. * ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code) (ppc_linux_spe_context_lookup, ppc_elfv2_skip_entrypoint): Update. * ppc-sysv-tdep.c (convert_code_addr_to_desc_addr): Update. * printcmd.c (build_address_symbolic): Update. (sym_info): Update. (address_info): Update. * proc-service.c (ps_pglobal_lookup): Update. * psymtab.c (find_pc_sect_psymtab_closer): Update. (find_pc_sect_psymtab): Update. * python/py-framefilter.c (py_print_frame): Update. * ravenscar-thread.c (get_running_thread_id): Update. * record-btrace.c (btrace_call_history, btrace_get_bfun_name): Update. * remote.c (remote_check_symbols): Update. * rs6000-tdep.c (rs6000_skip_main_prologue): Update. (rs6000_skip_trampoline_code): Update. * sh64-tdep.c (sh64_elf_make_msymbol_special): Update. * sol2-tdep.c (sol2_skip_solib_resolver): Update. * solib-dsbt.c (lm_base): Update. * solib-frv.c (lm_base): Update. (main_got): Update. * solib-irix.c (locate_base): Update. * solib-som.c (som_solib_create_inferior_hook): Update. (som_solib_desire_dynamic_linker_symbols): Update. (link_map_start): Update. * solib-spu.c (spu_enable_break): Update. (ocl_enable_break): Update. * solib-svr4.c (elf_locate_base): Update. (enable_break): Update. * spu-tdep.c (spu_get_overlay_table): Update. (spu_catch_start): Update. (flush_ea_cache): Update. * stabsread.c (define_symbol): Update. (scan_file_globals): Update. * stack.c (find_frame_funname): Update. (frame_info): Update. * symfile.c (simple_read_overlay_table): Update. (simple_overlay_update): Update. * symmisc.c (dump_msymbols): Update. * symtab.c (fixup_section): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (search_symbols): Update. (print_msymbol_info): Update. (rbreak_command): Update. (MCOMPLETION_LIST_ADD_SYMBOL): New macro. (completion_list_objc_symbol): Update. (default_make_symbol_completion_list_break_on): Update. * tracepoint.c (scope_info): Update. * tui/tui-disasm.c (tui_find_disassembly_address): Update. (tui_get_begin_asm_address): Update. * valops.c (find_function_in_inferior): Update. * value.c (value_static_field): Update. (value_fn_field): Update.
2013-08-15 16:43:43 +02:00
SYMBOL_SECTION (sym) = MSYMBOL_SECTION (msymbol);
}
if (prev)
{
sym = SYMBOL_VALUE_CHAIN (prev);
}
else
{
sym = global_sym_chain[hash];
}
}
else
{
prev = sym;
sym = SYMBOL_VALUE_CHAIN (sym);
}
}
}
if (resolve_objfile == objfile)
break;
resolve_objfile = objfile;
}
/* Change the storage class of any remaining unresolved globals to
LOC_UNRESOLVED and remove them from the chain. */
for (hash = 0; hash < HASHSIZE; hash++)
{
sym = global_sym_chain[hash];
while (sym)
{
prev = sym;
sym = SYMBOL_VALUE_CHAIN (sym);
/* Change the symbol address from the misleading chain value
to address zero. */
SET_SYMBOL_VALUE_ADDRESS (prev, 0);
/* Complain about unresolved common block symbols. */
if (SYMBOL_CLASS (prev) == LOC_STATIC)
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
SYMBOL_ACLASS_INDEX (prev) = LOC_UNRESOLVED;
else
Remove symfile_complaints The complaint system seems to allow for multiple different complaint topics. However, in practice only symfile_complaints has ever been defined. Seeing that complaints.c dates to 1992, and that no new complaints have been added in the intervening years, I think it is reasonable to admit that complaints are specifically related to debuginfo reading. This patch removes symfile_complaints and updates all the callers. Some of these spots should perhaps be calls to warning instead, but I did not make that change. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (clear_complaints, vcomplaint): Remove "c" parameter. (get_complaints): Remove. * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint) (dwarf2_debug_line_missing_file_complaint) (dwarf2_debug_line_missing_end_sequence_complaint) (dwarf2_complex_location_expr_complaint) (dwarf2_const_value_length_mismatch_complaint) (dwarf2_section_buffer_overflow_complaint) (dwarf2_macro_malformed_definition_complaint) (dwarf2_invalid_attrib_class_complaint) (create_addrmap_from_index, dw2_symtab_iter_next) (dw2_expand_marked_cus) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next) (create_debug_type_hash_table, init_cutu_and_read_dies) (partial_die_parent_scope, add_partial_enumeration) (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die) (dwarf2_compute_name, dwarf2_physname, read_namespace_alias) (read_import_statement, read_file_scope, create_dwo_cu_reader) (create_cus_hash_table, create_dwp_hash_table) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_rnglists_process, dwarf2_ranges_process) (dwarf2_add_type_defn, dwarf2_attach_fields_to_type) (dwarf2_add_member_fn, get_alignment, maybe_set_alignment) (handle_struct_member_die, process_structure_scope) (read_array_type, read_common_block, read_module_type) (read_tag_pointer_type, read_typedef, read_base_type) (read_subrange_type, load_partial_dies, partial_die_info::read) (partial_die_info::read, partial_die_info::read) (partial_die_info::read, read_checked_initial_length_and_offset) (dwarf2_string_attr, read_formatted_entries) (dwarf_decode_line_header) (lnp_state_machine::check_line_address, dwarf_decode_lines_1) (new_symbol, dwarf2_const_value_attr, lookup_die_type) (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset) (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes) (get_signatured_type, get_DW_AT_signature_type) (decode_locdesc, file_file_name, consume_improper_spaces) (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header) (dwarf_decode_macro_bytes, dwarf_decode_macros) (dwarf2_symbol_mark_computed, set_die_type) (read_attribute_value): Update. * stap-probe.c (handle_stap_probe, get_stap_base_address): Update. * dbxread.c (unknown_symtype_complaint) (lbrac_mismatch_complaint, repeated_header_complaint) (set_namestring, function_outside_compilation_unit_complaint) (read_dbx_symtab, process_one_symbol): Update. * gdbtypes.c (stub_noname_complaint): Update. * windows-nat.c (handle_unload_dll): Update. * coffread.c (coff_symtab_read, enter_linenos, decode_type) (decode_base_type): Update. * xcoffread.c (bf_notfound_complaint, ef_complaint) (eb_complaint, record_include_begin, record_include_end) (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab) (process_xcoff_symbol, read_symbol) (function_outside_compilation_unit_complaint) (scan_xcoff_symtab): Update. * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update. * buildsym.c (finish_block_internal, make_blockvector) (end_symtab_get_static_block, augment_type_symtab): Update. * dtrace-probe.c (dtrace_process_dof) (dtrace_static_probe_ops::get_probes): Update. * complaints.h (struct complaint): Don't declare. (symfile_complaints): Remove. (complaint_internal): Remove "complaints" parameter. (complaint): Likewise. (clear_complaints): Likewise. * symfile.c (syms_from_objfile_1, finish_new_objfile) (reread_symbols): Update. * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program) (dwarf2_frame_cache, decode_frame_entry): Update. * dwarf2loc.c (dwarf_reg_to_regnum): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (info_selectors_command): Update. * macrotab.c (macro_include, check_for_redefinition) (macro_undef): Update. * objfiles.c (filter_overlapping_sections): Update. * stabsread.c (invalid_cpp_abbrev_complaint) (reg_value_complaint, stabs_general_complaint, dbx_lookup_type) (define_symbol, error_type, read_type, rs6000_builtin_type) (stabs_method_name_from_physname, read_member_functions) (read_cpp_abbrev, read_baseclasses, read_tilde_fields) (attach_fields_to_type, complain_about_struct_wipeout) (read_range_type, read_args, common_block_start) (common_block_end, cleanup_undefined_types_1, scan_file_globals): Update. * mdebugread.c (index_complaint, unknown_ext_complaint) (basic_type_complaint, bad_tag_guess_complaint) (bad_rfd_entry_complaint, unexpected_type_code_complaint) (reg_value_complaint, parse_symbol, parse_type, upgrade_type) (parse_procedure, parse_lines) (function_outside_compilation_unit_complaint) (parse_partial_symbols, psymtab_to_symtab_1, cross_ref) (bad_tag_guess_complaint, reg_value_complaint): Update. * cp-support.c (demangled_name_complaint): Update. * macroscope.c (sal_macro_scope): Update. * dwarf-index-write.c (class debug_names): Update. gdb/testsuite/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * gdb.gdb/complaints.exp (test_initial_complaints): Don't mention symfile_complaints. (test_short_complaints): Likewise. (test_empty_complaints): Likewise. (test_initial_complaints): Update.
2018-05-17 06:54:44 +02:00
complaint (_("%s: common block `%s' from "
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
"global_sym_chain unresolved"),
Replace SYMBOL_*_NAME accessors with member functions Similar to the MSYMBOL version of this patch, improves readability and will eventually allow making name private. gdb/ChangeLog: 2019-11-22 Christian Biesinger <cbiesinger@google.com> * ada-exp.y: Update. * ada-lang.c (sort_choices): Update. (ada_print_symbol_signature): Update. (resolve_subexp): Update. (ada_parse_renaming): Update. (ada_read_renaming_var_value): Update. (lesseq_defined_than): Update. (remove_extra_symbols): Update. (remove_irrelevant_renamings): Update. (ada_add_block_symbols): Update. (ada_collect_symbol_completion_matches): Update. (ada_is_renaming_symbol): Update. (aggregate_assign_from_choices): Update. (ada_evaluate_subexp): Update. (ada_has_this_exception_support): Update. (ada_is_non_standard_exception_sym): Update. (ada_add_exceptions_from_frame): Update. (ada_add_global_exceptions): Update. (ada_print_subexp): Update. * ax-gdb.c (gen_var_ref): Update. (gen_maybe_namespace_elt): Update. (gen_expr_for_cast): Update. (gen_expr): Update. * block.h: Update. * blockframe.c (find_pc_partial_function): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update. * btrace.c (ftrace_print_function_name): Update. (ftrace_function_switched): Update. * buildsym.c (find_symbol_in_list): Update. * c-exp.y: Update. * c-typeprint.c (c_print_typedef): Update. (c_type_print_template_args): Update. * cli/cli-cmds.c (edit_command): Update. (list_command): Update. (print_sal_location): Update. * coffread.c (patch_opaque_types): Update. (process_coff_symbol): Update. (coff_read_enum_type): Update. * compile/compile-c-symbols.c (c_symbol_substitution_name): Update. (convert_one_symbol): Update. (hash_symname): Update. (eq_symname): Update. * compile/compile-cplus-symbols.c (convert_one_symbol): Update. * compile/compile-cplus-types.c (debug_print_scope): Update. * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update. * compile/compile-object-load.c (get_out_value_type): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. (search_symbol_list): Update. (cp_lookup_symbol_imports_or_template): Update. * cp-support.c (overload_list_add_symbol): Update. * ctfread.c (psymtab_to_symtab): Update. * dbxread.c (cp_set_block_scope): Update. * dictionary.c (iter_match_first_hashed): Update. (iter_match_next_hashed): Update. (insert_symbol_hashed): Update. (iter_match_next_linear): Update. * dictionary.h: Update. * dwarf2loc.c (func_get_frame_base_dwarf_block): Update. (locexpr_describe_location_piece): Update. (locexpr_describe_location_1): Update. (locexpr_generate_c_location): Update. (loclist_describe_location): Update. (loclist_generate_c_location): Update. * dwarf2read.c (dw2_debug_names_lookup_symbol): Update. (read_func_scope): Update. (process_enumeration_scope): Update. (new_symbol): Update. (dwarf2_const_value): Update. (dwarf2_symbol_mark_computed): Update. * eval.c (evaluate_funcall): Update. (evaluate_subexp_standard): Update. * expprint.c (print_subexp_standard): Update. (dump_subexp_body_standard): Update. * f-valprint.c (info_common_command_for_block): Update. * findvar.c (get_hosting_frame): Update. (default_read_var_value): Update. * go-lang.c (go_symbol_package_name): Update. * guile/scm-block.c (bkscm_print_block_smob): Update. * guile/scm-symbol.c (syscm_print_symbol_smob): Update. (gdbscm_symbol_name): Update. (gdbscm_symbol_linkage_name): Update. (gdbscm_symbol_print_name): Update. * infcall.c (get_function_name): Update. * infcmd.c (jump_command): Update. (finish_command): Update. * infrun.c (insert_exception_resume_breakpoint): Update. * linespec.c (canonicalize_linespec): Update. (create_sals_line_offset): Update. (convert_linespec_to_sals): Update. (complete_label): Update. (find_label_symbols_in_block): Update. * m2-typeprint.c (m2_print_typedef): Update. * mdebugread.c (mdebug_reg_to_regnum): Update. (parse_symbol): Update. (mylookup_symbol): Update. * mi/mi-cmd-stack.c (list_arg_or_local): Update. (list_args_or_locals): Update. * objc-lang.c (compare_selectors): Update. (info_selectors_command): Update. (compare_classes): Update. (info_classes_command): Update. (find_imps): Update. * p-typeprint.c (pascal_print_typedef): Update. * printcmd.c (build_address_symbolic): Update. (info_address_command): Update. (print_variable_and_value): Update. * python/py-framefilter.c (extract_sym): Update. (py_print_single_arg): Update. * python/py-symbol.c (sympy_str): Update. (sympy_get_name): Update. (sympy_get_linkage_name): Update. * python/python.c (gdbpy_rbreak): Update. * record-btrace.c (btrace_get_bfun_name): Update. (btrace_call_history): Update. * rust-lang.c (rust_print_typedef): Update. * solib-frv.c (frv_fdpic_find_canonical_descriptor): Update. * stabsread.c (stab_reg_to_regnum): Update. (define_symbol): Update. (read_enum_type): Update. (common_block_end): Update. (cleanup_undefined_types_1): Update. (scan_file_globals): Update. * stack.c (print_frame_arg): Update. (print_frame_args): Update. (find_frame_funname): Update. (info_frame_command_core): Update. (iterate_over_block_locals): Update. (print_block_frame_labels): Update. (do_print_variable_and_value): Update. (iterate_over_block_arg_vars): Update. (return_command): Update. * symmisc.c (dump_symtab_1): Update. (print_symbol): Update. * symtab.c (eq_symbol_entry): Update. (symbol_cache_dump): Update. (lookup_language_this): Update. (find_pc_sect_line): Update. (skip_prologue_sal): Update. (symbol_search::compare_search_syms): Update. (treg_matches_sym_type_name): Update. (search_symbols): Update. (print_symbol_info): Update. (rbreak_command): Update. (completion_list_add_symbol): Update. (find_gnu_ifunc): Update. (get_symbol_address): Update. (search_module_symbols): Update. (info_module_subcommand): Update. * symtab.h (SYMBOL_NATURAL_NAME): Remove. (SYMBOL_LINKAGE_NAME): Remove. (SYMBOL_DEMANGLED_NAME): Remove. (SYMBOL_PRINT_NAME): Remove. (SYMBOL_SEARCH_NAME): Remove. * tracepoint.c (set_traceframe_context): Update. (validate_actionline): Update. (collection_list::collect_symbol): Update. (encode_actions_1): Update. (info_scope_command): Update. (print_one_static_tracepoint_marker): Update. * typeprint.c (typedef_hash_table::add_template_parameters): Update. * valops.c (address_of_variable): Update. (find_overload_match): Update. (find_oload_champ): Update. Change-Id: I76bdc8b44eea6876bf03af9d351f8e90cc0154b2
2019-11-22 19:05:14 +01:00
objfile_name (objfile), prev->print_name ());
}
}
memset (global_sym_chain, 0, sizeof (global_sym_chain));
}
/* Initialize anything that needs initializing when starting to read
a fresh piece of a symbol file, e.g. reading in the stuff corresponding
to a psymtab. */
void
2000-07-30 03:48:28 +02:00
stabsread_init (void)
{
}
/* Initialize anything that needs initializing when a completely new
symbol file is specified (not just adding some symbols from another
file, e.g. a shared library). */
void
2000-07-30 03:48:28 +02:00
stabsread_new_init (void)
{
/* Empty the hash table of global syms looking for values. */
memset (global_sym_chain, 0, sizeof (global_sym_chain));
}
/* Initialize anything that needs initializing at the same time as
start_symtab() is called. */
1999-07-07 22:19:36 +02:00
void
2000-07-30 03:48:28 +02:00
start_stabs (void)
{
global_stabs = NULL; /* AIX COFF */
/* Leave FILENUM of 0 free for builtin types and this file's types. */
n_this_object_header_files = 1;
type_vector_length = 0;
type_vector = (struct type **) 0;
within_function = 0;
/* FIXME: If common_block_name is not already NULL, we should complain(). */
common_block_name = NULL;
}
/* Call after end_symtab(). */
1999-07-07 22:19:36 +02:00
void
2000-07-30 03:48:28 +02:00
end_stabs (void)
{
if (type_vector)
{
2000-12-15 02:01:51 +01:00
xfree (type_vector);
}
type_vector = 0;
type_vector_length = 0;
previous_stab_code = 0;
}
void
2000-07-30 03:48:28 +02:00
finish_global_stabs (struct objfile *objfile)
{
if (global_stabs)
{
patch_block_stabs (*get_global_symbols (), global_stabs, objfile);
2000-12-15 02:01:51 +01:00
xfree (global_stabs);
global_stabs = NULL;
}
}
/* Find the end of the name, delimited by a ':', but don't match
ObjC symbols which look like -[Foo bar::]:bla. */
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
static const char *
find_name_end (const char *name)
{
-Wwrite-strings: The Rest This is the remainder boring constification that all looks more of less borderline obvious IMO. gdb/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * ada-exp.y (yyerror): Constify. * ada-lang.c (bound_name, get_selections) (ada_variant_discrim_type) (ada_variant_discrim_name, ada_value_struct_elt) (ada_lookup_struct_elt_type, is_unchecked_variant) (ada_which_variant_applies, standard_exc, ada_get_next_arg) (catch_ada_exception_command_split) (catch_ada_assert_command_split, catch_assert_command) (ada_op_name): Constify. * ada-lang.h (ada_yyerror, get_selections) (ada_variant_discrim_name, ada_value_struct_elt): Constify. * arc-tdep.c (arc_print_frame_cache): Constify. * arm-tdep.c (arm_skip_stub): Constify. * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref) (gen_aggregate_elt_ref): Constify. * bcache.c (print_bcache_statistics): Constify. * bcache.h (print_bcache_statistics): Constify. * break-catch-throw.c (catch_exception_command_1): * breakpoint.c (struct ep_type_description::description): Constify. (add_solib_catchpoint): Constify. (catch_fork_command_1): Add cast. (add_catch_command): Constify. * breakpoint.h (add_catch_command, add_solib_catchpoint): Constify. * bsd-uthread.c (bsd_uthread_state): Constify. * buildsym.c (patch_subfile_names): Constify. * buildsym.h (next_symbol_text_func, patch_subfile_names): Constify. * c-exp.y (yyerror): Constify. (token::oper): Constify. * c-lang.h (c_yyerror, cp_print_class_member): Constify. * c-varobj.c (cplus_describe_child): Constify. * charset.c (find_charset_names): Add cast. (find_charset_names): Constify array and add const_cast. * cli/cli-cmds.c (complete_command, cd_command): Constify. (edit_command): Constify. * cli/cli-decode.c (lookup_cmd): Constify. * cli/cli-dump.c (dump_memory_command, dump_value_command): Constify. (struct dump_context): Constify. (add_dump_command, restore_command): Constify. * cli/cli-script.c (get_command_line): Constify. * cli/cli-script.h (get_command_line): Constify. * cli/cli-utils.c (check_for_argument): Constify. * cli/cli-utils.h (check_for_argument): Constify. * coff-pe-read.c (struct read_pe_section_data): Constify. * command.h (lookup_cmd): Constify. * common/print-utils.c (decimal2str): Constify. * completer.c (gdb_print_filename): Constify. * corefile.c (set_gnutarget): Constify. * cp-name-parser.y (yyerror): Constify. * cp-valprint.c (cp_print_class_member): Constify. * cris-tdep.c (cris_register_name, crisv32_register_name): Constify. * d-exp.y (yyerror): Constify. (struct token::oper): Constify. * d-lang.h (d_yyerror): Constify. * dbxread.c (struct header_file_location::name): Constify. (add_old_header_file, add_new_header_file, last_function_name) (dbx_next_symbol_text, add_bincl_to_list) (find_corresponding_bincl_psymtab, set_namestring) (find_stab_function_addr, read_dbx_symtab, start_psymtab) (dbx_end_psymtab, read_ofile_symtab, process_one_symbol): * defs.h (command_line_input, print_address_symbolic) (deprecated_readline_begin_hook): Constify. * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name): Constify. * event-top.c (handle_line_of_input): Constify and add cast. * exceptions.c (catch_errors): Constify. * exceptions.h (catch_errors): Constify. * expprint.c (print_subexp_standard, op_string, op_name) (op_name_standard, dump_raw_expression, dump_raw_expression): * expression.h (op_name, op_string, dump_raw_expression): Constify. * f-exp.y (yyerror): Constify. (struct token::oper): Constify. (struct f77_boolean_val::name): Constify. * f-lang.c (f_word_break_characters): Constify. * f-lang.h (f_yyerror): Constify. * fork-child.c (fork_inferior): Add cast. * frv-tdep.c (struct gdbarch_tdep::register_names): Constify. (new_variant): Constify. * gdbarch.sh (pstring_ptr, pstring_list): Constify. * gdbarch.c: Regenerate. * gdbcore.h (set_gnutarget): Constify. * go-exp.y (yyerror): Constify. (token::oper): Constify. * go-lang.h (go_yyerror): Constify. * go32-nat.c (go32_sysinfo): Constify. * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify. * guile/scm-cmd.c (cmdscm_function): Constify. * guile/scm-param.c (pascm_param_value): Constify. * h8300-tdep.c (h8300_register_name, h8300s_register_name) (h8300sx_register_name): Constify. * hppa-tdep.c (hppa32_register_name, hppa64_register_name): Constify. * ia64-tdep.c (ia64_register_names): Constify. * infcmd.c (construct_inferior_arguments): Constify. (path_command, attach_post_wait): Constify. * language.c (show_range_command, show_case_command) (unk_lang_error): Constify. * language.h (language_defn::la_error) (language_defn::la_name_of_this): Constify. * linespec.c (decode_line_2): Constify. * linux-thread-db.c (thread_db_err_str): Constify. * lm32-tdep.c (lm32_register_name): Constify. * m2-exp.y (yyerror): Constify. * m2-lang.h (m2_yyerror): Constify. * m32r-tdep.c (m32r_register_names): Constify and make static. * m68hc11-tdep.c (m68hc11_register_names): Constify. * m88k-tdep.c (m88k_register_name): Constify. * macroexp.c (appendmem): Constify. * mdebugread.c (fdr_name, add_data_symbol, parse_type) (upgrade_type, parse_external, parse_partial_symbols) (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab) (new_symbol): Constify. * memattr.c (mem_info_command): Constify. * mep-tdep.c (register_name_from_keyword): Constify. * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env): Constify. * mi/mi-cmd-stack.c (list_args_or_locals): Constify. * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify. * mi/mi-main.c (captured_mi_execute_command): Constify and add cast. (mi_execute_async_cli_command): Constify. * mips-tdep.c (mips_register_name): Constify. * mn10300-tdep.c (register_name, mn10300_generic_register_name) (am33_register_name, am33_2_register_name) * moxie-tdep.c (moxie_register_names): Constify. * nat/linux-osdata.c (osdata_type): Constify fields. * nto-tdep.c (nto_parse_redirection): Constify. * objc-lang.c (lookup_struct_typedef, lookup_objc_class) (lookup_child_selector): Constify. (objc_methcall::name): Constify. * objc-lang.h (lookup_objc_class, lookup_child_selector) (lookup_struct_typedef): Constify. * objfiles.c (pc_in_section): Constify. * objfiles.h (pc_in_section): Constify. * p-exp.y (struct token::oper): Constify. (yyerror): Constify. * p-lang.h (pascal_yyerror): Constify. * parser-defs.h (op_name_standard): Constify. (op_print::string): Constify. (exp_descriptor::op_name): Constify. * printcmd.c (print_address_symbolic): Constify. * psymtab.c (print_partial_symbols): Constify. * python/py-breakpoint.c (stop_func): Constify. (bppy_get_expression): Constify. * python/py-cmd.c (cmdpy_completer::name): Constify. (cmdpy_function): Constify. * python/py-event.c (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-event.h (evpy_add_attribute) (gdbpy_initialize_event_generic): Constify. * python/py-evts.c (add_new_registry): Constify. * python/py-finishbreakpoint.c (outofscope_func): Constify. * python/py-framefilter.c (get_py_iter_from_func): Constify. * python/py-inferior.c (get_buffer): Add cast. * python/py-param.c (parm_constant::name): Constify. * python/py-unwind.c (fprint_frame_id): Constify. * python/python.c (gdbpy_parameter_value): Constify. * remote-fileio.c (remote_fio_func_map): Make 'name' const. * remote.c (memory_packet_config::name): Constify. (show_packet_config_cmd, remote_write_bytes) (remote_buffer_add_string): * reverse.c (exec_reverse_once): Constify. * rs6000-tdep.c (variant::name, variant::description): Constify. * rust-exp.y (rustyyerror): Constify. * rust-lang.c (rust_op_name): Constify. * rust-lang.h (rustyyerror): Constify. * serial.h (serial_ops::name): Constify. * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name) (sh_sh3e_register_name, sh_sh2e_register_name) (sh_sh2a_register_name, sh_sh2a_nofpu_register_name) (sh_sh_dsp_register_name, sh_sh3_dsp_register_name) (sh_sh4_register_name, sh_sh4_nofpu_register_name) (sh_sh4al_dsp_register_name): Constify. * sh64-tdep.c (sh64_register_name): Constify. * solib-darwin.c (lookup_symbol_from_bfd): Constify. * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify. * stabsread.c (patch_block_stabs, read_type_number) (ref_map::stabs, ref_add, process_reference) (symbol_reference_defined, define_symbol, define_symbol) (error_type, read_type, read_member_functions, read_cpp_abbrev) (read_one_struct_field, read_struct_fields, read_baseclasses) (read_tilde_fields, read_struct_type, read_array_type) (read_enum_type, read_sun_builtin_type, read_sun_floating_type) (read_huge_number, read_range_type, read_args, common_block_start) (find_name_end): Constify. * stabsread.h (common_block_start, define_symbol) (process_one_symbol, symbol_reference_defined, ref_add): * symfile.c (get_section_index, add_symbol_file_command): * symfile.h (get_section_index): Constify. * target-descriptions.c (tdesc_type::name): Constify. (tdesc_free_type): Add cast. * target.c (find_default_run_target): (add_deprecated_target_alias, find_default_run_target) (target_announce_detach): Constify. (do_option): Constify. * target.h (add_deprecated_target_alias): Constify. * thread.c (print_thread_info_1): Constify. * top.c (deprecated_readline_begin_hook, command_line_input): Constify. (init_main): Add casts. * top.h (handle_line_of_input): Constify. * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify. * tracepoint.c (tvariables_info_1, trace_status_mi): Constify. (tfind_command): Rename to ... (tfind_command_1): ... this and constify. (tfind_command): New function. (tfind_end_command, tfind_start_command): Adjust. (encode_source_string): Constify. * tracepoint.h (encode_source_string): Constify. * tui/tui-data.c (tui_partial_win_by_name): Constify. * tui/tui-data.h (tui_partial_win_by_name): Constify. * tui/tui-source.c (tui_set_source_content_nil): Constify. * tui/tui-source.h (tui_set_source_content_nil): Constify. * tui/tui-win.c (parse_scrolling_args): Constify. * tui/tui-windata.c (tui_erase_data_content): Constify. * tui/tui-windata.h (tui_erase_data_content): Constify. * tui/tui-winsource.c (tui_erase_source_content): Constify. * tui/tui.c (tui_enable): Add cast. * utils.c (defaulted_query): Constify. (init_page_info): Add cast. (puts_debug, subset_compare): Constify. * utils.h (subset_compare): Constify. * varobj.c (varobj_format_string): Constify. * varobj.h (varobj_format_string): Constify. * vax-tdep.c (vax_register_name): Constify. * windows-nat.c (windows_detach): Constify. * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify. * xml-support.c (gdb_xml_end_element): Constify. * xml-tdesc.c (tdesc_start_reg): Constify. * xstormy16-tdep.c (xstormy16_register_name): Constify. * xtensa-tdep.c (xtensa_find_register_by_name): Constify. * xtensa-tdep.h (xtensa_register_t::name): Constify. gdb/gdbserver/ChangeLog: 2017-04-05 Pedro Alves <palves@redhat.com> * gdbreplay.c (sync_error): Constify. * linux-x86-low.c (push_opcode): Constify.
2017-04-05 20:21:37 +02:00
const char *s = name;
if (s[0] == '-' || *s == '+')
{
/* Must be an ObjC method symbol. */
if (s[1] != '[')
{
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("invalid symbol name \"%s\""), name);
}
s = strchr (s, ']');
if (s == NULL)
{
2005-02-10 Andrew Cagney <cagney@gnu.org> Mark up all error and warning messages. * ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update. * bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update. * core-aout.c, core-regset.c, corefile.c, corelow.c: Update. * cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update. * dbxread.c, demangle.c, doublest.c, dsrec.c: Update. * dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update. * dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update. * event-top.c, exec.c, expprint.c, f-lang.c: Update. * f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update. * frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update. * gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update. * hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update. * hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update. * hpread.c, hpux-thread.c, i386-linux-nat.c: Update. * i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update. * i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update. * ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update. * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update. * inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update. * kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update. * linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update. * m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update. * m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update. * maint.c, mdebugread.c, mem-break.c, memattr.c: Update. * mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update. * nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update. * observer.c, ocd.c, p-lang.c, p-typeprint.c: Update. * p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update. * ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update. * remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update. * remote-rdp.c, remote-sim.c, remote-st.c: Update. * remote-utils.c, remote-utils.h, remote.c: Update. * rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update. * ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update. * sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update. * solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update. * solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update. * somread.c, somsolib.c, source.c, stabsread.c: Update. * stack.c, std-regs.c, symfile-mem.c, symfile.c: Update. * symmisc.c, symtab.c, target.c, thread.c, top.c: Update. * tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update. * uw-thread.c, valarith.c, valops.c, valprint.c: Update. * value.c, varobj.c, version.in, win32-nat.c, wince.c: Update. * xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update. * cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update. * cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update. * mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update. * mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update. * mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update. * tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
error (_("invalid symbol name \"%s\""), name);
}
return strchr (s, ':');
}
else
{
return strchr (s, ':');
}
}
/* See stabsread.h. */
int
hashname (const char *name)
{
return fast_hash (name, strlen (name)) % HASHSIZE;
}
/* Initializer for this module. */
gdb: add back declarations for _initialize functions I'd like to enable the -Wmissing-declarations warning. However, it warns for every _initialize function, for example: CXX dcache.o /home/smarchi/src/binutils-gdb/gdb/dcache.c: In function ‘void _initialize_dcache()’: /home/smarchi/src/binutils-gdb/gdb/dcache.c:688:1: error: no previous declaration for ‘void _initialize_dcache()’ [-Werror=missing-declarations] _initialize_dcache (void) ^~~~~~~~~~~~~~~~~~ The only practical way forward I found is to add back the declarations, which were removed by this commit: commit 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9 Author: John Baldwin <jhb@FreeBSD.org> Date: Sat Sep 9 11:02:37 2017 -0700 Remove unnecessary function prototypes. I don't think it's a big problem to have the declarations for these functions, but if anybody has a better solution for this, I'll be happy to use it. gdb/ChangeLog: * aarch64-fbsd-nat.c (_initialize_aarch64_fbsd_nat): Add declaration. * aarch64-fbsd-tdep.c (_initialize_aarch64_fbsd_tdep): Add declaration. * aarch64-linux-nat.c (_initialize_aarch64_linux_nat): Add declaration. * aarch64-linux-tdep.c (_initialize_aarch64_linux_tdep): Add declaration. * aarch64-newlib-tdep.c (_initialize_aarch64_newlib_tdep): Add declaration. * aarch64-tdep.c (_initialize_aarch64_tdep): Add declaration. * ada-exp.y (_initialize_ada_exp): Add declaration. * ada-lang.c (_initialize_ada_language): Add declaration. * ada-tasks.c (_initialize_tasks): Add declaration. * agent.c (_initialize_agent): Add declaration. * aix-thread.c (_initialize_aix_thread): Add declaration. * alpha-bsd-nat.c (_initialize_alphabsd_nat): Add declaration. * alpha-linux-nat.c (_initialize_alpha_linux_nat): Add declaration. * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add declaration. * alpha-nbsd-tdep.c (_initialize_alphanbsd_tdep): Add declaration. * alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Add declaration. * alpha-tdep.c (_initialize_alpha_tdep): Add declaration. * amd64-darwin-tdep.c (_initialize_amd64_darwin_tdep): Add declaration. * amd64-dicos-tdep.c (_initialize_amd64_dicos_tdep): Add declaration. * amd64-fbsd-nat.c (_initialize_amd64fbsd_nat): Add declaration. * amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Add declaration. * amd64-linux-nat.c (_initialize_amd64_linux_nat): Add declaration. * amd64-linux-tdep.c (_initialize_amd64_linux_tdep): Add declaration. * amd64-nbsd-nat.c (_initialize_amd64nbsd_nat): Add declaration. * amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Add declaration. * amd64-obsd-nat.c (_initialize_amd64obsd_nat): Add declaration. * amd64-obsd-tdep.c (_initialize_amd64obsd_tdep): Add declaration. * amd64-sol2-tdep.c (_initialize_amd64_sol2_tdep): Add declaration. * amd64-tdep.c (_initialize_amd64_tdep): Add declaration. * amd64-windows-nat.c (_initialize_amd64_windows_nat): Add declaration. * amd64-windows-tdep.c (_initialize_amd64_windows_tdep): Add declaration. * annotate.c (_initialize_annotate): Add declaration. * arc-newlib-tdep.c (_initialize_arc_newlib_tdep): Add declaration. * arc-tdep.c (_initialize_arc_tdep): Add declaration. * arch-utils.c (_initialize_gdbarch_utils): Add declaration. * arm-fbsd-nat.c (_initialize_arm_fbsd_nat): Add declaration. * arm-fbsd-tdep.c (_initialize_arm_fbsd_tdep): Add declaration. * arm-linux-nat.c (_initialize_arm_linux_nat): Add declaration. * arm-linux-tdep.c (_initialize_arm_linux_tdep): Add declaration. * arm-nbsd-nat.c (_initialize_arm_netbsd_nat): Add declaration. * arm-nbsd-tdep.c (_initialize_arm_netbsd_tdep): Add declaration. * arm-obsd-tdep.c (_initialize_armobsd_tdep): Add declaration. * arm-pikeos-tdep.c (_initialize_arm_pikeos_tdep): Add declaration. * arm-symbian-tdep.c (_initialize_arm_symbian_tdep): Add declaration. * arm-tdep.c (_initialize_arm_tdep): Add declaration. * arm-wince-tdep.c (_initialize_arm_wince_tdep): Add declaration. * auto-load.c (_initialize_auto_load): Add declaration. * auxv.c (_initialize_auxv): Add declaration. * avr-tdep.c (_initialize_avr_tdep): Add declaration. * ax-gdb.c (_initialize_ax_gdb): Add declaration. * bfin-linux-tdep.c (_initialize_bfin_linux_tdep): Add declaration. * bfin-tdep.c (_initialize_bfin_tdep): Add declaration. * break-catch-sig.c (_initialize_break_catch_sig): Add declaration. * break-catch-syscall.c (_initialize_break_catch_syscall): Add declaration. * break-catch-throw.c (_initialize_break_catch_throw): Add declaration. * breakpoint.c (_initialize_breakpoint): Add declaration. * bsd-uthread.c (_initialize_bsd_uthread): Add declaration. * btrace.c (_initialize_btrace): Add declaration. * charset.c (_initialize_charset): Add declaration. * cli/cli-cmds.c (_initialize_cli_cmds): Add declaration. * cli/cli-dump.c (_initialize_cli_dump): Add declaration. * cli/cli-interp.c (_initialize_cli_interp): Add declaration. * cli/cli-logging.c (_initialize_cli_logging): Add declaration. * cli/cli-script.c (_initialize_cli_script): Add declaration. * cli/cli-style.c (_initialize_cli_style): Add declaration. * coff-pe-read.c (_initialize_coff_pe_read): Add declaration. * coffread.c (_initialize_coffread): Add declaration. * compile/compile-cplus-types.c (_initialize_compile_cplus_types): Add declaration. * compile/compile.c (_initialize_compile): Add declaration. * complaints.c (_initialize_complaints): Add declaration. * completer.c (_initialize_completer): Add declaration. * copying.c (_initialize_copying): Add declaration. * corefile.c (_initialize_core): Add declaration. * corelow.c (_initialize_corelow): Add declaration. * cp-abi.c (_initialize_cp_abi): Add declaration. * cp-namespace.c (_initialize_cp_namespace): Add declaration. * cp-support.c (_initialize_cp_support): Add declaration. * cp-valprint.c (_initialize_cp_valprint): Add declaration. * cris-linux-tdep.c (_initialize_cris_linux_tdep): Add declaration. * cris-tdep.c (_initialize_cris_tdep): Add declaration. * csky-linux-tdep.c (_initialize_csky_linux_tdep): Add declaration. * csky-tdep.c (_initialize_csky_tdep): Add declaration. * ctfread.c (_initialize_ctfread): Add declaration. * d-lang.c (_initialize_d_language): Add declaration. * darwin-nat-info.c (_initialize_darwin_info_commands): Add declaration. * darwin-nat.c (_initialize_darwin_nat): Add declaration. * dbxread.c (_initialize_dbxread): Add declaration. * dcache.c (_initialize_dcache): Add declaration. * disasm-selftests.c (_initialize_disasm_selftests): Add declaration. * disasm.c (_initialize_disasm): Add declaration. * dtrace-probe.c (_initialize_dtrace_probe): Add declaration. * dummy-frame.c (_initialize_dummy_frame): Add declaration. * dwarf-index-cache.c (_initialize_index_cache): Add declaration. * dwarf-index-write.c (_initialize_dwarf_index_write): Add declaration. * dwarf2-frame-tailcall.c (_initialize_tailcall_frame): Add declaration. * dwarf2-frame.c (_initialize_dwarf2_frame): Add declaration. * dwarf2expr.c (_initialize_dwarf2expr): Add declaration. * dwarf2loc.c (_initialize_dwarf2loc): Add declaration. * dwarf2read.c (_initialize_dwarf2_read): Add declaration. * elfread.c (_initialize_elfread): Add declaration. * exec.c (_initialize_exec): Add declaration. * extension.c (_initialize_extension): Add declaration. * f-lang.c (_initialize_f_language): Add declaration. * f-valprint.c (_initialize_f_valprint): Add declaration. * fbsd-nat.c (_initialize_fbsd_nat): Add declaration. * fbsd-tdep.c (_initialize_fbsd_tdep): Add declaration. * filesystem.c (_initialize_filesystem): Add declaration. * findcmd.c (_initialize_mem_search): Add declaration. * findvar.c (_initialize_findvar): Add declaration. * fork-child.c (_initialize_fork_child): Add declaration. * frame-base.c (_initialize_frame_base): Add declaration. * frame-unwind.c (_initialize_frame_unwind): Add declaration. * frame.c (_initialize_frame): Add declaration. * frv-linux-tdep.c (_initialize_frv_linux_tdep): Add declaration. * frv-tdep.c (_initialize_frv_tdep): Add declaration. * ft32-tdep.c (_initialize_ft32_tdep): Add declaration. * gcore.c (_initialize_gcore): Add declaration. * gdb-demangle.c (_initialize_gdb_demangle): Add declaration. * gdb_bfd.c (_initialize_gdb_bfd): Add declaration. * gdbarch-selftests.c (_initialize_gdbarch_selftests): Add declaration. * gdbarch.c (_initialize_gdbarch): Add declaration. * gdbtypes.c (_initialize_gdbtypes): Add declaration. * gnu-nat.c (_initialize_gnu_nat): Add declaration. * gnu-v2-abi.c (_initialize_gnu_v2_abi): Add declaration. * gnu-v3-abi.c (_initialize_gnu_v3_abi): Add declaration. * go-lang.c (_initialize_go_language): Add declaration. * go32-nat.c (_initialize_go32_nat): Add declaration. * guile/guile.c (_initialize_guile): Add declaration. * h8300-tdep.c (_initialize_h8300_tdep): Add declaration. * hppa-linux-nat.c (_initialize_hppa_linux_nat): Add declaration. * hppa-linux-tdep.c (_initialize_hppa_linux_tdep): Add declaration. * hppa-nbsd-nat.c (_initialize_hppanbsd_nat): Add declaration. * hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Add declaration. * hppa-obsd-nat.c (_initialize_hppaobsd_nat): Add declaration. * hppa-obsd-tdep.c (_initialize_hppabsd_tdep): Add declaration. * hppa-tdep.c (_initialize_hppa_tdep): Add declaration. * i386-bsd-nat.c (_initialize_i386bsd_nat): Add declaration. * i386-cygwin-tdep.c (_initialize_i386_cygwin_tdep): Add declaration. * i386-darwin-nat.c (_initialize_i386_darwin_nat): Add declaration. * i386-darwin-tdep.c (_initialize_i386_darwin_tdep): Add declaration. * i386-dicos-tdep.c (_initialize_i386_dicos_tdep): Add declaration. * i386-fbsd-nat.c (_initialize_i386fbsd_nat): Add declaration. * i386-fbsd-tdep.c (_initialize_i386fbsd_tdep): Add declaration. * i386-gnu-nat.c (_initialize_i386gnu_nat): Add declaration. * i386-gnu-tdep.c (_initialize_i386gnu_tdep): Add declaration. * i386-go32-tdep.c (_initialize_i386_go32_tdep): Add declaration. * i386-linux-nat.c (_initialize_i386_linux_nat): Add declaration. * i386-linux-tdep.c (_initialize_i386_linux_tdep): Add declaration. * i386-nbsd-nat.c (_initialize_i386nbsd_nat): Add declaration. * i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Add declaration. * i386-nto-tdep.c (_initialize_i386nto_tdep): Add declaration. * i386-obsd-nat.c (_initialize_i386obsd_nat): Add declaration. * i386-obsd-tdep.c (_initialize_i386obsd_tdep): Add declaration. * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Add declaration. * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Add declaration. * i386-tdep.c (_initialize_i386_tdep): Add declaration. * i386-windows-nat.c (_initialize_i386_windows_nat): Add declaration. * ia64-libunwind-tdep.c (_initialize_libunwind_frame): Add declaration. * ia64-linux-nat.c (_initialize_ia64_linux_nat): Add declaration. * ia64-linux-tdep.c (_initialize_ia64_linux_tdep): Add declaration. * ia64-tdep.c (_initialize_ia64_tdep): Add declaration. * ia64-vms-tdep.c (_initialize_ia64_vms_tdep): Add declaration. * infcall.c (_initialize_infcall): Add declaration. * infcmd.c (_initialize_infcmd): Add declaration. * inflow.c (_initialize_inflow): Add declaration. * infrun.c (_initialize_infrun): Add declaration. * interps.c (_initialize_interpreter): Add declaration. * iq2000-tdep.c (_initialize_iq2000_tdep): Add declaration. * jit.c (_initialize_jit): Add declaration. * language.c (_initialize_language): Add declaration. * linux-fork.c (_initialize_linux_fork): Add declaration. * linux-nat.c (_initialize_linux_nat): Add declaration. * linux-tdep.c (_initialize_linux_tdep): Add declaration. * linux-thread-db.c (_initialize_thread_db): Add declaration. * lm32-tdep.c (_initialize_lm32_tdep): Add declaration. * m2-lang.c (_initialize_m2_language): Add declaration. * m32c-tdep.c (_initialize_m32c_tdep): Add declaration. * m32r-linux-nat.c (_initialize_m32r_linux_nat): Add declaration. * m32r-linux-tdep.c (_initialize_m32r_linux_tdep): Add declaration. * m32r-tdep.c (_initialize_m32r_tdep): Add declaration. * m68hc11-tdep.c (_initialize_m68hc11_tdep): Add declaration. * m68k-bsd-nat.c (_initialize_m68kbsd_nat): Add declaration. * m68k-bsd-tdep.c (_initialize_m68kbsd_tdep): Add declaration. * m68k-linux-nat.c (_initialize_m68k_linux_nat): Add declaration. * m68k-linux-tdep.c (_initialize_m68k_linux_tdep): Add declaration. * m68k-tdep.c (_initialize_m68k_tdep): Add declaration. * machoread.c (_initialize_machoread): Add declaration. * macrocmd.c (_initialize_macrocmd): Add declaration. * macroscope.c (_initialize_macroscope): Add declaration. * maint-test-options.c (_initialize_maint_test_options): Add declaration. * maint-test-settings.c (_initialize_maint_test_settings): Add declaration. * maint.c (_initialize_maint_cmds): Add declaration. * mdebugread.c (_initialize_mdebugread): Add declaration. * memattr.c (_initialize_mem): Add declaration. * mep-tdep.c (_initialize_mep_tdep): Add declaration. * mi/mi-cmd-env.c (_initialize_mi_cmd_env): Add declaration. * mi/mi-cmds.c (_initialize_mi_cmds): Add declaration. * mi/mi-interp.c (_initialize_mi_interp): Add declaration. * mi/mi-main.c (_initialize_mi_main): Add declaration. * microblaze-linux-tdep.c (_initialize_microblaze_linux_tdep): Add declaration. * microblaze-tdep.c (_initialize_microblaze_tdep): Add declaration. * mips-fbsd-nat.c (_initialize_mips_fbsd_nat): Add declaration. * mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Add declaration. * mips-linux-nat.c (_initialize_mips_linux_nat): Add declaration. * mips-linux-tdep.c (_initialize_mips_linux_tdep): Add declaration. * mips-nbsd-nat.c (_initialize_mipsnbsd_nat): Add declaration. * mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Add declaration. * mips-sde-tdep.c (_initialize_mips_sde_tdep): Add declaration. * mips-tdep.c (_initialize_mips_tdep): Add declaration. * mips64-obsd-nat.c (_initialize_mips64obsd_nat): Add declaration. * mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Add declaration. * mipsread.c (_initialize_mipsread): Add declaration. * mn10300-linux-tdep.c (_initialize_mn10300_linux_tdep): Add declaration. * mn10300-tdep.c (_initialize_mn10300_tdep): Add declaration. * moxie-tdep.c (_initialize_moxie_tdep): Add declaration. * msp430-tdep.c (_initialize_msp430_tdep): Add declaration. * nds32-tdep.c (_initialize_nds32_tdep): Add declaration. * nios2-linux-tdep.c (_initialize_nios2_linux_tdep): Add declaration. * nios2-tdep.c (_initialize_nios2_tdep): Add declaration. * nto-procfs.c (_initialize_procfs): Add declaration. * objc-lang.c (_initialize_objc_language): Add declaration. * observable.c (_initialize_observer): Add declaration. * opencl-lang.c (_initialize_opencl_language): Add declaration. * or1k-linux-tdep.c (_initialize_or1k_linux_tdep): Add declaration. * or1k-tdep.c (_initialize_or1k_tdep): Add declaration. * osabi.c (_initialize_gdb_osabi): Add declaration. * osdata.c (_initialize_osdata): Add declaration. * p-valprint.c (_initialize_pascal_valprint): Add declaration. * parse.c (_initialize_parse): Add declaration. * ppc-fbsd-nat.c (_initialize_ppcfbsd_nat): Add declaration. * ppc-fbsd-tdep.c (_initialize_ppcfbsd_tdep): Add declaration. * ppc-linux-nat.c (_initialize_ppc_linux_nat): Add declaration. * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Add declaration. * ppc-nbsd-nat.c (_initialize_ppcnbsd_nat): Add declaration. * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Add declaration. * ppc-obsd-nat.c (_initialize_ppcobsd_nat): Add declaration. * ppc-obsd-tdep.c (_initialize_ppcobsd_tdep): Add declaration. * printcmd.c (_initialize_printcmd): Add declaration. * probe.c (_initialize_probe): Add declaration. * proc-api.c (_initialize_proc_api): Add declaration. * proc-events.c (_initialize_proc_events): Add declaration. * proc-service.c (_initialize_proc_service): Add declaration. * procfs.c (_initialize_procfs): Add declaration. * producer.c (_initialize_producer): Add declaration. * psymtab.c (_initialize_psymtab): Add declaration. * python/python.c (_initialize_python): Add declaration. * ravenscar-thread.c (_initialize_ravenscar): Add declaration. * record-btrace.c (_initialize_record_btrace): Add declaration. * record-full.c (_initialize_record_full): Add declaration. * record.c (_initialize_record): Add declaration. * regcache-dump.c (_initialize_regcache_dump): Add declaration. * regcache.c (_initialize_regcache): Add declaration. * reggroups.c (_initialize_reggroup): Add declaration. * remote-notif.c (_initialize_notif): Add declaration. * remote-sim.c (_initialize_remote_sim): Add declaration. * remote.c (_initialize_remote): Add declaration. * reverse.c (_initialize_reverse): Add declaration. * riscv-fbsd-nat.c (_initialize_riscv_fbsd_nat): Add declaration. * riscv-fbsd-tdep.c (_initialize_riscv_fbsd_tdep): Add declaration. * riscv-linux-nat.c (_initialize_riscv_linux_nat): Add declaration. * riscv-linux-tdep.c (_initialize_riscv_linux_tdep): Add declaration. * riscv-tdep.c (_initialize_riscv_tdep): Add declaration. * rl78-tdep.c (_initialize_rl78_tdep): Add declaration. * rs6000-aix-tdep.c (_initialize_rs6000_aix_tdep): Add declaration. * rs6000-lynx178-tdep.c (_initialize_rs6000_lynx178_tdep): Add declaration. * rs6000-nat.c (_initialize_rs6000_nat): Add declaration. * rs6000-tdep.c (_initialize_rs6000_tdep): Add declaration. * run-on-main-thread.c (_initialize_run_on_main_thread): Add declaration. * rust-exp.y (_initialize_rust_exp): Add declaration. * rx-tdep.c (_initialize_rx_tdep): Add declaration. * s12z-tdep.c (_initialize_s12z_tdep): Add declaration. * s390-linux-nat.c (_initialize_s390_nat): Add declaration. * s390-linux-tdep.c (_initialize_s390_linux_tdep): Add declaration. * s390-tdep.c (_initialize_s390_tdep): Add declaration. * score-tdep.c (_initialize_score_tdep): Add declaration. * ser-go32.c (_initialize_ser_dos): Add declaration. * ser-mingw.c (_initialize_ser_windows): Add declaration. * ser-pipe.c (_initialize_ser_pipe): Add declaration. * ser-tcp.c (_initialize_ser_tcp): Add declaration. * ser-uds.c (_initialize_ser_socket): Add declaration. * ser-unix.c (_initialize_ser_hardwire): Add declaration. * serial.c (_initialize_serial): Add declaration. * sh-linux-tdep.c (_initialize_sh_linux_tdep): Add declaration. * sh-nbsd-nat.c (_initialize_shnbsd_nat): Add declaration. * sh-nbsd-tdep.c (_initialize_shnbsd_tdep): Add declaration. * sh-tdep.c (_initialize_sh_tdep): Add declaration. * skip.c (_initialize_step_skip): Add declaration. * sol-thread.c (_initialize_sol_thread): Add declaration. * solib-aix.c (_initialize_solib_aix): Add declaration. * solib-darwin.c (_initialize_darwin_solib): Add declaration. * solib-dsbt.c (_initialize_dsbt_solib): Add declaration. * solib-frv.c (_initialize_frv_solib): Add declaration. * solib-svr4.c (_initialize_svr4_solib): Add declaration. * solib-target.c (_initialize_solib_target): Add declaration. * solib.c (_initialize_solib): Add declaration. * source-cache.c (_initialize_source_cache): Add declaration. * source.c (_initialize_source): Add declaration. * sparc-linux-nat.c (_initialize_sparc_linux_nat): Add declaration. * sparc-linux-tdep.c (_initialize_sparc_linux_tdep): Add declaration. * sparc-nat.c (_initialize_sparc_nat): Add declaration. * sparc-nbsd-nat.c (_initialize_sparcnbsd_nat): Add declaration. * sparc-nbsd-tdep.c (_initialize_sparcnbsd_tdep): Add declaration. * sparc-obsd-tdep.c (_initialize_sparc32obsd_tdep): Add declaration. * sparc-sol2-tdep.c (_initialize_sparc_sol2_tdep): Add declaration. * sparc-tdep.c (_initialize_sparc_tdep): Add declaration. * sparc64-fbsd-nat.c (_initialize_sparc64fbsd_nat): Add declaration. * sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Add declaration. * sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Add declaration. * sparc64-linux-tdep.c (_initialize_sparc64_linux_tdep): Add declaration. * sparc64-nat.c (_initialize_sparc64_nat): Add declaration. * sparc64-nbsd-nat.c (_initialize_sparc64nbsd_nat): Add declaration. * sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Add declaration. * sparc64-obsd-nat.c (_initialize_sparc64obsd_nat): Add declaration. * sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Add declaration. * sparc64-sol2-tdep.c (_initialize_sparc64_sol2_tdep): Add declaration. * sparc64-tdep.c (_initialize_sparc64_adi_tdep): Add declaration. * stabsread.c (_initialize_stabsread): Add declaration. * stack.c (_initialize_stack): Add declaration. * stap-probe.c (_initialize_stap_probe): Add declaration. * std-regs.c (_initialize_frame_reg): Add declaration. * symfile-debug.c (_initialize_symfile_debug): Add declaration. * symfile-mem.c (_initialize_symfile_mem): Add declaration. * symfile.c (_initialize_symfile): Add declaration. * symmisc.c (_initialize_symmisc): Add declaration. * symtab.c (_initialize_symtab): Add declaration. * target.c (_initialize_target): Add declaration. * target-connection.c (_initialize_target_connection): Add declaration. * target-dcache.c (_initialize_target_dcache): Add declaration. * target-descriptions.c (_initialize_target_descriptions): Add declaration. * thread.c (_initialize_thread): Add declaration. * tic6x-linux-tdep.c (_initialize_tic6x_linux_tdep): Add declaration. * tic6x-tdep.c (_initialize_tic6x_tdep): Add declaration. * tilegx-linux-nat.c (_initialize_tile_linux_nat): Add declaration. * tilegx-linux-tdep.c (_initialize_tilegx_linux_tdep): Add declaration. * tilegx-tdep.c (_initialize_tilegx_tdep): Add declaration. * tracectf.c (_initialize_ctf): Add declaration. * tracefile-tfile.c (_initialize_tracefile_tfile): Add declaration. * tracefile.c (_initialize_tracefile): Add declaration. * tracepoint.c (_initialize_tracepoint): Add declaration. * tui/tui-hooks.c (_initialize_tui_hooks): Add declaration. * tui/tui-interp.c (_initialize_tui_interp): Add declaration. * tui/tui-layout.c (_initialize_tui_layout): Add declaration. * tui/tui-regs.c (_initialize_tui_regs): Add declaration. * tui/tui-stack.c (_initialize_tui_stack): Add declaration. * tui/tui-win.c (_initialize_tui_win): Add declaration. * tui/tui.c (_initialize_tui): Add declaration. * typeprint.c (_initialize_typeprint): Add declaration. * ui-style.c (_initialize_ui_style): Add declaration. * unittests/array-view-selftests.c (_initialize_array_view_selftests): Add declaration. * unittests/child-path-selftests.c (_initialize_child_path_selftests): Add declaration. * unittests/cli-utils-selftests.c (_initialize_cli_utils_selftests): Add declaration. * unittests/common-utils-selftests.c (_initialize_common_utils_selftests): Add declaration. * unittests/copy_bitwise-selftests.c (_initialize_copy_bitwise_utils_selftests): Add declaration. * unittests/environ-selftests.c (_initialize_environ_selftests): Add declaration. * unittests/filtered_iterator-selftests.c (_initialize_filtered_iterator_selftests): Add declaration. * unittests/format_pieces-selftests.c (_initialize_format_pieces_selftests): Add declaration. * unittests/function-view-selftests.c (_initialize_function_view_selftests): Add declaration. * unittests/help-doc-selftests.c (_initialize_help_doc_selftests): Add declaration. * unittests/lookup_name_info-selftests.c (_initialize_lookup_name_info_selftests): Add declaration. * unittests/main-thread-selftests.c (_initialize_main_thread_selftests): Add declaration. * unittests/memory-map-selftests.c (_initialize_memory_map_selftests): Add declaration. * unittests/memrange-selftests.c (_initialize_memrange_selftests): Add declaration. * unittests/mkdir-recursive-selftests.c (_initialize_mkdir_recursive_selftests): Add declaration. * unittests/observable-selftests.c (_initialize_observer_selftest): Add declaration. * unittests/offset-type-selftests.c (_initialize_offset_type_selftests): Add declaration. * unittests/optional-selftests.c (_initialize_optional_selftests): Add declaration. * unittests/parse-connection-spec-selftests.c (_initialize_parse_connection_spec_selftests): Add declaration. * unittests/rsp-low-selftests.c (_initialize_rsp_low_selftests): Add declaration. * unittests/scoped_fd-selftests.c (_initialize_scoped_fd_selftests): Add declaration. * unittests/scoped_mmap-selftests.c (_initialize_scoped_mmap_selftests): Add declaration. * unittests/scoped_restore-selftests.c (_initialize_scoped_restore_selftests): Add declaration. * unittests/string_view-selftests.c (_initialize_string_view_selftests): Add declaration. * unittests/style-selftests.c (_initialize_style_selftest): Add declaration. * unittests/tracepoint-selftests.c (_initialize_tracepoint_selftests): Add declaration. * unittests/tui-selftests.c (_initialize_tui_selftest): Add declaration. * unittests/unpack-selftests.c (_initialize_unpack_selftests): Add declaration. * unittests/utils-selftests.c (_initialize_utils_selftests): Add declaration. * unittests/vec-utils-selftests.c (_initialize_vec_utils_selftests): Add declaration. * unittests/xml-utils-selftests.c (_initialize_xml_utils): Add declaration. * user-regs.c (_initialize_user_regs): Add declaration. * utils.c (_initialize_utils): Add declaration. * v850-tdep.c (_initialize_v850_tdep): Add declaration. * valops.c (_initialize_valops): Add declaration. * valprint.c (_initialize_valprint): Add declaration. * value.c (_initialize_values): Add declaration. * varobj.c (_initialize_varobj): Add declaration. * vax-bsd-nat.c (_initialize_vaxbsd_nat): Add declaration. * vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Add declaration. * vax-tdep.c (_initialize_vax_tdep): Add declaration. * windows-nat.c (_initialize_windows_nat): Add declaration. (_initialize_check_for_gdb_ini): Add declaration. (_initialize_loadable): Add declaration. * windows-tdep.c (_initialize_windows_tdep): Add declaration. * x86-bsd-nat.c (_initialize_x86_bsd_nat): Add declaration. * x86-linux-nat.c (_initialize_x86_linux_nat): Add declaration. * xcoffread.c (_initialize_xcoffread): Add declaration. * xml-support.c (_initialize_xml_support): Add declaration. * xstormy16-tdep.c (_initialize_xstormy16_tdep): Add declaration. * xtensa-linux-nat.c (_initialize_xtensa_linux_nat): Add declaration. * xtensa-linux-tdep.c (_initialize_xtensa_linux_tdep): Add declaration. * xtensa-tdep.c (_initialize_xtensa_tdep): Add declaration. Change-Id: I13eec7e0ed2b3c427377a7bdb055cf46da64def9
2020-01-13 20:01:38 +01:00
void _initialize_stabsread ();
void
gdb: add back declarations for _initialize functions I'd like to enable the -Wmissing-declarations warning. However, it warns for every _initialize function, for example: CXX dcache.o /home/smarchi/src/binutils-gdb/gdb/dcache.c: In function ‘void _initialize_dcache()’: /home/smarchi/src/binutils-gdb/gdb/dcache.c:688:1: error: no previous declaration for ‘void _initialize_dcache()’ [-Werror=missing-declarations] _initialize_dcache (void) ^~~~~~~~~~~~~~~~~~ The only practical way forward I found is to add back the declarations, which were removed by this commit: commit 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9 Author: John Baldwin <jhb@FreeBSD.org> Date: Sat Sep 9 11:02:37 2017 -0700 Remove unnecessary function prototypes. I don't think it's a big problem to have the declarations for these functions, but if anybody has a better solution for this, I'll be happy to use it. gdb/ChangeLog: * aarch64-fbsd-nat.c (_initialize_aarch64_fbsd_nat): Add declaration. * aarch64-fbsd-tdep.c (_initialize_aarch64_fbsd_tdep): Add declaration. * aarch64-linux-nat.c (_initialize_aarch64_linux_nat): Add declaration. * aarch64-linux-tdep.c (_initialize_aarch64_linux_tdep): Add declaration. * aarch64-newlib-tdep.c (_initialize_aarch64_newlib_tdep): Add declaration. * aarch64-tdep.c (_initialize_aarch64_tdep): Add declaration. * ada-exp.y (_initialize_ada_exp): Add declaration. * ada-lang.c (_initialize_ada_language): Add declaration. * ada-tasks.c (_initialize_tasks): Add declaration. * agent.c (_initialize_agent): Add declaration. * aix-thread.c (_initialize_aix_thread): Add declaration. * alpha-bsd-nat.c (_initialize_alphabsd_nat): Add declaration. * alpha-linux-nat.c (_initialize_alpha_linux_nat): Add declaration. * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add declaration. * alpha-nbsd-tdep.c (_initialize_alphanbsd_tdep): Add declaration. * alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Add declaration. * alpha-tdep.c (_initialize_alpha_tdep): Add declaration. * amd64-darwin-tdep.c (_initialize_amd64_darwin_tdep): Add declaration. * amd64-dicos-tdep.c (_initialize_amd64_dicos_tdep): Add declaration. * amd64-fbsd-nat.c (_initialize_amd64fbsd_nat): Add declaration. * amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Add declaration. * amd64-linux-nat.c (_initialize_amd64_linux_nat): Add declaration. * amd64-linux-tdep.c (_initialize_amd64_linux_tdep): Add declaration. * amd64-nbsd-nat.c (_initialize_amd64nbsd_nat): Add declaration. * amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Add declaration. * amd64-obsd-nat.c (_initialize_amd64obsd_nat): Add declaration. * amd64-obsd-tdep.c (_initialize_amd64obsd_tdep): Add declaration. * amd64-sol2-tdep.c (_initialize_amd64_sol2_tdep): Add declaration. * amd64-tdep.c (_initialize_amd64_tdep): Add declaration. * amd64-windows-nat.c (_initialize_amd64_windows_nat): Add declaration. * amd64-windows-tdep.c (_initialize_amd64_windows_tdep): Add declaration. * annotate.c (_initialize_annotate): Add declaration. * arc-newlib-tdep.c (_initialize_arc_newlib_tdep): Add declaration. * arc-tdep.c (_initialize_arc_tdep): Add declaration. * arch-utils.c (_initialize_gdbarch_utils): Add declaration. * arm-fbsd-nat.c (_initialize_arm_fbsd_nat): Add declaration. * arm-fbsd-tdep.c (_initialize_arm_fbsd_tdep): Add declaration. * arm-linux-nat.c (_initialize_arm_linux_nat): Add declaration. * arm-linux-tdep.c (_initialize_arm_linux_tdep): Add declaration. * arm-nbsd-nat.c (_initialize_arm_netbsd_nat): Add declaration. * arm-nbsd-tdep.c (_initialize_arm_netbsd_tdep): Add declaration. * arm-obsd-tdep.c (_initialize_armobsd_tdep): Add declaration. * arm-pikeos-tdep.c (_initialize_arm_pikeos_tdep): Add declaration. * arm-symbian-tdep.c (_initialize_arm_symbian_tdep): Add declaration. * arm-tdep.c (_initialize_arm_tdep): Add declaration. * arm-wince-tdep.c (_initialize_arm_wince_tdep): Add declaration. * auto-load.c (_initialize_auto_load): Add declaration. * auxv.c (_initialize_auxv): Add declaration. * avr-tdep.c (_initialize_avr_tdep): Add declaration. * ax-gdb.c (_initialize_ax_gdb): Add declaration. * bfin-linux-tdep.c (_initialize_bfin_linux_tdep): Add declaration. * bfin-tdep.c (_initialize_bfin_tdep): Add declaration. * break-catch-sig.c (_initialize_break_catch_sig): Add declaration. * break-catch-syscall.c (_initialize_break_catch_syscall): Add declaration. * break-catch-throw.c (_initialize_break_catch_throw): Add declaration. * breakpoint.c (_initialize_breakpoint): Add declaration. * bsd-uthread.c (_initialize_bsd_uthread): Add declaration. * btrace.c (_initialize_btrace): Add declaration. * charset.c (_initialize_charset): Add declaration. * cli/cli-cmds.c (_initialize_cli_cmds): Add declaration. * cli/cli-dump.c (_initialize_cli_dump): Add declaration. * cli/cli-interp.c (_initialize_cli_interp): Add declaration. * cli/cli-logging.c (_initialize_cli_logging): Add declaration. * cli/cli-script.c (_initialize_cli_script): Add declaration. * cli/cli-style.c (_initialize_cli_style): Add declaration. * coff-pe-read.c (_initialize_coff_pe_read): Add declaration. * coffread.c (_initialize_coffread): Add declaration. * compile/compile-cplus-types.c (_initialize_compile_cplus_types): Add declaration. * compile/compile.c (_initialize_compile): Add declaration. * complaints.c (_initialize_complaints): Add declaration. * completer.c (_initialize_completer): Add declaration. * copying.c (_initialize_copying): Add declaration. * corefile.c (_initialize_core): Add declaration. * corelow.c (_initialize_corelow): Add declaration. * cp-abi.c (_initialize_cp_abi): Add declaration. * cp-namespace.c (_initialize_cp_namespace): Add declaration. * cp-support.c (_initialize_cp_support): Add declaration. * cp-valprint.c (_initialize_cp_valprint): Add declaration. * cris-linux-tdep.c (_initialize_cris_linux_tdep): Add declaration. * cris-tdep.c (_initialize_cris_tdep): Add declaration. * csky-linux-tdep.c (_initialize_csky_linux_tdep): Add declaration. * csky-tdep.c (_initialize_csky_tdep): Add declaration. * ctfread.c (_initialize_ctfread): Add declaration. * d-lang.c (_initialize_d_language): Add declaration. * darwin-nat-info.c (_initialize_darwin_info_commands): Add declaration. * darwin-nat.c (_initialize_darwin_nat): Add declaration. * dbxread.c (_initialize_dbxread): Add declaration. * dcache.c (_initialize_dcache): Add declaration. * disasm-selftests.c (_initialize_disasm_selftests): Add declaration. * disasm.c (_initialize_disasm): Add declaration. * dtrace-probe.c (_initialize_dtrace_probe): Add declaration. * dummy-frame.c (_initialize_dummy_frame): Add declaration. * dwarf-index-cache.c (_initialize_index_cache): Add declaration. * dwarf-index-write.c (_initialize_dwarf_index_write): Add declaration. * dwarf2-frame-tailcall.c (_initialize_tailcall_frame): Add declaration. * dwarf2-frame.c (_initialize_dwarf2_frame): Add declaration. * dwarf2expr.c (_initialize_dwarf2expr): Add declaration. * dwarf2loc.c (_initialize_dwarf2loc): Add declaration. * dwarf2read.c (_initialize_dwarf2_read): Add declaration. * elfread.c (_initialize_elfread): Add declaration. * exec.c (_initialize_exec): Add declaration. * extension.c (_initialize_extension): Add declaration. * f-lang.c (_initialize_f_language): Add declaration. * f-valprint.c (_initialize_f_valprint): Add declaration. * fbsd-nat.c (_initialize_fbsd_nat): Add declaration. * fbsd-tdep.c (_initialize_fbsd_tdep): Add declaration. * filesystem.c (_initialize_filesystem): Add declaration. * findcmd.c (_initialize_mem_search): Add declaration. * findvar.c (_initialize_findvar): Add declaration. * fork-child.c (_initialize_fork_child): Add declaration. * frame-base.c (_initialize_frame_base): Add declaration. * frame-unwind.c (_initialize_frame_unwind): Add declaration. * frame.c (_initialize_frame): Add declaration. * frv-linux-tdep.c (_initialize_frv_linux_tdep): Add declaration. * frv-tdep.c (_initialize_frv_tdep): Add declaration. * ft32-tdep.c (_initialize_ft32_tdep): Add declaration. * gcore.c (_initialize_gcore): Add declaration. * gdb-demangle.c (_initialize_gdb_demangle): Add declaration. * gdb_bfd.c (_initialize_gdb_bfd): Add declaration. * gdbarch-selftests.c (_initialize_gdbarch_selftests): Add declaration. * gdbarch.c (_initialize_gdbarch): Add declaration. * gdbtypes.c (_initialize_gdbtypes): Add declaration. * gnu-nat.c (_initialize_gnu_nat): Add declaration. * gnu-v2-abi.c (_initialize_gnu_v2_abi): Add declaration. * gnu-v3-abi.c (_initialize_gnu_v3_abi): Add declaration. * go-lang.c (_initialize_go_language): Add declaration. * go32-nat.c (_initialize_go32_nat): Add declaration. * guile/guile.c (_initialize_guile): Add declaration. * h8300-tdep.c (_initialize_h8300_tdep): Add declaration. * hppa-linux-nat.c (_initialize_hppa_linux_nat): Add declaration. * hppa-linux-tdep.c (_initialize_hppa_linux_tdep): Add declaration. * hppa-nbsd-nat.c (_initialize_hppanbsd_nat): Add declaration. * hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Add declaration. * hppa-obsd-nat.c (_initialize_hppaobsd_nat): Add declaration. * hppa-obsd-tdep.c (_initialize_hppabsd_tdep): Add declaration. * hppa-tdep.c (_initialize_hppa_tdep): Add declaration. * i386-bsd-nat.c (_initialize_i386bsd_nat): Add declaration. * i386-cygwin-tdep.c (_initialize_i386_cygwin_tdep): Add declaration. * i386-darwin-nat.c (_initialize_i386_darwin_nat): Add declaration. * i386-darwin-tdep.c (_initialize_i386_darwin_tdep): Add declaration. * i386-dicos-tdep.c (_initialize_i386_dicos_tdep): Add declaration. * i386-fbsd-nat.c (_initialize_i386fbsd_nat): Add declaration. * i386-fbsd-tdep.c (_initialize_i386fbsd_tdep): Add declaration. * i386-gnu-nat.c (_initialize_i386gnu_nat): Add declaration. * i386-gnu-tdep.c (_initialize_i386gnu_tdep): Add declaration. * i386-go32-tdep.c (_initialize_i386_go32_tdep): Add declaration. * i386-linux-nat.c (_initialize_i386_linux_nat): Add declaration. * i386-linux-tdep.c (_initialize_i386_linux_tdep): Add declaration. * i386-nbsd-nat.c (_initialize_i386nbsd_nat): Add declaration. * i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Add declaration. * i386-nto-tdep.c (_initialize_i386nto_tdep): Add declaration. * i386-obsd-nat.c (_initialize_i386obsd_nat): Add declaration. * i386-obsd-tdep.c (_initialize_i386obsd_tdep): Add declaration. * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Add declaration. * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Add declaration. * i386-tdep.c (_initialize_i386_tdep): Add declaration. * i386-windows-nat.c (_initialize_i386_windows_nat): Add declaration. * ia64-libunwind-tdep.c (_initialize_libunwind_frame): Add declaration. * ia64-linux-nat.c (_initialize_ia64_linux_nat): Add declaration. * ia64-linux-tdep.c (_initialize_ia64_linux_tdep): Add declaration. * ia64-tdep.c (_initialize_ia64_tdep): Add declaration. * ia64-vms-tdep.c (_initialize_ia64_vms_tdep): Add declaration. * infcall.c (_initialize_infcall): Add declaration. * infcmd.c (_initialize_infcmd): Add declaration. * inflow.c (_initialize_inflow): Add declaration. * infrun.c (_initialize_infrun): Add declaration. * interps.c (_initialize_interpreter): Add declaration. * iq2000-tdep.c (_initialize_iq2000_tdep): Add declaration. * jit.c (_initialize_jit): Add declaration. * language.c (_initialize_language): Add declaration. * linux-fork.c (_initialize_linux_fork): Add declaration. * linux-nat.c (_initialize_linux_nat): Add declaration. * linux-tdep.c (_initialize_linux_tdep): Add declaration. * linux-thread-db.c (_initialize_thread_db): Add declaration. * lm32-tdep.c (_initialize_lm32_tdep): Add declaration. * m2-lang.c (_initialize_m2_language): Add declaration. * m32c-tdep.c (_initialize_m32c_tdep): Add declaration. * m32r-linux-nat.c (_initialize_m32r_linux_nat): Add declaration. * m32r-linux-tdep.c (_initialize_m32r_linux_tdep): Add declaration. * m32r-tdep.c (_initialize_m32r_tdep): Add declaration. * m68hc11-tdep.c (_initialize_m68hc11_tdep): Add declaration. * m68k-bsd-nat.c (_initialize_m68kbsd_nat): Add declaration. * m68k-bsd-tdep.c (_initialize_m68kbsd_tdep): Add declaration. * m68k-linux-nat.c (_initialize_m68k_linux_nat): Add declaration. * m68k-linux-tdep.c (_initialize_m68k_linux_tdep): Add declaration. * m68k-tdep.c (_initialize_m68k_tdep): Add declaration. * machoread.c (_initialize_machoread): Add declaration. * macrocmd.c (_initialize_macrocmd): Add declaration. * macroscope.c (_initialize_macroscope): Add declaration. * maint-test-options.c (_initialize_maint_test_options): Add declaration. * maint-test-settings.c (_initialize_maint_test_settings): Add declaration. * maint.c (_initialize_maint_cmds): Add declaration. * mdebugread.c (_initialize_mdebugread): Add declaration. * memattr.c (_initialize_mem): Add declaration. * mep-tdep.c (_initialize_mep_tdep): Add declaration. * mi/mi-cmd-env.c (_initialize_mi_cmd_env): Add declaration. * mi/mi-cmds.c (_initialize_mi_cmds): Add declaration. * mi/mi-interp.c (_initialize_mi_interp): Add declaration. * mi/mi-main.c (_initialize_mi_main): Add declaration. * microblaze-linux-tdep.c (_initialize_microblaze_linux_tdep): Add declaration. * microblaze-tdep.c (_initialize_microblaze_tdep): Add declaration. * mips-fbsd-nat.c (_initialize_mips_fbsd_nat): Add declaration. * mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Add declaration. * mips-linux-nat.c (_initialize_mips_linux_nat): Add declaration. * mips-linux-tdep.c (_initialize_mips_linux_tdep): Add declaration. * mips-nbsd-nat.c (_initialize_mipsnbsd_nat): Add declaration. * mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Add declaration. * mips-sde-tdep.c (_initialize_mips_sde_tdep): Add declaration. * mips-tdep.c (_initialize_mips_tdep): Add declaration. * mips64-obsd-nat.c (_initialize_mips64obsd_nat): Add declaration. * mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Add declaration. * mipsread.c (_initialize_mipsread): Add declaration. * mn10300-linux-tdep.c (_initialize_mn10300_linux_tdep): Add declaration. * mn10300-tdep.c (_initialize_mn10300_tdep): Add declaration. * moxie-tdep.c (_initialize_moxie_tdep): Add declaration. * msp430-tdep.c (_initialize_msp430_tdep): Add declaration. * nds32-tdep.c (_initialize_nds32_tdep): Add declaration. * nios2-linux-tdep.c (_initialize_nios2_linux_tdep): Add declaration. * nios2-tdep.c (_initialize_nios2_tdep): Add declaration. * nto-procfs.c (_initialize_procfs): Add declaration. * objc-lang.c (_initialize_objc_language): Add declaration. * observable.c (_initialize_observer): Add declaration. * opencl-lang.c (_initialize_opencl_language): Add declaration. * or1k-linux-tdep.c (_initialize_or1k_linux_tdep): Add declaration. * or1k-tdep.c (_initialize_or1k_tdep): Add declaration. * osabi.c (_initialize_gdb_osabi): Add declaration. * osdata.c (_initialize_osdata): Add declaration. * p-valprint.c (_initialize_pascal_valprint): Add declaration. * parse.c (_initialize_parse): Add declaration. * ppc-fbsd-nat.c (_initialize_ppcfbsd_nat): Add declaration. * ppc-fbsd-tdep.c (_initialize_ppcfbsd_tdep): Add declaration. * ppc-linux-nat.c (_initialize_ppc_linux_nat): Add declaration. * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Add declaration. * ppc-nbsd-nat.c (_initialize_ppcnbsd_nat): Add declaration. * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Add declaration. * ppc-obsd-nat.c (_initialize_ppcobsd_nat): Add declaration. * ppc-obsd-tdep.c (_initialize_ppcobsd_tdep): Add declaration. * printcmd.c (_initialize_printcmd): Add declaration. * probe.c (_initialize_probe): Add declaration. * proc-api.c (_initialize_proc_api): Add declaration. * proc-events.c (_initialize_proc_events): Add declaration. * proc-service.c (_initialize_proc_service): Add declaration. * procfs.c (_initialize_procfs): Add declaration. * producer.c (_initialize_producer): Add declaration. * psymtab.c (_initialize_psymtab): Add declaration. * python/python.c (_initialize_python): Add declaration. * ravenscar-thread.c (_initialize_ravenscar): Add declaration. * record-btrace.c (_initialize_record_btrace): Add declaration. * record-full.c (_initialize_record_full): Add declaration. * record.c (_initialize_record): Add declaration. * regcache-dump.c (_initialize_regcache_dump): Add declaration. * regcache.c (_initialize_regcache): Add declaration. * reggroups.c (_initialize_reggroup): Add declaration. * remote-notif.c (_initialize_notif): Add declaration. * remote-sim.c (_initialize_remote_sim): Add declaration. * remote.c (_initialize_remote): Add declaration. * reverse.c (_initialize_reverse): Add declaration. * riscv-fbsd-nat.c (_initialize_riscv_fbsd_nat): Add declaration. * riscv-fbsd-tdep.c (_initialize_riscv_fbsd_tdep): Add declaration. * riscv-linux-nat.c (_initialize_riscv_linux_nat): Add declaration. * riscv-linux-tdep.c (_initialize_riscv_linux_tdep): Add declaration. * riscv-tdep.c (_initialize_riscv_tdep): Add declaration. * rl78-tdep.c (_initialize_rl78_tdep): Add declaration. * rs6000-aix-tdep.c (_initialize_rs6000_aix_tdep): Add declaration. * rs6000-lynx178-tdep.c (_initialize_rs6000_lynx178_tdep): Add declaration. * rs6000-nat.c (_initialize_rs6000_nat): Add declaration. * rs6000-tdep.c (_initialize_rs6000_tdep): Add declaration. * run-on-main-thread.c (_initialize_run_on_main_thread): Add declaration. * rust-exp.y (_initialize_rust_exp): Add declaration. * rx-tdep.c (_initialize_rx_tdep): Add declaration. * s12z-tdep.c (_initialize_s12z_tdep): Add declaration. * s390-linux-nat.c (_initialize_s390_nat): Add declaration. * s390-linux-tdep.c (_initialize_s390_linux_tdep): Add declaration. * s390-tdep.c (_initialize_s390_tdep): Add declaration. * score-tdep.c (_initialize_score_tdep): Add declaration. * ser-go32.c (_initialize_ser_dos): Add declaration. * ser-mingw.c (_initialize_ser_windows): Add declaration. * ser-pipe.c (_initialize_ser_pipe): Add declaration. * ser-tcp.c (_initialize_ser_tcp): Add declaration. * ser-uds.c (_initialize_ser_socket): Add declaration. * ser-unix.c (_initialize_ser_hardwire): Add declaration. * serial.c (_initialize_serial): Add declaration. * sh-linux-tdep.c (_initialize_sh_linux_tdep): Add declaration. * sh-nbsd-nat.c (_initialize_shnbsd_nat): Add declaration. * sh-nbsd-tdep.c (_initialize_shnbsd_tdep): Add declaration. * sh-tdep.c (_initialize_sh_tdep): Add declaration. * skip.c (_initialize_step_skip): Add declaration. * sol-thread.c (_initialize_sol_thread): Add declaration. * solib-aix.c (_initialize_solib_aix): Add declaration. * solib-darwin.c (_initialize_darwin_solib): Add declaration. * solib-dsbt.c (_initialize_dsbt_solib): Add declaration. * solib-frv.c (_initialize_frv_solib): Add declaration. * solib-svr4.c (_initialize_svr4_solib): Add declaration. * solib-target.c (_initialize_solib_target): Add declaration. * solib.c (_initialize_solib): Add declaration. * source-cache.c (_initialize_source_cache): Add declaration. * source.c (_initialize_source): Add declaration. * sparc-linux-nat.c (_initialize_sparc_linux_nat): Add declaration. * sparc-linux-tdep.c (_initialize_sparc_linux_tdep): Add declaration. * sparc-nat.c (_initialize_sparc_nat): Add declaration. * sparc-nbsd-nat.c (_initialize_sparcnbsd_nat): Add declaration. * sparc-nbsd-tdep.c (_initialize_sparcnbsd_tdep): Add declaration. * sparc-obsd-tdep.c (_initialize_sparc32obsd_tdep): Add declaration. * sparc-sol2-tdep.c (_initialize_sparc_sol2_tdep): Add declaration. * sparc-tdep.c (_initialize_sparc_tdep): Add declaration. * sparc64-fbsd-nat.c (_initialize_sparc64fbsd_nat): Add declaration. * sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Add declaration. * sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Add declaration. * sparc64-linux-tdep.c (_initialize_sparc64_linux_tdep): Add declaration. * sparc64-nat.c (_initialize_sparc64_nat): Add declaration. * sparc64-nbsd-nat.c (_initialize_sparc64nbsd_nat): Add declaration. * sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Add declaration. * sparc64-obsd-nat.c (_initialize_sparc64obsd_nat): Add declaration. * sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Add declaration. * sparc64-sol2-tdep.c (_initialize_sparc64_sol2_tdep): Add declaration. * sparc64-tdep.c (_initialize_sparc64_adi_tdep): Add declaration. * stabsread.c (_initialize_stabsread): Add declaration. * stack.c (_initialize_stack): Add declaration. * stap-probe.c (_initialize_stap_probe): Add declaration. * std-regs.c (_initialize_frame_reg): Add declaration. * symfile-debug.c (_initialize_symfile_debug): Add declaration. * symfile-mem.c (_initialize_symfile_mem): Add declaration. * symfile.c (_initialize_symfile): Add declaration. * symmisc.c (_initialize_symmisc): Add declaration. * symtab.c (_initialize_symtab): Add declaration. * target.c (_initialize_target): Add declaration. * target-connection.c (_initialize_target_connection): Add declaration. * target-dcache.c (_initialize_target_dcache): Add declaration. * target-descriptions.c (_initialize_target_descriptions): Add declaration. * thread.c (_initialize_thread): Add declaration. * tic6x-linux-tdep.c (_initialize_tic6x_linux_tdep): Add declaration. * tic6x-tdep.c (_initialize_tic6x_tdep): Add declaration. * tilegx-linux-nat.c (_initialize_tile_linux_nat): Add declaration. * tilegx-linux-tdep.c (_initialize_tilegx_linux_tdep): Add declaration. * tilegx-tdep.c (_initialize_tilegx_tdep): Add declaration. * tracectf.c (_initialize_ctf): Add declaration. * tracefile-tfile.c (_initialize_tracefile_tfile): Add declaration. * tracefile.c (_initialize_tracefile): Add declaration. * tracepoint.c (_initialize_tracepoint): Add declaration. * tui/tui-hooks.c (_initialize_tui_hooks): Add declaration. * tui/tui-interp.c (_initialize_tui_interp): Add declaration. * tui/tui-layout.c (_initialize_tui_layout): Add declaration. * tui/tui-regs.c (_initialize_tui_regs): Add declaration. * tui/tui-stack.c (_initialize_tui_stack): Add declaration. * tui/tui-win.c (_initialize_tui_win): Add declaration. * tui/tui.c (_initialize_tui): Add declaration. * typeprint.c (_initialize_typeprint): Add declaration. * ui-style.c (_initialize_ui_style): Add declaration. * unittests/array-view-selftests.c (_initialize_array_view_selftests): Add declaration. * unittests/child-path-selftests.c (_initialize_child_path_selftests): Add declaration. * unittests/cli-utils-selftests.c (_initialize_cli_utils_selftests): Add declaration. * unittests/common-utils-selftests.c (_initialize_common_utils_selftests): Add declaration. * unittests/copy_bitwise-selftests.c (_initialize_copy_bitwise_utils_selftests): Add declaration. * unittests/environ-selftests.c (_initialize_environ_selftests): Add declaration. * unittests/filtered_iterator-selftests.c (_initialize_filtered_iterator_selftests): Add declaration. * unittests/format_pieces-selftests.c (_initialize_format_pieces_selftests): Add declaration. * unittests/function-view-selftests.c (_initialize_function_view_selftests): Add declaration. * unittests/help-doc-selftests.c (_initialize_help_doc_selftests): Add declaration. * unittests/lookup_name_info-selftests.c (_initialize_lookup_name_info_selftests): Add declaration. * unittests/main-thread-selftests.c (_initialize_main_thread_selftests): Add declaration. * unittests/memory-map-selftests.c (_initialize_memory_map_selftests): Add declaration. * unittests/memrange-selftests.c (_initialize_memrange_selftests): Add declaration. * unittests/mkdir-recursive-selftests.c (_initialize_mkdir_recursive_selftests): Add declaration. * unittests/observable-selftests.c (_initialize_observer_selftest): Add declaration. * unittests/offset-type-selftests.c (_initialize_offset_type_selftests): Add declaration. * unittests/optional-selftests.c (_initialize_optional_selftests): Add declaration. * unittests/parse-connection-spec-selftests.c (_initialize_parse_connection_spec_selftests): Add declaration. * unittests/rsp-low-selftests.c (_initialize_rsp_low_selftests): Add declaration. * unittests/scoped_fd-selftests.c (_initialize_scoped_fd_selftests): Add declaration. * unittests/scoped_mmap-selftests.c (_initialize_scoped_mmap_selftests): Add declaration. * unittests/scoped_restore-selftests.c (_initialize_scoped_restore_selftests): Add declaration. * unittests/string_view-selftests.c (_initialize_string_view_selftests): Add declaration. * unittests/style-selftests.c (_initialize_style_selftest): Add declaration. * unittests/tracepoint-selftests.c (_initialize_tracepoint_selftests): Add declaration. * unittests/tui-selftests.c (_initialize_tui_selftest): Add declaration. * unittests/unpack-selftests.c (_initialize_unpack_selftests): Add declaration. * unittests/utils-selftests.c (_initialize_utils_selftests): Add declaration. * unittests/vec-utils-selftests.c (_initialize_vec_utils_selftests): Add declaration. * unittests/xml-utils-selftests.c (_initialize_xml_utils): Add declaration. * user-regs.c (_initialize_user_regs): Add declaration. * utils.c (_initialize_utils): Add declaration. * v850-tdep.c (_initialize_v850_tdep): Add declaration. * valops.c (_initialize_valops): Add declaration. * valprint.c (_initialize_valprint): Add declaration. * value.c (_initialize_values): Add declaration. * varobj.c (_initialize_varobj): Add declaration. * vax-bsd-nat.c (_initialize_vaxbsd_nat): Add declaration. * vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Add declaration. * vax-tdep.c (_initialize_vax_tdep): Add declaration. * windows-nat.c (_initialize_windows_nat): Add declaration. (_initialize_check_for_gdb_ini): Add declaration. (_initialize_loadable): Add declaration. * windows-tdep.c (_initialize_windows_tdep): Add declaration. * x86-bsd-nat.c (_initialize_x86_bsd_nat): Add declaration. * x86-linux-nat.c (_initialize_x86_linux_nat): Add declaration. * xcoffread.c (_initialize_xcoffread): Add declaration. * xml-support.c (_initialize_xml_support): Add declaration. * xstormy16-tdep.c (_initialize_xstormy16_tdep): Add declaration. * xtensa-linux-nat.c (_initialize_xtensa_linux_nat): Add declaration. * xtensa-linux-tdep.c (_initialize_xtensa_linux_tdep): Add declaration. * xtensa-tdep.c (_initialize_xtensa_tdep): Add declaration. Change-Id: I13eec7e0ed2b3c427377a7bdb055cf46da64def9
2020-01-13 20:01:38 +01:00
_initialize_stabsread ()
{
undef_types_allocated = 20;
undef_types_length = 0;
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
undef_types = XNEWVEC (struct type *, undef_types_allocated);
noname_undefs_allocated = 20;
noname_undefs_length = 0;
Replace some xmalloc-family functions with XNEW-family ones This patch is part of the make-gdb-buildable-in-C++ effort. The idea is to change some calls to the xmalloc family of functions to calls to the equivalents in the XNEW family. This avoids adding an explicit cast, so it keeps the code a bit more readable. Some of them also map relatively well to a C++ equivalent (XNEW (struct foo) -> new foo), so it will be possible to do scripted replacements if needed. I only changed calls that were obviously allocating memory for one or multiple "objects". Allocation of variable sizes (such as strings or buffer handling) will be for later (and won't use XNEW). - xmalloc (sizeof (struct foo)) -> XNEW (struct foo) - xmalloc (num * sizeof (struct foo)) -> XNEWVEC (struct foo, num) - xcalloc (1, sizeof (struct foo)) -> XCNEW (struct foo) - xcalloc (num, sizeof (struct foo)) -> XCNEWVEC (struct foo, num) - xrealloc (p, num * sizeof (struct foo) -> XRESIZEVEC (struct foo, p, num) - obstack_alloc (ob, sizeof (struct foo)) -> XOBNEW (ob, struct foo) - obstack_alloc (ob, num * sizeof (struct foo)) -> XOBNEWVEC (ob, struct foo, num) - alloca (sizeof (struct foo)) -> XALLOCA (struct foo) - alloca (num * sizeof (struct foo)) -> XALLOCAVEC (struct foo, num) Some instances of xmalloc followed by memset to zero the buffer were replaced by XCNEW or XCNEWVEC. I regtested on x86-64, Ubuntu 14.04, but the patch touches many architecture-specific files. For those I'll have to rely on the buildbot or people complaining that I broke their gdb. gdb/ChangeLog: * aarch64-linux-nat.c (aarch64_add_process): Likewise. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * ada-exp.y (write_ambiguous_var): Likewise. * ada-lang.c (resolve_subexp): Likewise. (user_select_syms): Likewise. (assign_aggregate): Likewise. (ada_evaluate_subexp): Likewise. (cache_symbol): Likewise. * addrmap.c (allocate_key): Likewise. (addrmap_create_mutable): Likewise. * aix-thread.c (sync_threadlists): Likewise. * alpha-tdep.c (alpha_push_dummy_call): Likewise. (alpha_gdbarch_init): Likewise. * amd64-windows-tdep.c (amd64_windows_push_arguments): Likewise. * arm-linux-nat.c (arm_linux_add_process): Likewise. * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise. * arm-tdep.c (push_stack_item): Likewise. (arm_displaced_step_copy_insn): Likewise. (arm_gdbarch_init): Likewise. (_initialize_arm_tdep): Likewise. * avr-tdep.c (push_stack_item): Likewise. * ax-general.c (new_agent_expr): Likewise. * block.c (block_initialize_namespace): Likewise. * breakpoint.c (alloc_counted_command_line): Likewise. (update_dprintf_command_list): Likewise. (parse_breakpoint_sals): Likewise. (decode_static_tracepoint_spec): Likewise. (until_break_command): Likewise. (clear_command): Likewise. (update_global_location_list): Likewise. (get_breakpoint_objfile_data) Likewise. * btrace.c (ftrace_new_function): Likewise. (btrace_set_insn_history): Likewise. (btrace_set_call_history): Likewise. * buildsym.c (add_symbol_to_list): Likewise. (record_pending_block): Likewise. (start_subfile): Likewise. (start_buildsym_compunit): Likewise. (push_subfile): Likewise. (end_symtab_get_static_block): Likewise. (buildsym_init): Likewise. * cli/cli-cmds.c (source_command): Likewise. * cli/cli-decode.c (add_cmd): Likewise. * cli/cli-script.c (build_command_line): Likewise. (setup_user_args): Likewise. (realloc_body_list): Likewise. (process_next_line): Likewise. (copy_command_lines): Likewise. * cli/cli-setshow.c (do_set_command): Likewise. * coff-pe-read.c (read_pe_exported_syms): Likewise. * coffread.c (coff_locate_sections): Likewise. (coff_symtab_read): Likewise. (coff_read_struct_type): Likewise. * common/cleanups.c (make_my_cleanup2): Likewise. * common/common-exceptions.c (throw_it): Likewise. * common/filestuff.c (make_cleanup_close): Likewise. * common/format.c (parse_format_string): Likewise. * common/queue.h (DEFINE_QUEUE_P): Likewise. * compile/compile-object-load.c (munmap_list_add): Likewise. (compile_object_load): Likewise. * compile/compile-object-run.c (compile_object_run): Likewise. * compile/compile.c (append_args): Likewise. * corefile.c (specify_exec_file_hook): Likewise. * cp-support.c (make_symbol_overload_list): Likewise. * cris-tdep.c (push_stack_item): Likewise. (cris_gdbarch_init): Likewise. * ctf.c (ctf_trace_file_writer_new): Likewise. * dbxread.c (init_header_files): Likewise. (add_new_header_file): Likewise. (init_bincl_list): Likewise. (dbx_end_psymtab): Likewise. (start_psymtab): Likewise. (dbx_end_psymtab): Likewise. * dcache.c (dcache_init): Likewise. * dictionary.c (dict_create_hashed): Likewise. (dict_create_hashed_expandable): Likewise. (dict_create_linear): Likewise. (dict_create_linear_expandable): Likewise. * dtrace-probe.c (dtrace_process_dof_probe): Likewise. * dummy-frame.c (register_dummy_frame_dtor): Likewise. * dwarf2-frame-tailcall.c (cache_new_ref1): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. (decode_frame_entry_1): Likewise. * dwarf2expr.c (new_dwarf_expr_context): Likewise. * dwarf2loc.c (dwarf2_compile_expr_to_ax): Likewise. * dwarf2read.c (dwarf2_has_info): Likewise. (create_signatured_type_table_from_index): Likewise. (dwarf2_read_index): Likewise. (dw2_get_file_names_reader): Likewise. (create_all_type_units): Likewise. (read_cutu_die_from_dwo): Likewise. (init_tu_and_read_dwo_dies): Likewise. (init_cutu_and_read_dies): Likewise. (create_all_comp_units): Likewise. (queue_comp_unit): Likewise. (inherit_abstract_dies): Likewise. (read_call_site_scope): Likewise. (dwarf2_add_field): Likewise. (dwarf2_add_typedef): Likewise. (dwarf2_add_member_fn): Likewise. (attr_to_dynamic_prop): Likewise. (abbrev_table_alloc_abbrev): Likewise. (abbrev_table_read_table): Likewise. (add_include_dir): Likewise. (add_file_name): Likewise. (dwarf_decode_line_header): Likewise. (dwarf2_const_value_attr): Likewise. (dwarf_alloc_block): Likewise. (parse_macro_definition): Likewise. (set_die_type): Likewise. (write_psymtabs_to_index): Likewise. (create_cus_from_index): Likewise. (dwarf2_create_include_psymtab): Likewise. (process_psymtab_comp_unit_reader): Likewise. (build_type_psymtab_dependencies): Likewise. (read_comp_units_from_section): Likewise. (compute_compunit_symtab_includes): Likewise. (create_dwo_unit_in_dwp_v1): Likewise. (create_dwo_unit_in_dwp_v2): Likewise. (read_func_scope): Likewise. (process_structure_scope): Likewise. (mark_common_block_symbol_computed): Likewise. (load_partial_dies): Likewise. (dwarf2_symbol_mark_computed): Likewise. * elfread.c (elf_symfile_segments): Likewise. (elf_read_minimal_symbols): Likewise. * environ.c (make_environ): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * event-loop.c (create_file_handler): Likewise. (create_async_signal_handler): Likewise. (create_async_event_handler): Likewise. (create_timer): Likewise. * exec.c (build_section_table): Likewise. * fbsd-nat.c (fbsd_remember_child): Likewise. * fork-child.c (fork_inferior): Likewise. * frv-tdep.c (new_variant): Likewise. * gdbarch.sh (gdbarch_alloc): Likewise. (append_name): Likewise. * gdbtypes.c (rank_function): Likewise. (copy_type_recursive): Likewise. (add_dyn_prop): Likewise. * gnu-nat.c (make_proc): Likewise. (make_inf): Likewise. (gnu_write_inferior): Likewise. * gnu-v3-abi.c (build_gdb_vtable_type): Likewise. (build_std_type_info_type): Likewise. * guile/scm-param.c (compute_enum_list): Likewise. * guile/scm-utils.c (gdbscm_parse_function_args): Likewise. * guile/scm-value.c (gdbscm_value_call): Likewise. * h8300-tdep.c (h8300_gdbarch_init): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. (read_unwind_info): Likewise. * ia64-tdep.c (ia64_gdbarch_init): Likewise. * infcall.c (dummy_frame_context_saver_setup): Likewise. (call_function_by_hand_dummy): Likewise. * infcmd.c (step_once): Likewise. (finish_forward): Likewise. (attach_command): Likewise. (notice_new_inferior): Likewise. * inferior.c (add_inferior_silent): Likewise. * infrun.c (add_displaced_stepping_state): Likewise. (save_infcall_control_state): Likewise. (save_inferior_ptid): Likewise. (_initialize_infrun): Likewise. * jit.c (bfd_open_from_target_memory): Likewise. (jit_gdbarch_data_init): Likewise. * language.c (add_language): Likewise. * linespec.c (decode_line_2): Likewise. * linux-nat.c (add_to_pid_list): Likewise. (add_initial_lwp): Likewise. * linux-thread-db.c (add_thread_db_info): Likewise. (record_thread): Likewise. (info_auto_load_libthread_db): Likewise. * m32c-tdep.c (m32c_gdbarch_init): Likewise. * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise. * m68k-tdep.c (m68k_gdbarch_init): Likewise. * m88k-tdep.c (m88k_analyze_prologue): Likewise. * macrocmd.c (macro_define_command): Likewise. * macroexp.c (gather_arguments): Likewise. * macroscope.c (sal_macro_scope): Likewise. * macrotab.c (new_macro_table): Likewise. * mdebugread.c (push_parse_stack): Likewise. (parse_partial_symbols): Likewise. (parse_symbol): Likewise. (psymtab_to_symtab_1): Likewise. (new_block): Likewise. (new_psymtab): Likewise. (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (elfmdebug_build_psymtabs): Likewise. * mep-tdep.c (mep_gdbarch_init): Likewise. * mi/mi-main.c (mi_execute_command): Likewise. * mi/mi-parse.c (mi_parse_argv): Likewise. * minidebug.c (lzma_open): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * mips-linux-nat.c (mips_linux_insert_watchpoint): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * mn10300-tdep.c (mn10300_gdbarch_init): Likewise. * msp430-tdep.c (msp430_gdbarch_init): Likewise. * mt-tdep.c (mt_registers_info): Likewise. * nat/aarch64-linux.c (aarch64_linux_new_thread): Likewise. * nat/linux-btrace.c (linux_enable_bts): Likewise. (linux_enable_pt): Likewise. * nat/linux-osdata.c (linux_xfer_osdata_processes): Likewise. (linux_xfer_osdata_processgroups): Likewise. * nios2-tdep.c (nios2_gdbarch_init): Likewise. * nto-procfs.c (procfs_meminfo): Likewise. * objc-lang.c (start_msglist): Likewise. (selectors_info): Likewise. (classes_info): Likewise. (find_methods): Likewise. * objfiles.c (allocate_objfile): Likewise. (update_section_map): Likewise. * osabi.c (gdbarch_register_osabi): Likewise. (gdbarch_register_osabi_sniffer): Likewise. * parse.c (start_arglist): Likewise. * ppc-linux-nat.c (hwdebug_find_thread_points_by_tid): Likewise. (hwdebug_insert_point): Likewise. * printcmd.c (display_command): Likewise. (ui_printf): Likewise. * procfs.c (create_procinfo): Likewise. (load_syscalls): Likewise. (proc_get_LDT_entry): Likewise. (proc_update_threads): Likewise. * prologue-value.c (make_pv_area): Likewise. (pv_area_store): Likewise. * psymtab.c (extend_psymbol_list): Likewise. (init_psymbol_list): Likewise. (allocate_psymtab): Likewise. * python/py-inferior.c (add_thread_object): Likewise. * python/py-param.c (compute_enum_values): Likewise. * python/py-value.c (valpy_call): Likewise. * python/py-varobj.c (py_varobj_iter_next): Likewise. * python/python.c (ensure_python_env): Likewise. * record-btrace.c (record_btrace_start_replaying): Likewise. * record-full.c (record_full_reg_alloc): Likewise. (record_full_mem_alloc): Likewise. (record_full_end_alloc): Likewise. (record_full_core_xfer_partial): Likewise. * regcache.c (get_thread_arch_aspace_regcache): Likewise. * remote-fileio.c (remote_fileio_init_fd_map): Likewise. * remote-notif.c (remote_notif_state_allocate): Likewise. * remote.c (demand_private_info): Likewise. (remote_notif_stop_alloc_reply): Likewise. (remote_enable_btrace): Likewise. * reverse.c (save_bookmark_command): Likewise. * rl78-tdep.c (rl78_gdbarch_init): Likewise. * rx-tdep.c (rx_gdbarch_init): Likewise. * s390-linux-nat.c (s390_insert_watchpoint): Likewise. * ser-go32.c (dos_get_tty_state): Likewise. (dos_copy_tty_state): Likewise. * ser-mingw.c (ser_windows_open): Likewise. (ser_console_wait_handle): Likewise. (ser_console_get_tty_state): Likewise. (make_pipe_state): Likewise. (net_windows_open): Likewise. * ser-unix.c (hardwire_get_tty_state): Likewise. (hardwire_copy_tty_state): Likewise. * solib-aix.c (solib_aix_new_lm_info): Likewise. * solib-dsbt.c (dsbt_current_sos): Likewise. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. (frv_relocate_main_executable): Likewise. * solib-spu.c (spu_bfd_fopen): Likewise. * solib-svr4.c (lm_info_read): Likewise. (svr4_copy_library_list): Likewise. (svr4_default_sos): Likewise. * source.c (find_source_lines): Likewise. (line_info): Likewise. (add_substitute_path_rule): Likewise. * spu-linux-nat.c (spu_bfd_open): Likewise. * spu-tdep.c (info_spu_dma_cmdlist): Likewise. * stabsread.c (dbx_lookup_type): Likewise. (read_type): Likewise. (read_member_functions): Likewise. (read_struct_fields): Likewise. (read_baseclasses): Likewise. (read_args): Likewise. (_initialize_stabsread): Likewise. * stack.c (func_command): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (addrs_section_sort): Likewise. (addr_info_make_relative): Likewise. (load_section_callback): Likewise. (add_symbol_file_command): Likewise. (init_filename_language_table): Likewise. * symtab.c (create_filename_seen_cache): Likewise. (sort_search_symbols_remove_dups): Likewise. (search_symbols): Likewise. * target.c (make_cleanup_restore_target_terminal): Likewise. * thread.c (new_thread): Likewise. (enable_thread_stack_temporaries): Likewise. (make_cleanup_restore_current_thread): Likewise. (thread_apply_all_command): Likewise. * tic6x-tdep.c (tic6x_gdbarch_init): Likewise. * top.c (gdb_readline_wrapper): Likewise. * tracefile-tfile.c (tfile_trace_file_writer_new): Likewise. * tracepoint.c (trace_find_line_command): Likewise. (all_tracepoint_actions_and_cleanup): Likewise. (make_cleanup_restore_current_traceframe): Likewise. (get_uploaded_tp): Likewise. (get_uploaded_tsv): Likewise. * tui/tui-data.c (tui_alloc_generic_win_info): Likewise. (tui_alloc_win_info): Likewise. (tui_alloc_content): Likewise. (tui_add_content_elements): Likewise. * tui/tui-disasm.c (tui_find_disassembly_address): Likewise. (tui_set_disassem_content): Likewise. * ui-file.c (ui_file_new): Likewise. (stdio_file_new): Likewise. (tee_file_new): Likewise. * utils.c (make_cleanup_restore_integer): Likewise. (add_internal_problem_command): Likewise. * v850-tdep.c (v850_gdbarch_init): Likewise. * valops.c (find_oload_champ): Likewise. * value.c (allocate_value_lazy): Likewise. (record_latest_value): Likewise. (create_internalvar): Likewise. * varobj.c (install_variable): Likewise. (new_variable): Likewise. (new_root_variable): Likewise. (cppush): Likewise. (_initialize_varobj): Likewise. * windows-nat.c (windows_make_so): Likewise. * x86-nat.c (x86_add_process): Likewise. * xcoffread.c (arrange_linetable): Likewise. (allocate_include_entry): Likewise. (process_linenos): Likewise. (SYMBOL_DUP): Likewise. (xcoff_start_psymtab): Likewise. (xcoff_end_psymtab): Likewise. * xml-support.c (gdb_xml_parse_attr_ulongest): Likewise. * xtensa-tdep.c (xtensa_register_type): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. gdb/gdbserver/ChangeLog: * ax.c (gdb_parse_agent_expr): Likewise. (compile_bytecodes): Likewise. * dll.c (loaded_dll): Likewise. * event-loop.c (append_callback_event): Likewise. (create_file_handler): Likewise. (create_file_event): Likewise. * hostio.c (handle_open): Likewise. * inferiors.c (add_thread): Likewise. (add_process): Likewise. * linux-aarch64-low.c (aarch64_linux_new_process): Likewise. * linux-arm-low.c (arm_new_process): Likewise. (arm_new_thread): Likewise. * linux-low.c (add_to_pid_list): Likewise. (linux_add_process): Likewise. (handle_extended_wait): Likewise. (add_lwp): Likewise. (enqueue_one_deferred_signal): Likewise. (enqueue_pending_signal): Likewise. (linux_resume_one_lwp_throw): Likewise. (linux_resume_one_thread): Likewise. (linux_read_memory): Likewise. (linux_write_memory): Likewise. * linux-mips-low.c (mips_linux_new_process): Likewise. (mips_linux_new_thread): Likewise. (mips_add_watchpoint): Likewise. * linux-x86-low.c (initialize_low_arch): Likewise. * lynx-low.c (lynx_add_process): Likewise. * mem-break.c (set_raw_breakpoint_at): Likewise. (set_breakpoint): Likewise. (add_condition_to_breakpoint): Likewise. (add_commands_to_breakpoint): Likewise. (clone_agent_expr): Likewise. (clone_one_breakpoint): Likewise. * regcache.c (new_register_cache): Likewise. * remote-utils.c (look_up_one_symbol): Likewise. * server.c (queue_stop_reply): Likewise. (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. (handle_target_event): Likewise. * spu-low.c (fetch_ppc_memory): Likewise. (store_ppc_memory): Likewise. * target.c (set_target_ops): Likewise. * thread-db.c (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (add_tracepoint): Likewise. (add_tracepoint_action): Likewise. (create_trace_state_variable): Likewise. (cmd_qtdpsrc): Likewise. (cmd_qtro): Likewise. (add_while_stepping_state): Likewise. * win32-low.c (child_add_thread): Likewise. (get_image_name): Likewise.
2015-08-26 23:16:07 +02:00
noname_undefs = XNEWVEC (struct nat, noname_undefs_allocated);
2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> Tom Tromey <tromey@redhat.com> PR symtab/8421: * coffread.c (coff_register_index): New global. (process_coff_symbol, coff_read_enum_type): Set SYMBOL_ACLASS_INDEX. (_initialize_coffread): Initialize new global. * dwarf2loc.c (locexpr_find_frame_base_location) (dwarf2_block_frame_base_locexpr_funcs) (loclist_find_frame_base_location) (dwarf2_block_frame_base_loclist_funcs): New. (dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error. (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist. * dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs) (dwarf2_block_frame_base_loclist_funcs): New. * dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index) (dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New globals. (read_func_scope): Update. (fixup_go_packaging, mark_common_block_symbol_computed) (var_decode_location, new_symbol_full, dwarf2_const_value): Set SYMBOL_ACLASS_INDEX. (dwarf2_symbol_mark_computed): Likewise. Add 'is_block' argument. (_initialize_dwarf2_read): Initialize new globals. * jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX. * jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX. * mdebugread.c (mdebug_register_index, mdebug_regparm_index): New globals. (parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX. (_initialize_mdebugread): Initialize new globals. * psympriv.h (struct partial_symbol) <aclass>: Update comment. * stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX. (stab_register_index, stab_regparm_index): New globals. (define_symbol, read_enum_type, common_block_end): Set SYMBOL_ACLASS_INDEX. (_initialize_stabsread): Initialize new globals. * symtab.c (next_aclass_value, symbol_impl, symbol_impls): New globals. (MAX_SYMBOL_IMPLS): New define. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl) (initialize_ordinary_address_classes): New functions. (_initialize_symtab): Call initialize_ordinary_address_classes. * symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant. (struct symbol_impl): New. (SYMBOL_ACLASS_BITS): New define. (struct symbol) <aclass, ops>: Remove fields. <aclass_index>: New field. (symbol_impls): Declare. (SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine. (SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines. (register_symbol_computed_impl, register_symbol_block_impl) (register_symbol_register_impl): Declare. (struct symbol_computed_ops): Add location_has_loclist. (struct symbol_block_ops): New. (SYMBOL_BLOCK_OPS): New. * xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 19:33:05 +01:00
stab_register_index = register_symbol_register_impl (LOC_REGISTER,
&stab_register_funcs);
stab_regparm_index = register_symbol_register_impl (LOC_REGPARM_ADDR,
&stab_register_funcs);
}