From 9dcc0b141cc6b94354177de13359f44691713b19 Mon Sep 17 00:00:00 2001 From: nobody <> Date: Fri, 20 Sep 2002 15:07:16 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'carlton_dictionary-branch'. Cherrypick from master 2002-09-20 15:07:15 UTC Fernando Nasser ' From 2002-07-02 George Helffrich ': gdb/ChangeLog gdb/Makefile.in gdb/ada-lang.c gdb/c-lang.c gdb/dbxread.c gdb/mdebugread.c gdb/symfile.c gdb/symtab.c gdb/symtab.h Cherrypick from gdb_5_3-branch 2002-09-03 22:29:15 UTC nobody 'This commit was manufactured by cvs2svn to create branch 'gdb_5_3-branch'.': gdb/coffread.c gdb/dwarf2read.c gdb/dwarfread.c gdb/hpread.c gdb/symfile.h gdb/xcoffread.c --- gdb/ChangeLog | 11415 +++++++++++++++++++++++++++++++++++++++++++++++++++++ gdb/Makefile.in | 2595 ++++++++++++ gdb/ada-lang.c | 8311 ++++++++++++++++++++++++++++++++++++++ gdb/c-lang.c | 652 +++ gdb/coffread.c | 2166 ++++++++++ gdb/dbxread.c | 3599 +++++++++++++++++ gdb/dwarf2read.c | 6938 ++++++++++++++++++++++++++++++++ gdb/dwarfread.c | 3788 ++++++++++++++++++ gdb/hpread.c | 6310 +++++++++++++++++++++++++++++ gdb/mdebugread.c | 5021 +++++++++++++++++++++++ gdb/symfile.c | 3340 ++++++++++++++++ gdb/symfile.h | 328 ++ gdb/symtab.c | 4063 +++++++++++++++++++ gdb/symtab.h | 1414 +++++++ gdb/xcoffread.c | 3049 ++++++++++++++ 15 files changed, 62989 insertions(+) create mode 100644 gdb/ChangeLog create mode 100644 gdb/Makefile.in create mode 100644 gdb/ada-lang.c create mode 100644 gdb/c-lang.c create mode 100644 gdb/coffread.c create mode 100644 gdb/dbxread.c create mode 100644 gdb/dwarf2read.c create mode 100644 gdb/dwarfread.c create mode 100644 gdb/hpread.c create mode 100644 gdb/mdebugread.c create mode 100644 gdb/symfile.c create mode 100644 gdb/symfile.h create mode 100644 gdb/symtab.c create mode 100644 gdb/symtab.h create mode 100644 gdb/xcoffread.c diff --git a/gdb/ChangeLog b/gdb/ChangeLog new file mode 100644 index 0000000..ec776f7 --- /dev/null +++ b/gdb/ChangeLog @@ -0,0 +1,11415 @@ +2002-09-20 Fernando Nasser + + From 2002-07-02 George Helffrich + * cli/cli-cmds.c (list_command): New function. Implements the new + cli edit command. + (_init_cli_cmds): Add new command definition. + * gdb.1: Document edit command. + * doc/gdb.texinfo: Document edit command. + +2002-09-20 Fernando Nasser + + * source.c: Make global variables current_source_symtab and + current_source_line static. + (list_command): Moved to cli/cli-cmds.c. + (ambiguous_line_spec): Moved to cli/cli-cmds.c. + (get_first_line_listed): New accessor function. + (get_lines_to_list): New accessor function. + (get_current_source_symtab_and_line): New function. Retrieves the + position in the source code that we consider current. + (get_current_or_default_source_symtab_and_line): New function. + Like the above but attempts to determine a default position if one + is not currently defined. + (set_current_source_symtab_and_line): New function. Sets the source + code position considered current and returns the previously set one. + (clear_current_source_symtab_and_line): Reset stored information about + a current source line. + (_initialize_source): Remove registration for the "list" command and + its alias. + * source.h: Add declarations for the new functions above. + * symtab.h: Remove declarations for the global variables mentioned + above. + * breakpoint.c (parse_breakpoint_sals): Use accessor functions to + obtain current source line. + * linespec.c (decode_line_1): Ditto. + * macroscope.c (default_macro_scope): Ditto. + * scm-lang.c (scm_unpac): Ditto. + * stack.c (print_frame_info_base): Ditto. + * symfile.c (clear_symtab_users): Ditto. + * symtab.c (decode_line_spec): Ditto. + * cli/cli-cmds.c (list_command): Moved here from source.c. + (ambiguous_line_spec): Moved here from source.c. + (_init_cli_cmds): Add definition for "list" and its alias. + * Makefile.in: Update dependencies. + +2002-09-20 Corinna Vinschen + + * h8300-tdep.c (h8300_examine_prologue): Match saved regs location + with what gcc thinks is correct. + +2002-09-20 Corinna Vinschen + + * h8300-tdep.c (h8300_examine_prologue): Fix loop for saved regs in + multiple register push instruction. + +2002-09-19 Jim Blandy + + Add support for distinct host and target character sets. + * charset.c, charset.h: New files. + * c-exp.y: #include "charset.h". + (yylex): Convert character and string literals to the target + character set, before returning them as the semantic value of the + token. + * c-lang.c: #include "charset.h". + (c_emit_char): Use charset-specific methods to recognize + characters with backslash escape forms, to decide which characters + to print literally and which to print using numeric escape + sequences, and to convert target characters to host characters + before printing. + * utils.c: #include "charset.h". + (no_control_char_error): New function. + (parse_escape): Use charset-specific methods to recognize + backslash escapes, parse `control character' notation, and convert + characters from the host character set to the target character set. + * configure.in: Set the default host character set. + Check where to find iconv, and what its argument types might be. + * acinclude.m4 (AM_ICONV): New macro, borrowed from GCC. + * Makefile.in (SFILES): List charset.c. + (COMMON_OBS): List charset.o. + (charset.o): New rule. + (charset_h): New header dependency variable. + (c-lang.o, utils.o, c-exp.tab.o): Note dependency on $(charset_h). + (LIBICONV): New variable, set by configure. + (CLIBS): Include $(LIBICONV) here. + * aclocal.m4, config.in, configure: Regenerated. + +2002-09-19 Joel Brobecker + + * ada-exp.y: Add missing semicolons to end rules. Fixes a + bison 1.35 warning. + +2002-09-19 Richard Earnshaw + + * gdb_mbuild.sh: New file. + +2002-09-19 Andrew Cagney + + * objc-exp.y, objc-lang.h, objc-lang.c: Fix copyright notice. + +2002-09-18 Andrew Cagney + + * breakpoint.c, c-exp.y, defs.h, elfread.c, expression.h, + jv-exp.y, language.c, language.h, p-exp.y, parse.c, parser-defs.h, + printcmd.c, source.c, stabsread.c, symfile.c, symtab.h, utils.c, + valops.c, value.h: Revert previous change. + +2002-09-18 Michael Snyder + + Preliminary support for Objective-C: + * defs.h (language_objc): New enum value. + (puts_filtered_tabular): Declaration only, exported from utils.c. + (skip_quoted): Delete, declared in completer.h. + * c-exp.y: Include completer.h. + * p-exp.y: Ditto. + * jv-exp.y: Ditto. + * expression.h (OP_MSGCALL, OP_SELECTOR, OP_SELF, OP_NSSTRING): + New operator enum values. + * language.h (CAST_IS_CONVERSION): Test for language_objc. + * language.c (binop_result_type): Handle language_objc case. + (integral_type, character_type, string_type, boolean_type, + structured_type, binop_type_check): Ditto. + * symtab.h (SYMBOL_OBJC_DEMANGLED_NAME): Define. + (struct objc_specific): Add to general_symbol_info. + (SYMBOL_INIT_LANGUAGE_SPECIFIC): Add objc initialization. + (SYMBOL_DEMANGLED_NAME): Handle objc case. + * parser-defs.h (struct objc_class_str): New struct type. + (start_msglist, end_msglist, add_msglist): Declaration only, + exported from objc-lang.c. + * value.h (value_of_local, value_nsstring, + call_function_by_hand_expecting_type): Exported from valops.c. + * valops.c (find_function_addr): Export. + (call_function_by_hand_expecting_type): New function. + (value_of_local): New function. + * symfile.c (init_filename_language_table): Add ".m" extension + for Objective-C. + * utils.c (puts_filtered_tabular): New function. + (fprintf_symbol_filtered): Add objc demangling support (disabled). + (set/show demangle): Extend help-string to refer to ObjC. + * elfread.c (elf_symtab_read): Skip Objective-C special symbols. + * stabsread.c (symbol_reference_defined): Objective-C symbols + may contain colons: make allowances when scanning stabs strings + for colons. + (objc_find_colon): New function. + * printcmd.c (address_info): If language == objc then print + "self" instead of "this". + * parse.c (length_of_subexp): Handle new operators OP_MSGCALL, + OP_NSSTRING, and OP_SELF. + (prefixify_subexp): Ditto. + * source.c (print_source_lines): Mention objc in comment. + * breakpoint.c (parse_breakpoint_sals): Recognize Objective-C + method names. + +2002-09-18 Andrew Cagney + + * complaints.h: Update copyright. + (struct complaints): Declare. + (struct complaint): Make `message' constant. + (internal_complaint): Declare. + (complaint): Declare. + (complaint_root): Delete declaration. + (symfile_complaints): Delete declaration. + (struct complaints): Add opaque declaration. + (clear_complaints): Add a complaints parameter. + * complaints.c: Update copyright. + (enum complaint_series): Define. + (complaint_root): Delete. + (struct complaints): Define. + (complaint_sentinel, symfile_complaint_book): New variables. + (symfile_explanations, symfile_complaints): New variables. + New variables. + (get_complaints): New function. + (vcomplaint): New function. + (complaint): New function. + (internal_complaint): New function. + (complain): Call vcomplain with symfile_complaint. + (clear_complaints): Rewrite. + (_initialize_complaints): Use add_setshow_command. + * Makefile.in (complaints.o): Update dependencies. + * symfile.c (syms_from_objfile): Add symfile_complaints parameter + to call to clear_complaints. + (new_symfile_objfile, reread_symbols): Ditto. + (oldsyms_complaint): Delete. + (empty_symtab_complaint, unknown_option_complaint): Delete. + (free_named_symtabs): Use complaint instead of complain. + +2002-09-18 Michael Snyder + + Contributed by Apple Computer, Inc. Merged with current sources + by Adam Fedor [cagney]. + + * objc-lang.c: First clean-up round: comments, indentation. + * objc-lang.h: Ditto. + * objc-lang.y: Ditto. + +2002-09-18 Andrew Cagney + + * maint.c (maintenance_internal_error): Print the parameter as the + error message. + (maintenance_internal_warning): New function. + (_initialize_maint_cmds): Add command `maint internal-warning'. + + * defs.h (internal_warning, internal_vwarning): Declare. + * utils.c (struct internal_problem): Define. + (internal_vproblem): New function. + (internal_warning): New function. + (internal_vwarning): New function. + (internal_warning_problem, internal_error_problem): New variables. + (internal_verror): Just call internal_vproblem. + +2002-09-18 Michael Snyder + + * objc-lang.c: New file, support for Objective-C. + Preliminary check-in, not yet integrated into gdb. + * objc-lang.h: New file. + * objc-exp.y: New file. + +2002-09-18 Andrew Cagney + + * infrun.c (signal_stop_update): Convert definition to ISO C. + (signal_print_update): Ditto. + (signal_pass_update): Ditto. + * inflow.c (terminal_save_ours): Ditto. + + * h8300-tdep.c (h8300_gdbarch_init): Use C instead of C++ + comments. + + * config/djgpp/fnchange.lst: Handle name clashes between + bfd/coff-tic30.c, bfd/coff-tic4x.c, bfd/coff-tic54x.c and + bfd/coff-tic80.c. + + * i386-linux-tdep.h: Fix tipo. + +2002-09-18 Adam Fedor + + * MAINTAINERS: Add myself to the Write After Approval list. + +2002-09-18 Jim Blandy + + * dbxread.c, mdebugread.c: Revert my change of 2001-10-23. Moving + texthigh and textlow to reader-specific structs caused + objfile_relocate to miss them. This is fixable, but the work that + the change was supposed to prepare GDB for never got done anyway. + +2002-09-18 David Carlton + + * MAINTAINERS: Alphabetize Write After Approval list. + +2002-09-18 Daniel Jacobowitz + + Fix PR gdb/709 + * values.c (value_static_field): Call read_var_value. + +2002-09-18 Andrew Cagney + + * valops.c (hand_function_call): Align the initial stack pointer + and STRUCT_ADDR using frame_align. When STRUCT_RETURN and + FRAME_ALIGN_P, use STRUCT_ADDR to obtain the called function's + return value. + * mips-tdep.c (mips_frame_align): New function. + (mips_gdbarch_init): Set frame_align. + * gdbarch.sh (FRAME_ALIGN): New method. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-09-18 Michal Ludvig + + * x86-64-linux-nat.c (x86_64_regmap): Added CS and SS + registers. + +2002-09-17 Andrew Cagney + + * NEWS: Mention that MIPS $fp behavior changed. + * mipsnbsd-tdep.c (mipsnbsd_cannot_fetch_register): Delete + reference to FP_REGNUM. + (mipsnbsd_cannot_store_register): Ditto. + * mips-linux-nat.c: Update copyright. + (mips_linux_cannot_fetch_register): Delete reference to FP_REGNUM. + (mips_linux_cannot_store_register): Ditto. + * mips-linux-tdep.c (supply_gregset): Ditto. Update copyright. + * config/mips/tm-mips.h: Update copyright. + (FP_REGNUM): Delete macro. + (MIPS_REGISTER_NAMES): Replace "fp" with "". + * config/mips/tm-irix6.h (FP_REGNUM): Delete macro. + * mips-tdep.c (mips_gdbarch_init): Set read_fp to mips_read_sp. + (mips_r3041_reg_names, mips_r3051_reg_names) + (mips_r3081_reg_names): Replace "fp" with "". + Fix PR gdb/480. + +2002-09-17 Theodore A. Roth + + * gdb/avr-tdep.c(avr_scan_prologue): Fix bad call to + generic_read_register_dummy() (PR gdb/703). + (avr_push_return_address): #if 0 out unused vars. + (avr_gdbarch_init): Enable use of avr_push_return_address(). + +2002-09-17 Michael Snyder + + * m32r-stub.c (restore_and_return): Postpone restoring of PSW. + RTE will take care of it. + +2002-09-17 Andrew Cagney + + * arch-utils.c (legacy_virtual_frame_pointer): If FP_REGNUM is + invalid, return SP_REGNUM. + +2002-09-17 Michael Snyder + + * mips-tdep.c (mips_pop_frame): Read saved values of floating + point registers without sign extension. + +2002-09-17 Andrew Cagney + + * blockframe.c (deprecated_read_register_dummy): Rename + generic_read_register_dummy. + * frame.c (frame_unwind_signed_register): New function. + (frame_unwind_unsigned_register): New function. + * frame.h (frame_unwind_signed_register): Declare. + (frame_unwind_unsigned_register): Declare. + (deprecated_read_register_dummy): Rename + generic_read_register_dummy. + + * h8300-tdep.c (h8300_frame_chain): Update. + (h8300_frame_saved_pc): Update. + * xstormy16-tdep.c (xstormy16_frame_saved_pc): Update. + * rs6000-tdep.c (rs6000_frame_saved_pc): Update. + * s390-tdep.c (s390_frame_saved_pc_nofix): Update. + (s390_frame_chain): Update. + * v850-tdep.c (v850_find_callers_reg): Update. + (v850_frame_saved_pc): Update. + * m32r-tdep.c (m32r_init_extra_frame_info): Update. + (m32r_find_callers_reg): Update. + (m32r_frame_saved_pc): Update. + * sh-tdep.c (sh_find_callers_reg): Update. + (sh64_get_saved_pr): Update. + (sh_init_extra_frame_info): Update. + (sh_init_extra_frame_info): Update. + (sh64_init_extra_frame_info): Update. + (sh64_init_extra_frame_info): Update. + * mcore-tdep.c (mcore_find_callers_reg): Update. + (mcore_frame_saved_pc): Update. + (mcore_init_extra_frame_info): Update. + * i386-tdep.c (i386_frame_saved_pc): Update. + * ia64-tdep.c (ia64_frame_saved_pc): Update. + (ia64_init_extra_frame_info): Update. + (ia64_init_extra_frame_info): Update. + * d10v-tdep.c (d10v_frame_saved_pc): Update. + * cris-tdep.c (cris_init_extra_frame_info): Update. + * avr-tdep.c (avr_frame_chain): Update. + (avr_init_extra_frame_info): Update. + (avr_frame_saved_pc): Update. + * arm-tdep.c (arm_find_callers_reg): Update. + (arm_init_extra_frame_info): Update. + (arm_frame_saved_pc): Update. + +2002-09-17 Tom Tromey + + * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter + is "'". + +2002-09-17 Corinna Vinschen + + * MAINTAINERS: Remove "non multi-arched" text from h8300. + * h8300-tdep.c (h8300_next_prologue_insn) Renamed from + NEXT_PROLOGUE_INSN. + (h8300_examine_prologue): Call h8300_next_prologue_insn instead of + NEXT_PROLOGUE_INSN. + +2002-09-16 Joel Brobecker + + * osfsolib.c: Remove file, replaced by solib-osf.c. + * Makefile.in: Remove compilation rules for osfsolib.c. + +2002-09-16 David Carlton + + * cp-valprint.c (cp_print_class_method): Correct args to + check_stub_method_group. + +2002-09-16 Corinna Vinschen + + * h8300-tdep.c: Multiarch. Drop `set machine' command in favor of + `set architecture'. Unify naming convention of functions. + (h8300_skip_prologue): Improve prologue analysis. + (h8300_push_arguments): Rewritten to more closely match GCC's + bizarre argument-passing behavior, along with the comment describing + said behavior. + * remote-hms.c (hms_regnames): Don't use NUM_REGS in definition. + * config/h8300/tm-h8300.h: Multiarch. Just keep stuff needed by + sim, remote-e7000.c, remote-hms.c and remote.c + +2002-09-15 Mark Kettenis + + * i386-tdep.c (gdb_print_insn_i386): Removed. + (i386_print_insn): New function. + (i386_gdbarch_init): Set print_insn to i386_print_insns. + (_initialize_i386_tdep): Don't initialize tm_print_insn and + tm_print_insn_info. + +2002-09-14 Mark Kettenis + + * gdbtypes.c (check_stub_method_group): Initialize found_stub to + zero. + +2002-09-14 Corinna Vinschen + + * arch-utils.c (legacy_pc_in_sigtramp): Move preprocessor expression + for IN_SIGTRAMP to here. Use IN_SIGTRAMP only if it's defined. + Guard usage of SIGTRAMP_START() by using SIGTRAMP_START_P. + +2002-09-13 Christopher Faylor + + * win32-nat.c (child_create_inferior): Honor 'tty' command. + +2002-09-13 Daniel Jacobowitz + + * gdbtypes.c (check_stub_method): Make static. + (check_stub_method_group): New function. + * gdbtypes.h: Update prototypes. + * cp-support.c: New file. + * cp-support.h: New file. + + * stabsread.c: Include "cp-abi.h" and "cp-support.h". + (update_method_name_from_physname): New function. + (read_member_functions): Correct method names for operators + and v3 constructors/destructors. Separate v2 constructors and + destructors. + * Makefile.in (stabsread.o): Update dependencies. + (SFILES): Add cp-support.c. + (COMMON_OBS): Add cp-support.o. + (cp_support_h, cp-support.o): Add. + + * cp-valprint.c (cp_print_class_method): Call + check_stub_method_group instead of check_stub_method. Remove + extraneous QUITs. + * p-valprint.c (pascal_object_print_class_method): Likewise. + * valops.c (search_struct_method): Likewise. + (find_method_list, value_struct_elt_for_reference): Likewise. + +2002-09-13 Andrew Cagney + + * gdbarch.sh (SIGTRAMP_END): Change to a predicate function. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-09-13 Andrew Cagney + + * frame.c (find_saved_register): Delete function. + * frame.h (find_saved_register): Delete declaration. + Fix PR gdb/631. + +Fri Sep 13 14:59:55 2002 Andrew Cagney + + * mips-tdep.c (read_next_frame_reg): Re-hack using + frame_register_unwind. + +Fri Sep 13 07:42:09 2002 Andrew Cagney + + * mips-tdep.c (mips_get_saved_register): Re-hack using + frame_register_unwind. + +2002-09-12 Joel Brobecker + + * gdbarch.sh (NAME_OF_MALLOC): New variable in the architecture + vector. Will be useful for Interix. + * gdbarch.h, gdbarch.c: Regenerate. + + * valops.c (value_allocate_space_in_inferior): Replace hard-coded + name of the malloc function by NAME_OF_MALLOC. + +2002-09-12 Joel Brobecker + + * value.h (find_function_in_inferior): Add const keyword to + one of the parameters. Allows us to invoke this function with + a const char *. + * valops.c (find_function_in_inferior): Likewise. + +2002-09-12 Joel Brobecker + + * exec.c (xfer_memory): Fix compilation warning with old versions + of GCC. + * tracepoint.c (trace_find_tracepoint_command): Likewise. + +2002-09-12 David Carlton + + * symtab.h: Run through gdb_indent.h. + Add 2002 to Copyright year list. + +2002-09-12 Alan Modra + + * x86-64-tdep.c (_initialize_x86_64_tdep): Don't use hard-coded + mach constants. + * MAINTAINERS: Add myself to write after approval list. + +2002-09-11 J. Brobecker + + * osabi.c (gdb_osabi_name): Add entry for GDB_OSABI_INTERIX. + +2002-09-11 J. Brobecker + + * osabi.h (gdb_osabi): Add new GDB_OSABI_INTERIX enum value for + Interix. + +2002-06-05 Paul N. Hilfinger + + * procfs.c (do_detach): Clear current signal, not just fault. + Corrects problem with breakpoint trap signal leaking to detached + process on Tru64. + +2002-09-10 Michael Snyder + + * buildsym.c (finish_block): Protect against null pointer. + +2002-09-10 Andrew Cagney + + * infcmd.c (default_print_registers_info): Send all output to + ``file'' instead of ``gdb_stdout''. + +2002-09-10 Michael Snyder + + * mips-tdep.c (mips_extract_struct_value_address): Make val a + LONGEST, and use signed register read (addresses are sign- + extended for mips). + +2002-09-10 Stephane Carrez + + * event-loop.c (gdb_do_one_event): Make public. + * event-loop.h (gdb_do_one_event): Declare. + +2002-09-10 Jeff Law + + * infttrace.c (child_resume): Simplify and rework to avoid + TT_PROC_CONTINUE. + +2002-09-09 Fred Fish + + * printcmd.c (print_scalar_formatted): "len" is the number of + target bytes, NOT the number of target bits. + +2002-09-09 Elena Zannoni + + From: Emmanuel Thome' + * top.c (init_main): Set rl_terminal_name. + +2002-09-08 Aidan Skinner + + * ada-lang.c (ada_array_bound, ada_type_match, + _initialize_ada_language): Fix K&R definitions. + * ada-tasks.c (get_current_task): Fix K&R definitions. + * ada-valprint.c (adjust_type_signedness): Fix K&R definitions. + +2002-09-07 Christopher Faylor + + * MAINTAINERS: Remove CE from list of maintainership responsibilities. + Add XP. + +2002-09-06 Mark Kettenis + + * i386-tdep.c (i386_register_virtual_type, + i386_register_convertible, i386_register_convert_to_virtual, + i386_register_comvert_to_raw): Use FP_REGNUM_P and SSE_REGNUM_P + instead of IS_FP_REGNUM and IS_SSE_REGNUM. + (i386_gdbarch_init): Fix comment. Add comments on calls that set + sp_regnum, fp_regnum, pc_regnum, ps_regnum and fp0_regnum. + Don't set push_arguments twice. + + * i386bsd-tdep.c (i386bsd_init_abi): Set sigtramp_start and + sigtramp_end to i386bsd_sigtramp_start and i386bsd_sigtramp_end. + * i386nbsd-tdep.c (i386nbsd_init_abi): Set sigtramp_start and + sigtramp_end to NULL. + * config/i386/tm-fbsd.h (SIGTRAMP_START, SIGTRAMP_END): Remove + defines. + (i386bsd_sigtramp_start, i386_sigtramp_end): Remove prototypes. + + * i386nbsd-tdep.c (i386nbsd_pc_in_sigtramp): Remove spurious + whitespace. + + * gdbarch.sh (SIGTRAMP_START, SIGTRAMP_END): New methods. + * gdbarch.h, gdbarch.c: Re-generate. + * blockframe.c (find_pc_sect_partial_function): Convert to use + SIGTRAMP_START_P predicate. + +2002-09-05 Michael Snyder + + * arm-tdep.c (arm_init_extra_frame_info): Distinguish between + generic_dummy_frame method and old method. Also distinguish + between ARM_FP_REGNUM and THUMB_FP_REGNUM. + (arm_extract_return_value): Use new regcache method. + + * mips-tdep.c (mips_n32n64_push_arguments): Remove alignment + adjustment that doesn't conform to the ABI. + (mips_extract_struct_value_address): Retrieve V0_REGNUM from + saved regcache, not from current regcache. + +2002-09-05 Andrew Cagney + + * NEWS: Update for 5.3. Add new section ``Changes since 5.3''. + * README: Update. + +2002-09-04 Jason Thorpe + + * arm-tdep.c (arm_addr_bits_remove): Don't check for Thumb mode + if arm_apcs_32 is false. + +2002-09-04 Andrew Cagney + + GDB 5.3 branch created. + +2002-09-03 Theodore A. Roth + + * gdb/avr-tdep.c (avr_gdbarch_init): Use + generic_unwind_get_saved_register. + +2002-09-03 David Carlton + + * dwarf2read.c (dwarf2_add_member_fn): Add the 'type' + argument (PR gdb/653). Update call to smash_to_method_type. + (read_structure_scope): Update call to dwarf2_add_member_fn. + +2002-09-03 Michal Ludvig + + * x86-64-linux-tdep.c: Include gdb_string.h + * x86-64-linux-nat.c: Ditto. + +2002-09-02 Jason Thorpe + + * ada-exp.y (yyname, yyrule): Remap global variables that appear + when YYDEBUG is set to 1. + * c-exp.y: Likewise. + * f-exp.y: Likewise. + * jv-exp.y: Likewise. + * m2-exp.y: Likewise. + * p-exp.y: Likewise. + +2002-09-02 Jason Thorpe + + * Makefile.in (i386nbsd-tdep.o): Add $(solib_svr4_h) to + dependency list. + * i386nbsd-tdep.c (i386nbsdelf_init_abi): Set + solib_svr4_fetch_link_map_offsets to + nbsd_ilp32_solib_svr4_fetch_link_map_offsets. + * config/i386/nbsd.mt (TDEPFILES): Add solib.o and solib-svr4.o. + * config/i386/nbsdaout.mh (NATDEPFILES): Remove solib.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Remove solib.o, + solib-svr4.o, and solib-legacy.o. + * config/i386/tm-nbsd.h: Include solib.h. + +2002-09-02 Jason Thorpe + + * configure.tgt (i[3456]86-*-netbsdelf*): Merge with... + (i[3456]86-*-netbsd*): ...this. Set gdb_target to nbsd. + (i[3456]86-*-openbsd*): Make this a separate entry. Add a + comment noting that this needs its own target configuration. + * config/i386/nbsd.mt: New file. + * config/i386/nbsdaout.mt: Remove. + * config/i386/nbsdelf.mt: Ditto. + * config/i386/tm-nbsdaout.h: Ditto. + +2002-09-02 Jason Thorpe + + * i386nbsd-tdep.c (i386nbsd_sigtramp_offset): New function. + (i386nbsd_pc_in_sigtramp): Rewrite to use i386nbsd_sigtramp_offset. + (i386nbsd_init_abi): Don't initialize tdep->sigtramp_start or + tdep->sigtramp_end. + (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end): Remove. + * config/i386/tm-nbsd.h (SIGTRAMP_START, SIGTRAMP_END) + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove. + +2002-09-02 Jason Thorpe + + * Makefile.in (i386nbsd-tdep.o): Add $(arch_utils_h), + $(i386_tdep_h), and $(nbsd_tdep_h) to dependency list. + * i386-tdep.h (i386bsd_init_abi): New prototype. + * i386bsd-tdep.c (i386bsd_init_abi): Remove "static" from + function declaration. + (_initialize_i386bsd_tdep): Don't register OS ABI handlers + for NetBSD-a.out or NetBSD-ELF. + (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end) + (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset) + (i386nbsd_init_abi, i386nbsdelf_init_abi): Move to... + * i386nbsd-tdep.c: ...here. Include arch-utils.h, i386-tdep.h, + and nbsd-tdep.h. + (i386nbsd_pc_in_sigtramp): New function. + (i386nbsd_init_abi): Set gdbarch_pc_in_sigtramp to + i386nbsd_pc_in_sigtramp. + (_initialize_i386nbsd_tdep): Register i386nbsd_init_abi + and i386nbsdelf_init_abi OS ABI handlers. + * config/i386/nbsdaout.mt (TDEPFILES): Add nbsd-tdep.o. + * config/i386/nbsdelf.mt (TDEPFILES): Likewise. + +2002-09-02 Mark Kettenis + + * i386-linux-nat.c (dummy_sse_values): Only try to fill in the SSE + registers if the target really has them. + +2002-08-31 Jason Thorpe + + * Makefile.in (mipsnbsd-tdep.o): Use $(nbsd_tdep_h) rather + than nbsd-tdep.h. + +2002-08-31 Jason Thorpe + + * Makefile.in (alphanbsd-tdep.o): Add $(frame_h) to dependency + list. + * alphanbsd-tdep.c (alphanbsd_sigcontext_addr) + (alphanbsd_skip_sigtramp_frame): New functions. + (alphanbsd_init_abi): Set tdep->skip_sigtramp_frame to + alphanbsd_skip_sigtramp_frame. Set tdep->sigcontext_addr + to alphanbsd_sigcontext_addr. + +2002-08-31 Jason Thorpe + + * Makefile.in (mipsnbsd-tdep.o): Add nbsd-tdep.h to dependency + list. + (nbsd-tdep.o): Add $(gdb_string_h) to dependency list. + * alphanbsd-tdep.c (alphanbsd_pc_in_sigtramp): Use + nbsd_pc_in_sigtramp. + * mipsnbsd-tdep.c: Include nbsd-tdep.h. + (mipsnbsd_pc_in_sigtramp): Use nbsd_pc_in_sigtramp. + * nbsd-tdep.c: Include gdb_string.h. + (nbsd_pc_in_sigtramp): New function. + * nbsd-tdep.h (nbsd_pc_in_sigtramp): New prototype. + * ppcnbsd-tdep.c (ppcnbsd_pc_in_sigtramp): New function. + (ppcnbsd_init_abi): Set gdbarch_pc_in_sigtramp to + ppcnbsd_pc_in_sigtramp. + * shnbsd-tdep.c (shnbsd_pc_in_sigtramp): New function. + (shnbsd_init_abi): Set gdbarch_pc_in_sigtramp to + shnbsd_pc_in_sigtramp. + * sparcnbsd-tdep.c (sparcnbsd_init_abi_elf): Set + gdbarch_pc_in_sigtramp to nbsd_pc_in_sigtramp. + * config/mips/nbsd.mt (TDEPFILES): Add nbsd-tdep.o. + +2002-08-30 Pierre Muller + + * breakpoint.c (breakpoint_init_inferior): Reset the val field of + watchpoints to NULL. + (insert_breakpoints): set val field of watchpoints if NULL. + + +2002-08-29 Jim Blandy + + * symtab.c (lookup_symbol_aux): In the cases where we find a + minimal symbol of an appropriate name and use its address to + select a symtab to read and search, use `name' (as passed to us) + as the demangled name when searching the symtab's global and + static blocks, not the minsym's name. + +2002-08-29 Keith Seitz + + * stack.c (print_frame_info_base): Always set current_source_symtab + and current_source_line. + +2002-08-29 Donn Terry + + * proc-api.c (rw_table): Fix typo in #ifdef PCSHOLD (missing S). + +2002-08-28 Keith Seitz + + * stack.c (select_frame): Add FIXME concerning selected-frame + events. + (select_frame_command): Send selected-frame-level-changed + event notification, but only if the level actually changed. + (up_silently_base): Add selected-frame-level-changed event + notification. + (down_silently_base): Likewise. + +2002-08-28 Andrew Cagney + + * Makefile.in: Update dependencies for all gdb/*.c files. + +2002-08-27 Tom Tromey + + * Makefile.in (osabi.o, i387-tdep.o, i386-linux-nat.o, lin-lwp.o, + ax-gdb.o, signals.o, jv-valprint.o, c-valprint.o, cp-abi.o): + Update dependencies. + * i387-tdep.c: Include gdb_string.h. + * osabi.c: Likewise. + * i386-linux-nat.c: Likewise. + * lin-lwp.c: Likewise. + * ax-gdb.c: Likewise. + * signals/signals.c: Likewise. + * jv-valprint.c: Likewise. + * p-lang.c: Likewise. + * c-valprint.c: Likewise. + * cp-abi.c: Likewise. + +2002-08-27 Elena Zannoni + + * cli/cli-script.h (copy_command_lines): Export. + * breakpoint.c: Include cli/cli-script.h. + * Makefile.in (breakpoint.o): Update dependencies. + +2002-08-26 Michael Snyder + + * breakpoint.c (insert_breakpoints): Protect all references + to 'process_warning'. Shorten long lines. + +2002-08-26 Joel Brobecker + + * cli/cli-script.c (copy_command_lines): New function. + * defs.h (copy_command_lines): Export. + * testsuite/gdb.base/commands.exp: New tests for commands + attached to a temporary breakpoint, and for commands that + delete the breakpoint they are attached to. + +2002-08-26 Michael Snyder + + * breakpoint.c (bpstat_stop_status): Instead of copying the + pointer to the breakpoint commands struct, make a new copy + of the struct and point to that. + (bpstat_clear): Free the commands struct. + (bpstat_clear_actions): Free the commands struct. + (bpstat_do_actions): Free the command actions. Also execute + the local cleanups, instead of deleting them. + (delete_breakpoint): Leave the commands field of the bpstat + chain alone -- it will be freed later. + +2002-08-26 Kevin Buettner + + * rs6000-tdep.c (altivec_register_p): Restore function inadvertently + deleted in 2002-08-20 commit. This function is still used by + ppc-linux-nat.c. + +2002-08-26 Keith Seitz + + * gdb-events.sh: Add selected-frame-level-changed event. + * gdb-events.c: Regenerated. + * gdb-events.h: Regenerated. + +2002-08-26 Stephane Carrez + + Fix PR gdb/393: + * inflow.c (terminal_save_ours): New function to save terminal + settings. + * inferior.h (terminal_save_ours): Declare. + * target.c (debug_to_terminal_save_ours): New function. + (cleanup_target): Defaults to_terminal_save_ours. + (update_current_target): Inherit to_terminal_save_ours. + (setup_target_debug): Set to_terminal_save_ours. + * target.h (target_terminal_save_ours): New to save terminal settings. + (target_ops): New member to_terminal_save_ours. + * gnu-nat.c (init_gnu_ops): Set to_terminal_save_ours. + * hpux-thread.c (init_hpux_thread_ops): Likewise. + * inftarg.c (init_child_ops): Likewise. + * m3-nat.c (init_m3_ops): Likewise. + * procfs.c (init_procfs_ops): Likewise. + * wince.c (init_child_ops): Likewise. + * win32-nat.c (init_child_ops): Likewise. + * sol-thread.c (init_sol_thread_ops): Likewise. + +2002-08-26 Mark Kettenis + + * i386-tdep.c (i386_store_return_value): Undeprecate. Convert to + use regcache_* functions. + (i386_gdbarch_init): Set store_return_value instead of + deprecated_store_return_value. + + * regcache.c (regcache_raw_write_signed, + regcache_raw_write_unsigned): New functions. + * regcache.h (regcache_raw_write_signed, + regcache_raw_write_unsigned): New prototypes. + +2002-08-25 Andrew Cagney + + * Makefile.in (c-exp.tab.o, jv-exp.tab.o, f-exp.tab.o) + (m2-exp.tab.o, p-exp.tab.o, ada-exp.tab.o): Move to before the + source file dependencies. Cleanup corresponding generator rules. + +2002-08-25 Andrew Cagney + + * regcache.h (register_offset_hack): Declare. + (regcache_cooked_read_using_offset_hack): Declare. + (regcache_cooked_write_using_offset_hack): Declare. + + * regcache.c (register_offset_hack): New function. + (regcache_cooked_read_using_offset_hack): New function. + (regcache_cooked_write_using_offset_hack): New function. + (regcache_dump): Check that the registers, according to their + offset, are packed hard against each other. + (cooked_xfer_using_offset_hack): New function. + +2002-08-25 Andrew Cagney + + * regcache.c (struct regcache_descr): Add field register_type. + (init_legacy_regcache_descr): Pass a pre-allocated regcache_descr + in as a parameter + (init_regcache_descr): Initialize register_type. Pass the descr + to init_legacy_regcache_descr. Use register_type instead of + REGISTER_VIRTUAL_TYPE. + (register_type): New function. + (regcache_dump): Replace REGISTER_VIRTUAL_TYPE with register_type. + * regcache.h (register_type): Declare. + +2002-08-25 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Set store_struct_return + instead of deprecated_store_return_value. Fix fallout from + 2002-08-23 Andrew Cagney . + +2002-08-25 Andrew Cagney + + * regcache.c (max_register_size): New function. + (init_legacy_regcache_descr): Ensure that max_register_size is + large enough for REGISTER_VIRTUAL_SIZE. + * regcache.h (max_register_size): Declare. + +2002-08-24 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Use deprecated version of + store_return_value. + (e500_extract_return_value): Change type of valbuf pointer to + void. + +2002-08-24 Mark Kettenis + + * PROBLEMS: Clarify problems with FreeBSD's compiler and suggest + workaround. + + * valprint.c (print_longest) [CC_HAS_LONG_LONG && + PRINTF_HAS_LONG_LONG]: Cast val_long to (long long) or (unsigned + long long) to prevent compiler warning on 64-bit systems. + +2002-08-23 Andrew Cagney + + * gdbarch.sh (STORE_RETURN_VALUE): Add regcache parameter. + (DEPRECATED_STORE_RETURN_VALUE): New method. + (EXTRACT_RETURN_VALUE): Make buffer parameter a void pointer. + * gdbarch.h, gdbarch.c: Re-generate. + + * values.c (set_return_value): Pass current_regcache to + STORE_RETURN_VALUE. + * arch-utils.h (legacy_store_return_value): Declare. + * arch-utils.c (legacy_store_return_value): New function. + (legacy_extract_return_value): Update parameters. + + * config/pa/tm-hppa.h (DEPRECATED_STORE_RETURN_VALUE): Rename + STORE_RETURN_VALUE. + * config/pa/tm-hppa64.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/sparc/tm-sparc.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/z8k/tm-z8k.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/sparc/tm-sparclet.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/mn10200/tm-mn10200.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/m68k/tm-linux.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/m68k/tm-delta68.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/m32r/tm-m32r.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/h8500/tm-h8500.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + * config/h8300/tm-h8300.h (DEPRECATED_STORE_RETURN_VALUE): Ditto. + + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * i386-tdep.c (i386_extract_return_value): Update. + * arch-utils.c (legacy_extract_return_value): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * d10v-tdep.c (d10v_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * m68k-tdep.c (m68k_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * i386-tdep.c (i386_gdbarch_init): Update. + +2002-08-23 Andrew Cagney + + * config/djgpp/fnchange.lst: Add entries for bfd/elf32-ppcqnx.c, + bfd/elf32-ppc.c, bfd/elf32-sh.c and bfd/elf32-shqnx.c. + +2002-08-24 Mark Kettenis + + * PROBLEMS: Refer to GDB 5.3 instead of 5.2. Mention FreeBSD + problems. + +2002-08-23 Joel Brobecker + + * infrun.c (handle_inferior_event): Move a comment outside of a + function call, in order to avoid indent reformatting this part + of the code in an unreadable way. + +2002-08-23 Grace Sainsbury + + * infrun.c (normal_stop, proceed): Remove call to print_sys_errmsg + when breakpoints fail. Move general breakpoint error messages to + insert_breakpoints. + * breakpoint.c (insert_breakpoints): Change warnings when + breakpoints are nto inserted to specify the type. Remove call to + memory_error when hardware breakpoints can't be inserted. Remove + multiple calls to warning so all messages are sent to the user at + once. + (delete_breakpoints): Make insert error messsages more explicit. + +2002-08-23 Daniel Jacobowitz + + * ChangeLog: Move gdbserver entries after GDB 5.2 to + gdbserver/ChangeLog. + +2002-08-23 Mark Kettenis + + * i386-tdep.c: Include "objfiles.h". + (i386_svr4_init_abi): Set in_solib_call_trampoline and + skip_trampoline_code. + * config/i386/tm-i386v4.h: Don't include "config/tm-sysv4.h". + (CPLUS_MARKER): Define to '.'. + + * linux-proc.c (struct linux_corefile_thread_data): Add num_notes + member. + (linux_corefile_thread_callback): Increase args->num_notes. + (linux_make_note_section): Initialize thread_args.num_notes, and + use it to determine whether notes for any threads were created. + +2002-08-23 Donn Terry + + * proc-api.c (rw_table): Do not include a row for PCDSTOP if the + corresponding macro is not defined. Likewise for PCNICE, PCSHOLD + and PCUNKILL. + (write_with_trace): Conditionalize out the switch branch handling + PCSHOLD if the corresponding macro is not defined. Likewise for + PRSABORT and PRSTOP. + This change will be needed by the Interix port. + +2002-08-22 Elena Zannoni + + * ppc-sysv-tdep.c (ppc_sysv_abi_push_arguments): use + write_register wherever possible instead of manipulating the + register bytes directly. + Assign VALUE_CONTENTS to a variable and use that. + The GPR numbers are now dependent on the architecture. + +2002-08-22 Elena Zannoni + + * rs6000-tdep.c (struct rs6000_framedata): Add saved_ev and + ev_offset fields. + (skip_prologue): Add support for BookE/e500 instructions. + (e500_extract_return_value): New function. + (frame_get_saved_regs): Add support for saving ev registers and + pseudo gpr's. + (e500_store_return_value): New function. + (rs6000_gdbarch_init): Move up default intializations of + deprecated_extract_return_value and store_return_value. Overwrite + init of store_return_value with e500 specific version. + Set extract_return_value for e500. + +2002-08-22 Elena Zannoni + + * blockframe.c (generic_call_dummy_register_unwind): Use + regcache_cooked_read to catch cases in which the variable is + stored in a pseudo register. + +2002-08-22 Andrew Cagney + + * NEWS: Mention that the i960 has been made obsolete. + * Makefile.in (SFILES): Delete remote-nrom.c, remote-nindy.c and + i960-tdep.c + (remote-nrom.o): Obsolete target. + (remote-nindy.o, i960-tdep.o): Ditto. + * remote-nrom.c: Make file obsolete. + * remote-nindy.c, remote-vx960.c: Ditto. + * config/i960/vxworks960.mt, config/i960/nindy960.mt: Ditto. + * config/i960/mon960.mt, config/i960/tm-i960.h: Ditto. + * config/i960/tm-vx960.h, config/i960/tm-nindy960.h: Ditto. + * config/i960/tm-mon960.h, i960-tdep.c: Ditto. + * configure.tgt: Make i960-*-bout*, i960-nindy-coff*, + i960-*-coff*, i960-nindy-elf*, i960-*-elf*, i960-*-nindy* and + i960-*-vxworks* obsolete. + * MAINTAINERS: Note that the i960 is obsolete. + +2002-08-21 Corinna Vinschen + + * MAINTAINERS: Change the s390 target to s390-linux-gnu (second + attempt). + +2002-08-22 Jim Blandy + + * coffread.c (coff_symfile_read): Don't try to read the line + number table from disk if the image file doesn't have a symbol + table; we'll never actually look at the info anyway, and Windows + ships DLL's with bogus file offsets for the line number data. + +2002-08-21 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Figure out whether we have + an e500 executable. + +2002-08-21 Michael Snyder + + * mips-tdep.c (MSYMBOL_IS_SPECIAL): Replace macro with function. + (MSYMBOL_SIZE): Replace macro with function. + (DEFAULT_MIPS_TYPE): Delete unused macro. + * config/mips/tm-mips.h (DEFAULT_MIPS_TYPE): Delete unused macro. + * config/mips/tm-embed.h (DEFAULT_MIPS_TYPE): Delete unused macro. + +2002-08-21 Jim Blandy + + * valops.c (value_cast): Simplify and correct logic for doing a + static cast from a pointer to a base class to a pointer to a + derived class. + +2002-08-21 Andrew Cagney + + * infcmd.c (default_print_registers_info): Replace + do_registers_info. + (registers_info): Use gdbarch_print_registers_info instead of + DO_REGISTERS_INFO. + * inferior.h (default_print_registers_info): Replace + do_registers_info. + * gdbarch.sh (PRINT_REGISTERS_INFO): New method. + (DO_REGISTERS_INFO): Change to a predicate function. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-21 Keith Seitz + + * gdb-events.sh: Add target-changed event. + * gdb-events.c: Regenerated. + * gdb-events.c: Regenerated. + * valops.c (value_assign): Add target-changed event notification + to inlval_register, lval_memory, and lval_reg_frame_relative. + +2002-08-21 Joel Brobecker + + * NEWS: Add an entry regarding the improvement of the next/step + operation on Alpha Tru64 multi-processor machines. + +2002-08-21 Andrew Cagney + + * Makefile.in: Update dependencies for mi/ cli/ and tui/ + directores. + * Makefile.in: Update all _h macro definitions. + * Makefile.in (install-gdbtk): Move to install section. + (rdi-share/libangsd.a): Move to end of file. + +2002-08-19 Andrew Cagney + + * frame.c (frame_register_unwind): When a register, set addrp to + the register's byte. + +2002-08-20 Michael Snyder + + * mips-tdep.c (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): These are only + used locally, so move them from the target machine header to here. + (mips_set_processor_type, mips_register_name, mips32_next_pc, + mips16_next_pc, cached_proc_desc, mips_set_processor_type): + Make static. + * config/mips/tm-mips.h (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Delete. + +2002-08-20 Andrew Cagney + + * NEWS: Mention that the Apollo line was made obsolete. + * configure.tgt: Make m68*-apollo*-bsd*, m68*-hp-bsd*, and + m68*-hp-hpux* obsolete. + * configure.host: Make m68*-apollo*-sysv*, m68*-apollo*-bsd*, + m68*-hp-bsd* and m68*-hp-hpux* obsolete. + * buildsym.c (make_blockvector): Make static. + * buildsym.h (make_blockvector): Make extern declaration obsolete. + * Makefile.in (HFILES_NO_SRCDIR): Remove dst.h + (ALLDEPFILES): Remove dstread.c. + (dstread.o): Obsolete make rule. + * dstread.c: Makefile obsolete. + * dst.h: Ditto. + * config/m68k/hp300hpux.mt: Ditto. + * config/m68k/hp300hpux.mh: Ditto. + * config/m68k/hp300bsd.mt: Ditto. + * config/m68k/hp300bsd.mh: Ditto. + * config/m68k/apollo68b.mt: Ditto. + * config/m68k/apollo68v.mh: Ditto. + * config/m68k/apollo68b.mh: Ditto. + +2002-08-20 Michael Snyder + + * mips-tdep.c (mips_in_return_stub): Make static. + (mips_gdbarch_init): Set in_solib_return_trampoline. + * config/mips/tm-mips.h (IN_SOLIB_RETURN_TRAMPOLINE): Delete. + +2002-08-20 Michael Snyder + + * gdbarch.sh (IN_SOLIB_RETURN_TRAMPOLINE): Add. + * gdbarch.c, gdbarch.h: Regenerate. + * arch-utils.c, arch-utils.h (generic_in_solib_return_trampoline): + Add. + * infrun.c (IN_SOLIB_RETURN_TRAMPOLINE): Delete default definition. + +2002-08-20 Michael Snyder + + * mips-tdep.c (mips_skip_stub, mips_in_call_stub): Make static. + (mips_gdbarch_init): Set skip_trampoline_code, + in_solib_call_trampoline. + * config/mips/tm-mips.h (REGISTER_NAME): Delete. + (IN_SOLIB_CALL_TRAMPOLINE, SKIP_TRAMPOLINE_CODE): Delete. + +2002-08-20 Elena Zannoni + + * ppc-tdep.h (struct gdbarch_tdep): Add ev registers. + + * rs6000-tdep.c (rs6000_register_virtual_type): Return 64 bit + vector type for ev registers. + (e500_pseudo_register_read): New function. + (e500_pseudo_register_write): New function. + (e500_dwarf2_reg_to_regnum): New function. + (PPC_UISA_NOFP_SPRS): New macro. + (PPC_EV_REGS): New macro. + (PPC_GPRS_PSEUDO_REGS): New macro. + (registers_e500): New register set for e500. + (variants): Add e500 variant. + (rs6000_gdbarch_init): Move setting of pc, sp, fp regnums to + before setting architectural dependent variations. Initialize ev + registers numbers. Add case for e500 architecture. Set the + number of pseudo registers. + +2002-08-20 Elena Zannoni + + * rs6000-tdep.c: Clean up comments. + +2002-08-20 Andrew Cagney + + * h8300-tdep.c: Re-indent file. + +2002-08-20 Jim Blandy + + * Makefile.in (LDFLAGS): Allow the configure script to establish a + default for this. + +2002-08-20 Keith Seitz + + * breakpoints.c (watch_command_1): Use internal breakpoint + when setting a watchpoint_scope breakpoint. + +2002-08-20 Elena Zannoni + + * gdbtypes.c (build_builtin_type_vec64): Add name to type. + (build_builtin_type_vec64i): Ditto. + (build_builtin_type_vec128): Ditto. + (build_builtin_type_vec128i): Ditto. + +2002-08-19 Michael Snyder + + * config/mips/tm-mips.h (ELF_MAKE_MSYMBOL_SPECIAL): Delete. + (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Change into functions. + (FIX_CALL_DUMMY, PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME, + POP_FRAME, INIT_EXTRA_FRAME_INFO): Delete. + (CALL_DUMMY_START_OFFSET, CALL_DUMMY_BREAKPOINT_OFFSET, + CALL_DUMMY_ADDRESS): Delete. + * mips-tdep.c (mips_elf_make_msymbol_special, mips_msymbol_size, + mips_msymbol_is_special, mips_fix_call_dummy): New functions. + (mips_gdbarch_init): Set elf_make_msymbol_special, pop_frame, + push_dummy_frame, fix_call_dummy, init_extra_frame_info, + push_return_address. + (mips_register_raw_size, mips_eabi_use_struct_convention, + mips_n32n64_use_struct_convention, mips_o32_use_struct_convention, + mips_o32_reg_struct_has_addr, mips_frame_saved_pc, mips_frame_chain, + mips_init_extra_frame_info, mips_eabi_push_arguments, + mips_n32n64_push_arguments, mips_push_return_address, + mips_push_dummy_frame, mips_pop_frame, mips_skip_prologue, + mips_breakpoint_from_pc, mips_call_dummy_address): Make static. + +2002-08-19 Michael Snyder + + * mips-tdep.c (mips_frame_num_args): New function. + (mips_gdbarch_init): Set frame_chain, frameless_function_invocation, + frame_saved_pc, frame_args_address, frame_locals_address, + frame_num_args, and frame_args_skip. + * config/mips/tm-mips.h (FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, + FRAME_SAVED_PC, FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, + FRAME_NUM_ARGS, FRAME_ARGS_SKIP): Delete. + * config/mips/tm-mipsv4.h (FRAME_CHAIN_VALID): Delete. + +2002-08-20 Michael Snyder + + * config/mips/tm-mips.h (STORE_STRUCT_RETURN): Delete. + (EXTRACT_STRUCT_VALUE_ADDRESS): Delete. + * mips-tdep.c (mips_store_struct_return): New function. + (mips_extract_struct_value_address): New function. + (mips_gdbarch_init): Set store_struct_return and + extract_struct_value_address. + +2002-08-20 David Carlton + + * dwarf2read.c (dwarf2_build_psymtabs): Check that + dwarf_line_offset is nonzero before creating dwarf_line_buffer. + (read_file_scope): Check that line_header is nonzero before + decoding macro information. + +2002-08-20 Mark Kettenis + + * i386-tdep.h (FP_REGNUM_P): Change such that we don't incorrectly + flag the general-purpose registers as floating-point on targets + that don't support the floating-point registers. + +2002-08-20 Elena Zannoni + + * rs6000-tdep.c (altivec_register_p): Delete. + (rs6000_do_altivec_registers): Delete. + (rs6000_altivec_registers_info): Delete. + (rs6000_do_registers_info): Delete. + (_initialize_rs6000_tdep): Remove command 'info powerpc altivec'. + (rs6000_gdbarch_init): Remove setting of do_registers_info. + +2002-08-20 Elena Zannoni + + * infcmd.c (do_registers_info): Print vector registers in hex + format only. + (print_vector_info): Check that printing registers + makes sense. + (print_float_info): Ditto. + +2002-08-20 Andrew Cagney + + * mips-tdep.c (mips_gdbarch_init): Update. + (mips_o32_extract_return_value): Rewrite. + (mips_o32_store_return_value): Rewrite. + (mips_o32_xfer_return_value): New function. + (mips_xfer_register): Tweak debug print message. Allow for + buf_offset when dumping the value transfered. + +2002-08-20 Andrew Cagney + + * config/mips/tm-nbsd.h (MIPS_DEFAULT_ABI): Delete. + * config/mips/tm-linux.h (MIPS_DEFAULT_ABI): Delete. + * config/mips/tm-irix5.h (MIPS_DEFAULT_ABI): Delete. + * config/mips/tm-irix6.h (MIPS_DEFAULT_ABI): Delete. + * mips-tdep.c (mips_gdbarch_init) [MIPS_DEFAULT_ABI]: Delete code. + +2002-08-14 Michael Snyder + + * mips-tdep.c (mips_frame_chain): Check for call-dummy frames. + +2002-08-19 Elena Zannoni + + * rs6000-tdep.c (struct reg): Add field to indicate a pseudo + register. + (P): New macro to define a register as a pseudo register. + (R, R4, R8, R16, FR32, R64, R0): Updated. + (struct variant): Add new fields for number of pseudo registers + and number of total registers. + (tot_num_registers): New macro replacing.... + (num_registers): ...deleted macro. + (num_registers): New function. + (num_pseudo_registers): New function. + (variants): Update all variants to intialize new fields correctly. + Postpone initialization of number of pseudo regs and real regs. + (init_variants): New function. + (rs6000_gdbarch_init): Initialize variants. Update calculation of + registers offsets. + +2002-08-19 David Carlton + + * valops.c (search_struct_field): Change error message to treat + return value of 0 from value_static_field as meaning that field is + optimized out. + (value_struct_elt_for_reference): Ditto. + * values.c (value_static_field): Treat an unresolved location the + same as a nonexistent symbol. Fix PR gdb/635. + * gnu-v2-abi.c (gnuv2_value_rtti_type): Eliminate test for being + enclosed. Fix PR gdb/574. + * MAINTAINERS: Add self to Write After Approval list. + +2002-08-19 Andrew Cagney + + * mips-tdep.c (mips_xfer_register): New function. + (mips_n32n64_extract_return_value): Rewrite. + (mips_gdbarch_init): For N32 and N64, set extract_return_value + instead of deprecated_extract_return_value. + +2002-08-19 Elena Zannoni + + * rs6000-tdep.c (TDEP): Delete macro. + (branch_dest): Replace use of TDEP macro with its body. + (rs6000_pop_frame): Ditto. + (rs6000_push_arguments): Ditto. + (rs6000_skip_trampoline_code): Ditto. + (rs6000_frame_saved_pc): Ditto. + (rs6000_frame_chain): Ditto. + (rs6000_register_name): Ditto. + (rs6000_register_byte): Ditto. + (rs6000_register_raw_size): Ditto. + (rs6000_register_virtual_type): Ditto. + (rs6000_register_convertible): Ditto. + (rs6000_convert_from_func_ptr_addr): Ditto. + +2002-08-19 Daniel Jacobowitz + + * config/mips/tm-linux.h (REALTIME_LO, REALTIME_HI): Define + conditionally. + (JB_PC, JB_ELEMENT_SIZE): Rename to MIPS_LINUX_JB_PC and + MIPS_LINUX_JB_ELEMENT_SIZE. + * mips-linux-tdep.c (supply_gregset, fill_gregset): Use alloca + for MAX_REGISTER_RAW_SIZE arrays. + (mips_linux_get_longjmp_target): Use MIPS_LINUX_JB_PC and + MIPS_LINUX_JB_ELEMENT_SIZE. + +2002-08-19 Pierre Muller + + * i387-tdep.c (i387_print_float_info): Fix typo in comment. + +2002-08-19 Aidan Skinner + + * Makefile.in (SFILES): Add ada-exp.y ada-lang.c ada-typeprint.c + ada-valprint.c ada-tasks.c. + (YYFILES): Add ada-exp.y. + (ada-exp.tab.c ada-lex.c ada-lang.o): New target. + (ada-tasks.o ada-typeprint.o ada-valprint.o): New target. + (ada-exp.tab.o): New target. + +2002-08-18 Andrew Cagney + + * regcache.c (regcache_xfer_part): New function. + (regcache_raw_read_part): New function. + (regcache_raw_write_part): New function. + (regcache_cooked_read_part): New function. + (regcache_cooked_write_part): New function. + * regcache.h (regcache_raw_read_part): Declare. + (regcache_raw_write_part): Declare. + (regcache_cooked_read_part): Declare. + (regcache_cooked_write_part): Declare. + +2002-08-18 Daniel Jacobowitz + + * remote.c (remote_open_1): Add async_p. + (remote_async_open_1): Delete. + (open_remote_target): Delete. + (remote_open, extended_remote_open): Update calls to remote_open_1. + (remote_async_open, extended_remote_async_open): Call + remote_open_1 instead of remote_async_open_1. + +2002-08-19 Mark Kettenis + + * blockframe.c: Fix a few coding standard violations. + +2002-08-19 Mark Kettenis + + * config/i386/nm-i386sco5.h (START_INFERIOR_TRAPS_EXPECTED): Moved + here from ... + * config/i386/tm-i386sco5.h: ... here. File removed. + * config/i386/i386sco5.mt (TM_FILE): Set to tm-i386v4.h. + + * config/i386/nm-i386v.h (START_INFERIOR_TRAPS_EXPECTED): New define. + * config/i386/i386aout.mt (TDEPFILES): Add i387-tdep.o + (TM_FILE): Set to tm-i386.h. + * config/i386/i386v.mt (TM_FILE): Set to tm-i386.h. + * config/i386/tm-i386v.h: Remove file. + * config/i386/tm-ptx.h [!SEQUENT_PTX4]: Include "i386/tm-i386.h" + instead of "i386/tm-i386v.h". + (START_INFERIOR_TRAPS_EXPECTED): Remove define. + * config/i386/tm-symmetry: Include "i386/tm-i386.h" instead of + "i386/tm-i386v.h". + (START_INFERIOR_TRAPS_EXPECTED): Remove define. + * config/i386/tm-vxworks.h: Include "i386/tm-i386.h" instead of + "i386/tm-i386.h". + +2002-08-18 Mark Kettenis + + * config/i386/nm-i386v.h: Add protection against + multiple-inclusion. + (i386_register_u_addr): Remove prototype. + (register_u_addr): New prototype. + (REGISTER_U_ADDR): Redefine accordingly. + * i386v-nat.c: Improve several comments. + (i386_register_u_addr): Change signature and rename to + register_u_addr. Use FP_REGNUM_P. Rewrite slightly to get rid of + ubase variable. + +2002-08-18 Andrew Cagney + + * config/mips/tm-mips.h (STORE_RETURN_VALUE): Delete macro. + (DEPRECATED_EXTRACT_RETURN_VALUE): Delete macro. + * mips-tdep.c (mips_gdbarch_init): Set store_return_value and + deprecated_extract_return_value. + (mips_o32_push_arguments, mips_o64_push_arguments): Clone and + rename mips_o32o64_push_arguments. + (mips_gdbarch_init): Update. + (mips_extract_return_value): Delete. + (mips_o32_extract_return_value): Clone mips_extract_return_value. + (mips_o64_extract_return_value): Clone mips_extract_return_value. + (mips_eabi_extract_return_value): Clone mips_extract_return_value. + (mips_n32n64_extract_return_value): Clone + mips_extract_return_value. + (mips_store_return_value): Delete. + (mips_o32_store_return_value): Clone mips_store_return_value. + (mips_o64_store_return_value): Clone mips_store_return_value. + (mips_eabi_store_return_value): Clone mips_store_return_value. + (mips_n32n64_store_return_value): Clone mips_store_return_value. + +2002-08-18 Aidan Skinner + + * ada-lang.c: Use gdb_string.h instead of . + * ada-typeprint.c: Use gdb_string.h instead of . + +2002-08-18 Aidan Skinner + + * ada-lang.c: Run through gdb_indent.sh. + * ada-lang.h: Run through gdb_indent.sh. + * ada-tasks.c: Run through gdb_indent.sh. + * ada-typeprint.c: Run through gdb_indent.sh. + * ada-valprint.c: Run through gdb_indent.sh. + +2002-08-18 Andrew Cagney + + * osabi.c (gdbarch_init_osabi): Don't complain about an unknown + ABI. + +2002-08-18 Mark Kettenis + + * i386b-nat.c [FETCH_INFERIOR_REGISTERS]: Remove dead code. + + * config/i386/nm-i386bsd.h (FLOAT_INFO): Remove redundant #undef. + * i386b-nat.c [FLOAT_INFO]: Remove dead code. + + * i386-tdep.c (i386_do_pop_frame, i386_store_return_value): Call + write_register_gen instead of write_register_bytes. + + * NEWS: Mention that the i[3456]-*mach3*, i[3456]-*-mach* and + i[3456]-*-osf1mk* configurations have been made obsolete. + * configure.host: Make i[3456]86-*-mach3*, i[3456]86-*mach* and + i[3456]86-*-osf1mk* hosts obsolete. + * confighure.tgt: Make i[3456]86-*-mach3*, i[3456]86-*-osf1mk* + targets obsolete. + * config/i386/i386mach.mh, config/i386/nm-i386mach.h, + config/i386/xm-i386mach.h, config/i386/i386m3.mh, + config/i386/i386m3.mt, config/i386/nm-m3.h, + config/i386/tm-i386m3.h, config/i386/xm-i386m3.h, + config/i386/i386mk.mh, config/i386/i386mk.mt, + config/i386/tm-i386mk.h, config/i386/xm-i386mk.h: Make files + obsolete. + * i386mach-nat.c, i386m3-nat.c: Make files obsolete. + * Makefile.in (ALLDEPFILES): Remove i386mach.c i386m3-nat.c + (i386mach-nat.o, i386m3-nat.o):Make targets obsolete. + +2002-08-18 Andrew Cagney + + * config/pa/tm-hppa.h (hppa_store_return_value): Declare. + (hppa_value_returned_from_stack): Declare. + (hppa_extract_return_value): Declare. + * config/pa/hppa.mt: New file. + * configure.tgt: Recognize hppa*-*-*. + * MAINTAINERS: Change HPPA target to hppa-elf. Still broken. + +2002-08-18 Mark Kettenis + + * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Fix typo in + comment. + +2002-08-17 Mark Kettenis + + * top.c (gdb_rl_operate_and_get_next): Make sure + operate-and-get-next functions correctly even when the history + list is completely filled. + +2002-08-18 Andrew Cagney + + * MAINTAINERS (Target Instruction Set Architectures): Rename + Target/Architectures. Replace vax-dec-vms5.5 with vax-netbsd. + Replace s390-linux with s390-linux-gnu. Remove i386-aout, + mcore-pe, mips64-elf, sparc64-elf. Remove i586-pc-msdosdjgpp, + already listed under Host/Native. + + * configure.tgt: Combine i[3456]86-*-coff*, i[3456]86-*-elf*, + i[3456]86-*-pe*, and i[3456]86-*-aout* into i[3456]86-*-*. Add + mips*-*-*. + +2002-08-17 Andrew Cagney + + * config/ia64/ia64.mt: New file. + * config/alpha/alpha.mt: New file. + * MAINTAINERS: Change the alpha target to alpha-elf and IA-64 to + ia64-linux-gnu. Mention that ia64-elf is broken. + * configure.tgt: Add alpha*-*-* and ia64*-*-* patterns. + +2002-08-17 Mark Kettenis + + * i386-tdep.c (i386_svr4_init_abi, i386_nw_init_abi): Use + generic_func_frame_valid instead of func_frame_valid. + +2002-08-16 Joel Brobecker + + * alpha-osf1-tdep.c (alpha_osf1_init_abi): Unfortunately, + procfs appears to be broken when debugging on multi-processor + machines. So enable software single stepping in order to avoid + using the procfs interface to do next/step operations, using + internal breakpoints instead. + + * infrun.c (handle_inferior_event): Readjust the stop_pc by + DECR_PC_AFTER_BREAK when hitting a single step breakpoint, to + make this pc address equal to the value it would have if the + system stepping capability was used. Also set a new flag used + to ensure that we don't readjust the PC one more time later. + + * breakpoint.c (bpstat_stop_status): Do not adjust the PC + address by DECR_PC_AFTER_BREAK when software single step is + in use for this architecture, as this has already been taken + care of in handle_inferior_event(). + +2002-08-16 Joel Brobecker + + * infrun.c (handle_inferior_event): Minor reformatting, to make + a rather long condition expression easier to read. + +2002-08-16 Andrew Cagney + + * Makefile.in (gdbtk.o): Move to end of file. + (gdbtk-bp.o, gdbtk-cmds.o): Ditto. + (gdbtk-hooks.o, gdbtk-register.o): Ditto. + (gdbtk-stack.o, gdbtk-varobj.o): Ditto. + (gdbtk-wrapper.o, gdbres.o): Ditto. + +2002-08-16 Andrew Cagney + + * Makefile.in (copying.o): Separate out compile rule. + (hpux-thread.o, procfs.o, signals.o): Ditto. + (v850ice.o, z8k-tdep.o): Ditto. + (tui-file.o): Move to TUI section. + (xdr_ptrace.o, xdr_rdb.o, xdr_ld.o): Move to separate section. + (nindy.o, Onindy.o, ttyflush.o): Move to separate section. + +2002-08-16 Joel Brobecker + + * i386-tdep.c (i386_pe_skip_trampoline_code): renamed from + skip_trampoline_code, for better namespace-proofing. + + * i386-tdep.h (i386_pe_skip_trampoline_code): Add declaration. + +2002-08-16 Joel Brobecker + + * config/i386/tm-cygwin.h: Remove some "#if 0"'ed macros. + +2002-08-16 Joel Brobecker + + * infrun.c (handle_inferior_event): When receiving a SIGTRAP + signal, check whether we hit a breakpoint before checking for a + single step breakpoint. Otherwise, GDB fails to notice that a + breakpoint has been hit when stepping onto a breakpoint. + +2002-08-16 Keith Seitz + + * gdb-events.sh (clear_gdb_event_hooks): New function. + * gdb-events.c: Regenerate. + * gdb-events.h: Regenerate. + +2002-08-16 Andrew Cagney + + * breakpoint.c (bpstat_stop_status): Rename not_a_breakpoint to + not_a_sw_breakpoint. + * breakpoint.h (bpstat_stop_status): Add parameter names. + +2002-08-16 Grace Sainsbury + + * remote.c (remote_insert_hw_breakpoint) + (remote_remove_hw_breakpoint): Fix calculation of length field + for Z-packet. + +2002-08-15 Michael Snyder + + * irix5-nat.c (supply_gregset): Allocate plenty-big buffer + (32 bytes) instead of using MAX_REGISTER_RAW_SIZE. + (supply_fpregset): Ditto. + + * config/mips/tm-mips.h (REGISTER_CONVERT_TO_VIRTUAL, + REGISTER_CONVERT_TO_RAW, REGISTER_CONVERTIBLE, + MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE): Delete. + (TARGET_READ_SP): Delete. + (DO_REGISTERS_INFO): Delete. + (FUNCTION_START_OFFSET, IN_SIGTRAMP, REGISTER_VIRTUAL_SIZE): + Delete. + (REGISTER_CONVERT_FROM_TYPE, REGISTER_CONVERT_TO_TYPE): Convert + from macros to functions. + + * mips-tdep.c (mips_gdbarch_init): Set the above in the gdbarch. + (mips_register_convertible, mips_register_convert_to_virtual, + mips_register_convert_to_raw): Make static. + (mips_read_sp): New function. + (mips_gdbarch_init): Set gdbarch read_sp to mips_read_sp. + (mips_do_registers_info): Make static. + (mips_gdbarch_init): Insert mips_do_registers_info into gdbarch. + (in_sigtramp): Make static, rename to mips_pc_in_sigtramp. + (mips_register_convert_from_type, mips_register_convert_to_type): + New functions. + (mips_gdbarch_init): Set up function_start_offset, + register_virtual_size, pc_in_sigtramp. + +2002-08-15 Andrew Cagney + + * infcmd.c (vector_info): New function. + (_initialize_infcmd): Add command "info vector". + (print_vector_info): New function. + + * gdbarch.sh (PRINT_VECTOR_INFO): New method + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-15 Andrew Cagney + + * infcmd.c (do_registers_info): Rename parameter ``fpregs'' to + ``print_all''. Only print vector registers when ``print_all''. + +2002-08-15 Andrew Cagney + + * i387-tdep.h (i387_print_float_info): Add `args' parameter. + * i387-tdep.c (i387_print_float_info): Add `args' parameter. + + * gdbarch.sh (PRINT_FLOAT_INFO): Change to a predicate method. + Add `args' parameter. + * gdbarch.h, gdbarch.c: Regenerate. + + * arm-tdep.c (arm_print_float_info): Add the parameter `args'. + + * infcmd.c (float_info): Call print_float_info. + (print_float_info): New function. By default, print the + floating-point registers. + + * arch-utils.h (default_print_float_info): Delete declaration. + * arch-utils.c (default_print_float_info): Delete function. + +2002-08-16 Mark Kettenis + + * config/i386/nm-i386v.h (FLOAT_INFO): Remove already commented + out define. + + * i387-tdep.c (i387_print_float_info): Add comment about ignoring + FRAME. + + * NEWS: Mention that the i[3456]-*-aix target has been made obsolete. + * configure.host: Make i[3456]86-*-aix host obsolete. + * configure.tgt: Make i[3456]86-*-aix target obsolete. + * config/i386/i386aix.mh, config/i386/i386aix.mt, + config/i386/nm-i386aix.h, condig/i386/tm-i386aix.h, + config/i386/xm-i386aix.h: Make files obsolete. + * i386aix-nat.c: Make file obsolete. + * Makefile.in (ALLDEPFILES): Remove i386aix-nat.c. + (i386aix-nat.o): Make target obsolete. + + * config/i386/nm-gnu.h: Removed. + * config/i386/nm-i386gnu.h: New file. + (THREAD_STATE_FLAVOR, THREAD_STATE_SIZE, + THREAD_STATE_SET_TRACED, THREAD_STATE_CLEAR_STATE, ATTACH_DETACH): + Moved here from ... + * config/i386/tm-i386gnu.h: ... here. Removed. + * config/i386/xm-i386gnu.h: Removed. + * config/i386/i386gnu.mh (XM_FILE): Set to xm-i386.h. + (NAT_FILE): Set to nm-i386gnu.h. + * config/i386/i386gnu.mt (TDEPFILES): Add i386gnu-tdep.o. + * i386-tdep.c: New file. + * Makefile.in (ALLDEPFILES): Add i386gnu-nat.c and i386gnu-tdep.c. + (i386gnu-tdep.o): Specify dependencies. + +2002-08-15 Mark Kettenis + + * config/i386/tm-i386sco5.h: Include "i386/tm-i386v4.h" instead of + "i386/tm-i386.h", "i386/tm-i386v.h" and "config/tm-sysv.h". + Adjust a few comments to reflect reality a bit closer. + (KERNEL_U_SIZE, TARGET_HAS_HARDWARE_WATCHPOINTS, + TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUEABLE_WATCHPOINT, + HAVE_STEPPABLE_WATCHPOINT, STOPPED_BY_WATCHPOINT, + target_insert_watchpoint, target_remove_watchpoint): + Move defines to ... + * config/i386/nm-i386sco5.h: ... here. + (kernel_u_size): Add prototype. Improve a few comments and add + protection against multiple inclusion. + + * config/i386/nm-i386sco.h (FLOAT_INFO): Remove already commented + out define. + + * uw-thread.c (SP_ARG0): Define if not already defined. + * config/i386/tm-i386.h (SO_ARG0): Remove define. + + * config/i386/tm-i386v4.h (HAVE_I387_REGS): Remove define. + + * config/i386/tm-i386.h: Don't include "regcache.h". + + * i387-tdep.h (i387_print_float_info): New prototype. + * i387-tdep.c (print_i387_value, print_i387_ext, + print_i387_status_word, print_i387_control_word): Add `struct + ui_file *' argument and use it for output. + (i387_print_float_info): Renamed from i387_float_info. Add + `struct gdbarch *' and `struct ui_file *' arguments and use the + latter for output. + * i386-tdep.c: Include "i387-tdep.h". + (i386_gdbarch_init): Set print_float_info. + * config/i386/tm-i386.h (i387_float_info): Remove prototype. + (FLOAT_INFO): Remove define. + +2002-08-13 Michael Snyder + + * mips-tdep.c (mips_push_arguments): Rename to + mips_eabi_push_arguments, and tune for EABI. + (MIPS_REGS_HAVE_HOME_P): Delete. + (struct gdbarch_tdep): Remove mips_regs_have_home_p field. + (mips_gdbarch_init): Set gdbarch push_arguments for eabi. + Delete references to mips_regs_have_home_p. + +2002-08-14 Keith Seitz + + * Makefile.in (install-gdbtk): Create insight plugin directory. + Install plugins.tcl file. + +2002-08-14 Keith Seitz + + * configure.in: Move SUBDIRS to near top of the file so that + --enable options may add things to it. + If gdbtk is enabled, add gdbtk directory to SUBDIRS and configdirs. + * configure: Regenerate. + +2002-08-13 Michael Snyder + + * mips-tdep.c (mips_o32o64_push_arguments): New function, + cloned from mips_push_arguments, tuned for o32/o64 ABI. + (mips_gdbarch_init): Set gdbarch_push_arguments to new func. + +2002-08-13 Andrew Cagney + + * vax-tdep.c (vax_get_saved_register): Delete function. + (vax_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_get_saved_register): Delete function. + (ns32k_gdbarch_init): Update. + * alpha-tdep.c (alpha_get_saved_register): Delete function. + (alpha_gdbarch_init): Update. + +2002-08-13 Andrew Cagney + + * regcache.c (init_regcache_descr): Overallocate the + raw_register_valid_p array including space for NUM_PSEUDO_REGS. + (registers_changed): Replace NUM_REGS+NUM_PSEUDO_REGS with + nr_raw_registers. + (set_register_cached): Add range checking assertions. Use + current_regcache. + +2002-08-13 Mark Kettenis + + * i386-tdep.c (i386_stab_reg_to_regnum): Return correct register + numbers for MMX registers. + +2002-08-13 Andrew Cagney + + * i386-tdep.c (i386_gdbarch_init): Use + generic_unwind_get_saved_register. + +2002-08-13 Kevin Buettner + + * procfs.c (procfs_can_use_hw_breakpoint): New function. + (init_procfs_ops): Define ``to_can_use_hw_breakpoint'' for procfs + target vector. + * config/mips/nm-irix5.h (TARGET_CAN_USE_HARDWARE_WATCHPOINT): + Delete. Add comment regarding this now-deleted target method. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (M68HC12_NUM_PSEUDO_REGS): New define. + (M68HC12_HARD_PC_REGNUM): Define specific PC for 68HC12 (pseudo reg). + (m68hc11_pseudo_register_read): Compute the 68HC12 PC using the + real PC and the page number (if it's within the memory bank window). + (m68hc11_pseudo_register_write): Likewise when saving. + (m68hc11_register_name): Name the virtual pc 'pc' and the real one ppc. + (m68hc11_register_virtual_type): Return uint32 for virtual pc. + (m68hc11_register_raw_size): And use 32-bit for it. + (m68hc11_gdbarch_init): Use 32-bit address for 68HC12 if the + 16K memory bank is used by the prog; also use the virtual pc. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (m68hc11_elf_make_msymbol_special): New function. + (m68hc11_gdbarch_init): Install it in gdbarch. + (MSYMBOL_SET_RTC, MSYMBOL_SET_RTI): New to set symbol specific flags. + (MSYMBOL_IS_RTC, MSYMBOL_IS_RTI): New to test these flags. + (MSYMBOL_SIZE): New for documentation. + (insn_return_kind): Enum to specify how a function returns. + (frame_extra_info): Cleanup and record the return mode. + (gdbarch_tdep, USE_PAGE_REGISTER): New to control the use of page + register in address computation. + (m68hc11_get_return_insn): New to obtain the return instruction used + by the function. + (m68hc11_frame_init_saved_regs): Take into account the return + instruction used by the function for far and interrupt functions. + (m68hc11_init_extra_frame_info): Take into account page register. + (m68hc11_frame_args_address): Adjust according to the return mode. + (show_regs): Print page register only when it's used. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (HARD_PAGE_REGNUM): Define for 68HC12 page register. + (M68HC11_LAST_HARD_REG, m68hc11_register_names): Update. + (m68hc11_register_virtual_type): Return a 8-bit type for 8-bit + registers. + (m68hc11_register_raw_size): Likewise. + +2002-08-13 Andrew Cagney + + * i386-tdep.c (i386_register_name): Handle mmx registers. + (mmx_regnum_p): New function. + (i386_mmx_names): New array. + (mmx_num_regs): New variable. + (i386_pseudo_register_read): New function. + (i386_pseudo_register_write): New function. + (mmx_regnum_to_fp_regnum): New function. Code from Fernando Nasser. + + * regcache.c (regcache_raw_read_unsigned): New function. + (regcache_raw_read_signed): New function. + * regcache.h (regcache_raw_read_unsigned): Declare. + (regcache_raw_read_signed): Declare. + +2002-08-13 Andrew Cagney + + * regcache.c (regcache_raw_read_as_address): Delete function. + (regcache_cooked_read_signed): New function. + (regcache_cooked_read_unsigned): New function. + * regcache.h (regcache_cooked_read_signed): Declare. + (regcache_cooked_read_unsigned): Declare. + (regcache_raw_read_as_address): Delete declaration. + + * blockframe.c (generic_read_register_dummy): Use + regcache_cooked_read_unsigned. + * i386-tdep.c (i386_extract_struct_value_address): Use + regcache_cooked_read_unsigned. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (m68hc11_gdbarch_init): Set int, double and long + double sizes according to ELF ABI flags. + (gdbarch_tdep): Record elf_flags. + +2002-08-13 Stephane Carrez + + * m68hc11-tdep.c (M6812_OP_PSHX, M6812_OP_PSHY): New defines. + (m6812_prolog): They can appear in 68HC12 function prologue. + (m68hc11_frame_chain): Cleanup. + +2002-08-12 Andrew Cagney + + * i386-tdep.h (i386_register_byte, i386_register_raw_size): Delete + declarations. + * i386-linux-tdep.c (i386_linux_register_byte): Delete function. + (i386_linux_register_raw_size): Delete function. + (i386_linux_init_abi): Update. + * i386-tdep.c (i386_register_raw_size): Delete function. + (i386_register_byte): Delete function. + (i386_gdbarch_init): Update. + (i386_register_size): Delete array. + (i386_register_offset): Delete array. + + * config/i386/tm-symmetry.h (REGISTER_BYTE): Delete macro. + (REGISTER_RAW_SIZE): Delete macro. + * config/i386/tm-ptx.h (REGISTER_RAW_SIZE): Delete macro. + (REGISTER_BYTE): Delete macro. + +2002-08-11 Aidan Skinner + + * ada-lang.c (ada_lookup_partial_symbol) + (to_fixed_variant_branch_type) (find_line_in_linetable): Fix + prototype names so that grep ^func works properly. + + * ada-lang.c (ada_array_element_type) + (ada_lookup_partial_symbol): Fix typos in parameter list. + + * ada-valprint.c (val_print_packed_array_elements) (ada_val_print_1): + Fix prototype names so that grep ^func works properly. + +2002-08-10 Andrew Cagney + Elena Zannoni + Martin M. Hunt + + * gdbtypes.c (build_builtin_type_vec128): Set the vector bit. + (build_builtin_type_vec128i): Set the vector bit. + * gdbtypes.h (builtin_type_vec64, builtin_type_vec64i): Declare. + * gdbtypes.c (builtin_type_vec64, builtin_type_vec64i): Define. + (build_builtin_type_vec64): New function. + (build_builtin_type_vec64i): New function. + (build_gdbtypes): Initialize builtin_type_vec64 and + builtin_type_vec64i. + +2002-08-09 Andrew Cagney + + * regcache.c (regcache_dump): Compare the register offset + with REGISTER_BYTE. + * arch-utils.c (generic_register_byte): New function. + * arch-utils.h (generic_register_byte): Declare. + * gdbarch.sh (REGISTER_BYTE): Default to generic_register_byte. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-09 Andrew Cagney + + * regcache.c: Include "gdbcmd.h" + (_initialize_regcache): Add commands "maintenance print + registers", "maintenance print raw-registers" and "maintenance + print cooked-registers". + (enum regcache_dump_what): Define. + (dump_endian_bytes): New function. + (regcache_dump): New function. + (regcache_print): New function. + (maintenance_print_registers): New function. + (maintenance_print_raw_registers): New function. + (maintenance_print_cooked_registers): New function. + * Makefile.in (regcache.o): Update dependencies. + +2002-08-09 Michael Snyder + + * mips-tdep.c (ROUND_DOWN, ROUND_UP): Move to global scope. + (mips_push_arguments): Correct some comments. Use paddr_nz + for printing addresses in debug output. Replace static + allocation using MAX_REGISTER_RAW_SIZE with alloca. + (mips_n32n64_push_arguments): New function, cloned from + mips_push_arguments and tuned for the n32/n64 ABI. + (mips_push_register): Buffer needs dynamic allocation. + (mips_print_register): Ditto. + (do_gp_register_row): Ditto. + (mips_store_return_value): Ditto. + (mips_gdbarch_init): Set gdbarch_push_arguments per ABI. + +2002-08-09 Don Howard + + * memattr.c (mem_info_command): Print special case of upper bound + as max CORE_ADDR + 1. + +2002-08-08 Michael Snyder + + * mips-tdep.c (mips_n32n64_use_struct_convention): N32 only + returns structs by ref if they're too big to fit in two registers. + +2002-08-09 Kevin Buettner + + * mips-tdep.c (mips_init_extra_frame_info): Initialize SP_REGNUM's + saved regs value. + (read_next_frame_reg): Call FRAME_INIT_SAVED_REGS instead of + mips_find_saved_regs(). + (mips_pop_frame): Likewise. + +2002-08-09 Kevin Buettner + + * blockframe.c (frame_saved_regs_register_unwind): Revise + PC_IN_CALL_DUMMY assertion to only apply when generic dummy + frames are in use. + +2002-08-09 Grace Sainsbury + + * remote.c: (remote_wait, remote_async_wait): Add check for awatch + T-packets; the 'a' is not taken as a register number. + (remote_check_watch_resources, remote_stopped_by_watchpoint) + (remote_stopped_data_address): New functions; add to target + vector. + (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Change + prototypes to match other implementations of this + function. replace integer argument with pointer -- the length + field in the Z-packet is the length of what is pointed to or 1 if + pointer is null. Add to target vector. + (remote_insert_watchpoint, remote_remove_watchpoint): Add to + target vector. + + From Mark Salter: + * remote.c (remote_wait): Add support to extract optional + watchpoint information from T-packet. Ignore unrecognized + optional info in T-packet. + (remote_async_wait): Ditto. + +2002-08-09 Corinna Vinschen + + * cli/cli-dump.c: Change fopen modes to use binary open modes + as defined in include/fopen-bin.h throughout. + +2002-08-08 Michael Snyder + + * mips-tdep.c: Minor whitespace and indentation clean-ups. + +2002-08-08 Kevin Buettner + + * doublest.c (store_floating): Avoid floatformat_from_doublest() + assertion failure by returning early after a warning. + +2002-08-08 Kevin Buettner + + * mips-tdep.c (mips_find_saved_regs): Make static. + (mips_frame_init_saved_regs): New function. + (mips_gdbarch_init): Setup FRAME_INIT_SAVED_REGS method. + * config/mips/tm-mips.h (FRAME_INIT_SAVED_REGS): Delete macro. + (mips_find_saved_regs): Delete declaration. + +2002-08-08 Grace Sainsbury + + * remote.c (remote_wait, remote_async_wait): Change + thread_num from int to ULONGEST. + (unpack_varlen_hex): Change result parameter from + int * to ULONGEST *. + +2002-08-08 Andrew Cagney + + * configure.tgt: Replace powerpc-*-sysv*, powerpc-*-elf*, + powerpcle-*-eabi*, powerpcle-*-sysv* and powerpcle-*-elf* with + powerpc*-*-*. + * MAINTAINERS: Remove redundant rs6000-ibm-aix4.1 target. + +2002-08-08 Andrew Cagney + + * gcore.c (override_derive_stack_segment): Delete variable. + (preempt_derive_stack_segment): Delete function. + (derive_stack_segment): Delete function. + (default_derive_stack_segment): Renamed to derive_stack_segment. + (override_derive_heap_segment): Delete variable. + (preempt_derive_heap_segment): Delete function. + (derive_heap_segment): Delete function. + (default_derive_heap_segment): Rename to derive_heap_segment. + +2002-08-06 Michael Snyder + + * config/mips/tm-mips.h: Remove #define USE_STRUCT_CONVENTION. + * mips-tdep.c (mips_EABI_use_struct_convention, + mips_OABI_use_struct_convention, mips_NABI_use_struct_convention): + New functions. (mips_use_struct_convention): Delete. + (mips_gdbarch_init): set use_gdbarch_convention. + +2002-08-06 Michael Snyder + + * mips-tdep.c: gdbarch-ify reg_struct_has_addr. + (mips_eabi_reg_struct_has_addr, mips_n32n64_reg_struct_has_addr, + mips_o32_reg_struct_has_addr): New functions. + (mips_gdbarch_init): Set gdbarch reg_struct_has_addr. + +2002-08-07 Andrew Cagney + + * regcache.c (pseudo_register): Delete function. + (fetch_register): Delete function. + (store_register): Delete function. + (regcache_raw_read, legacy_read_register_gen): Use + target_fetch_registers instead of fetch_register. + (legacy_write_register_gen, regcache_raw_write): Use + target_store_register instead of store_register. + (write_register_bytes): Ditto. + + * gdbarch.sh (FETCH_PSEUDO_REGISTER): Delete. + (STORE_PSEUDO_REGISTER): Delete. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-08-06 Corinna Vinschen + + * cli/cli-dump.c (add_dump_command): Explicitely use "b" flag to + write dump file binary. + +2002-08-05 Michael Snyder + + * mips-tdep.c (mips_find_saved_regs): Adjust stack according + to MIPS_SAVED_REGSIZE, not GDB_TARGET_IS_MIPS64. Enhance comment. + (mips_gdbarch_init): Set N32 target to be mips64. + +2002-08-06 Kevin Buettner + + * frame.c (find_saved_register): Break out of loop once saved + register address is found. Don't mention sparc in loop comment + anymore. + +2002-08-06 Kevin Buettner + + * mips-tdep.c (mips_gdbarch_init): For the N32 ABI, set + mips_default_saved_regsize to 8. + +2002-08-06 Andrew Cagney + + * gcore.c: Do not include . + * Makefile.in (gcore.o): Update dependencies. + +2002-08-06 Andrew Cagney + + * configure.tgt: Make arc-*-* obsolete. + * NEWS: Mention that arc-*-* has been identifed as obsolete. + * MAINTAINERS: Make arc-elf obsolete. + * arc-tdep.c: Make file obsolete. + * config/arc/arc.mt: Ditto. + * config/arc/tm-arc.h: Ditto. + +2002-08-05 Theodore A. Roth + + * avr-tdep.c (avr_skip_prologue): Fix to return the correct pc. + +2002-08-05 Andrew Cagney + + * mcore-tdep.c (mcore_gdbarch_init): Use + generic_unwind_get_saved_register instead of + generic_get_saved_register. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * frv-tdep.c (frv_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * s390-tdep.c (s390_gdbarch_init): Ditto. + * d10v-tdep.c (d10v_gdbarch_init): Ditto. + * config/mn10200/tm-mn10200.h (GET_SAVED_REGISTER): Ditto. + * config/h8300/tm-h8300.h (GET_SAVED_REGISTER): Ditto. + +2002-08-05 Joel Brobecker + + * objfiles.h: Add missing #include "symfile.h" + + * Makefile.in (objfiles_h): Add dependency on symfile.h and dependents. + +2002-08-04 Andrew Cagney + + From 2002-08-01 david carlton : + * hpread.c (hpread_read_struct_type): Deleted superfluous setting + of FIELD_BITSIZE. + +2002-08-04 Daniel Jacobowitz + + * NEWS: Cleanup and nitpick. + +2002-08-03 Andrew Cagney + + * NEWS: Cleanup. Use *-linux*-gnu*. Only use `*' for headings. + +2002-08-03 Andrew Cagney + + * Makefile.in (gdbtk-bp.o): Update dependencies. + (gdbtk-register.o): Ditto. + (gdbtk-varobj.o): Ditto. + +2002-08-03 Andrew Cagney + + * m68hc11-tdep.c (m68hc11_pseudo_register_read): Replace + m68hc11_fetch_pseudo_register. + (m68hc11_pseudo_register_write): Replace + m68hc11_store_pseudo_register. + (m68hc11_gdbarch_init): Update. + +Fri Aug 2 15:53:50 2002 Andrew Cagney + + * gdbarch.sh: Include "gdb_string.h". + * gdbarch.c: Regenerate. + + * regcache.c: Include "gdb_string.h". + * ax-general.c: Ditto. + * varobj.c: Ditto. + * std-regs.c: Ditto. + * fbsd-proc.c: Ditto. + * thread.c: Ditto. + + * Makefile.in (regcache.o): Update dependencies. + (thread.o, gdbarch.o): Ditto. + (ax-general.o, gdbarch.o): Ditto. + (varobj.o, std-regs.o): Ditto. + (fbsd-proc.o): Specify dependencies. + +2002-08-02 Andrew Cagney + + * regcache.c (regcache_cooked_read): Rename rawnum parameter to + regnum. + (regcache_cooked_write): Ditto. + +2002-08-02 Andrew Cagney + + * regcache.c (regcache_cooked_read): New function. + (regcache_cooked_write): New function. + (read_register_gen): Rewrite using regcache_cooked_read. + (write_register_gen): Rewrite using regcache_cooked_write. + + * regcache.h (regcache_cooked_read, regcache_cooked_write): + Declare. + +2002-08-02 Andrew Cagney + + * gdbarch.sh (pseudo_register_read, pseudo_register_write): + Replace the architecture methods register_read and register_write. + * gdbarch.h, gdbarch.c: Regenerate. + * regcache.c (init_regcache_descr): Update. + (read_register_gen): Update. + (write_register_gen): Update. + (supply_register): Update comment. + + * sh-tdep.c (sh_gdbarch_init): Update. + (sh_pseudo_register_read, sh64_pseudo_register_read): Add + `regcache' and `gdbarch' parameters. Make `buffer' a void + pointer. Update code. + (sh_pseudo_register_write, sh64_pseudo_register_write): Add + `regcache' and `gdbarch' parameters. Make `buffer' a constant + void pointer. Update code. + (sh64_register_write): Delete. + (sh4_register_read): Delete. + (sh64_register_read): Delete. + (sh4_register_write): Delete. + (sh_sh4_register_convert_to_raw): Make `from' parameter a constant + void pointer, `to' parameter a void pointer. + (sh_sh64_register_convert_to_raw): Ditto. + +2002-08-01 Kevin Buettner + + * mips-tdep.c (mips_register_virtual_type): Use architecture + invariant return values. + +2002-08-01 Andrew Cagney + + * linux-proc.c: Include "gdb_string.h". + * Makefile.in (linux-proc.o): Update dependency list. + +2002-08-01 Kevin Buettner + + * mips-tdep.c (mips_gdbarch_init): Add comments. Fix typo in + comment. + +2002-08-01 Grace Sainsbury + + * target.h: Add to_insert_hw_breakpoint, to_remove_hw_breakpoint, + to_insert_watchpoint, to_remove_watchpoint, + to_stopped_by_watchpoint, to_stopped_data_address, + to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint to + target vecctor. Define their corresponding macros so they call + them. + + * target.c: Add default and debug versions of for + to_insert_hw_breakpoint, to_remove_hw_breakpoint, + to_insert_watchpoint, to_remove_watchpoint, + to_stopped_by_watchpoint, to_stopped_data_address, + to_region_size_ok_for_hw_watchpoint, to_can_use_hw_breakpoint. + +2002-08-01 Kevin Buettner + + * mips-tdep.c (mips_register_virtual_type): New function. + (mips_gdbarch_init): Register mips_register_virtual_type() + with gdbarch machinery. + * config/mips/tm-irix6.h (mips/tm-bigmips64.h): Include + this file instead of tm-bigmips.h. + (MIPS_REGSIZE): Delete this macro. + (REGISTER_VIRTUAL_TYPE): Delete macro. Undef macro so that + multiarch version in mips-tdep.c will be found. + +2002-08-01 Andrew Cagney + + * NEWS: Menion that CHILL has been made obsolete. + + * gdbtypes.c (chill_varying_type): Make chill references obsolete. + * stabsread.c (read_range_type): Ditto. + * gdbtypes.h: Ditto. + * language.c (binop_type_check): Ditto. + (binop_result_type): Ditto. + (integral_type): Ditto. + (character_type): Ditto. + (string_type): Ditto. + (boolean_type): Ditto. + (structured_type): Ditto. + (lang_bool_type): Ditto. + (binop_type_check): Ditto. + * language.h (_LANG_chill): Ditto. + * dwarfread.c (set_cu_language): Ditto. + * dwarfread.c (CHILL_PRODUCER): Ditto. + * dwarfread.c (handle_producer): Ditto. + * expression.h (enum exp_opcode): Ditto. + * eval.c: Ditto for comments. + * typeprint.c (typedef_print) [_LANG_chill]: Ditto. + * expprint.c (print_subexp): Ditto. + (print_subexp): Ditto. + * valops.c (value_cast): Ditto. + (search_struct_field): Ditto. + * value.h (COERCE_VARYING_ARRAY): Ditto. + * symfile.c (init_filename_language_table): Ditto. + (add_psymbol_with_dem_name_to_list): Ditto. + * valarith.c (value_binop): Ditto. + (value_neg): Ditto. + * valops.c (value_slice): Ditto. + * symtab.h (union language_specific): Ditto. + (SYMBOL_INIT_LANGUAGE_SPECIFIC): Ditto. + (SYMBOL_DEMANGLED_NAME): Ditto. + (SYMBOL_CHILL_DEMANGLED_NAME): Ditto. + * defs.h (enum language): Ditto. + * symtab.c (got_symtab): Ditto. + * utils.c (fprintf_symbol_filtered): Ditto. + + * ch-typeprint.c: Make file obsolete. + * ch-valprint.c: Make file obsolete. + * ch-lang.h: Make file obsolete. + * ch-exp.c: Make file obsolete. + * ch-lang.c: Make file obsolete. + + * Makefile.in (FLAGS_TO_PASS): Do not pass CHILL or CHILLFLAGS or + CHILL_LIB. + (TARGET_FLAGS_TO_PASS): Ditto. + (CHILLFLAGS): Obsolete. + (CHILL): Obsolete. + (CHILL_FOR_TARGET): Obsolete. + (CHILL_LIB): Obsolete. + (SFILES): Remove ch-exp.c, ch-lang.c, ch-typeprint.c and + ch-valprint.c. + (HFILES_NO_SRCDIR): Remove ch-lang.h. + (COMMON_OBS): Remove ch-valprint.o, ch-typeprint.o, ch-exp.o and + ch-lang.o. + (ch-exp.o, ch-lang.o, ch-typeprint.o, ch-valprint.o): Delete + targets. + +2002-07-31 Joel Brobecker + + * dwarf2read.c (set_cu_language): Add handler for LANG_Ada95. + This does not change anything at the moment, but will be helpful + later when full Ada support is integrated. + +2002-07-31 Kevin Buettner + + * mips-tdep.c (_initialize_mips_tdep): Add "n64" to "set mips abi" + help message. + +2002-07-31 Kevin Buettner + + * mips-tdep.c (mips_push_arguments): Fetch gdbarch_tdep struct + and save it in a local variable. Use variable in later test. + +2002-07-31 Kevin Buettner + + * mips-tdep.c (mips_find_abi_section): Add N64 ABI recognition + test. (Thanks to Daniel Jacobowitz.) + +2002-07-31 Kevin Buettner + + * mips-tdep.c (enum mips_abi): Add MIPS_ABI_N64. + (mips_abi_strings): Add "n64". + (mips_gdbarch_init): Add test for n64 abi. Add MIPS_ABI_N64 case. + +2002-07-31 Kevin Buettner + + * config/mips/tm-irix6.h (MIPS_REGSIZE): Define to be 8. + (REGISTER_VIRTUAL_TYPE): Some registers are now 64 bits wide. + +2002-07-31 Kevin Buettner + + * utils.c (host_pointer_to_address, address_to_host_pointer): + Use gdb_assert() instead of explicit call to internal_error(). + +2002-07-30 Kevin Buettner + + * Makefile.in (rs6000-nat.o): Update dependencies. + + From Nicholas Duffek: + * Makefile.in (ALLDEPFILES): Add aix-thread.c. + (aix-thread.o): New rule. + * configure.host (gdb_host): Set to aix432 on AIX 4.3.2+. + * config/powerpc/aix432.mh: New file. + +2002-07-30 Daniel Jacobowitz + + * ppc-linux-tdep.c (ELF_NGREG, ELF_NFPREG, ELF_NVRREG) + (ELF_FPREGSET_SIZE, ELF_GREGSET_SIZE): New enums. + (fetch_core_registers, ppc_linux_supply_gregset) + (ppc_linux_supply_fpregset): New functions. + (ppc_linux_regset_core_fns): New. + (_initialize_ppc_linux_tdep): Call add_core_fns. + * ppc-tdep.h: Add prototypes for ppc_linux_supply_fpregset + and ppc_linux_supply_gregset. + * ppc-linux-nat.c (supply_gregset): Call ppc_linux_supply_gregset. + (supply_fpregset): Call ppc_linux_supply_fpregset. + * config/powerpc/linux.mh (NATDEPFILES): Remove core-regset.o and + corelow.o. + * config/powerpc/linux.mt (TDEPFILES): Add corelow.o. + +2002-07-30 Daniel Jacobowitz + + * symtab.c (lookup_symbol): Demangle before lowercasing. + +2002-07-30 Andrew Cagney + + * symtab.h: Replace #include "gdb_obstack.h" with opaque + declaration. + * cli/cli-cmds.c, cli/cli-script.c: Include "gdb_string.h". + * gnu-v3-abi.c, arc-tdep.c, cli/cli-decode.c: Ditto. + * avr-tdep.c, mon960-rom.c, i960-tdep.c: Ditto. + * arch-utils.c, cli/cli-setshow.c: Unconditionally include + "gdb_string.h". + * Makefile.in (cli-script.o, cli-cmds.o): Update dependencies. + (gnu-v3-abi.o, cli-setshow.o, i960-tdep.o): Ditto. + (cli-decode.o, mi-cmd-var.o, mi-cmd-disas.o): Ditto. + (avr-tdep.o, mon960-rom.o): Ditto. + (aout_stabs_gnu_h): Define. + (symtab_h): Remove $(gdb_obstack_h). + +2002-07-30 Jim Blandy + + Patch from David Carlton : + * gdbinit.in: Move the `dir' commands that add GDB's own source + directory to the search path to the end, so that the `gdb' source + directory will be searched first. + +2002-07-29 Andrew Cagney + + * gdb_obstack.h: New file. + * symtab.h: Include "gdb_obstack.h" instead of "obstack.h". + (obstack_chunk_alloc, obstack_chunk_free): Delete macros. + * objfiles.h: Include "gdb_obstack.h". + * Makefile.in (gdb_obstack_h): Define. + (symtab_h): Add $(gdb_obstack_h). + (objfiles_h): Add $(gdb_obstack_h). + + * objfiles.c: Include "gdb_obstack.h" instead of "obstack.h". + * macrotab.c, cp-valprint.c, dbxread.c: Ditto. + * ch-typeprint.c, ch-valprint.c, dstread.c: Ditto. + * macroexp.c, p-typeprint.c, stabsread.c: Ditto. + * symtab.c, f-typeprint.c, mdebugread.c: Ditto. + * p-valprint.c, symmisc.c, typeprint.c: Ditto. + * symfile.c, coffread.c, c-typeprint.c: Ditto. + * buildsym.c, bcache.c, ada-typeprint.c: Ditto. + + * Makefile.in (bcache.o): Update dependencies. + (buildsym.o, c-typeprint.o, ch-typeprint.o): Ditto. + (ch-valprint.o, coffread.o, cp-valprint.o): Ditto. + (dbxread.o, dstread.o, f-typeprint.o): Ditto. + (objfiles.o, p-typeprint.o, p-valprint.o): Ditto. + (stabsread.o, symfile.o, symmisc.o): Ditto. + (symtab.o, typeprint.o, macroexp.o): Ditto. + (macrotab.o, mdebugread.o): Ditto. + (f_lang_h, coff_sym_h, coff_symconst_h): Define. + (coff_ecoff_h, aout_aout64_h): Define. + (aout_stabs_gnu_h, libaout_h): Define. + +2002-07-29 Andrew Cagney + + * regcache.c (struct regcache_descr): Rename nr_registers to + nr_cooked_registers. Revise comments describing the structure + member fields. + (init_regcache_descr): Update. + (init_legacy_regcache_descr): Update. + (read_register_gen, write_register_gen): When a cooked register in + the raw register range, directly access the value from the raw + register cache. + +2002-07-29 Andrew Cagney + + * z8k-tdep.c: Do not include "obstack.h". + * h8300-tdep.c, h8500-tdep.c: Ditto. + * m68hc11-tdep.c, sh-tdep.c: Ditto. + * valprint.c, v850-tdep.c: Ditto. + * d10v-tdep.c, mn10300-tdep.c: Ditto. + * mn10200-tdep.c: Ditto. + + * Makefile.in (z8k-tdep.o): Update dependencies. + (m68hc11-tdep.o, valprint.o): Ditto. + (v850-tdep.o, d10v-tdep.o): Ditto. + (mn10300-tdep.o, sparc-tdep.o): Ditto. + (sh-tdep.o, h8500-tdep.o, h8300-tdep.o): Ditto. + (m32r-tdep.o, mn10200-tdep.o): Specify dependencies. + (sh_opc_h, gdb_sim_sh_h): Define. + (elf_sh_h, elf_bfd_h): Define. + (opcode_m68hc11_h): Define. + (OPCODES_SRC, OPCODES_DIR): define. + (OPCODES): Use $(OPCODES_DIR). + (gdb_sim_d10v_h): Rename sim_d10v_h. + (gdb_sim_arm_h): Rename sim_arm_h. + +2002-07-26 Kevin Buettner + + * utils.c (host_pointer_to_address, address_to_host_pointer): + Change internal_error() message to indicate function responsible + for the error. + +2002-07-26 Kevin Buettner + + * ui-out.c (ui_out_field_core_addr): Remove unnecessary cast in + calls to local_hex_string_custom(). + +2002-07-26 Kevin Buettner + + * irix5-nat.c: Move IRIX shared library support from here... + * solib-irix.c: ...to here. Revised substantially to work with + generic solib framework. + + * osabi.h (gdb_osabi): Add new enum constant GDB_OSABI_IRIX. + * osabi.c (gdb_osabi_names): Add corresponding string for Irix. + * mips-irix-tdep.c: New file. + + * Makefile.in (ALLDEPFILES): Add mips-irix-tdep.c and solib-irix.c. + (mips-irix-tdep.o, solib-irix.o): New rules. + * config/mips/irix5.mt (TDEPFILES): Add mips-irix-tdep.o, solib.o, + solib-irix.o. + * config/mips/irix6.mt (TDEPFILES): Likewise. + * config/mips/irix6.mh (NATDEPFILES): Remove solib.o. + +2002-07-26 Kevin Buettner + + * aix-thread.c (coff/internal.h, bfd/libcoff.h, pthread.h): Remove + disabled (via ``#if 0'') includes. + +2002-07-26 Kevin Buettner + + * aix-thread.c (special_register_p, supply_sprs64, supply_sprs32) + (fetch_regs_user_thread, fetch_regs_kernel_thread, fill_sprs64) + (fill_sprs32, store_regs_user_thread, store_regs_kernel_thread): + Add support for the fpscr register. + * rs6000-nat.c (regmap, fetch_inferior_registers) + (store_inferior_registers, fetch_core_registers): Likewise. + +2002-07-26 Kevin Buettner + + * rs6000-nat.c (language.h): Include. + (special_regs): Delete this array. + (regmap): New function. + (fetch_register, store_register): Use regmap() to map gdb + register numbers to ptrace register numbers. Also, use + outputs from regmap() to make decisions regarding type of + ptrace() call to make. In particular, don't compare against + FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM. + (fetch_inferior_registers, store_inferior_registers): Where + possible, obtain register numbers from tdep struct. Don't + refer to FIRST_UISA_SP_REGNUM or LAST_UISA_SP_REGNUM. + * config/rs6000/tm-rs6000.h (FIRST_UISA_SP_REGNUM) + (LAST_UISA_SP_REGNUM): Delete. + +2002-07-25 Kevin Buettner + + * rs6000-nat.c (ppc-tdep.h): Include. + (fetch_registers, store_register, fetch_core_registers): Don't + access registers[] directly. Instead, use supply_register() or + regcache_collect() as appropriate. + (find_toc_address): Format hex address with local_hex_string(). + +2002-07-25 Andrew Cagney + + * config/djgpp/fnchange.lst: Rename bfd/elf32-fr30.c and + bfd/elf32-frv.c. + +2002-07-24 Tom Tromey + + * jv-exp.y: Marked all strings with _(). + (ClassInstanceCreationExpression, ArrayCreationExpression): Use + internal_error. + (MethodInvocation, CastExpression, parse_number, yyerror, + java_type_from_name, push_expression_name, yylex): Typo fixes. + +2002-07-24 Daniel Jacobowitz + + * ui-file.c (struct tee_file, tee_file_new, tee_file_delete) + (tee_file_flush, tee_file_write, tee_file_fputs) + (tee_file_isatty): New. + * ui-file.h (tee_file_new): Add prototype. + +2002-07-24 Aidan Skinner + + * ada-lang.c: Change k&r style function definitions to prototyped + form. + * ada-typeprint.c: Change k&r style function definitions to prototyped + form. + * ada-valprint.c: Change k&r style function definitions to prototyped + form. + +2002-07-24 Andrew Cagney + + * README: Remove reference to remote-bug. + * Makefile.in (ALLDEPFILES): Remove m88k-nat.c, m88k-tdep.c and + remote-bug.c. + (m88k-nat.o): Delete rule. + (m88k-tdep.o): Delete rule. + (remote-bug.o): Delete rule. + * MAINTAINERS: Mark as obsolete. + * elfread.c (elf_symtab_read): Mention that m88k is obsolete. + * m88k-tdep.c: Make file obsolete. + * config/m88k/m88k.mh: Ditto. + * config/m88k/delta88v4.mh: Ditto. + * config/m88k/delta88v4.mt: Ditto. + * config/m88k/delta88.mt: Ditto. + * config/m88k/delta88.mh: Ditto. + * remote-bug.c: Ditto. + * config/m88k/tm-delta88.h: Ditto. + * config/m88k/nm-delta88v4.h: Ditto. + * config/m88k/xm-delta88.h: Ditto. + * config/m88k/xm-dgux.h: Ditto. + * config/m88k/tm-m88k.h: Ditto. + * config/m88k/nm-m88k.h: Ditto. + * config/m88k/tm-delta88v4.h: Ditto. + * m88k-nat.c: Ditto. + * cxux-nat.c: Ditto. + * configure.host: Make m88*-motorola-sysv4*, m88*-motorola-sysv* + and m88*-*-* obsolete. + * configure.tgt: Make m88*-motorola-sysv4*, m88*-motorola-* and + m88*-*-* obsolete. + +2002-07-24 Andrew Cagney + + * findvar.c (extract_unsigned_integer): Make `addr' parameter + constant. Same for local pointer variables. + (extract_signed_integer): Ditto. + * defs.h (extract_unsigned_integer): Update. + (extract_signed_integer): Update. + +2002-07-24 Andrew Cagney + + * regcache.c (regcache_raw_write): Change buf parameter to a + constant void pointer. + (regcache_raw_read): Change buf parameter to a void pointer. + (legacy_write_register_gen): Change myaddr parameter a constant + void pointer. + (supply_register): Change val parameter to a const void pointer. + * regcache.h (regcache_raw_write): Update declaration. + (regcache_raw_read): Update declaration. + (supply_register): Update declaration. + +2002-07-24 Tom Tromey + + * defs.h (gdb_readline_wrapper): Declare. + * utils.c (prompt_for_continue): Use gdb_readline_wrapper. + * tracepoint.c (read_actions): Use gdb_readline_wrapper. + * top.c (gdb_readline_wrapper): New function. + (command_line_input): Use it. + +2002-07-24 Andrew Cagney + + * regcache.h (regcache_raw_read, regcache_raw_write): Replace + regcache_read and regcache_write. + (regcache_raw_read_as_address): Replace regcache_read_as_address. + * regcache.c: Update. + * sh-tdep.c (sh64_push_arguments): Update comment. + (sh_pseudo_register_read): Update. + (sh_pseudo_register_write): Update. + (sh4_register_read): Update. + (sh4_register_write): Update. + (sh64_pseudo_register_read): Update. + (sh64_pseudo_register_write): Update. + (sh64_register_read): Update. + (sh64_register_write): Update. + * i386-tdep.c (i386_extract_return_value): Update. + (i386_extract_struct_value_address): Update. + (i386_extract_return_value): Update. + * blockframe.c (generic_read_register_dummy): Update. + (generic_call_dummy_register_unwind): Update + * infrun.c (write_inferior_status_register): Update. + +2002-07-23 Jim Blandy + + * parser-defs.h (expression_context_pc): Make this extern. + (Thanks to Michael Snyder.) + +2002-07-23 Andrew Cagney + + GDB 5.2.1 released from 5.2 branch. + * NEWS: Mention changes in 5.2.1 including addition of AVR target. + * README: Update to mention 5.2.1. + +2002-07-23 Mark Salter + + * remote.c (remote_read_bytes): Fix check for error. + +2002-07-22 Kevin Buettner + + * aix-thread.c (language.h): Include. + (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs) + (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc): + Print newlines at end of debug messages. + (pdc_symbol_addrs, pdc_read_regs, pdc_write_regs, pdc_read_data) + (pdc_write_data): Use local_hex_string() instead of %llx formats. + +2002-07-22 Kevin Buettner + + * aix-thread.c (ppc-tdep.h): Include. + (special_register_p): New function. + (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32) + (store_regs_user_thread): Use register number information from + gdbarch_tdep struct instead of hardcoded offsets relative to + FIRST_UISA_SP_REGNUM. + (fetch_regs_kernel_thread, store_regs_kernel_thread): Call + special_register_p() instead of using FPLAST_REGNUM and + LAST_UISA_SP_REGNUM as lower and upper bounds on the special + register numbers. Also, don't assume that LAST_UISA_SP_REGNUM + will be MQ's register number. + +2002-07-22 Michael Snyder + + * aix-thread.c (ops): Rename to aix_thread_ops. + (base_ops): Rename to base_target. + (ops_attach): Rename to aix_thread_attach. + (ops_detach): Rename to aix_thread_detach. + (ops_resume): Rename to aix_thread_detach. + (ops_wait): Rename to aix_thread_wait. + (ops_kill): Rename to aix_thread_kill. + (init_ops): Rename to init_aix_thread_ops. + (ops_fetch_register): Rename to aix_thread_fetch_register. + (ops_store_register): Rename to aix_thread_store_register. + (ops_mourn_inferior): Rename to aix_thread_mourn_inferior. + (ops_thread_alive): Rename to aix_thread_thread_alive. + (ops_extra_thread_info: Rename to aix_thread_extra_thread_info. + (ops_pid_to_str): Rename to aix_thread_pid_to_str. + (ops_xfer_memory): Rename to aix_thread_xfer_memory. + (fetch_regs_lib): Rename to fetch_regs_user_thread. + (fetch_regs_kern): Rename to fetch_regs_kernel_thread. + (store_regs_lib): Rename to store_regs_user_thread. + (store_regs_kern): Rename to store_regs_kernel_thread. + +2002-07-22 Michael Snyder + + * aix-thread.c (ops_prepare_to_store): Eliminate. + (init_ops): Don't initialize ops.prepare_to_store. + (store_regs_kern): Pre-fetch register buffers from child, + because some registers may not be in the cache. Copy + regs from register cache only if they are cached. + (store_regs_lib): Copy regs from register cache only + if they are cached. + (fill_sprs32, (fill_sprs64, fill_fprs, fill_gprs32, + fill_gprs64): Ditto. + +2002-07-22 Kevin Buettner + + * aix-thread.c (gdb_assert.h): Include. + (fill_sprs64, fill_sprs32): Add selected asserts to make sure that + register sizes (from register cache) match size of buffer holding + register data. + (fill_sprs32): Change parameter types to match those in the ptrace() + buffer. + (store_regs_lib): Likewise, but for 32-bit temporary variables. + (ops_prepare_to_store): Rename loop variable ``i'' to ``regno''. + +2002-07-22 Michael Snyder + + * aix-thread.c (supply_sprs64): Cosmetic change. + (supply_sprs32): Cosmetic change. + (fill_gprs64, fill_gprs32, fill_fprs, fill_sprs32): New funcs. + (fill_sprs64): Use regcache_collect instead of read_register. + (store_regs_lib): Use regcache_collect instead of + read_register. Use fill_sprs32 instead of fill_sprs64, + if debugging a 32-bit architecture. + (store_regs_kern): Use fill_gprs64 etc. to pull the values + out of the register cache, instead of passing a pointer into + the register cache directly to ptrace. Use regcache_collect + insteaad of read_register. + (ops_prepare_to_store): Use target_read_registers instead + of read_register_bytes. + +2002-07-20 Aidan Skinner + + * MAINTAINERS: Add self under write after approval. + +2002-07-20 Aidan Skinner + + * ada-tasks.c: Change k&r style function definitions to prototyped + form. + +2002-07-19 Andrew Cagney + + * Makefile.in (x86-64-tdep.o): Add $(objfiles_h). + * x86-64-tdep.c: Include "objfiles.h". + (x86_64_gdbarch_init): Set in_solib_call_trampoline to + in_plt_section. From 2002-07-18 Michal Ludvig . + +2002-07-17 Michal Ludvig + + * dwarf2cfi.c (execute_stack_op): Complain on unknown DW_OP_ value. + (update_context): Initialise cfa variable. + +2002-07-17 Michael Snyder + + * aix-thread.c: Shorten some long lines. + Bring comments into line with code spec. + +2002-07-18 Joel Brobecker + + * infrun.c: Re-indent using gdb_indent.sh. + +2002-07-18 Joel Brobecker + + * infrun.c (handle_inferior_event): Remove unneeded extra brace. + Leave the indentation temporarily untouched, to minimize the diffs. + +2002-07-18 Elena Zannoni + + * stabsread.c: Make os9k sections of the code obsolete, + for real this time. + * stabsread.h: Make os9k sections of the code obsolete. + +2002-07-18 Michal Ludvig + + * linux-low.c (regsets_store_inferior_registers): Add free() + at the end of a loop to prevent memory leak. + * linux-x86-64-low.c (x86_64_regmap): Add CS, SS registers. + (X86_64_NUM_GREGS): Count it from the size of x86_64_regmap. + * config/sparc/tm-sp64linux.h: Make the rest of #endif + line a comment. + * Makefile.in (x86-64-linux-nat.o): Remove dependency on i387-tdep.h + +2002-07-17 Jim Blandy + + * macrocmd.c (info_macro_command): Remove newline from error + message. + +2002-07-17 J"orn Rennecke + + * sh-tdep.c (sh_dsp_register_sim_regno): New function. + (sh_gdbarch_init): Use it for sh-dsp. + +2002-07-16 Kevin Buettner + + * dwarf2read.c (read_initial_length): Handle older, non-standard, + 64-bit DWARF2 format. + +2002-07-16 Joel Brobecker + + * proc-api.c: use HAVE_SYS_PROC_H macro to avoid including + when not available. + +2002-07-16 Andrew Cagney + + * NEWS: Mention that the i[34]86-*-os9k has been made obsolete. + * stabsread.c: Make os9k sections of the code obsolete. + * configure.tgt: Make i[3456]86-*-os9k target obsolete. + * config/i386/i386os9k.mt: Make file obsolete. + * Makefile.in (ALLDEPFILES): Remove remote-os9k.c. + (COMMON_OBS): Remove os9kread.o + (SFILES): Remove os9kread.c. + (os9kread.o, remote-os9k.o): Make target obsolete. + * remote-os9k.c: Make file obsolete. + * os9kread.c: Make file obsolete. + * Makefile.in + +2002-07-16 Andrew Cagney + + * NEWS: Mention that the FR30 has been made obsolete. + * fr30-tdep.c: Make file obsolete. + * config/fr30/tm-fr30.h: Ditto. + * config/fr30/fr30.mt: Ditto. + * configure.tgt: Make fr30-*-elf obsolete. + * MAINTAINERS: Make fr30-elf obsolete. + +2002-07-16 Pierre Muller + + * blockframe.c (get_pc_function_start): return 0 if the minimal symbol + found is not inside a section. + +2002-07-15 Kevin Buettner + + * aix-thread.c (ptrace_check): Use safe_strerror() instead of + strerror(). + (pdc_realloc): Use xrealloc() instead of realloc(). + +2002-07-15 Kevin Buettner + + * aix-thread.c (PD_ERROR, CALL_BASE): Delete. + (ops_resume, ops_wait, fetch_regs_lib, store_regs_lib) + (ops_xfer_memory, ops_kill): Don't use PD_ERROR or CALL_BASE + macros. + +2002-07-15 Kevin Buettner + + * aix-thread.c (ptrace_check): Eliminate goto. + (sync_threadlists): Eliminate gotos. Also, fix array overrun + problem. + +2002-07-15 Kevin Buettner + + * aix-thread.c (gdbcmd.h): Include. + (DEBUG, DBG, DBG2, dbg): Eliminate. + (debug_aix_thread): New static global. + (ptrace_check, pdc_symbol_addrs, pdc_read_regs, pdc_write_regs) + (pdc_read_data, pdc_write_data, pdc_alloc, pdc_realloc, pdc_dealloc) + (fetch_regs_lib, store_regs_lib, store_regs_kern): Rewrite + invocations to DBG and DBG2 macros to test against + ``debug_aix_thread'' and call fprintf_unfiltered(). + (_initialize_aix_thread): Add new command "set debug aix-thread". + +2002-07-15 Andrew Cagney + + From Gerhard Tonn : + * s390-nat.c (fill_fpregset, fill_gregset): Use regcache_collect + instead of supply_register. + +2002-07-15 Andrew Cagney + + * dwarf2cfi.c: Include "gdb_assert.h". + (frame_state_for): Use gdb_assert to check that fde->cie_ptr is + non-NULL. + (update_context): Do not use __func__. Add missing ``break''. + (update_context): Do not use __func__. + +2002-07-15 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Remove variable print_insn + and its setting. Set gdbarch instruction printing functions + directly. For non-rs6000 case use new function + gdb_print_insn_powerpc. + (gdb_print_insn_powerpc): New function. + +2002-07-13 Andrew Cagney + + * NEWS: Mention that the d30v has been marked obsolete. + * MAINTAINERS: Note that d30v / d30v-elf has been made obsolete. + * configure.tgt: Mark d30v-*-* as obsolete. + * d30v-tdep.c: Mark file as obsolete. + * config/d30v/d30v.mt: Ditto. + * config/d30v/tm-d30v.h: Ditto. + +2002-07-13 Aidan Skinner + + * ada-tasks.c (add_task_entry): replace calls to + malloc() with xmalloc + * ada-tasks.c (init_task_list): replace calls to free with xfree() + + * ada-lang.c (replace_operator_with_call, fill_in_ada_prototype, + ada_finish_decode_line_1, all_sals_for_line + ada_breakpoint_rewrite): replace calls to free() with xfree() + +2002-07-12 Kevin Buettner + + From Nicholas Duffek (with minor changes by Martin Hunt, + Louis Hamilton, and Kevin Buettner): + * aix-thread.c: New file. + +2002-07-12 Petr Sorfa + + * dwarf2read.c (dwarf2_invalid_attrib_class): New + complaint for invalid attribute class or form. + (read_func_scope): DW_AT_frame_base + better handling of DW_AT_block*. + (dwarf2_add_member_fn): DW_AT_vtable_elem_location + better handling of DW_AT_block*. + (read_common_block): DW_AT_location + better handling of DW_AT_block*. + (read_partial_die): DW_AT_location better handling + of DW_AT_block*. + (new_symbol): DW_AT_external better handling of + DW_AT_block*. Proper initialization of variable + "addr". + (attr_form_is_block): New function that returns true + if the attribute's form is of DW_FORM_block*. + +2002-07-12 Peter Schauer + + * valops.c (find_method_list): Remove comment about + removed STATIC_MEMFUNCP argument. + (value_find_oload_method_list): Likewise. + +2002-07-12 Kevin Buettner + + From Nicholas Duffek: + * rs6000-nat.c (vmap_ldinfo, xcoff_relocate_core): Call + target_new_objfile_hook. + +2002-07-12 Kevin Buettner + + From Nicholas Duffek: + * xcoffread.c (scan_xcoff_symtab): Recognize XMC_TD as a data storage + csect. + +2002-07-12 Andrew Cagney + + * MAINTAINERS: Mention --enable-sim-build-warnings. + (m68hc11-elf): Disable sim build warnings. + (m32r-elf): Mark as broken obsolete candidate. + (x86_64-linux-gnu): Mark as buildable with -Werror. + (arm-elf): Change -w to ``,'' which enables warnings but not + -Werror. + +2002-07-12 Andrew Cagney + + * bcache.h: Update copyright. + (struct bstring, struct bcache): Move definition to "bcache.c". + Replaced by opaque declaration. + (bcache_xfree): Replace free_bcache. + (bcache_xmalloc, bcache_memory_used): Declare. + + * bcache.c: Update copyright. + (struct bstring, struct bcache): Moved to here from "bcache.h". + Update comments. + (bcache_xmalloc, bcache_memory_used): New functions. + (bcache_xfree): Replace function free_bcache. + + * Makefile.in (objfiles.o): Add $(bcache_h). + (objfiles_h): Remove $(bcache_h). + (symfile.o): Add $(bcache_h). + + * symmisc.c: Update copyright. + (print_symbol_bcache_statistics): Pass psymbol_cache by value. + (print_objfile_statistics): Use bcache_memory_used. + + * symfile.c: Include "bcache.h". + (reread_symbols): Use bcache_xfree. + (reread_symbols): Use bcache_xmalloc and bcache_xfree. + (add_psymbol_to_list): Pass psymbol_cache by value. + (add_psymbol_with_dem_name_to_list): Ditto. + + * objfiles.h: Update copyright. + (struct bcache): Declare opaque. Do not include "bcache.h". + (struct objfile): Change psymbol_cache and macro_cache to ``struct + bcache'' pointers. + * dwarf2read.c (macro_start_file): Pass macro_cache by value. + + * objfiles.c: Include "bcache.h". Update copyright. + (allocate_objfile): Use bcache_xmalloc to create psymbol_cache and + macro_cache. + (free_objfile): Use bcache_xfree. + +2002-07-11 Grace Sainsbury + + * monitor.c (monitor_fetch_register): Make name a constant. + (monitor_store_register): Same. + +2002-07-11 Daniel Jacobowitz + + Based on patch from Daniel Berlin . + * buildsym.c: Include "demangle.h" for SYMBOL_INIT_DEMANGLED_NAME. + (finish_block) For non-function blocks, hash the symbol table. For + function blocks, mark the symbol table as unhashed. + * minsyms.c (msymbol_hash): Return hash value without taking modulus. + (msymbol_hash_iw): Likewise. + (add_minsym_to_hash_table): Take modulus of msymbol_hash's return + value. + (add_minsym_to_demangled_hash_table): Likewise for msymbol_hash_iw. + (lookup_minimal_symbol): Likewise for both. + * symtab.h (struct block): Add `hashtable' flag. Comment the + hashtable. + (BLOCK_HASHTABLE, BLOCK_BUCKETS, BLOCK_BUCKET): New macro. + (ALL_BLOCK_SYMBOLS): Update. + (BLOCK_SHOULD_SORT): Do not sort hashed blocks. + (struct symbol): Add `hash_next' pointer. + * symtab.c (lookup_block_symbol): Search using the hash table when + possible. + (find_pc_sect_symtab): Use ALL_BLOCK_SYMBOLS. + (search_symbols, find_addr_symbol): Likewise. + + * dstread.c (process_dst_block): Clear hashtable bit for new block. + (read_dst_symtab): Likewise. + * jv-lang.c (get_java_class_symtab): Likewise. + * mdebugread.c: Include "gdb_assert.h". + (shrink_block): Assert that the block being modified is not hashed. + * coffread.c (patch_opaque_types): Use ALL_BLOCK_SYMBOLS. + * symmisc.c (free_symtab_block): Walk the hash table when freeing + symbols. + (dump_symtab): Recognize hashed blocks. + * printcmd.c (print_frame_args): Assert that function blocks do not + have hashed symbol tables. + * ada-lang.c (symtab_for_sym): Use ALL_BLOCK_SYMBOLS. + (fill_in_ada_prototype, debug_print_block): Likewise. + (ada_add_block_symbols): Use ALL_BLOCK_SYMBOLS. Handle hash tables. + +2002-07-11 Corinna Vinschen + + * stack.c (print_frame): Use result of frame_address_in_block() + instead of fi->pc when evaluating symbols. + (backtrace_command_1): Ditto. + +2002-07-11 Andrew Cagney + + * cris-tdep.c (cris_saved_pc_after_call): Fix parameter type. + Make static. + + * arm-tdep.c (arm_register_name): Make return type constant. + +2002-07-10 Andrew Cagney + + * win32-nat.c (has_detach_ability): Convert to strict ISO C + prototype. + * top.c (gdb_rl_operate_and_get_next_completion): Ditto. + * s390-tdep.c (s390_fp_regnum): Ditto. + (s390_read_fp): Ditto. + (s390_pop_frame): Ditto. + (_initialize_s390_tdep): Ditto. + * remote.c (get_remote_state): Ditto. + * procfs.c (mappingflags): Ditto. + * memattr.c (_initialize_mem): Ditto. + * mcore-tdep.c (mcore_pop_frame): Ditto. + * m68klinux-nat.c (_initialize_m68k_linux_nat): Ditto. + * m68k-tdep.c (m68k_register_bytes_ok): Ditto. + * language.c (set_case_str): Ditto. + * gnu-v3-abi.c (vtable_address_point_offset): Ditto. + * frv-tdep.c (new_variant): Ditto. + (frv_stopped_data_address): Ditto. + * dwarf2cfi.c (fde_chunks_need_space): Ditto. + (context_alloc): Ditto. + (frame_state_alloc): Ditto. + (unwind_tmp_obstack_init): Ditto. + (unwind_tmp_obstack_free): Ditto. + (cfi_read_fp): Ditto. + * cris-tdep.c (cris_saved_pc_after_call): Ditto. + (cris_pop_frame): Ditto. + * c-lang.c (scanning_macro_expansion): Ditto. + (finished_macro_expansion): Ditto. + (c_preprocess_and_parse): Ditto. + * gdbarch.sh: Ditto. + * gdbarch.h, gdbarch.c: Regenerate. + * config/mn10200/tm-mn10200.h: Adjust indentation. + * target.c: Adjust indentation. + * symtab.h: Adjust indentation. + * stabsread.h: Adjust indentation. + * remote-es.c: Adjust indentation. + * os9kread.c: Adjust indentation. + +2002-07-10 Andrew Cagney + + * wince.c (_initialize_wince): Rename _initialize_inftarg. + * win32-nat.c (_initialize_win32_nat): Rename _initialize_inftarg. + +2002-07-10 Grace Sainsbury + + * NEWS: Mention m68k, mcore multi-arching. + * MAINTAINERS: Change status of m68k, mcore to reflect + multi-arching. + +2002-07-10 Daniel Jacobowitz + + * valops.c (find_overload_match): Free oload_syms. + +2002-07-09 Joel Brobecker + + Define HAVE_SYS_PROC_H if sys/proc.h exists + * configure.in: Add check for sys/proc.h + * config.in: Regenerate. + * configure: Regenerate. + +2002-07-09 Grace Sainsbury + + * config/m68k/tm-m68k.h: Remove macros wrapped in + #if !GDB_MULTI_ARCH. + +2002-07-08 Andrew Cagney + + * config.in, configure: Regenerate. + +2002-07-08 Mark Kettenis + + * dwarf2cfi.c: Include "gcore.h". + (execute_stack_op): Fix implementation of the + DW_OP_deref and DW_OP_deref_size operators by letting do their + lookup in the target. + +2002-07-07 Mark Kettenis + + From Peter Schauer : + * i386-sol2-tdep.c (i386_sol2_init_abi): Correct value for + tdep->sc_sp_offset. + +2002-07-05 Daniel Jacobowitz + + Fix PR gdb/595, gdb/602 + * gnu-v3-abi.c (gnuv3_baseclass_offset): Remove unused variables. + Don't call value_cast, just read the vtable pointer; update comments + to match. + +2002-07-05 Grace Sainsbury + + * config/mcore/tm-mcore.h: Remove file. + * config/mcore/mcore.mt: Remove definition of TM_FILE + * configure.tgt: Set gdb_multi_arch to yes for the mcore target. + +2002-07-05 Mark Kettenis + + * i386bsd-tdep.c: Include "gdb_string.h". + +2002-07-04 Grace Sainsbury + + * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Set to 2. + (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG,RETVAL_REGNUM): Move to + mcore-tdep. + (REG_STRUCT_HAS_ADDR, USE_STRUCT_CONVENTION, GET_SAVED_REGISTER) + (TARGET_VIRTUAL_FRAME_POINTER, BELIEVE_PCC_PROMOTION): Remove. + * mcore-tdep.c (PR_REGNUM, FIRST_ARGREG, LAST_ARGREG) + (RETVAL_REGNUM): Move macros from tm-mcore.h + (mcore_reg_struct_has_addr): New function. + (mcore_gdbarch_init): Added initializations for the macros removed + from tm-mcore.h. + +2002-07-04 Mark Kettenis + + * osabi.c (generic_elf_osabi_sniffer): Add check for FreeBSD 3.x's + traditonal string branding within the ELF header. + +2002-07-04 Daniel Jacobowitz + + * symtab.c (remove_params): New function. + (make_symbol_overload_list): Use it instead of cplus_demangle. + (overload_list_add_symbol): Likewise. Reorder. Fix memory leak. + +2002-07-04 Mark Kettenis + + * i386obsd-nat.c (_initialize_i386obsd_nat): Fix typo in prototype. + + * i386bsd-tdep.c (i386nbsd_sigtramp_start, i386nbsd_sigtramp_end): + New variables. + (i386nbsd_init_abi): Use these to initialize tdep->sigtramp_start + and tdep->sigtramp_end. + * i386obsd-nat.c: New file. + * config/i386/obsd.mh (NATDEPFILES): Add i386obsd-nat.o. + + * dwarf2cfi.c (cfi_pop_frame): Use alloca() for regbuf. + Don't call get_current_frame(). + +2002-07-04 Pierre Muller + + * i386-nat.c (child_post_startup_inferior): New function + calling i386_cleanup_dregs if + I386_USE_GENERIC_WATCHPOINTS is defined. + * config/i386/nm-i386.h: define CHILD_POST_STARTUP_INFERIOR + conditional to acknowledge that i386-nat.c has its + own child_post_startup_inferior function. + +2002-07-04 Mark Kettenis + + * i386-tdep.h (I386_MAX_REGISTER_SIZE): New define. + * i386-tdep.c (i386_do_pop_frame): Use I386_MAX_REGISTER_SIZE + instead of MAX_REGISTER_RAW_SIZE. + (i386_extract_return_value, i386_extract_struct_value_address): + Convert to use regcache. + (i386_gdbarch_init): Set max_register_raw_size and + max_register_virtual_size to I386_MAX_REGISTER_SIZE. + Set extract_return_value and extract_struct_value_address instead + of their deprecated variants. + + Convert i386 target to generic dummy frames. + * i386-tdep.c: Include "symfile.h". + (i386_frameless_signal_p): Consider a function to be frameless if + the pc points at the first instruction of the function. + (i386_frame_chain): Handle (generic) call dummies. + (i386_frame_saved_pc): Likewise. + (i386_frame_init_saved_regs): Remove code dealing with call + dummies on the stack. + (i386_push_dummy_frame): Removed. + (i386_call_dummy_words): Removed. + (i386_fix_call_dummy): Removed. + (i386_push_return_address): New function. + (i386_do_pop_frame): Renamed from i386_pop_frame. Add FRAME + parameter, and don't call get_current_frame. + (i386_pop_frame): New function. + (i386_gdbarch_init): Set use_generic_dummy_frames to 1, set + call_dummy_location to AT_ENTRY_POINT, set call_dummy_address to + entry_point_address, set call_dummy_breakpoint_offset to 0, set + call_dummy_length to 0, set call_dummy_words to NULL, set + sizeof_call_dummy_words to 0, set fix_call_dummy to + generic_fix_call_dummy, set pc_in_call_dummy to + pc_in_call_dummy_at_entry_point, set push_dummy_frame to + generic_push_dummy_frame, set push_return_address to + i386_push_return_address and set frame_chain_valid to + generic_file_frame_chain_valid. + +2002-07-03 Andrew Cagney + + * gdbarch.sh (struct regcache): Add opaque declaration. + (EXTRACT_RETURN_VALUE): New architecture method. + (EXTRACT_STRUCT_VALUE_ADDRESS): Ditto. + * gdbarch.h, gdbarch.c: Regenerate. + * arch-utils.c (legacy_extract_return_value): New function. + * arch-utils.h (legacy_extract_return_value): Declare. + * values.c (value_being_returned): Re-enable code handling + EXTRACT_STRUCT_VALUE_ADDRESS. Move + deprecated_grub_regcache_for_registers call to block handling + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. + (EXTRACT_RETURN_VALUE): Do not define. + +2002-07-03 Grace Sainsbury + + * config/mcore/tm-mcore.h (REGISTER_BYTES, NUM_REGS, PC_REGNUM) + (SP_REGNUM, FP_REGNUM, FUNCTION_START_OFFSET, DECR_PC_AFTER_BREAK) + (BREAKPOINT_FROM_PC, INNER_THAN, SAVED_PC_AFTER_CALL) + (INIT_EXTRA_FRAME_INFO, FRAME_INIT_SAVED_REGS, INIT_FRAME_PC) + (FRAME_CHAIN, FRAME_CHAIN_VALID, FRAME_SAVED_PC) + (STORE_RETURN_VALUE, DEPRECATED_EXTRACT_RETURN_VALUE) + (STORE_STRUCT_RETURN, DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) + (SKIP_PROLOGUE, FRAME_ARGS_SKIP, FRAME_ARGS_ADDRESS) + (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, POP_FRAME) + (PUSH_RETURN_ADDRESS, PUSH_DUMMY_FRAME, PUSH_ARGUMENTS): Remove. + * mcore-tdep.c (mcore_init_extra_frame_info): Add fromleaf + argument so the function fits the prototype in the architecture + vector. + (mcore_pop_frame): Remove argument so the function fits the + prototype. Use get_current_frame instead of the argument. + (mcore_push_arguments): Change type of struct_return so the + function can be used in the architecture vector. + (mcore_store_struct_return): Add. + (mcore_frame_init_saved_regs): Add. + (mcore_gdbarch_init): Add function calls to replace the macros + removed from tm-mcore.h + +2002-07-03 Andrew Cagney + + * infcmd.c (print_return_value): Remove compatibility code calling + deprecated_grub_regcache_for_registers. + + * values.c: Include "regcache.h". + (value_being_returned): Update. Use + deprecated_grub_regcache_for_registers to extract the register + buffer address. + * value.h (value_being_returned): Change ``retbuf'' parameter to a + ``struct regcache''. + * Makefile.in (values.o): Add dependency on $(regcache_h). + + * inferior.h (run_stack_dummy): Change type of second parameter to + a ``struct regcache''. + * valops.c (hand_function_call): Change type of retbuf to ``struct + regcache''. Allocate using regcache_xmalloc, clean using + make_cleanup_regcache_xfree. + * infcmd.c (run_stack_dummy): Update. Use + regcache_cpu_no_passthrough instead of memcpy to copy the buffer. + + * regcache.c (do_regcache_xfree): New function. + (make_cleanup_regcache_xfree): New function. + * regcache.h (make_cleanup_regcache_xfree): Declare. + +2002-07-03 Martin M. Hunt + + * event-top.c (command_line_handler): Don't read past + beginning of buffer. + +2002-07-03 Martin M. Hunt + + * varobj.c (struct varobj_root): Change frame from CORE_ADDR to + struct frame_id. + (varobj_create): Store frame_id for root. + (varobj_gen_name): Use xasprintf. + (varobj_update): Save and restore frame using get_frame_id() and + frame_find_by_id(). + (create_child): Use xasprintf. + (new_root_variable): Initialize frame_id. + (c_name_of_child): Use xasprintf. Call find_frame_by_id(). + (c_value_of_variable): Use xasprintf. Move mem_fileopen call + to prevent memory leak. + +2002-07-03 Andrew Cagney + + * valops.c (hand_function_call): Move declaration of retbuf to + start of function, allocate using malloc, add a cleanup but before + the inf_status cleanup, cleanup the buffer. Rename local variable + old_chain to inf_status_cleanup. + +2002-07-03 Martin M. Hunt + + * top.c (execute_command): Use cmd_func() and cmd_func_p(). + + * cli/cli-decode.c (cmd_func_p): New function. + (cmd_func): New function. + + * command.h: Add cmd_func() and cmd_func_p(). + +2002-07-03 Grace Sainsbury + + * config/mcore/tm-mcore.h (GDB_MULTI_ARCH): Add macro. Set to 0. + (REGISTER_SIZE): Remove. + (MAX_REGISTER_RAW_SIZE): Remove. + (REGISTER_VIRTUAL_TYPE): Remove. + (MAX_REGISTER_VIRTUAL_SIZE): Remove. + (REGISTER_NAME): Remove. + (USE_GENERIC_DUMMY_FRAMES): Remove. + (CALL_DUMMY): Remove. + (CALL_DUMMY_START_OFFSET): Remove. + (CALL_DUMMY_BREAKPOINT_OFFSET): Remove. + (CALL_DUMMY_LOCATION): Remove. + (FIX_CALL_DUMMY): Remove. + (CALL_DUMMY_ADDRESS): Remove. + (SIZEOF_CALL_DUMMY_WORDS): Remove. + (SAVE_DUMMY_FRAME_TOS): Remove. + * mcore-tdep.c (MCORE_REG_SIZE, MCORE_NUM_REGS): Add macros. + (mcore_register_virtual_type): New function. + (mcore_register_byte): New function. + (mcore_register_size): New function. + (mcore_register_name): New function. + (mcore_gdbarch_init): New function. Add set_gdbarch calls for + macros removed from tm-mcore.h. + (mcore_dump_tdep): Add. + (_initialize_mcore_tdep): Add gdbarch_register call. + +2002-07-03 Mark Kettenis + + * i386-tdep.c (i386_frameless_signal_p): Provide an argument in to + frameless_look_for_prologue, such that we actually call this + function. + +2002-07-02 Joel Brobecker + + * frame.h (frame_address_in_block): New function. + + * blockframe.c (frame_address_in_block): New function extracted + from get_frame_block(). + (get_frame_block): Use frame_address_in_block(). + (block_innermost_frame): Use frame_address_in_block() to match + the frame pc address against the block boundaries rather than + the frame pc directly. This prevents a failure when a frame pc + is actually a return-address pointing immediately after the end + of the given block. + +2002-07-02 Grace Sainsbury + + * MAINTAINERS: Add self under write after approval. + +2002-07-02 Grace Sainsbury + + * m68k-tdep.c (m68k_remote_breakpoint_from_pc): Add. Currently not + used in architecture vector. The default is + m68k_local_breakpoint_from_pc. + (m68k_local_breakpoint_from_pc): Add. + (enum): Add register numbers from tm-m68k.h. + (m68k_gdbarch_init): Add breakpoint_from_pc to architecture + vector. + * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Set to + GDB_MULTI_ARCH_PARTIAL. + (BPT_VECTOR, REGISTER_BYTES_FP, REGISTER_BYTES_NOFP) + (NUM_FREGS, SIG_PC_FP_OFFSET, SP_ARG0, REMOTE_BPT_VECTOR): Move to + m68k-tdep.c. + (BREAKPOINT, REMOTE_BREAKPOINT): Remove. + (A1_REGNUM, FP0_REGNUM, FPC_REGNUM, FPS_REGNUM, FPI_REGNUM): Move + to enum in m68k-tdep.c + +2002-07-02 Joel Brobecker + + * solib-osf.c (open_map): Compute the list of shared libraries + loaded by the inferior, rather than the list of libraries loaded + by GDB itself. Otherwise, GDB ends up reading the symbols from + the wrong shared libraries... + +2002-07-02 Mark Kettenis + + * i386-linux-tdep.c (i386_linux_sigcontext_addr): Make static. + (LINUX_SIGCONTEXT_PC_OFFSET, LINUX_SIGCONEXT_SP_OFFSET): Remove + macros. + (i386_linux_sigtramp_saved_pc, i386_linux_sigtramp_saved_sp): + Remove functions. + (FRAMELESS_SIGNAL): Remove function. + (i386_linux_frame_chain, i386_linux_frame_saved_pc, + i386_linux_saved_pc_after_call): Removed. + (i386_linux_init_abi): Initialize tdep->sigcontext_addr, + tdep->sc_pc_offset and tdep->sc_sp_offset. Don't override + frame_chain, frame_saved_pc and saved_pc_after_call any longer. + + * i386-tdep.c (i386_frameless_signal_p): New function. + (i386_frame_chain): Deal with frameless signals. + (i386_sigtramp_saved_sp): New function. + (i386_frame_saved_pc): Deal with frameless signals. + (i386_saved_pc_after_call): Make sure the correct value is + returned just after entry into a sigtramp. + * i386bsd-tdep.c (i386bsd_sc_sp_offset, i386nbsd_sc_sp_offset, + i386fbsd4_sc_sp_offset): New variables. + (i386bsd_init_abi, i386nbsd_init_abi, i386fbsd4_init_abi): Use + these variables to initialize tdep->sc_sp_offset. * i386bsd-nat.c + (_initialize_i386bsd_nat): Add sanity check for sc_sp_offset + similiar to what we already did for sc_pc_offset. + * i386-sol2-tdep.c (i386_sol2_init_abi): Initialize + tdep->sc_sp_offset. + + * i386nbsd-tdep.c (fetch_elfcore_registers): Wrap long line. + +2002-07-02 Michal Ludvig + + * config/i386/tm-x86-64linux.h: New. + * config/i386/x86-64linux.mt: Add GDB_MULTI_ARCH and TM_FILE + definitions. + * config/i386/nm-x86-64.h: Rename to ... + * config/i386/nm-x86-64linux.h: ... this one. + * config/i386/x86-64linux.mh: Reflect the above change. + +2002-07-01 Mark Kettenis + + * i386-tdep.h (struct gdbarch_tdep): Replace sigtramp_saved_pc + with sigcontext_addr. Add sc_sp_offset. + (i386bsd_sigtramp_saved_pc): Remove prototype. + (i386bsd_sicontext_addr): Add prototype. + * i386-tdep.c (i386_sigtramp_saved_pc): New function. + (i386_frame_saved_pc): Rewrite to call i386_sigtramp_saved_pc. + (i386_svr4_sigtramp_saved_pc): Removed. + (i386_svr4_sigcontext_addr): New function. + (i386_svr4_init_abi): Don't initialize tdep->sigtramp_saved_pc. + Initialize tdep->sigcontext_addr instead. Initialize + tdep->sc_pc_offset and tdep->sc_sp_offset. + (i386_gdbarch_init): Likewise. + * i386bsd-tdep.c (i386bsd_sigcontext_addr): Don't make it static + any more. + (i386bsd_sigtramp_saved_pc): Remove function. + (i386bsd_init_abi): Don't initialize tdep->sigtramp_saved_pc. + Initialize tdep->sigcontext_addr instead. Initialize + tdep->sc_pc_offset. + * i386-linux-tdep.c (i386_linux_init_abi): Remove initialization + of tdep->sigtramp_saved_pc. + * i386-sol2-tdep.c (i386_sol2_init_abi): Don't initialize + tdep->sigtramp_saved_pc. Initialize tdep->sigcontext_addr + instead. + + * i386-tdep.c (i386_frameless_function_invocation, + i386_frame_num_args, i386_frame_init_saved_regs, + i386_skip_prologue, i386_push_dummy_frame, i386_fix_call_dummy, + i386_pop_frame, i386_push_arguments, i386_store_struct_return, + i386_extract_return_value, i386_store_return_value, + i386_extract_struct_value_address, i386_register_virtual_type, + i386_register_convertible, i386_register_convert_to_virtual, + i386_register_convert_to_raw, i386_svr4_sigtramp_saved_pc, + i386_go32_init_abi, i386_nw_init_abi, i386_gdbarch_init): Make + static. + +2002-07-01 Mark Kettenis + + * i386bsd-tdep.c (i386bsd_frame_saved_pc): Removed. + + * config/i386/tm-i386sol2.h (COERCE_FLOAT_TO_DOUBLE): Removed. + * i386-sol2-tdep.c (i386_sol2_init_abi): Adjust for the removal of + this macro. Include "value.h". + +2002-06-30 Aidan Skinner + + * ada-exp.tab.c: remove as it's a generated file + * ada-lex.c: remove as it's a generated file + +2002-06-30 Mark Kettenis + + * config/i386/tm-i386.h (struct frame_info, struct + frame_saved_regs, struct value, struct type): Remove forward + declarations. + + * config/i386/tm-linux.h [HAVE_PTRACE_GETFPXREGS] + (FILL_FPXREGSET, HAVE_SSE_REGS): Remove define. + * config/i386/nm-linux.h [HAVE_PTRACE_GETFPXREGS] + (FILL_FPXREGSET): Define. + + * config/i386/tm-nbsd.h (HAVE_SSE_REGS): Remove define. + + * configure.tgt (i[3456]86-*-openbsd*): Fold into + i[3456]86-*-netbsd* case. + * config/i386/tm-obsd.h: Removed. + * config/i386/obsd.mt: Removed. + * config/i386/obsd.mh (NATDEPFILES): Remove corelow.o and + core-aout.o. + (MH_CFLAGS): Add -DYYDEBUG=0. + + * i386bsd-nat.c (_initialize_i386bsd_nat): Define SC_PC_OFFSET to + i386nbsd_sc_pc_offset on OpenBSD too. + + * config/i386/tm-fbsd.h [!SVR4_SHARED_LIBS] + (IN_SOLIB_CALL_TRAMPOLINE): Remove define. + * config/i386/tm-nbsdaout.h (IN_SOLIB_CALL_TRAMPOLINE): Remove + define. + * i386bsd-tdep.c: Include "arch-utils.h". + (i386bsd_aout_in_solib_call_trampoline): New function. + (i386bsd_init_abi): Set in_solib_call_trampoline to + i386bsd_aout_in_solib_call_trampoline. + (i386nbsdelf_init_abi, i386fbsd_init_abi): Set + in_solib_call_trampoline to generic_in_solib_call_trampoline. + +2002-06-28 Andrew Cagney + + * macrotab.h: Do not include "obstack.h" or "bcache.h". + (struct obstack, struct bcache): Add opaque declarations. + * Makefile.in (macrotab_h): Update + +2002-06-28 Andrew Cagney + + * blockframe.c (generic_find_dummy_frame): Change return type to + ``struct regcache''. + (struct dummy_frame): Replace field ``registers'' with regcache, a + struct regcache object. + (generic_find_dummy_frame): Update. + (generic_push_dummy_frame): Update. Use regcache_xfree, + regcache_xmalloc and regcache_cpy. + (generic_pop_dummy_frame): Update. Use regcache_cpy and + regcache_xfree. + (deprecated_generic_find_dummy_frame): Update. + (generic_read_register_dummy): Update. Use + regcache_read_as_address. + (generic_call_dummy_register_unwind): Update. Use regcache_read. + (generic_get_saved_register): Update. Use regcache_read. + +2002-06-28 Andrew Cagney + + * Makefile.in (objfiles_h): Add $(bcache_h). + * objfiles.h: Include "bcache.h". + + * Makefile.in (symtab_h): Remove $(bcache_h). + * symtab.h: Do not include "bcache.h". + +2002-06-28 Andrew Cagney + + * ppcnbsd-tdep.c (ppcnbsd_init_abi): Set frame_chain_valid to + generic_func_frame_chain_valid. + +2002-06-28 David O'Brien + + * config/i386/nm-fbsd.h: Include . + * config/i386/tm-fbsd.h: Likewise. + +2002-06-28 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Use + generic_unwind_get_saved_register. + +2002-06-27 Andrew Cagney + + From 2002-06-27 John David Anglin : + * regcache.c (supply_register): Add missing argument to + register_buffer call. + +2002-06-27 Andrew Cagney + + * Makefile.in (init.c): Drop -e option to grep. Not necessary and + Solaris /bin/grep does not not like it. From Peter Schauer. + +2002-06-26 Tom Tromey + + * command.h (add_setshow_cmd): Declare. + (add_setshow_cmd_full): Declare. + * cli/cli-decode.c (add_setshow_cmd): No longer static. Now + returns void. Use add_setshow_cmd_full. + (add_setshow_cmd_full): New function. + (add_setshow_auto_boolean_cmd): Use add_setshow_cmd_full. + (add_setshow_boolean_cmd): Likewise. + +2002-06-26 Jason Thorpe + + * config/vax/tm-vax.h: Protect from multiple inclusion. + (TARGET_UPAGES, TARGET_NBPG, STACK_END_ADDR) + (SIGTRAMP_START, SIGTRAMP_END, SIGCONTEXT_PC_OFFSET): Move to... + * config/vax/tm-vaxbsd.h: ...here. New file. + * config/vax/vax.mt (TM_FILE): Set to tm-vaxbsd.h. + +2002-06-26 Jason Thorpe + + * config/vax/tm-vax.h (BREAKPOINT): Remove. + (BELIEVE_PCC_PROMOTION): Remove. + (AP_REGNUM): Move to... + * config/vax/nm-vax.h: ...here. + * vax-tdep.c: Use VAX_AP_REGNUM instead of AP_REGNUM. + (vax_breakpoint_from_pc): New function. + (vax_gdbarch_init): Initialize gdbarch_breakpoint_from_pc + and gdbarch_believe_pcc_promotion. + +2002-06-26 Jason Thorpe + + * Makefile.in (vax_tdep_h): Define. + (vax-tdep.o): Use $(vax_tdep_h). + * vax-tdep.c (vax_gdbarch_init): Use generic OS ABI framework. + (vax_dump_tdep): New function. + (_initialize_vax_tdep): Register vax_dump_tdep. + * vax-tdep.h: Include osabi.h. + (struct gdbarch_tdep): New. + +2002-06-26 Andrew Cagney + + * frame.h (deprecated_generic_find_dummy_frame): Rename + generic_find_dummy_frame. + * blockframe.c (generic_find_dummy_frame): Make static. + (deprecated_generic_find_dummy_frame): New function. + * sh-tdep.c (sh_nofp_frame_init_saved_regs): Replace + generic_find_dummy_frame with deprecated_find_dummy_frame. + (sh64_nofp_frame_init_saved_regs): Ditto. + (sh_fp_frame_init_saved_regs): Ditto. + * s390-tdep.c (s390_frame_saved_pc_nofix): Ditto. + (s390_frame_chain): Ditto. + * cris-tdep.c (cris_frame_init_saved_regs): Ditto. + +2002-06-26 Grace Sainsbury + + * config/m68k/tm-m68k.h: Rearrange code so macros not in the + gdbarch vector are at the top. + (NUM_REGS): Remove. + (FP_REGNUM, SP_REGNUM, PS_REGNUM, PC_REGNUM, FP0_REGNUM): Remove. + (FRAME_ARGS_ADDRESS): Remove. + (FRAME_LOCALS_ADDRESS): Remove. + (FRAME_NUM_ARGS): Remove. + (FRAME_ARGS_SKIP): Remove. + * m68k-tdep.c (enum): Add eumeration of special register numbers. + (m68k_gdbarch_init): Add gdbarch initializations for macros + undefined in tm-m68k.h + +2002-06-26 Grace Sainsbury + + * monitor.h: Add the function regname to monitor_ops + structure. This way NUM_REGS does not have to be a constant. + * monitor.c (monitor_fetch_register): Added support for regname + function. The function is called if the array regnames is NULL. + (monitor_store_register): Same. + * cpu32bug-rom.c (cpu32bug_regname): Add function. Replaces + regnames array. + (init_cpu32bug_cmds): set cpu32bug_cmds.regnames to NULL, + cpu32bug_cmds.regname to point to new function. + * abug-rom.c (abug_regname): Same as above. + (init_abug_cmds): Same. + * dbug-rom.c (dbug_regname): Same as above. + (init_dbug_cmds): Same. + * remote-est.c (est_regname): Same. + (init_est_cmds): Same. + * rom68k-rom.c (rom68k_regname): Same. + (init_rom68k_cmds): Same. + +2002-06-25 Tom Tromey + + * breakpoint.c (delete_command): Don't repeat `delete' commands. + +2002-06-25 Andrew Cagney + + * infrun.c (stop_registers): Change variable's type to ``struct + regcache'''. + (xmalloc_inferior_status): Delete function. + (free_inferior_status): Delete function. + (normal_stop): Use regcache_cpy. + (struct inferior_status): Change type of fields ``stop_registers'' + and ``registers'' to ``struct regcache''. + (write_inferior_status_register): Use regcache_write. + (save_inferior_status): Instead of calling + xmalloc_inferior_status, allocate the inf_status buffer directly. + Use regcache_dup_no_passthrough and regcache_dup to save the + buffers. + (restore_inferior_status): Use regcache_xfree and regcache_cpy. + Replace the stop_registers regcache instead of overriding it. Use + regcache_xfree. Instead of calling free_inferior_status, xfree + the buffer directly. + (discard_inferior_status): Use regcache_xfree. Instead of calling + free_inferior_status, xfree the buffer directly. + (build_infrun): Use regcache_xmalloc. + (_initialize_infrun): Delete redundant call to build_infrun. + + * Makefile.in (infcmd.o): Add $(regcache_h). + + * infcmd.c: Include "regcache.h". + (run_stack_dummy): Use deprecated_grub_regcache_for_registers to + obtain the address of `stop_registers' register buffer. + (print_return_value): Ditto. + + * inferior.h (struct regcache): Add opaque declaration. + (stop_registers): Change variable's declared type to ``struct + regcache''. + +2002-06-24 Tom Tromey + + * cli/cli-decode.c (add_show_from_set): Fixed typo in comment. + * target.c (initialize_targets): Fixed typo in + trust-readonly-sections `show' documentation. + + * main.c: Marked all strings with _(). + +2002-06-24 Don Howard + + * memattr.c (create_mem_region): Treat hi == 0 as a special case + that means max CORE_ADDR+1. + (lookup_mem_region): Ditto. + (mem_info_command): Ditto. + +2002-06-24 Grace Sainsbury + + * config/m68k/tm-m68k.h (DECR_PC_AFTER_BREAK): Remove. + (REGISTER_BYTES_OK): Remove. + (REGISTER_BYTES): Remove. + (STORE_STRUCT_RETURN): Remove. + (DEPRECATED_EXTRACT_RETURN_VALUE): Remove. + (STORE_RETURN_VALUE): Remove. + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Remove. + (FRAME_CHAIN): Remove. + (FRAMELESS_FUNCTION_INVOCATION): Remove. + (FRAME_SAVED_PC): Remove. + * m68k-tdep.c (m68k_register_bytes_ok):Add. + (m68k_store_struct_return): Add. + (m68k_deprecated_extract_return_value): Add. + (m68k_deprecated_extract_struct_value_address): Add. + (m68k_store_return_value): Add. + (m68k_frame_chain): Add. + (m68k_frameless_function_invocation): Add. + (m68k_frame_saved_pc): Add. + (m68k_gdbarch_init): added set_gdbarch calls for new + functions and deleted macros. + +2002-06-23 Tom Tromey + + * Makefile.in (HFILES_NO_SRCDIR): Remove old files. + (ALLDEPFILES): Likewise. + (udiheaders): Removed. + (udip2soc.o): Likewise. + (udi2go32.o): Likewise. + (udr.o): Likewise. + (HFILES_WITH_SRCDIR): Don't mention udiheaders. + +2002-06-22 Andrew Cagney + + * infrun.c (_initialize_infrun): Delete unnecessary call to + build_infrun. + + * regcache.h: Update comments describing the regcache_cpy family + of functions. + (regcache_save, regcache_restore): Delete declaration. + (regcache_save_no_passthrough): Delete declaration. + (regcache_restore_no_passthrough): Delete declaration. + * regcache.c (regcache_save): Delete function. + (regcache_save_no_passthrough): Delete function. + (regcache_restore): Delete function. + (regcache_restore_no_passthrough): Delete function. + +2002-06-21 Andrew Cagney + + * config/m68k/tm-m68k.h: Fix typo. + (FRAME_INIT_SAVED_REGS): Define when non-multi-arch. + (m68k_frame_init_saved_regs): Declare. + +2002-06-21 Jim Blandy + + Remove some vestiges of Harris 88k support. + * dwarf2read.c (decode_locdesc): Remove `#if' block for Harris 88k + register numbering quirk. + * elfread.c (elf_symtab_read): Remove `#if' block for skipping + odd symbols occurring in Harris 88k ELF targets. + +2002-06-21 Tom Tromey + + * gdb_locale.h: New file. + * Makefile.in (GDB_CFLAGS): Define LOCALEDIR. + (defs_h): Added gdb_locale.h. + * configure, config.in: Rebuilt. + * configure.in (PACKAGE): Define. + * defs.h: Include gdb_locale.h. + * main.c (captured_main): Call setlocale, bindtextdomain, + textdomain. + +2002-06-21 Dave Brolley + + From Stan Shebs, Jim Blandy, Mark Salter, Kevin Buettner: + * config/frv/frv.mt: New file. + * config/frv/tm-frv.h: New file. + * configure.tgt: Support frv-*-*. + * Makefile.in (frv-tdep.o): New target. + * frv-tdep.c: New file. + * NEWS: Mention frv. + +2002-06-21 Dave Brolley + + * MAINTAINERS: Add self to "Write After Approval" list. + +2002-06-21 Grace Sainsbury + + * config/m68k/tm-m68k.h (REGISTER_BYTE, REGISTER_RAW_SIZE) + (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE) + (REGISTER_VIRTUAL_TYPE, REGISTER_NAMES, TARGET_LONG_DOUBLE_FORMAT) + (FUNCTION_START_OFFSET, SKIP_PROLOGUE, SAVED_PC_AFTER_CALL) + (INNER_THAN, STACK_ALIGN, REGISTER_SIZE): Remove macros. + + * m68k-tdep.c: Include arch-utils.h + (m68k_register_raw_size): Add. + (m68k_register_virtual_size): Add. + (m68k_register_virtual_type): Add. + (m68k_register_name): Add. + (m68k_stack_align): Add. + (m68k_register_byte): Add. + (m68k_gdbarch_init): Add set_gdbarch calls for macros removed in + tm-m68k.h. + +2002-06-21 Grace Sainsbury + + * m68k-tdep.c (m68k_frame_init_saved_regs): Replace + m68k_find_saved_regs. + (m68k_pop_frame): Removed saved_regs structure, and replaced + references to it with frame->saved_regs. + (m68k_gdbarch_init): Added function calls to initialize the + gdbarch structure. + (m68k_fix_call_dummy): Add. + * config/m68k/tm-m68k.h: (FRAME_FIND_SAVED_REGS): Remove. + (CALL_DUMMY): Remove. + (CALL_DUMMY_LENGTH): Remove. + (CALL_DUMMY_START_OFFSET): Remove. + (CALL_DUMMY_BREAKPOINT_OFFSET): Remove. + (FIX_CALL_DUMMY): Remove. + (PUSH_DUMMY_FRAME): Remove. + (POP_FRAME): Remove. + +2002-06-19 Pierre Muller + + * parse.c (parse_fprintf): New function used to avoid calls to + fprintf in bison parser generated debug code. + * parser-defs.h: Declaration of new parse_fprintf function. + * ada-exp.y, c-exp.y, f-exp.y, jv-exp.y, m2-exp.y, p-exp.y: + Set YYDEBUG to 1 by default. + Set YYFPRINTF as parse_fprintf. + +2002-06-21 Michal Ludvig + + * dwarf2cfi.c (read_encoded_pointer): Don't handle pointer + encoding anymore. + (pointer_encoding, enum ptr_encoding): New. + (execute_cfa_program): Take care about pointer encoding. + (dwarf2_build_frame_info): Only call parse_frame_info for + .debug_frame and .eh_frame. + (parse_frame_info): New, derived from former dwarf2_build_frame_info. + fixed augmentation handling, added relative addressing, + ignore duplicate FDEs. Added comments. + * dwarf2cfi.c: Reindented. + +2002-06-20 Elena Zannoni + + * event-top.c (command_handler): Don't use space_at_cmd_start + unless there is sbrk() on the host. Assign time and space data + to union fields of the appropriate length. + +2002-06-20 Michal Ludvig + + * x86-64-tdep.c (x86_64_register_nr2name): Rename to + x86_64_register_name. Return type changed to 'const char *'. + (x86_64_register_name2nr): Rename to x86_64_register_number. + (x86_64_gdbarch_init): Update to reflect the change. + * x86-64-tdep.h: Ditto. + * x86-64-linux-nat.c (x86_64_fxsave_offset) + (supply_fpregset): Ditto. + +2002-06-19 Andrew Cagney + + * regcache.h: Update copyright. + (struct regcache, struct gdbarch): Add opaque declarations. + (current_regcache): Declare global variable. + (regcache_read, regcache_write): Add gdbarch parameter. + (regcache_save, regcache_save_no_passthrough) + (regcache_restore, regcache_restore_no_passthrough) + (regcache_dup, regcache_dup_no_passthrough) + (regcache_cpy, regcache_cpy_no_passthrough) + (deprecated_grub_regcache_for_registers) + (deprecated_grub_regcache_for_register_valid) + (regcache_valid_p): Add function declarations. + + * regcache.c: Update copyright. + (regcache_descr_handle): New global variable. + (struct regcache_descr): Define. + (init_legacy_regcache_descr, init_regcache_descr): New functions. + (regcache_descr, xfree_regcache_descr): New functions. + (struct regcache): Define. + (regcache_xmalloc, regcache_xfree): New functions. + (regcache_cpy, regcache_cpy_no_passthrough): New functions. + (regcache_dup, regcache_dup_no_passthrough): New functions. + (regcache_valid_p, regcache_read_as_address): New functions. + (deprecated_grub_regcache_for_registers): New function. + (deprecated_grub_regcache_for_register_valid): New function. + (current_regcache): New global variable. + (register_buffer): Add regcache parameter. Update calls. + (regcache_read, regcache_write): Add regcache parameter. Rewrite. + (read_register_gen, write_register_gen): Update register_buffer + call. Test for legacy_p instead of gdbarch_register_read_p or + gdbarch_register_write_p. + (regcache_collect): Update register_buffer call. + (build_regcache): Rewrite. Use deprecated grub functions. + (regcache_save, regcache_save_no_passthrough): New functions. + (regcache_restore, regcache_restore_no_passthrough): New + functions. + (_initialize_regcache): Create the regcache_data_handle. Swap + current_regcache global variable. + + * sh-tdep.c (sh_pseudo_register_read): Add current_regcache + parameter to regcache_read and regcache_write calls. + (sh4_register_read): Ditto. + (sh64_pseudo_register_read): Ditto. + (sh64_register_read): Ditto. + (sh_pseudo_register_write): Ditto. + (sh4_register_write): Ditto. + (sh64_pseudo_register_write): Ditto. + (sh64_register_write): Ditto. + + * defs.h (XCALLOC): Define. + +2002-06-19 Grace Sainsbury + + * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Added (set to 0). + * m68k-tdep.c (m68k_gdbarch_init): Added. + (m68k_dump_tdep): Added. + +2002-06-19 Daniel Jacobowitz + + * ada-lang.c (fill_in_ada_prototype): Update comment. + +2002-06-19 Daniel Jacobowitz + + * mips-tdep.c (enum mips_abi): Explicitly start at 0. Add + MIPS_ABI_LAST. + (mips_abi_string, mips_abi_strings): New. + (struct gdbarch_tdep): Remove mips_abi_string, add found_abi. + (mips_gdbarch_init): Set tdep->found_abi. Don't set + tdep->mips_abi_string. Honor mips_abi_string. Default to + O32 if no ABI is found. + (mips_dump_tdep): Use mips_abi_strings. + (mips_abi_update): New function. + (_initialize_mips_tdep): Initialize mips_abi_string. Add + ``set mips abi'' and ``show mips abi''. Check the size of + mips_abi_strings. + +2002-06-19 Andrew Cagney + + * i386-linux-tdep.c (i386_linux_register_name): Make return type + constant. + +2002-06-18 Joel Brobecker + + * alpha-tdep.c (heuristic_proc_desc): Compute the size of the + current frame using only the first stack size adjustment. All + subsequent size adjustments are not considered to be part of + the "static" part of the current frame. + Compute the address of the saved registers relative to the + Frame Pointer ($fp) instead of the Stack Pointer if $fp is + in use in this frame. + +2002-06-18 Don Howard + + * valops.c (value_ind): Use value_at_lazy() when dereferencing + type int expressions. Thanks to Jim Blandy for + suggesting this solution. + +2002-06-18 Andrew Cagney + + * config/romp/xm-rtbsd.h: Delete file. + * config/romp/rtbsd.mh: Delete file. + +2002-06-18 Keith Seitz + + * breakpoint.c (condition_command): Post breakpoint_modify + when a condition is added to an existing breakpoint. + (commands_command): Likewise for commands. + (set_ignore_count): Likewise for ignore counts. + If no tty, do not simply return, still need to send event + notification. + (ignore_command): Only print a newline if the command came + from a tty. + Don't call breakpoints_changed, since this is now properly + handled by set_ignore_count. + +2002-06-18 Andrew Cagney + + * MAINTAINERS: Note that cris-elf target can be compiled with + -Werror. + * cris-tdep.c (cris_register_name): Make return type constant. + (cris_breakpoint_from_pc): Ditto. + +2002-06-18 Michal Ludvig + + * frame.h (struct frame_info): Change type of context to + 'struct context'. + +2002-06-17 Andrew Cagney + + * gdbarch.sh (REGISTER_NAME): Change return type a constant string + pointer. + * gdbarch.h, gdbarch.c: Regenerate. + * config/mips/tm-mips.h (mips_register_name): Update. + * i386-tdep.h (i386_register_name): Update. + * mips-tdep.c (mips_register_name): Update + * alpha-tdep.c (alpha_register_name): Update. + * arch-utils.c (legacy_register_name): Update. + * arch-utils.h (legacy_register_name): Update. + * avr-tdep.c (avr_register_name): Update. + * ia64-tdep.c (ia64_register_name): Update. + * i386-tdep.c (i386_register_name): Update. + * sparc-tdep.c (sparc32_register_name): Update. + (sparc64_register_name): Update. + (sparclite_register_name): Update. + (sparclet_register_name): Update. + * sh-tdep.c (sh_generic_register_name): Update. + (sh_sh_register_name): Update. + (sh_sh3_register_name): Update. + (sh_sh3e_register_name): Update. + (sh_sh_dsp_register_name): Update. + (sh_sh3_dsp_register_name): Update. + (sh_sh4_register_name): Update. + (sh_sh64_register_name): Update. + * s390-tdep.c (s390_register_name): Update. + * rs6000-tdep.c (rs6000_register_name): Update. + * ns32k-tdep.c (ns32k_register_name_32082): Update. + (ns32k_register_name_32382): Update. + * d10v-tdep.c (d10v_ts2_register_name): Update. + (d10v_ts3_register_name): Update. + * xstormy16-tdep.c (xstormy16_register_name): Update. + * vax-tdep.c (vax_register_name): Update. + * v850-tdep.c (v850_register_name): Update. + * m68hc11-tdep.c (m68hc11_register_name): Update. + * mn10300-tdep.c (mn10300_generic_register_name): Update. + (am33_register_name): Update. + +2002-06-17 Grace Sainsbury + + * m68k-tdep.c: Reindented. + +2002-06-17 Andrew Cagney + + * gdb_indent.sh: Add prgregset_t, fpregset_t, and gregset_t to the + list of predefined types. + +2002-06-16 Mark Kettenis + + * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE, + REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL, + REGISTER_CONVERT_TO_RAW): Remove defines. + (i386_register_virtual_type, i386_register_convertible, + i386_register_convert_to_virtual, i386_register_convert_to_raw): + Remove prototypes. + * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + + * config/i386/tm-i386lynx.h (SAVED_PC_AFTER_CALL): Remove define. + (i386lynx_saved_pc_after_call): Remove prototype. + * i386ly-tdep.c: Include "i386-tdep.h". + (i386lynx_saved_pc_after_call): Make static. Use + read_memory_nobpt instead of read_memory. Use + read_memory_unsigned_integer instead of read_memory_integer. + (i386lynx_init_abi): New function. + (i386lynx_coff_osabi_sniffer): New function. + (_initialize_i386bsd_tdep): New function. + + * config/i386/tm-i386.h (PARM_BOUNDARY, CALL_DUMMY, + CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET, + CALL_DUMMY_BREAKPOINT_OFFSET, FIX_CALL_DUMMY): Remove defines. + (i386_fix_call_dummy): Remove prototype. + * i386-tdep.c (i386_call_dummy_words): New variable. + (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + +2002-06-15 Andrew Cagney + + * command.h (add_setshow_auto_boolean_cmd): Replace + add_set_auto_boolean_cmd. + * cli/cli-decode.c (add_setshow_auto_boolean_cmd): Replace + add_set_auto_boolean_cmd. + * cli/cli-decode.h (add_set_auto_boolean_cmd): Delete declaration. + * mips-tdep.c (_initialize_mips_tdep): Update ``set mips + mask-address'' command. + (show_mask_address): Add cmd parameter. + * remote.c (add_packet_config_cmd): Update. Change type of + set_func and show_func to cmd_sfunc_ftype. + (_initialize_remote): Update `set remote Z-packet' + (show_remote_protocol_qSymbol_packet_cmd): Add cmd parameter. + (show_remote_protocol_e_packet_cmd): Ditto. + (show_remote_protocol_E_packet_cmd): Ditto. + (show_remote_protocol_P_packet_cmd): Ditto. + (show_remote_protocol_Z_software_bp_packet_cmd): Ditto. + (show_remote_protocol_Z_hardware_bp_packet_cmd): Ditto. + (show_remote_protocol_Z_write_wp_packet_cmd): Ditto. + (show_remote_protocol_Z_read_wp_packet_cmd): Ditto. + (show_remote_protocol_Z_access_wp_packet_cmd): Ditto. + (show_remote_protocol_Z_packet_cmd): Ditto. + (show_remote_protocol_binary_download_cmd): Ditto. + (show_remote_cmd): Pass NULL to all of above. + +2002-06-15 Mark Kettenis + + * config/i386/tm-i386.h (PUSH_ARGUMENTS, STORE_STRUCT_RETURN, + DEPRECATED_EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS, PUSH_DUMMY_FRAME, + POP_FRAME): Remove defines. + (i386_push_arguments, i386_store_struct_return, + i386_extract_return_value, i386_store_return_value, + i386_extract_struct_value_address, i386_push_dummy_frame, + i386_pop_frame): Renove prototypes. + * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + +2002-06-15 Andrew Cagney + + * cli/cli-decode.c (add_setshow_boolean_cmd): Replace + add_set_boolean_cmd. + (add_setshow_cmd): New function. + * command.h (add_setshow_boolean_cmd): Replace + add_set_boolean_cmd. + * remote-rdi.c (_initialize_remote_rdi): Update ``set rdiheartbeat'' + and ``set rdiromatzero''. + * maint.c (_initialize_maint_cmds): Update commented out code. + * cli/cli-decode.h (add_set_boolean_cmd): Delete declaration. + * target.c (initialize_targets): Update `set + trust-readonly-sections'. + * remote.c (_initialize_remote): Update `set remotebreak'. + +2002-06-15 Mark Kettenis + + * config/i386/tm-i386.h (FUNCTION_START_OFFSET, INNER_THAN, + BREAKPOINT, DECR_PC_AFTER_BREAK): Removed. + * i386-tdep.c (i386_skip_prologue): Adjust function signature to + fit into multi-arch framework. + (i386_breakpoint_from_pc): New function. + (i386_gdbarch_init): Adjust for removal of the macros mentioned + above. + + * config/i386/tm-i386.h (FRAMELESS_FUNCTION_INVOCATION, + FRAME_ARGS_ADDRESS, FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, + FRAME_ARGS_SKIP, FRAME_INIT_SAVED_REGS): Remove defines. + (i386_frameless_function_invocation, i386_frame_num_args, + i386_frame_init_saved_regs): Remove prototypes. + * i386-tdep.c (i386_gdbarch_init): Adjust for removal of the + macros mentioned above. + +2002-06-15 Andrew Cagney + + * cli/cli-decode.c (set_cmd_cfunc): Update. + (set_cmd_sfunc): Update. + * command.h (cmd_cfunc_ftype, cmd_sfunc_ftype): Declare. + (set_cmd_sfunc, set_cmd_cfunc): Update. + * cli/cli-decode.h: Update. + +2002-06-15 Mark Kettenis + + * i386-sol2-tdep.c (i386_sol2_osabi_sniffer): New function. + (_initialize_i386_sol2_tdep): Register i386_sol2_osabi_sniffer. + +2002-06-15 Andrew Cagney + + * defs.h (auto_boolean): Declare enum. + * command.h (cmd_auto_boolean): Delete enum. + * mips-tdep.c (mask_address_var): Update. + (mips_mask_address_p): Update. + (show_mask_address): Update. + * remote.c (struct packet_config): Update. + (update_packet_config): Update. + (show_packet_config_cmd): Update. + (packet_ok): Update. + (add_packet_config_cmd): Update. + (_initialize_remote): + * command.h: Update. + * cli/cli-setshow.c (parse_auto_binary_operation): Update. + (do_setshow_command): Update. + * cli/cli-decode.c (add_set_auto_boolean_cmd): Update. + * cli/cli-decode.h: Update. + +2002-06-15 Mark Kettenis + + * config/i386/tm-cygwin.h, config/i386/tm-fbsd.h, + config/i386/tm-go32.h, config/i386/tm-i386gnu.h, + config/i386/tm-i386sol2.h, config/i386/tm-i386v4.h, + config/i386/tm-linux.h, config/i386/tm-nbsd.h, + config/i386/tm-obsd.h (HAVE_I387_REGS): Remove define. + * config/i386/tm-i386.h: Unconditionally define FLOAT_INFO. + + * i386-tdep.c (i386_coff_osabi_sniffer): Add "coff-go32" to the + list of DJGPP COFF targets. + + * config/i386/tm-i386.h (REGISTER_SIZE): Remove define. + (NUM_GREGS, NUM_FREGS, NUM_SSE_REGS): Remove defines. + (FP_REGNUM, SP_REGNUM, PC_REGNUM, PS_REGNUM): Remove defines. + (FP0_REGNUM): Remove define. + (MAX_REGISTER_RAW_SIZE, MAX_REGISTER_VIRTUAL_SIZE, + MAX_REGISTER_VIRTUAL_SIZE): Remove define. + (i386_register_virtual_size): Remove protoype. + * i386-tdep.c (i386_register_virtual_size): Removed. + (i386_extract_return_value, i386_store_return_value): Use + FP0_REGNUM instead of NUM_FREGS to determine whether the + floating-point registers are available. + (i386_gdbarch_init): Tweak FIXME about FPU registers. + Adjust for removal of macros mentioned above. + +2002-06-15 Mark Kettenis + + * i386v4-nat.c: Include "i386-tdep.h". Reformat and tweak various + comments. + (fill_gregset, supply_gregset, supply_fpregset, fill_fpregset): + Remove prototypes. + (supply_gregset, fill_gregset): Remove use of register keyword and + remove declaration for regmap. Use I386_NUM_GREGS instead of + NUM_REGS and NUM_FREGS. + (FPREGSET_FSAVE_OFFSET): Remove. + (supply_fpregset, fill_fpregset): Use FPO_REGNUM instead of + NUM_FREGS to determine whether the floating-point registers are + available. + + * i386gnu-nat.c (supply_gregset, gnu_fetch_registers, + gnu_store_registers): Replace usage of NUM_GREGS with + I386_NUM_GREGS. + + * i386-linux-nat.c (OLD_CANNOT_FETCH_REGISTER, + OLD_CANNOT_STORE_REGISTER, supply_gregset, fill_gregset): Replace + usage of NUM_GREGS with I386_NUM_GREGS. + + * i386-linux-nat.c (fill_gregset): Remove redundant parentheses. + + * i386bsd-nat.c: Include "i386-tdep.h". + (supply_gregset, fill_gregset): Replace usage of NUM_GREGS with + I386_NUM_GREGS. + + * i386v-nat.c: Remove copnditional inclusion of , + and associated comment. They no longer make any sense, since we + don't use this file anymore on Linux. + + * config/i386/tm-i386.h (MAX_NUM_REGS): Removed. + * i386-tdep.c (i386_register_offset, i386_register_size): Use + I386_SSE_NUM_REGS instead of MAX_NUM_REGS for the number of + elements in these arrays. + (_initialize_i386_tdep): Use I386_SSE_NUM_REGS instead of + MAX_NUM_REGS. + +2002-06-15 Mark Kettenis + + * osabi.h (gdb_osabi): Add GDB_OSABI_LYNXOS. + * osabi.c (gdb_osabi_names): Add entry for "LynxOS". + +2002-06-14 Andrew Cagney + + * gdbarch.sh (DEPRECATED_EXTRACT_RETURN_VALUE): Rename + EXTRACT_RETURN_VALUE. + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Rename + EXTRACT_STRUCT_VALUE_ADDRESS. + * gdbarch.h, gdbarch.c: Regenerate. + + * values.c (value_being_returned): Handle + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS. + (EXTRACT_RETURN_VALUE): Define as DEPRECATED_EXTRACT_RETURN_VALUE. + + * arm-linux-tdep.c (arm_linux_init_abi): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * avr-tdep.c (avr_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * d10v-tdep.c (d10v_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * s390-tdep.c (s390_gdbarch_init): Update. + * sparc-tdep.c (sparc_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + * x86-64-tdep.c (x86_64_gdbarch_init): Update. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + + * config/arc/tm-arc.h: Update. + * config/d30v/tm-d30v.h: Update. + * config/fr30/tm-fr30.h: Update. + * config/h8300/tm-h8300.h: Update. + * config/h8500/tm-h8500.h: Update. + * config/i386/tm-i386.h: Update. + * config/i386/tm-ptx.h: Update. + * config/i386/tm-symmetry.h: Update. + * config/i960/tm-i960.h: Update. + * config/m32r/tm-m32r.h: Update. + * config/m68k/tm-delta68.h: Update. + * config/m68k/tm-linux.h: Update. + * config/m68k/tm-m68k.h: Update. + * config/m88k/tm-m88k.h: Update. + * config/mcore/tm-mcore.h: Update. + * config/mips/tm-mips.h: Update. + * config/mn10200/tm-mn10200.h: Update. + * config/pa/tm-hppa.h: Update. + * config/pa/tm-hppa64.h: Update. + * config/sparc/tm-sp64.h: Update. + * config/sparc/tm-sparc.h: Update. + * config/sparc/tm-sparclet.h: Update. + * config/z8k/tm-z8k.h: Update. + +2002-06-14 Andrew Cagney + + * Makefile.in (i386_linux_tdep_h): Define. + (i386_tdep_h, i387_tdep_h): Define. + (i386-linux-nat.o): Add $(i386_linux_tdep_h), + $(i386_tdep_h) and $(i387_tdep_h). + * i386-linux-nat.c: Include "i386-linux-tdep.h". + +2002-06-14 Mark Kettenis + + * config/i386/tm-i386.h (START_INFERIOR_TRAPS_EXPECTED): Removed. + Already covered by the default. + + * config/i386/tm-i386.h (TARGET_LONG_DOUBLE_FORMAT, + TARGET_LONG_DOUBLE_BIT): Remove. * i386-tdep.c + (i386_gdbarch_init): Initialize long_double_format and long_double + bit. + + * config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and + i386bsd-tdep.o. Remove solib.o, solib-svr4.o and solib-legacy.o. + Move these to ... + * config/i386/i386sol2.mh: ... here. + * config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define. + (sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef. + (SIGCONTEXT_PC_OFFSET): Remove define. + (IN_SIGTRAMP): Remove define. + * i386-sol2-tdep.c: New file. + + * config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h. + * config/i386/tm-i386nw.h: Removed. + + * config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM, + USE_STRUCT_CONVENTION): Remove defines. + (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + (IN_SIGTRAMP): Remove define. + (i386bsd_in_sigtramp): Remove prototype. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a + function. Update comment accordingly + (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. + (FRAME_SAVED_PC): Remove define. + (i386bsd_frame_saved_pc): Remove prototype. + * config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC, + GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + (IN_SIGTRAMP): Remove define. + (i386bsd_in_sigtramp): Remove prototype. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a + function. Update comment accordingly + (SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly. + (FRAME_SAVED_PC): Remove define. + (i386bsd_frame_saved_pc): Remove prototype. + * config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention): + Remove prototype. + (USE_STRUCT_CONVENTION): Remove prototype. + * i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove + declaration. + (_initialize_i386bsd_nat): Revise logic to determine some + constants at compile time when compiling a native GDB. Warn if + things don't match up with what we expect. + * i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end): + Remove variables. + (i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp. Rewrite + to use date stored in `struct gdbarch_tdep'. + (i386bsd_sigcontext_offset): Remove varaible. + (i386bsd_sigtramp_saved_pc): Make public. Rewrite to use data + stored in `struct gdbarch_tdep'. + (i386bsd_frame_saved_pc): Make static. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions. + (i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset, + i386fbsd_sigtramp_start, i386fbsd_sigtramp_end, + i386fbsd4_sc_pc_offset): New variables. + (i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi, + i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New + functions. + (i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New + functions. + * i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment. + Modify the value of i386fbsd_sigtramp_start and + i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and + i386fbsd_sigtramp_end. + * i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove + function. + + * config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move + define to i386-linux-tdep.h. + (NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME, + REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove + defines. + (i386_linux_register_name, i386_linux_register_byte, + i386_linux_register_raw_size): Remove prototypes. + (i386_linux_svr4_fetch_link_map_offsets): Remove prototype. + (SVR4_FETCH_LINK_MAP_OFFSETS): Remove define. + (IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL, + TARGET_WRITE_PC): Remove defines. + (i386_linux_in_sigtramp, i386_linux_frame_chain, + i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call, + i386_linux_write_pc): Remove prototypes. + (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + * i386-linux-tdep.h: New file. + * i386-linux-nat.c: Include "i386-linux-tdep.h". + * i386-linux-tdep.c: Include "i386-tdep.h" and + "i386-linux-tdep.h". + (i386_linux_register_name, i386_linux_register_byte, + i386_linux_register_raw_size, i386_linux_in_sigtramp, + i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets): + Make static. + (i386_linux_init_abi): New function. + (_initialize_i386_linux_tdep): New function. + + * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define. + (i386_saved_pc_after_call): Remove prototype. + (MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register". + (REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM, + DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines. + (i386_register_name, i386_stab_reg_to_regnum, + i386_dwarf_reg_to_regnum): Remove prototypes. + (SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS, + SIZEOF_SSE_REGS): Remove defines. + (REGISTER_BYTES): Remove define. + (REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines. + (i386_register_byte, i386_register_raw_size): Remove prototypes. + (FRAME_CHAIN, FRAME_SAVED_PC): Remove defines. + (i386_frame_chain, i386_frame_saved_pc): Remove prototypes. + * config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define. + (JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP, + JB_EDX, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + (I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines. + (sigtramp_saved_pc): Remove define. + (i386v4_sigtramp_saved_pc): Remove prototype. + * config/i386/tm-go32.h (FRAME_CHAIN, + FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines. + (i386go32_frame_saved_pc): Remove prototype. + (JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines. + (get_longjmp_target): Remove prototype. + * i386-tdep.h: Include "osabi.h". + (enum i386_abi): Removed. + (enum struct_return): New enum. + (struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset, + struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and + sc_pc_offset members. + (i386_gdbarch_register_os_abi): Remove prototype. + (I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS, + I386_SSE_NUM_REGS): New defines. + (I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS, + I386_SSE_SIZEOF_REGS): New defines. + (i386_register_name, i386_register_byte, i386_register_raw_size): + New prototypes. + (i386_elf_init_abi, i386_svr4_init_abi): New prototypes. + (i386bsd_sigtramp_saved_pc): New prototype. + * i386-tdep.c: Don't include "elf-bfd.h". + (i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum, + i386_frame_chain, i386_saved_pc_after_call): Make static. + (i386_frame_saved_pc): Rewrite to call architecture dependent + function to deal with signal handlers. Make static. + (i386go32_frame_saved_pc): Removed. + [GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target): + Removed. + (i386_get_longjmp_target): New function. + (default_struct_convention, pcc_struct_convention, + reg_struct_convention, valid_conventions, struct_convention): New + variables. + (i386_use_struct_convention): New function. + (i386v4_sigtramp_saved_pc): Renamed to + i386_svr4_sigtramp_saved_pc. Made static. Moved. + (i386_pc_in_sigtramp): New function. + (i386_abi_names): Removed. + (ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD, + ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD): + Removed. + (process_note_sections, i386_elf_abi_from_note, i386_elf_abi, + i386_gdbarch_register_os_abi): Removed. + (struct i386_abi_handler): Removed. + (i386_abi_handler_list): Removed. + (i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New + functions. + (i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi, + i386_nw_init_abi): New functions. + (i386_gdbarch_init): Rewritten to use generic OS ABI framework. + Use set_gdbarch_xxx() calls instead of relying on macros for a + number of calls. + (i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions. + (_initialize_i386_tdep): Add new 'struct-convcention' command. + Register the various architecture variants defined in this file. + +2002-06-14 Daniel Jacobowitz + + * 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-13 Daniel Jacobowitz + + * NEWS: Mention multithreaded debug support for gdbserver. + +2002-06-13 Daniel Jacobowitz + + * MAINTAINERS: Mention NEWS. + +2002-06-13 Daniel Jacobowitz + + * mips-tdep.c (PROC_SYMBOL): Add warning comment. + (struct mips_objfile_private, compare_pdr_entries): New. + (non_heuristic_proc_desc): Read the ".pdr" section if it + is present. + +2002-06-12 Andrew Cagney + + * arm-tdep.c (arm_push_arguments): Rewrite using a two-pass loop. + (arm_debug): New static variable. + (_initialize_arm_tdep): Add ``set debug arm'' command. + +2002-06-12 Andrew Cagney + + * Makefile.in (sim_arm_h): Define. + (arm-tdep.o): Add $(sim_arm_h) and $(gdb_assert_h). + * arm-tdep.c: Include "gdb/sim-arm.h" and "gdb_assert.h". + (arm_register_sim_regno): New function, map an internal REGNUM + onto a simulator register number. + (arm_gdbarch_init): Set register_sim_regno. + +2002-06-09 Aldy Hernandez + + * MAINTAINERS: Add self. + +2002-06-11 Jim Blandy + + * source.c (source_info): Mention whether the symtab has + information about preprocessor macros. + + Call the command `info macro', not `show macro'. + * macrocmd.c (info_macro_command): Renamed from `show_macro_command'. + Fix error message. + (_initialize_macrocmd): Register `info_macro_command' in + `infolist', not `showlist'. + +2002-06-11 Daniel Jacobowitz + + * mips-tdep.c (MIPS_FPU_TYPE, FP_REGISTER_DOUBLE, MIPS_EABI) + (MIPS_LAST_FP_ARG_REGNUM, MIPS_LAST_ARG_REGNUM) + (MIPS_DEFAULT_SAVED_REGSIZE, MIPS_REGS_HAVE_HOME_P) + (MIPS_DEFAULT_STACK_ARGSIZE, GDB_TARGET_IS_MIPS64) + (MIPS_DEFAULT_MASK_ADDRESS_P): Remove obsolete definitions. Define + unconditionally. + (set_mipsfpu_single_command, set_mipsfpu_double_command) + (set_mipsfpu_none_command): Remove if (GDB_MULTI_ARCH). + (_initialize_mips_tdep): Remove dead code. + * config/mips/tm-irix5.h (MIPS_LAST_ARG_REGNUM) + (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove. + * config/mips/tm-irix6.h (MIPS_LAST_ARG_REGNUM) + (MIPS_DEFAULT_STACK_ARGSIZE, MIPS_REGS_HAVE_HOME_P): Remove. + * config/mips/tm-mips.h (MIPS_EABI, MIPS_LAST_ARG_REGNUM, + MIPS_LAST_FP_ARG_REGNUM): Remove. + +2002-06-11 Michal Ludvig + + * dwarf2cfi.c (unwind_tmp_obstack_init): New. + (unwind_tmp_obstack_free, parse_frame_info) + (update_context, cfi_read_fp, cfi_write_fp) + (cfi_frame_chain, cfi_init_extra_frame_info) + (cfi_virtual_frame_pointer): Use the above function. + * dwarf2cfi.c: Reindented (using 'indent dwarf2cfi.c'). + +2002-06-11 Corinna Vinschen + + * v850-tdep.c (v850_type_is_scalar): New function. + (v850_use_struct_convention): Match current gcc implementation + as close as possible. + (v850_push_arguments): Fix stack_offset handling. Don't write + struct_addr into register. This is done by v850_store_struct_return. + (v850_extract_return_value): Care for structs. + (v850_store_return_value): Ditto. + (v850_store_struct_return): Actually write address. + +2002-06-11 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Fix to work on functions + without debug information too. + +2002-06-10 Andrew Cagney + + * gdbarch.sh (PRINT_FLOAT_INFO): Add frame and ui_file parameters. + Make multi-arch pure. + * gdbarch.h, gdbarch.c: Re-generate. + * arm-tdep.c (arm_print_float_info): Update. + * arch-utils.h (default_print_float_info): Update. + * arch-utils.c (default_print_float_info): Update. + * infcmd.c (float_info): Update call. + +2002-06-10 Andrew Cagney + + * Makefile.in (init.c): Move the call to _initialize_gdbtypes to + the front of the initialize list. + +2002-06-10 Andrew Cagney + + * infrun.c (struct inferior_status): Replace fields + selected_frame_address and selected_level with field + selected_frame_id. + (save_inferior_status): Update. Use get_frame_id. + (struct restore_selected_frame_args): Delete. + (restore_selected_frame): Update. Use frame_find_by_id. + (restore_inferior_status): Update. + + * breakpoint.h (struct breakpoint): Change type of + watchpoint_frame to frame_id. + * breakpoint.c (insert_breakpoints): Use frame_find_by_id. Remove + call to get_current_frame. + (do_enable_breakpoint): Use frame_find_by_id. Remove call to + get_current_frame. + (watchpoint_check): Use frame_find_by_id. + + * frame.h (record_selected_frame): Delete declaration. + * stack.c (record_selected_frame): Delete function. + + * frame.h (struct frame_id): Define. + (get_frame_id): Declare. + (frame_find_by_id): Declare. + * frame.c (frame_find_by_id): New function. + (get_frame_id): New function. + +2002-06-10 Andrey Volkov + + * ser-e7kpc.c: Fix duplicated define and call of + _initialize_ser_e7000pc + +2002-06-09 Daniel Jacobowitz + + * signals/signals.c (target_signal_from_host): Fix #ifdef + SIGRTMIN case. + (do_target_signal_to_host): Likewise. + +2002-06-09 Daniel Jacobowitz + + * mips-tdep.c (mips_find_abi_section): New function. + (mips_gdbarch_init): Call it. + +2002-06-09 Mark Kettenis + + * solib-svr4.c (init_fetch_link_map_offsets): Simply return + legacy_fetch_link_map_offsets. Adjust comment to reflect reality + after Andrew's 2002-06-08 gdbarch change. + +2002-06-09 Mark Kettenis + + * i386-linux-nat.c (suppy_gregset): Don't supply + I386_LINUX_ORIG_EAX_REGNUM if there isn't room for it in GDB's + register cache. + (fill_gregset): Don't fetch it under the same circumstances. + +2002-06-09 Andrew Cagney + + * Makefile.in (callback_h): Define. + (remote_sim_h): Update path to remote-sim.h. + (remote-rdp.o): Add $(callback_h). + (remote-sim.o): Use $(callback_h). + * remote-sim.c: Include "gdb/callback.h" and "gdb/remote-sim.h". + * remote-rdp.c: Include "gdb/callback.h". + +2002-06-09 Mark Kettenis + + * osabi.h (gdb_osabi): Add GDB_OSABI_GO32 and GDB_OSABI_NETWARE. + * osabi.c (gdb_osabi_names): Add "DJGPP" and "NetWare". + +2002-06-08 Andrew Cagney + + * sparcl-tdep.c: Use __CYGWIN__ instead of __CYGWIN32__. + * rdi-share/serpardr.c: Ditto. + * rdi-share/unixcomm.c: Ditto. + * rdi-share/serdrv.c: Ditto. + * rdi-share/hostchan.h: Ditto. + * rdi-share/hostchan.c: Ditto. + * rdi-share/host.h: Ditto. + * rdi-share/devsw.c: Ditto. + + * objfiles.h: Change type of obj_private to void pointer. + * pa64solib.c: Update copyright. Don't include "assert.h", use + strcmp instead of STREQ, use LONGEST, do not use PTR + * somsolib.c: Ditto. + + * config/djgpp/fnchange.lst: Fix problems with bfd/elf32-i386.c, + bfd/elf32-i386qnx.c, bfd/elf32-sh.c, bfd/elf32-sh64-nbsd.c, + bfd/elf64-sh64-nbsd.c bfd/elf64-sh64.c. + +2002-06-08 Andrew Cagney + + * frame.c (GET_SAVED_REGISTER): Delete macro definition. + (default_get_saved_register): Delete function. + * gdbarch.sh (GET_SAVED_REGISTER): Set default to + generic_unwind_get_saved_register. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-06-08 Andrew Cagney + + * gdbarch.sh (FRAME_CHAIN_VALID): Set default to + generic_func_frame_chain_valid. + * gdbarch.h, gdbarch.c: Re-generate. + * blockframe.c (generic_func_frame_chain_valid): Only check + PC_IN_CALL_DUMMY when generic dummy frames. Don't worry about + passing FP to PC_IN_CALL_DUMMY. + Fix PR gdb/360. + +2002-06-08 Andrew Cagney + + * gdbarch.sh (struct gdbarch_data): Add field init_p. + (register_gdbarch_data): Initialize init_p. + (gdbarch_data): Initialize data pointer using the init function. + (init_gdbarch_data): Delete function. + (gdbarch_update_p): Update. + (initialize_non_multiarch): Update. + (struct gdbarch): Add field initialized_p. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-06-07 Michal Ludvig + + * x86-64-linux-nat.c (x86_64_fxsave_offset): New. + (supply_fpregset, fill_fpregset): Don't call i387_*_fxsave, + better do the things actually here. + * x86-64-tdep.c (x86_64_register_name2nr): New. + (x86_64_register_name): Renamed to x86_64_register_nr2name. + (x86_64_gdbarch_init): Respect the above change. + * x86-64-tdep.h (x86_64_register_name2nr) + (x86_64_register_nr2name): Add prototypes. + * config/i386/x86-64linux.mt (TDEPFILES): Remove i387-tdep.o. + +2002-06-06 Michael Snyder + + * d10v-tdep.c (d10v_push_arguments): Handle struct_return. + Delete extra braces and re-indent. + (d10v_store_return_value): Char return values + must be shifted over by one byte in R0. + (d10v_extract_return_value): Delete extra braces, re-indent. + +2002-06-06 Elena Zannoni + + * d10v-tdep.c (d10v_read_sp, d10v_read_fp): Add prototype. + (d10v_register_virtual_type): Make $fp and $sp be pointer to data. + (d10v_integer_to_address): Rewrite. + (d10v_frame_init_saved_regs): When reading fp and sp registers use + the d10v specific functions which take care of converting to the + correct space. + +2002-06-06 Elena Zannoni + + * config/djgpp/fnchange.lst: Add testsuite files altivec-abi.c, + altivec-abi.exp, altivec-regs.c, altivec-regs.exp. + +2002-06-02 Andrew Cagney + + * config/alpha/nm-linux.h: Add "config/" prefix to tm, nm and xm + includes. + * config/tm-linux.h: Ditto. + * config/alpha/tm-alphalinux.h: Ditto. + * config/arm/nm-linux.h, config/arm/tm-linux.h: Ditto. + * config/arm/xm-nbsd.h, config/i386/nm-gnu.h: Ditto. + * config/i386/nm-i386lynx.h, config/i386/nm-i386sol2.h: Ditto. + * config/i386/nm-i386v4.h, config/i386/nm-i386v42mp.h: Ditto. + * config/i386/nm-linux.h, config/i386/nm-m3.h: Ditto. + * config/i386/nm-ptx4.h, config/i386/nm-x86-64.h: Ditto. + * config/i386/tm-i386gnu.h, config/i386/tm-i386lynx.h: Ditto. + * config/i386/tm-i386m3.h, config/i386/tm-i386sco5.h: Ditto. + * config/i386/tm-i386v4.h, config/i386/tm-linux.h: Ditto. + * config/i386/tm-ptx4.h, config/i386/tm-vxworks.h: Ditto. + * config/i386/xm-i386v4.h, config/i386/xm-nbsd.h: Ditto. + * config/i386/xm-ptx.h, config/i386/xm-ptx4.h: Ditto. + * config/i960/tm-vx960.h, config/ia64/nm-aix.h: Ditto. + * config/ia64/nm-linux.h, config/ia64/tm-aix.h: Ditto. + * config/ia64/tm-linux.h, config/ia64/xm-aix.h: Ditto. + * config/m68k/nm-linux.h, config/m68k/nm-m68klynx.h: Ditto. + * config/m68k/nm-sysv4.h, config/m68k/tm-linux.h: Ditto. + * config/m68k/tm-m68klynx.h, config/m68k/tm-m68kv4.h: Ditto. + * config/m68k/tm-sun2os4.h, config/m68k/tm-sun3os4.h: Ditto. + * config/m68k/tm-vx68.h, config/m68k/xm-m68kv4.h: Ditto. + * config/m68k/xm-nbsd.h, config/m88k/nm-delta88v4.h: Ditto. + * config/m88k/tm-delta88v4.h, config/m88k/xm-delta88v4.h: Ditto. + * config/mips/nm-irix5.h, config/mips/nm-linux.h: Ditto. + * config/mips/tm-linux.h, config/mips/tm-mips64.h: Ditto. + * config/mips/tm-mipsm3.h, config/mips/tm-mipsv4.h: Ditto. + * config/mips/tm-vxmips.h, config/mips/xm-irix5.h: Ditto. + * config/mips/xm-mipsv4.h, config/ns32k/xm-nbsd.h: Ditto. + * config/pa/nm-hppao.h, config/powerpc/nm-linux.h: Ditto. + * config/powerpc/tm-linux.h, config/powerpc/tm-vxworks.h: Ditto. + * config/powerpc/xm-aix.h, config/rs6000/nm-rs6000ly.h: Ditto. + * config/rs6000/tm-rs6000ly.h, config/rs6000/xm-aix4.h: Ditto. + * config/sh/tm-linux.h, config/sparc/nm-linux.h: Ditto. + * config/sparc/nm-sparclynx.h, config/sparc/nm-sun4sol2.h: Ditto. + * config/sparc/tm-linux.h, config/sparc/tm-sp64linux.h: Ditto. + * config/sparc/tm-sp64sim.h, config/sparc/tm-sparclynx.h: Ditto. + * config/sparc/tm-sun4os4.h, config/sparc/tm-sun4sol2.h: Ditto. + * config/sparc/tm-vxsparc.h, config/sparc/xm-sun4sol2.h: Ditto. + +2002-05-04 Aidan Skinner + + * ada-exp.tab.c: New file + * ada-exp.y: New file + * ada-lang.c: New file + * ada-lang.h: New file + * ada-lex.c: New file + * ada-lex.l: New file + * ada-tasks.c: New file + * ada-typeprint.c: New file + * ada-valprint.c: New file + +2002-06-02 Jason Thorpe + + * ppcnbsd-tdep.c (ppcnbsd_init_abi): Don't set + use_struct_convention to ppc_sysv_abi_broken_use_struct_convention. + +2002-06-02 Jason Thorpe + + * config/rs6000/aix4.mt (TDEPFILES): Use ppc-sysv-tdep.o + insetead of ppc-linux-tdep.o. + * config/rs6000/rs6000.mt (TDEPFILES): Likewise. + * config/rs6000/rs6000lynx.mt (TDEPFILES): Likewise. + +2002-06-02 Andrew Cagney + + 2002-05-07 Christian Groessler + * z8k-tdep.c (z8k_print_register_hook): Fix display of 32 and 64 + bit register contents for little endian hosts. + +2002-06-01 Andrew Cagney + + * MAINTAINERS: Mention that any `HP/UX reader' can be changed by + any maintainer. + +2002-06-01 Andrew Cagney + + * gdbarch.h: Regenerate. + +2002-06-01 Andrew Cagney + + * MAINTAINERS: Add everyone to write-after-approval list. + +2002-06-01 Andrew Cagney + + * stack.c (frame_info): Use frame_register_unwind instead of + saved_regs. Mention when the SP is on the stack or in a register. + + * frame.h (frame_register_unwind_ftype): Define. Document. + (struct frame_info): Add field register_unwind and + register_unwind_cache. + (frame_register_unwind): Declare. + (generic_unwind_get_saved_register): Declare. + + * frame.c (frame_register_unwind): New function. + (generic_unwind_get_saved_register): New function. + + * blockframe.c (generic_call_dummy_register_unwind): New function. + (frame_saved_regs_register_unwind): New function. + (set_unwind_by_pc): New function. + (create_new_frame): New function. + (get_prev_frame): New function. + +2002-05-30 Andrew Cagney + + * a29k-share/: Delete directory. + * remote-vx29k.c: Delete file. + +2002-05-30 Jason Thorpe + + * config/djgpp/fnchange.lst: Add ns32knbsd-nat.c, ns32knbsd-tdep.c, + ppcnbsd-nat.c, ppcnbsd-tdep.c, sparcnbsd-nat.c, and sparcnbsd-tdep.c. + +2002-05-30 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add sparc64nbsd-nat.c, + sparcnbsd-nat.c, and sparcnbsd-tdep.c. + (sparc64nbsd-nat.o) + (sparcnbsd-nat.o) + (sparcnbsd-tdep.o): New dependency lists. + * NEWS: Note new UltraSPARC NetBSD native configuration. + * configure.host (sparc64-*-netbsd*): New host. + * configure.tgt (sparc-*-netbsdelf*) + (sparc-*-netbsd*): Set gdb_target to nbsd. + (sparc64-*-netbsd*): New target. + * sparc64nbsd-nat.c: New file. + * sparcnbsd-nat.c: New file. + * sparcnbsd-tdep.c: New file. + * sparcnbsd-tdep.h: New file. + * config/sparc/nbsd.mt: New file. + * config/sparc/nbsd64.mh: New file. + * config/sparc/nbsd64.mt: New file. + * config/sparc/nbsdaout.mh (NATDEPFILES): Remove corelow.o, + sparc-nat.o, and solib.o. Add sparcnbsd-nat.o. + (HOST_IPC): Remove. + * config/sparc/nbsdaout.mt: Remove. + * config/sparc/nbsdelf.mh (NATDEPFILES): Remove corelow.o, + sparc-nat.o, and solib.o. Add sparcnbsd-nat.o. + (HOST_IPC): Remove. + * config/sparc/nbsdelf.mt: Remove. + * config/sparc/nm-nbsd.h: Update copyright years. Remove all + sparc-nat.c compatiblity defines. + * config/sparc/tm-nbsd.h: Update copyright years. Include solib.h. + (GDB_MULTI_ARCH): Set to GDB_MULTI_ARCH_PARTIAL. + * config/sparc/tm-nbsd64.h: New file. + * config/sparc/tm-nbsdaout.h: Remove. + * config/sparc/xm-nbsd.h: Remove. + +2002-05-30 Jason Thorpe + + * Makefile.in (sparc-tdep.o): Add osabi.h to dependency list. + * sparc-tdep.c: Include osabi.h. + (gdbarch_tdep): Add osabi member. + (_initialize_sparc_tdep): Use gdbarch_register. + (sparc_gdbarch_init): Use generic OS ABI framework. + (sparc_dump_tdep): New function. + +2002-05-30 Kevin Buettner + + * corefile.c (do_captured_read_memory_integer): Return non-zero + result. + (safe_read_memory_integer): Copy result of memory read when + status is non-zero. Also, add comments. + +2002-05-20 Jason Thorpe + + * Makefile.in (ppc_tdep_h): Define. + (ppc-linux-nat.o) + (ppc-linux-tdep.o) + (rs6000-tdep.o): Use $(ppc_tdep_h). + (ppc-sysv-tdep.o) + (ppcnbsd-nat.o) + (ppcnbsd-tdep.o): New dependency lists. + * ppc-tdep.h: Use generic OS ABI framework. + * ppc-linux-tdep.c (_initialize_ppc_linux_tdep) + (ppc_linux_init_abi): New functions. + (ppc_sysv_abi_broken_use_struct_convention) + (ppc_sysv_abi_use_struct_convention) + (ppc_sysv_abi_push_arguments): Move to... + * ppc-sysv-tdep.c: ...here. + * ppcnbsd-nat.c: Don't include gdbcore.h and regcache.h. + * rs6000-tdep.c (process_note_abi_tag_sections) + (get_elfosabi): Remove. + (rs6000_gdbarch_init): Use generic OS ABI framework. + (rs6000_dump_tdep): New function. + (_initialize_rs6000_tdep): Use gdbarch_register. + * config/powerpc/linux.mt (TDEPFILES): Add ppc-sysv-tdep.o. + * config/powerpc/nbsd.mh (NATDEPFILES): Remove solib-legacy.o. + * config/powerpc/aix.mt (TDEPFILES): Use ppc-sysv-tdep.o instead + of ppc-linux-tdep.o. + * config/powerpc/nbsd.mt (TDEPFILES): Likewise. + * config/powerpc/ppc-eabi.mt (TDEPFILES): Likewise. + * config/powerpc/ppc-sim.mt (TDEPFILES): Likewise. + * config/powerpc/ppcle-eabi.mt (TDEPFILES): Likewise. + * config/powerpc/ppcle-sim.mt (TDEPFILES): Likewise. + * config/powerpc/vxworks.mt (TDEPFILES): Likewise. + +2002-05-29 Jim Blandy + + * macroscope.c (default_macro_scope): Put `void' in empty argument + list. + +2002-05-29 Andrew Cagney + + * Makefile.in (arch-utils.o): Add $(sim_regno_h). + * arch-utils.c: Include "sim-regno.h". + * gdbarch.sh: Don't include "sim-regno.h". + * gdbarch.h, gdbarch.c: Regenerate. + * sim-regno.h (legacy_register_sim_regno): Move declaration from + here. + * arch-utils.h (legacy_register_sim_regno): To here. + * remote-sim.c (legacy_register_sim_regno): Move function from + here. + * arch-utils.c (legacy_register_sim_regno): To here. + +2002-05-28 Andrew Cagney + + * sim-regno.h: New file. + * Makefile.in (sim_regno_h): Define. + (d10v-tdep.o, remote-sim.o): Add dependency on $(sim_regno_h). + * remote-sim.c: Include "sim-regno.h" and "gdb_assert.h". + (legacy_register_sim_regno): New function. + (one2one_register_sim_regno): New function. + (gdbsim_fetch_register): Rewrite. + (gdbsim_store_register): Only store a register when + REGISTER_SIM_REGNO is valid. + * d10v-tdep.c: Include "sim-regno.h". + (d10v_ts2_register_sim_regno): Add legacy_regiter_sim_regno check. + (d10v_ts3_register_sim_regno): Ditto. + * gdbarch.sh: Include "sim-regno.h". + (REGISTER_SIM_REGNO): Set default to legacy_register_sim_regno. + * gdbarch.h, gdbarch.c: Regenerate. + * arch-utils.h (default_register_sim_regno): Delete declaration. + * arch-utils.c (default_register_sim_regno): Delete function. + +2002-05-28 Jason Thorpe + + * ppcnbsd-nat.c: Rewrite. + * ppcnbsd-tdep.c: New file. + * ppcnbsd-tdep.h: New file. + * config/powerpc/nbsd.mh (NATDEPFILES): Remove corelow.o, + solib.o, and solib-svr4.o. + * config/powerpc/nbsd.mt (TDEPFILES): Add ppcnbsd-tdep.o, + nbsd-tdep.o, and corelow.o. + +2002-05-28 Andrew Cagney + + * MAINTAINERS (--enable-gdb-build-warnings): Rewrite script to use + `tr' and `sed'. Mention that `broken' targets are not expected to + build. + +2002-05-27 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Remove obsolete note. + Let PC point right after the prologue before looking up symbols. + +2002-05-27 Martin M. Hunt + + * i386-tdep.c (i386_register_virtual_type): Return + builtin_type_vec128i for SSE registers. + + * gdbtypes.h (builtin_type_vec128i): Declare. + + * gdbtypes.c (build_builtin_type_vec128i): New function. + (builtin_type_v2_double, builtin_type_v4_int64): New types. + (builtin_type_vec128i): New type for SSE2 128-bit registers. + (build_gdbtypes): Initialize new builtin vector types. + (_initialize_gdbtypes): Register new vector types with gdbarch. + +2002-05-26 Jason Thorpe + + * MAINTAINERS: ns32k is not longer an obsolete candidate, + since it has been multi-arch'd. + * NEWS: Note that ns32k-*-* is now partial multi-arch. + Move Alpha and VAX multi-arch news entries to same section + as other multi-arch news. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c: include gdbtypes.h, inferior.h, regcache.h, + target.s, arch-utils.h, ns32k-tdep.h. Make many functions + static. Rename some register numbers to put them in ns32k-tdep + private namespace. + (ns32k_get_saved_register, ns32k_gdbarch_init_32082, + ns32k_gdbarch_init_32382, ns32k_gdbarch_init, ns32k_dump_tdep): New + functions. + (_initialize_ns32k_tdep): Use gdbarch_register. + * ns32k-tdep.h: New file. + * ns32knbsd-tdep.c: New file. + * config/ns32k/nbsdaout.mt (TDEPFILES): Add ns32knbsd-tdep.o. + * config/ns32k/tm-nbsd.h: Include "ns32k/tm-ns32k.h". + (IN_SOLIB_CALL_TRAMPOLINE, REGISTER_NAME, NUM_REGS, + REGISTER_BYTES, REGISTER_BYTE): Remove. + * config/ns32k/tm-ns32k.h: New file. + * config/ns32k/tm-umax.h: Remove. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_saved_pc_after_call, + ns32k_store_struct_return, ns32k_extract_return_value, + ns32k_store_return_value, ns32k_extract_struct_value_address): New + functions. + * config/ns32k/tm-umax.h (SAVED_PC_AFTER_CALL): Define as + ns32k_saved_pc_after_call. + (STORE_STRUCT_RETURN): Define as ns32k_store_struct_return. + (EXTRACT_RETURN_VALUE): Define as ns32k_extract_return_value. + (STORE_RETURN_VALUE): Define as ns32k_store_return_value. + (EXTRACT_STRUCT_VALUE_ADDRESS): Define as + ns32k_extract_struct_value_address. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_call_dummy_words, sizeof_ns32k_call_dummy_words, + ns32k_fix_call_dummy): New. + * config/ns32k/tm-umax.h (CALL_DUMMY_WORDS): Define as + ns32k_call_dummy_words. + (SIZEOF_CALL_DUMMY_WORDS): Define as sizeof_ns32k_call_dummy_words. + (CALL_DUMMY, CALL_DUMMY_LENGTH, CALL_DUMMY_ADDR, + CALL_DUMMY_NARGS): Remove. + (FIX_CALL_DUMMY): Define as ns32k_fix_call_dummy. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_breakpoint_from_pc, ns32k_frame_chain, + ns32k_frame_saved_pc, ns32k_frame_args_address, + ns32k_frame_locals_address, ns32k_frame_init_saved_regs, + ns32k_push_dummy_frame, ns32k_pop_frame): New functions. + * config/ns32k/tm-nbsd.h (FRAME_SAVED_PC): Remove. + * config/ns32k/tm-umax.h (INNER_THAN): Define as core_addr_lessthan. + (BREAKPOINT_FROM_PC): Define as ns32k_breakpoint_from_pc. + (BREAKPOINT): Remove.. + (FRAME_CHAIN): Define as ns32k_frame_chain. + (FRAME_SAVED_PC): Define as ns32k_frame_saved_pc. + (FRAME_ARGS_ADDRESS): Define as ns32k_frame_args_address. + (FRAME_LOCALS_ADDRESS): Define as ns32k_frame_locals_address. + (FRAME_FIND_SAVED_REGS): Remove. + (FRAME_INIT_SAVED_REGS): Define as ns32k_frame_init_saved_regs. + (PUSH_DUMMY_FRAME): Define as ns32k_push_dummy_frame. + (POP_FRAME): Define as ns32k_pop_frame. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c (ns32k_register_byte_32082, + ns32k_register_byte_32382, ns32k_register_raw_size, + ns32k_register_virtual_size, ns32k_register_virtual_type): New + functions. + * config/ns32k/tm-nbsd.h (REGISTER_BYTE): Define as + ns32k_register_byte_32382. + * config/ns32k/tm-umax.h: Update copyright years. + (REGISTER_BYTE): Define as ns32k_register_byte_32082. + (REGISTER_RAW_SIZE): Define as ns32k_register_raw_size. + (REGISTER_VIRTUAL_SIZE): Define as ns32k_register_virtual_size. + (REGISTER_VIRTUAL_TYPE): Define as ns32k_register_virtual_type. + (ns32k_get_enter_addr): Fix prototype. + +2002-05-26 Jason Thorpe + + * ns32k-tdep.c: Update copyright years. + (ns32k_register_name_32082): New function. + (ns32k_register_name_32382): Ditto. + * config/ns32k/tm-nbsd.h (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define as ns32k_register_name_32382. + * config/ns32k/tm-umax.h (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define as ns32k_register_name_32082. + +2002-05-24 Jim Blandy + + * dwarf2read.c (free_line_header): Use xfree, not free. + +2002-05-24 Jason Thorpe + + * config/djgpp/fnchange.lst: Add alphabsd-nat.c, + alphabsd-tdep.c, mipsnbsd-nat.c, and mipsnbsd-tdep.c + +2002-05-23 Andrew Cagney + + * PROBLEMS: Mention s390 and FreeBSD 4.4 build problems. + +2002-05-23 Andrew Cagney + + From Ross Alexander at NEC Europe: + * config/pa/hpux11w.mh (NATDEPFILES): Add solib.o. + +2002-05-23 Michael Snyder + + * cli/cli-dump.c (restore_command): Use parse_and_eval_long + for input, rather than parse_and_eval_address. + +2002-05-23 Andrew Cagney + + * d10v-tdep.c: Include "gdb/sim-d10v.h" instead of "sim-d10v.h". + * Makefile.in (sim_d10v_h): Update definition. + +2002-05-24 Andrew Cagney + + * d10v-tdep.c (d10v_gdbarch_init): Revert old code included in + change `2002-05-22 Michael Snyder' below. + (d10v_push_arguments): Ditto. + (d10v_extract_return_value): Ditto. + +2002-05-23 Jim Blandy + + * macrotab.c (check_for_redefinition): Don't complain if the new + definition is the same as the previous one. Take more arguments + to allow the comparison. + (macro_define_object, macro_define_function): Pass more arguments + to check_for_redefinition. + +2002-05-22 Michael Snyder + + * d10v-tdep.c: Change a few macros to enums for ease of debugging. + (d10v_frame_chain_valid): Add PC_IN_CALL_DUMMY clause. + (d10v_frame_saved_pc): Add PC_IN_CALL_DUMMY clause. + (d10v_frame_chain): Bail immediately if PC_IN_CALL_DUMMY. + Don't bail if return_pc is PC_IN_CALL_DUMMY. + Add a temp variable to save a call (and a memory read). + (d10v_init_extra_frame_info): Get fi->pc from callee's return_pc + if possible (so that PC_IN_CALL_DUMMY will work). + +2002-05-22 Corinna Vinschen + + * MAINTAINERS: Remove status `OBSOLETE' from v850. + +2002-05-22 Michal Ludvig + + * dwarf2cfi.c (frame_state_for): Added safety check for a valid + fde->cie_ptr. + (dwarf2_build_frame_info): Corrected handling of eh_frame. + (dwarf2_build_frame_info): Add offset to fde->initial_location + so that frames of shared libraries are mapped correctly. + (execute_stack_op): Change type of 'result' from ULONGEST to + CORE_ADDR. + +2002-05-22 Jason Thorpe + + * config/alpha/tm-nbsd.h: Include solib.h. + +2002-05-22 Jason Thorpe + + * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Don't make + assumptions about the host's byte order. + +2002-05-22 Jason Thorpe + + * Makefile.in (alphanbsd-tdep.o, shnbsd-tdep.o): Add solib-svr4.h + to dependency list. + * alphanbsd-tdep.c: Include solib-svr4.h. + * shnbsd-tdep.c: Ditto. + +2002-05-22 Jason Thorpe + + * Makefile.in (armnbsd-tdep.o): Add solib-svr4.h and + nbsd-tdep.h to dependency list. + * configure.host (arm*-*-netbsdelf*, arm*-*-netbsd*, + i[3456]86-*-netbsdaout*, i[3456]86-*-netbsd*, m68*-*-netbsd*, + ns32k-*-netbsd*, sparc-*-netbsdaout*, sparc-*-netbsd*): Use + nbsdaout.mh and nbsdelf.mh consistently. + * configure.tgt (i[3456]86-*-netbsd*, m68*-*-netbsd*, + ns32k-*-netbsd*, sparc-*-netbsdelf*, sparc-*-netbsd*) Use + nbsdaout.mt and nbsdelf.mh consistently. + * armnbsd-tdep.c: Include nbsd-tdep.h and solib-svr4.h. + (arm_netbsd_elf_init_abi): Use set_solib_svr4_fetch_link_map_offsets + to set nbsd_ilp32_solib_svr4_fetch_link_map_offsets. + * config/nm-nbsd.h: Garbage-collect SVR4_SHARED_LIBS. Move + a.out shared library stuff from here... + * config/nm-nbsdaout.h: ...to here. + * config/tm-nbsd.h: Remove. + * config/alpha/nm-nbsd.h (SVR4_SHARED_LIBS): Remove. + * config/arm/nbsd.mh: Remove. + * config/arm/nbsd.mt (TDEPFILES): Remove solib-sunos.o, add + nbsd-tdep.o. + * config/arm/nbsdaout.mh: New file. + * config/arm/nbsdelf.mh: New file. + * config/arm/nm-nbsdaout.h: New file. + * config/i386/nbsd.mh: Remove. + * config/i386/nbsd.mt: Remove. + * config/i386/nbsdaout.mh: New file. + * config/i386/nbsdaout.mt: New file. + * config/i386/nbsdelf.mh (NAT_FILE): Use nm-nbsd.h. + * config/i386/nbsdelf.mt (TM_FILE): Use tm-nbsd.h. + * config/i386/nm-nbsd.h (REGISTER_U_ADDR, + i386_register_u_addr): Remove. + * config/i386/nm-nbsdaout.h: New file. + * config/i386/nm-nbsdelf.h: Remove. + * config/i386/tm-nbsd.h: Don't include config/tm-nbsd.h. + (USE_STRUCT_CONVENTION): Remove. + * config/i386/tm-nbsdaout.h: New file. + * config/i386/tm-nbsdelf.h: Remove. + * config/m68k/nbsd.mh: Remove. + * config/m68k/nbsd.mt: Remove. + * config/m68k/nbsdaout.mh: New file. + * config/m68k/nbsdaout.mt: New file. + * config/m68k/nm-nbsd.h: Use config/nm-nbsd.h. + * config/m68k/nm-nbsdaout.h: New file. + * config/m68k/tm-nbsd.h: Don't include config/tm-nbsd.h. + (IN_SOLIB_CALL_TRAMPOLINE): Define. + * config/ns32k/nbsd.mh: Remove. + * config/ns32k/nbsd.mt: Remove. + * config/ns32k/nbsdaout.mh: New file. + * config/ns32k/nbsdaout.mt: New file. + * config/ns32k/nm-nbsd.h: Include config/nm-nbsd.h. + * config/ns32k/nm-nbsdaout.h: New file. + * config/ns32k/tm-nbsd.h: Don't include config/tm-nbsd.h. + (IN_SOLIB_CALL_TRAMPOLINE): Define. + * config/powerpc/nm-nbsd.h: Include config/nm-nbsd.h. + (SVR4_SHARED_LIBS): Remove. + * config/powerpc/tm-nbsd.h: Dont' include config/tm-nbsd.h. + * config/sparc/nbsd.mh: Remove. + * config/sparc/nbsd.mt: Remove. + * config/sparc/nbsdaout.mh: New file. + * config/sparc/nbsdaout.mt: New file. + * config/sparc/nbsdelf.mh (NAT_FILE): Use nm-nbsd.h. + * config/sparc/nbsdelf.mt: New file. + * config/sparc/nm-nbsdaout.h: New file. + * config/sparc/nm-nbsdelf.h: Remove. + * config/sparc/tm-nbsd.h: Don't include config/tm-nbsd.h. + * config/sparc/tm-nbsdaout.h: New file. + +2002-05-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add mipsnbsd-nat.c and + mipsnbsd-tdep.c + (mipsnbsd-nat.o, mipsnbsd-tdep.o): New dependency lists. + +2002-05-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add shnbsd-tdep.c and + shnbsd-nat.c. + (shnbsd-tdep.o, shnbsd-nat.o): New dependency lists. + +2002-05-21 Jason Thorpe + + * NEWS: Note new MIPS NetBSD native configuration. + * configure.host (mips*-*-netbsd*): New host. + * configure.tgt (mips*-*-netbsd*): New target. + * mipsnbsd-nat.c: New file. + * mipsnbsd-tdep.c: New file. + * mipsnbsd-tdep.h: New file. + * config/mips/nbsd.mh: New file. + * config/mips/nbsd.mt: New file. + * config/mips/nm-nbsd.h: New file. + * config/mips/tm-nbsd.h: New file. + +2002-05-21 Jason Thorpe + + * Makefile.in (SFILES): Add osabi.c. + (COMMON_OBS): Add osabi.o. + (osabi.o): New dependency list. + * osabi.c: New file. + * osabi.h: New file. + * doc/gdbint.texinfo: Document new generic OS ABI framework. + + * Makefile.in (alpha_tdep_h): Define and use instead of + alpha-tdep.h. + * alpha-tdep.c (alpha_abi_names, process_note_abi_tag_sections, + get_elfosabi, alpha_abi_handler_list, alpha_gdbarch_register_os_abi): + Remove. + (alpha_gdbarch_init, alpha_dump_tdep): Use generic OS ABI framework. + * alpha-tdep.h: Include osabi.h. + (alpha_abi): Remove. + (gdbarch_tdep): Use generic OS ABI framework. + * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Use + gdbarch_register_osabi. + * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. + * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. + * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. + + * Makefile.in (sh_tdep_h): Add osabi.h. + * sh-tdep.h (sh_osabi): Remove. + (gdbarch_tdep): Use generic OS ABI framework. + * sh-tdep.c (sh_osabi_names, process_note_abi_tag_sections, + sh_osabi_handler_list, sh_gdbarch_register_os_abi): Remove. + (sh_gdbarch_init, sh_dump_tdep): Use generic OS ABI framework. + * shnbsd-tdep.c (_initialize_shnbsd_tdep): Use gdbarch_register_osabi. + + * Makefile.in (arm_tdep_h): Define and use instead of arm-tdep.h. + * arm-linux-tdep.c (_initialize_arm_linux_tdep): Use + gdbarch_register_osabi. + * arm-tdep.c (arm_abi_names, process_note_abi_tag_sections, + arm_abi_handler_list, arm_gdbarch_register_os_abi): Remove. + (get_elfosabi): Rename to... + (arm_elf_osabi_sniffer): ...this. Adjust to use generic OS + ABI framework support routines. + (arm_gdbarch_init): Use generic OS ABI framework. + (arm_dump_tdep): Likewise. + (_initialize_arm_tdep): Likewise. + * arm-tdep.h: Include osabi.h. + (arm_abi): Remove. + (gdbarch_tdep): Remove arm_abi and abi_name members. Add + osabi member. + (arm_gdbarch_register_os_abi): Remove prototype. + * armnbsd-tdep.c (arm_netbsd_aout_osabi_sniffer): New function. + (_initialize_arm_netbsd_tdep): Use gdbarch_register_osabi. + + * Makefile.in (mips-tdep.o): Add osabi.h to dependency list. + * mips-tdep.c: Include osabi.h. + (gdbarch_tdep, mips_gdbarch_init, mips_dump_tdep): Use generic + OS ABI framework. + +2002-05-20 Kazu Hirata + + * h8300-tdep.c: Fix formatting. + +2002-05-20 Elena Zannoni + + * rs6000-tdep.c (rs6000_do_registers_info): Simplify code for + printing vector registers. + +2002-05-19 Andrew Cagney + + From Fernando Nasser: + * remote.c (remote_async_open_1): Re-throw the exception when the + connection fails. + (remote_cisco_open): Ditto. + (remote_open_1): Ditto. + +2002-05-19 Andrew Cagney + + * remote.c (remote_start_remote_dummy): Add uiout parameter. + (remote_start_remote): Add uiout parameter. Pass through to + remote_start_remote_dummy. + (remote_open_1): Use catch_exception instead of catch_errors. + (remote_async_open_1): Ditto. + (remote_cisco_open): Ditto. + +2002-05-19 Andrew Cagney + + * remote.c (remote_start_remote): Replace PTR with void pointer. + (sigint_remote_twice_token, sigint_remote_token): Ditto. Make + static. + +2002-05-18 Andrew Cagney + + * gdb_indent.sh: Allow the script to be run in the sim directory. + +2002-05-18 Mark Kettenis + + * config/i386/nm-cygwin.h (NO_PTRACE_H): Remove define. + * config/i386/nm-go32.h (NO_PTRACE_H): Remove define. + + * corelow.c (core_open): Only call set_gdbarch_from_file if + exec_bfd is NULL. + +2002-05-17 Andrey Volkov + + * h8300-tdep.c: Add support of EXR register + * config/h8300/tm-h8300.h: Ditto. + +2002-05-17 Andrey Volkov + + * h8300-tdep.c: Add additional CCR flags (I,UI,H,U) + +2002-05-17 Andrey Volkov + + * h8300-tdep.c: Change literal regnums to REGNO. + +2002-05-17 Jim Blandy + + * NEWS: Note addition of macro support. + + Expand preprocessor macros in C expressions. + * c-lang.h: #include "macroexp.h", for macro_lookup_ftype. + (scan_macro_expansion, scanning_macro_expansion, + finished_macro_expansion): New function declarations. + (expression_macro_lookup_func, expression_macro_lookup_baton): New + variable declarations. + * parser-defs.h (expression_context_pc): New declaration. + * parse.c (expression_context_pc): New variable. + (parse_exp_1): Set expression_context_pc, as well as + expression_context_block. + * c-exp.y (yylex): If we're not already reading the result of a + macro expansion, try to macro-expand the next token. When we're + done scanning a macro expansion, switch back to the mainline text. + Commas and `if's in a macro's expansion don't terminate the input. + * c-lang.c: #include "macroscope.h" and "gdb_assert.h". + (macro_original_text, macro_expanded_text, + expression_macro_lookup_func, expression_macro_lookup_baton): New + variables. + (scan_macro_expansion, scanning_macro_expansion, + finished_macro_expansion, scan_macro_cleanup, null_macro_lookup, + c_preprocess_and_parse): New functions. + (c_language_defn, cplus_language_defn, asm_language_defn): Call + c_preprocess_and_parse, instead of c_parse. + * Makefile.in (c_lang_h): Note that this #includes macroexp.h. + (c-lang.o): Note dependency on macroscope.h and gdb_assert.h. + +Fri May 17 14:26:19 2002 J"orn Rennecke + + * sh-tdep.c (gdb_print_insn_sh64): Delete. + (gdb_print_insn_sh): Just set info->endian and use print_insn_sh. + (sh_gdbarch_init): Always use gdb_print_insn_sh. + +2002-05-17 Corinna Vinschen + + * NEWS: Add section for multi-arched targets. Add v850 to that section. + +2002-05-17 Jason Thorpe + + * Makefile.in (sh_tdep_h): Define and use. + * config/sh/tm-sh.h (sh_osabi, sh_abi, gdbarch_tdep, + register enum): Move to... + * * sh-tdep.h: ...here. + * sh-tdep.c: Include sh-tdep.h. + * sh3-rom.c: Likewise. + * shnbsd-tdep.c: Likewise. + +2002-05-16 Michael Snyder + + * arm-tdep.c: Spelling fix in comment. + +2002-05-16 Jim Blandy + + Add commands for manually expanding macros and showing their + definitions. + * macrocmd.c, macroscope.c, macroscope.h: New files. + * Makefile.in (SFILES): Add macrocmd.c, macroscope.c. + (macroscope_h): New variable. + (HFILES_NO_SRCDIR): Add macroscope.h. + (COMMON_OBS): Add macrocmd.o, macroscope.o. + (macroscope.o, macrocmd.o): New rules. + + Teach the Dwarf 2 reader to read macro information. + * dwarf2read.c: #include "macrotab.h". + (dwarf_macinfo_buffer): New variable. + (struct dwarf2_pinfo): New members: dwarf_macinfo_buffer, and + dwarf_macinfo_size. + (DWARF_MACINFO_BUFFER, DWARF_MACINFO_SIZE): New macros. + (dwarf2_missing_macinfo_section, dwarf2_macros_too_long, + dwarf2_macros_not_terminated, dwarf2_macro_outside_file, + dwarf2_macro_unmatched_end_file, dwarf2_macro_malformed_definition, + dwarf2_macro_spaces_in_definition): New complaints. + (dwarf2_has_info): Initialize dwarf_macinfo_offset. + (dwarf2_build_psymtabs): Read the .dwarf_macinfo section. + (dwarf2_build_psymtabs_hard): Record the buffer and its size in + the partial symbol table. + (psymtab_to_symtab_1): Set the macinfo buffer and size globals + from what's recorded in the partial symbol table. + (read_file_scope): If the compilation unit has a + `DW_AT_macro_info' attribute, read its macro information. + * Makefile.in (dwarf2read.o): Depend on macrotab.h. + +2002-05-16 Daniel Jacobowitz + + Fix PR gdb/546 + * ser-tcp.c: Don't include . + +2002-05-16 Stephane Carrez + + * MAINTAINERS: Update my email address. + +2002-05-16 Richard Earnshaw + + * config/arm/nm-nbsd.h: Use "config/nm-nbsd.h" to include generic + include file of the same name. + +2002-05-16 Corinna Vinschen + + * configure.tgt: Mark v850 as multi-arched. + * config/v850/tm-v850.h: Remove file. + * config/v850/v850.mt: Eliminate TM_FILE. + +2002-05-16 Corinna Vinschen + + * v850-tdep.c: Full multi-arch. + * config/v850/tm-v850.h: Eliminate or move to v850-tdep.c everything. + Define GDB_MULTI_ARCH to 2. + +2002-05-16 Pierre Muller + + * p-exp.y (current_type): New static variable. + Carries the type of the expression at the position that is parsed. + (push_current_type, pop_current_type): Two new functions. Used + to store/restore current_type in expression on specific tokens. + (search_field): New static variable. Set to one after parsing a point + as at that point only a FIELDNAME token should be searched. + (FIELDNAME): New token. After a point only a token belonging to + current_type type definition is allowed. + (all over token rules): reset and change current_type according + to rules. + (exp '[' rule): insert implicit array index field if + exp is a pascal string type. + +2002-05-16 Corinna Vinschen + + * v850-tdep.c: Fix comment for v850_scan_prologue. Remove extra + frame info. Use frame_info's saved_regs instead of matching member + in extra_frame_info throughout. + (v850_frame_init_saved_regs): New function. + (v850_init_extra_frame_info): Move most functionality into + v850_frame_init_saved_regs(). + * config/v850/tm-v850.h (EXTRA_FRAME_INFO): Remove definition. + (v850_frame_find_saved_regs): Remove declaration. + (FRAME_FIND_SAVED_REGS): Remove definition. + (v850_frame_init_saved_regs): Add declaration. + (FRAME_INIT_SAVED_REGS): Add definition. + +2002-05-16 Corinna Vinschen + + * v850-tdep.c: Begin multi-arch'ing v850. + (v850_target_architecture_hook): Remove function. + (v850_gdbarch_init): New function. Add code previously in + v850_target_architecture_hook(). + (_initialize_v850_tdep): Don't set target_architecture_hook. + Call register_gdbarch_init() instead. + +2002-05-16 Daniel Jacobowitz + + * gdbtypes.h (struct cplus_struct_type): Remove args field. + * hpread.c (hpread_read_struct_type): Remove assignments to args. + (fixup_class_method_type): Likewise. + +2002-05-15 Jim Blandy + + Add macro structures to GDB's symbol tables. Nobody puts anything + in them yet. + * symtab.h (struct symtab): New member: `macro_table'. + * buildsym.h (pending_macros): New global variable. + * buildsym.c: #include "macrotab.h". + (buildsym_init): Initialize `pending_macros'. + (end_symtab): If we found macro information while reading a CU's + debugging info, do build a symtab structure for it. Make the + symtab point to the macro information, and clear the + `pending_macros' pointer which held it while we were reading the + debug info. + (really_free_pendings): Free any pending macro table. + * objfiles.h (struct objfile): New member: `macro_cache'. + * objfiles.c (allocate_objfile): Set allocate and free functions + for the macro cache's objstack. + (free_objfile): Empty the macro cache's obstack. + * symfile.c (reread_symbols): Empty the macro cache's obstack, and + set new allocate and free functions for it. + * solib-sunos.c (allocate_rt_common_objfile): Set allocate and + free functions for the macro cache's objstack. (Why is this + function building its own objfile?) + * symmisc.c (print_objfile_statistics): Print statistics on the + macro bcache. + * Makefile.in: Note that buildsym.o depends on macrotab.h. + +2002-05-15 Richard Earnshaw + + * config/arm/nm-nbsd.h: Use <> for include of config/nm-nbsd.h. + (REGISTER_U_ADDR): Delete definition. + (arm_register_u_addr): Delete declaration. + +2002-05-15 Richard Earnshaw + + * arm-linux-tdep.c (ARM_LINUX_JB_PC): Renamed from JB_PC. + (ARM_LINUX_JB_ELEMENT_SIZE): Likewise. + +2002-05-14 Andrew Cagney + + * regcache.c (register_valid): Revise comments refering to "Not + available" and "unavailable". + * frame.c (frame_register_read): Ditto. + * findvar.c (value_of_register): Ditto. + +2002-05-15 Andrew Cagney + + * Makefile.in (remote_sim_h): Replace remote-sim_h. + (remote-sim.o): Update dependencies. + (d10v-tdep.o): Specify dependencies. + (sim_d10v_h): Define. + +2002-05-14 Jim Blandy + + * macroexp.c (init_buffer, gather_arguments, expand): Use NULL, not 0. + * macrotab.c (macro_lookup_inclusion, find_definition, + new_macro_table): Same. + + * macroexp.c (currently_rescanning, expand): Use `strcmp () == 0', + not `! strcmp ()'. This is a dubious improvement. + * macrotab.c (macro_lookup_inclusion, find_definition): Same. + + * macrotab.c (macro_lookup_inclusion): Initialize `best_depth', + although it's not necessary, to avoid a warning. + +2002-05-14 Daniel Jacobowitz + + * gdbtypes.h: Update accessor macros to use TYPE_MAIN_TYPE. + (TYPE_CONST, TYPE_VOLATILE, TYPE_CODE_SPACE, TYPE_DATA_SPACE): Use + TYPE_INSTANCE_FLAGS. + (struct main_type): New. + (struct type): Move most members to struct main_type. Change + cv_type and as_type to new type_chain member. Add instance_flags. + (TYPE_MAIN_TYPE, TYPE_CHAIN, TYPE_INSTANCE_FLAGS): New macros. + (TYPE_CV_TYPE, TYPE_AS_TYPE): Remove. + (finish_cv_type): Remove prototype. + * gdbtypes.c (alloc_type): Update comment. Allocate TYPE_MAIN_TYPE. + Set TYPE_CHAIN. + (alloc_type_instance): New function. + (smash_type): New function. + (make_pointer_type, make_reference_type, make_function_type) + (smash_to_member_type, smash_to_method_type): Call smash_type. + (make_qualified_type): New function. + (make_type_with_address_space): Call make_qualified_type. + (make_cv_type): Likewise. + (finish_cv_type): Remove unnecessary function. + (replace_type): Update comment. Copy TYPE_MAIN_TYPE. + (recursive_dump_type): Dump TYPE_CHAIN and TYPE_INSTANCE_FLAGS; + remove TYPE_CV_TYPE and TYPE_AS_TYPE. + * c-typeprint.c (c_type_print_modifier): Use TYPE_INSTANCE_FLAGS. + * dwarf2read.c (read_structure_scope): Don't call finish_cv_type. + * hpread.c (hpread_read_struct_type): Likewise. + * stabsread.c (read_struct_type): Likewise. + +2002-05-14 Elena Zannoni + + * configure.tgt: Add a catch all sh* target, for cases like + sh[2,3,4]-elf and sh-hms. + +2002-05-14 Keith Seitz + + * event-loop.c (create_file_handler): Don't do anything but + update data when we are given a fd which we are already + monitoring. + +2002-05-14 Michal Ludvig + + * dwarf2cfi.c (context_cpy): Copy registers correctly. + (update_context): Use __func__ in warnings. + +2002-05-14 Daniel Jacobowitz + + * ser-tcp.c: Include . Rename tcp_open + and tcp_close to net_open and net_close. + (net_open): Accept "udp:" and "tcp:" specifications. Connect + using UDP if requested. Don't try to disable Nagle on UDP + sockets. + * remote.c (remote_serial_open): New function. Warn about UDP. + (remote_open_1, remote_async_open_1, remote_cisco_open): Call it. + +2002-05-13 Elena Zannoni + + * MAINTAINERS: List sh-elf as buildable with ,-Werror. + +2002-05-13 Elena Zannoni + + * configure.tgt: Remove sh-hms target. + * MAINTAINERS: Don't list sh-hms as a separate target. + +2002-05-13 Jim Blandy + + Add first preprocessor macro-expansion files. + * macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files. + * Makefile.in (SFILES): Add macrotab.c, macroexp.c. + (splay_tree_h, macroexp_h, macrotab_h): New variable. + (HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h. + (COMMON_OBS): Add macrotab.o, macroexp.o. + (macroexp.o, macrotab.o): New rules. + +2002-05-13 Andrew Cagney + + * config/m88k/tm-m88k.h: Update copyright. + (m88k_target_write_pc): Declare + (TARGET_WRITE_PC): Redefine using m88k_target_write_pc. + (M88K_NNPC_REGNUM): Rename NNPC_REGNUM. + (SHIFT_INST_REGS): Update definition. + * m88k-tdep.c (m88k_target_write_pc): New function. Implement + using old definition of TARGET_WRITE_PC. + * regcache.c (generic_target_write_pc): Delete code handling + NNPC_REGNUM. + * gdbarch.sh (NNPC_REGNUM): Delete. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-05-13 Richard Earnshaw + + * builtin-regs.c (value_of_builtin_reg): Correctly calculate the + builtin reg number. + +2002-05-13 Daniel Jacobowitz + + * ax-gdb.c (gen_sign_extend, gen_fetch, gen_usual_unary) + (gen_cast, gen_scale, gen_add, gen_sub, gen_binop, gen_deref) + (gen_address_of, gen_struct_ref, gen_repeat): Use type + access macros. + * c-typeprint.c (cp_type_print_method_args): Likewise. + (c_type_print_args): Likewise. + * d10v-tdep.c (d10v_push_arguments): Likewise. + (d10v_extract_return_value): Likewise. + * expprint.c (print_subexp): Likewise. + * gdbtypes.c (lookup_primitive_typename): Likewise. + (lookup_template_type, add_mangled_type, print_arg_types): Likewise. + * gdbtypes.h (TYPE_UNSIGNED, TYPE_NOSIGN, TYPE_STUB) + (TYPE_TARGET_STUB, TYPE_STATIC, TYPE_CONST, TYPE_VOLATILE) + (TYPE_PROTOTYPED, TYPE_INCOMPLETE, TYPE_CODE_SPACE, TYPE_VARARGS) + (TYPE_VECTOR): Likewise. + * hpread.c (hpread_read_struct_type) + (fix_static_member_physnames, fixup_class_method_type) + (hpread_type_lookup): Likewise. + * mdebugread.c (parse_symbol, parse_type): Likewise. + * p-lang.c (is_pascal_string_type): Likewise. + * valops.c (hand_function_call): Likewise. + * x86-64-tdep.c (classify_argument): Likewise. + + * hpread.c (hpread_read_function_type) + (hpread_read_doc_function_type): Call replace_type. + * dstread.c (create_new_type): Delete. + (decode_dst_structure, process_dst_function): Call alloc_type. + Use type access macros. + +2002-05-12 Mark Kettenis + + * i387-tdep.c (i387_supply_fxsave): Skip the SSE registers if + the're not supported by the current architecture. + (i387_fill_fxsave): Likewise. + +2002-05-12 Fred Fish + + * symfile.c (default_symfile_offsets): Arrange for uninitialized + sect_index_xxx members to index the first slot in section_offsets + if all of the section_offsets are zero. + +2002-05-12 Mark Kettenis + + * configure.tgt (sparc-*openbsd): Remove entry accidentially + checked in with last change. + +2002-05-12 Mark Kettenis + + * configure.tgt (i[3456]86-*-unixware*, i[3456]86-*-unixware2*): + Remove targets. These are canonicalized to i386-*-sysv4.2uw by + config.sub. + +2002-05-12 Daniel Jacobowitz + + * Makefile.in: Update dependencies. + +2002-05-11 Andrew Cagney + + * language.c (local_hex_string_custom): Simplify. Do not depend + on PRINTF_HAS_LONG_LONG or CC_HAS_LONG_LONG. + + * memattr.c (mem_info_command): Replace calls to + longest_local_hex_string and longest_local_hex_string_custom. + * buildsym.c (make_blockvector): Ditto. + * solib.c (info_sharedlibrary_command): Ditto. + * tracepoint.c (tracepoints_info): Ditto. + * symtab.c (print_msymbol_info): Ditto. + + * language.c (local_hex_string): Delete. + (local_hex_string_custom): Delete. + (longest_local_hex_string): Rename to local_hex_string. + (longest_local_hex_string_custom): Rename to + local_hex_string_custom. + * language.h (local_hex_string): Change parameter type to LONGEST. + (local_hex_string_custom): Ditto. + (longest_local_hex_string): Delete declaration. + (longest_local_hex_string_custom): Ditto. + + * solib.c: Update copyright. + * memattr.c: Update copyright. + +2002-05-11 Andrew Cagney + + * arch-utils.h (legacy_register_to_value): Declare. + (legacy_value_to_register): Declare. + (legacy_convert_register_p): Declare. + * arch-utils.c (legacy_register_to_value): New function. + (legacy_value_to_register): New function. + (legacy_convert_register_p): New function. + + * gdbarch.sh (REGISTER_TO_VALUE): Define. + (VALUE_TO_REGISTER): Define. + (CONVERT_REGISTER_P): Define. + * gdbarch.h, gdbarch.c: Regenerate. + + * valops.c (value_assign): Use CONVERT_REGISTER_P and + VALUE_TO_REGISTER. + * findvar.c (value_from_register): Use REGISTER_TO_VALUE and + CONVERT_REGISTER_P. + +2005-05-11 Daniel Jacobowitz + Peter Schauer + + * Makefile.in: Update dependencies for valops.c. + * valops.c: Include "gdb_assert.h". + (typecmp): Skip THIS parameter to methods. + (find_method_list): Remove static_memfuncp argument, + update callers. Check for stub methods. + (find_value_oload_method_list): Don't set *static_memfuncp. + (find_overload_match): Don't check for stub methods. Assert + that methods are not stubbed. Handle static methods. + (value_find_oload_method_list): Remove static_memfuncp argument. + * gdbtypes.c (check_stub_method): Do not add THIS pointer + to the argument list for static stub methods. + * value.h (value_find_oload_method_list): Update prototype. + +2002-05-11 Andrew Cagney + + * arch-utils.h (generic_register_size): Declare. + (generic_register_raw_size, generic_register_virtual_size): Delete + declarations. + * arch-utils.c (generic_register_raw_size): Delete. + (generic_register_size): New function. + (generic_register_virtual_size): Delete. + + * gdbarch.sh (REGISTER_RAW_SIZE, REGISTER_VIRTUAL_SIZE): Make + default generic_register_size. + * gdbarch.h, gdbarch.c: Re-generate. + + * d10v-tdep.c (d10v_gdbarch_init): Use generic_register_size for + register_virtual_size. + * x86-64-tdep.c (x86_64_gdbarch_init): Ditto. + * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. + +2002-05-11 Andrew Cagney + + * gdbarch.sh (gdbarch_data): Add gdbarch parameter. + * gdbarch.h, gdbarch.c: Regenerate. + * gnu-v3-abi.c: Update copyright. + (vtable_address_point_offset): Update. + (gnuv3_rtti_type): Update. + (gnuv3_baseclass_offset): Update. + * solib-svr4.c (svr4_fetch_link_map_offsets): Update. + (init_fetch_link_map_offsets): Update. + * remote.c (get_remote_state): Update. + +2002-05-11 Daniel Jacobowitz + + * TODO: Remove value_headof/value_from_vtable_info comment. + * printcmd.c (print_command_1): Don't call value_from_vtable_info. + * values.c (value_headof, value_from_vtable_info): Delete. + * value.h (value_from_vtable_info): Delete prototype. + +2002-05-11 Andrew Cagney + + * Makefile.in: Replace gdb_assert.h with $(gdb_assert_h), + gdb_string.h with $(gdb_string_h) and gdb_regex.h with + $(gdb_regex_h). + (gdb_assert_h): Define. + (gdb_wait_h): Define. + (gdb_regex_h): Define. + +2002-05-11 Daniel Jacobowitz + + From Peter Schauer : + * linespec.c (find_methods): Handle GCC 3.x template constructors. + +2002-05-11 Jason Thorpe + + * nbsd-tdep.c: Fix comment. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add nbsd-tdep.c. + (alphanbsd-tdep.o): Add nbsd-tdep.h to dependency list. + (nbsd-tdep.o): New dependency list. + * alphanbsd-tdep.c: Don't include solib-svr4.h. Include + nbsd-tdep.h. + (alphanbsd_solib_svr4_fetch_link_map_offsets): Remove. + (alphanbsd_init_abi): Use nbsd_lp64_solib_svr4_fetch_link_map_offsets. + * nbsd-tdep.c: New file. + * nbsd-tdep.h: New file. + * shnbsd-tdep.c: Don't include solib-svr4.h. Include + nbsd-tdep.h. + (shnbsd_solib_svr4_fetch_link_map_offsets): Remove. + (shnbsd_init_abi): Use nbsd_ilp32_solib_svr4_fetch_link_map_offsets. + * config/alpha/nbsd.mt (TDEPFILES): Add nbsd-tdep.o. + * config/sh/nbsd.mt (TDEPFILES): Ditto. + +2002-05-11 Jason Thorpe + + * config/alpha/nbsd.mh (NATDEPFILES): Remove corelow.o. + * config/alpha/nbsd.mt (TDEPFILES): Add corelow.o. + * config/i386/nbsd.mh (NATDEPFILES): Remove corelow.o. + * config/i386/nbsd.mt (TDEPFILES): Add corelow.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Remove corelow.o. + * config/i386/nbsdelf.mt (TDEPFILES): Add corelow.o. + +2002-05-11 Jason Thorpe + + * config/i386/nbsd.mh (NATDEPFILES): Use line continuations. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/m68k/nbsd.mh (NATDEPFILES): Likewise. + * config/ns32k/nbsd.mh (NATDEPFILES): Likewise. + * config/powerpc/nbsd.mh (NATDEPFILES): Likewise. + * config/sparc/nbsd.mh (NATDEPFILES): Likewise. + * config/sparc/nbsdelf.mh (NATDEPFILES): Likewise. + +2002-05-11 Jason Thorpe + + * i386nbsd-nat.c: Delete file. Move fetch_core_registers and + fetch_elfcore_registers to... + * i386nbsd-tdep.c: ...here. + (i386nbsd_use_struct_convention): Rename to... + (i386nbsd_aout_use_struct_convention): ...this. + (i386nbsd_supply_reg): New function. + (i386nbsd_fill_reg): New function. + (fetch_core_registers): Use i386nbsd_supply_reg. + (fetch_elfcore_registers): Likewise. + (_initialize_i386nbsd_tdep): New function. + * config/i386/nbsd.mh (NATDEPFILES): Remove i386nbsd-nat.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/i386/nbsdelf.mt (TDEPFILES): Add i386nbsd-tdep.o. + * config/i386/tm-nbsd.h (i386nbsd_use_struct_convention): Rename to... + (i386nbsd_aout_use_struct_convention): ...this. + +2002-05-11 Jason Thorpe + + * shnbsd-nat.c (fetch_inferior_registers): Use shnbsd_supply_reg. + (store_inferior_registers): Use shnbsd_fill_reg. + * shnbsd-tdep.c (sh_nbsd_supply_registers, + sh_nbsd_supply_register): Collapse into... + (shnbsd_supply_reg): ...this. + (sh_nbsd_fill_registers, sh_nbsd_fill_register): Collapse into... + (shnbsd_fill_reg): ...this. + (sh_nbsd_solib_svr4_fetch_link_map_offsets): Rename to... + (shnbsd_solib_svr4_fetch_link_map_offsets): ...this. + (fetch_core_registers): Use shnbsd_supply_reg. + (fetch_elfcore_registers): Use shnbsd_supply_reg. + (sh_nbsd_core_fns): Rename to... + (shnbsd_core_fns): ...this. + (sh_nbsd_elfcore_fns): Rename to... + (shnbsd_elfcore_fns): ...this. + (sh_nbsd_init_abi): Rename to... + (shnbsd_init_abi): ...this. + (_initialize_sh_nbsd_tdep): Rename to... + (_initialize_shnbsd_tdep): ...this. + * shnbsd-tdep.h (sh_nbsd_supply_registers, + sh_nbsd_supply_register, sh_nbsd_fill_registers, + sh_nbsd_fill_register): Remove prototypes. + (shnbsd_supply_reg, shnbsd_fill_reg): Add prototypes. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Remove i387-nat.c. + (i387-nat.o): Delete dependency list. + (go32-nat.o): Change i387-nat.h to i387-tdep.h. + (x86-64-linux-nat.o): Likewise. + * i387-nat.c: Delete file, moving contents to... + * i387-tdep.c: ...here. + * i387-nat.h: Rename... + * i387-tdep.h: ...to this. + * go32-nat.c: Include i387-tdep.h instead of i387-nat.h. + * i386-linux-nat.c: Likewise. + * i386bsd-nat.c: Likewise. + * i386gnu-nat.c: Likewise. + * i386nbsd-nat.c: Likewise. + * i386v4-nat.c: Likewise. + * x86-64-linux-nat.c: Likewise. + * config/i386/fbsd.mh (NATDEPFILES): Remove i387-nat.o. + * config/i386/go32.mh (NATDEPFILES): Likewise. + * config/i386/i386gnu.mh (NATDEPFILES): Likewise. + * config/i386/i386sol2.mh (NATDEPFILES): Likewise. + * config/i386/i386v42mp.mh (NATDEPFILES): Likewise. + * config/i386/linux.mh (NATDEPFILES): Likewise. + * config/i386/nbsd.mh (NATDEPFILES): Likewise. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/i386/obsd.mh (NATDEPFILES): Likewise. + * config/i386/x86-64linux.mh (NATDEPFILES): Likewise. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Remove alphanbsd-nat.c. + (alphanbsd-nat.o): Remove dependency list. + (alphanbsd-tdep.o): Add $(regcache_h) to dependency list. + * alphanbsd-nat.c: Delete. Contents moved to... + * alphanbsd-tdep.c: ...here. + (_initialize_alphanbsd_tdep): Register core functions. + * config/alpha/nbsd.mh (NATDEPFILES): Remove alphanbsd-nat.o. + +2002-05-11 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alphabsd-tdep.c. + (alphabsd-nat.o): Depend on alphabsd-tdep.h. + (alphanbsd-nat.o): Likewise. + (alphabsd-tdep.o): New dependency list. + * alphabsd-nat.c (supply_gregset): Use alphabsd_supply_reg. + (fill_gregset): Use alphabsd_fill_reg. + (supply_fpregset): Use alphabsd_supply_fpreg. + (fill_fpregset): Use alphabsd_fill_fpreg. + (fetch_inferior_registers): Use struct reg and struct fpreg + rather than gregset_t and fpregset_t. Use alphabsd_supply_reg + and alphabsd_supply_fpreg. + (store_inferior_registers): Use struct reg and struct fpreg + rather than gregset_t and fpregset_t. Use alphabsd_fill_reg + and alphabsd_fill_fpreg. + * alphabsd-tdep.c: New file. + * alphabsd-tdep.h: New file. + * alphanbsd-nat.c (fetch_core_registers): Use alphabsd_supply_fpreg. + (fetch_elfcore_registers): Use alphabsd_supply_reg and + alphabsd_supply_fpreg. + * config/alpha/fbsd.mt (TDEPFILES): Add alphabsd-tdep.o. + * config/alpha/nbsd.mt (TDEPFILES): Likewise. + +2002-05-11 Eric Christopher + + * mips-tdep.c (mips_double_register_type): Fix thinko. + (mips_single_register_type): Ditto. + * MAINTAINERS: Add self. + +2002-05-11 Mark Kettenis + + * i387-nat.c (i387_supply_register, i387_fill_fsave, + i387_supply_fxsave, i387_fill_fxsave): Rewrite in order to do the + right thing on architectures with different endianness and/or + integer sizes. + +2002-05-10 Jason Thorpe + + From Christian Limpach + * configure.in: Change sed expression which comments out + NATDEPFILES to also comment out continuation lines. + * configure: Regenerate. + +2002-05-10 Elena Zannoni + + * sh-tdep.c: Clean up code erroneously reintroduced by previous + big patch. + +2002-05-10 Elena Zannoni + + * sh-tdep.c: Include correct file. + +2002-05-10 Elena Zannoni + + New support for sh64-elf (sh5) target. + + * configure.tgt: For sh64-elf target, default to sh-elf. + + * config/sh/tm-sh.h (enum sh-abi): Possible ABI's. + (struct gdbarch_tdep): Add new fields for new registers and ABI + info. + + * sh-tdep.c: Include elf-bfd.h, elf/sh.h, gdb/sim-sh.h. + (NUM_PSEUDO_REGS_SH_MEDIA, NUM_PSEUDO_REGS_SH_COMPACT, + MSYMBOL_IS_SPECIAL, IS_ISA32_ADDR, MAKE_ISA32_ADDR, + UNMAKE_ISA32_ADDR, IS_PTABSL_R18, IS_STS_R0, IS_STS_PR, + IS_MOV_TO_R15, IS_MOV_R14, IS_STQ_R18_R14, IS_STQ_R18_R15, + IS_STL_R18_R15, IS_STQ_R14_R15, IS_STL_R14_R15, IS_ADDIL_SP_MEDIA, + IS_ADDI_SP_MEDIA, IS_ADDL_SP_FP_MEDIA, IS_ADD_SP_FP_MEDIA, + IS_MOV_SP_FP_MEDIA, IS_MOV_R0, IS_MOVL_R0, IS_ADD_SP_R0, + IS_MOV_R14_R0, IS_MEDIA_IND_ARG_MOV, IS_MEDIA_ARG_MOV, + IS_MEDIA_MOV_TO_R14, IS_COMPACT_IND_ARG_MOV, IS_COMPACT_ARG_MOV, + IS_COMPACT_MOV_TO_R14, IS_JSR_R0, IS_NOP): New macros. + (sh_sh64_register_name, sh64_elf_make_msymbol_special, + pc_is_isa32, sh_sh64_breakpoint_from_pc, look_for_args_moves, + sh64_skip_prologue_hard_way, sh64_use_struct_convention, + gdb_print_insn_sh64, translate_insn_rn, sh64_frame_chain, + sh64_get_saved_pr, fpp_reg_base_num, is_media_pseudo, + sh64_get_gdb_regnum, sh64_media_reg_base_num, + sh64_compact_reg_base_num, translate_rn_to_arch_reg_num, + sign_extend, sh64_nofp_frame_init_saved_regs, + sh64_init_extra_frame_info, sh64_get_saved_register, + sh64_extract_struct_value_address, sh64_pop_frame, + sh64_push_arguments, sh64_extract_return_value, + sh64_store_return_value, sh64_show_media_regs, + sh64_show_compact_regs, sh64_show_regs, sh_sh64_register_byte, + sh_sh64_register_raw_size, sh_sh64_register_virtual_size, + sh_sh64_register_virtual_type, + sh_sh64_register_convert_to_virtual, + sh_sh64_register_convert_to_raw, sh64_pseudo_register_read, + sh64_register_read, sh64_pseudo_register_write, + sh64_register_write, do_fv_c_register_info, do_dr_c_register_info, + do_r_c_register_info, do_fpp_register_info, do_cr_c_register_info, + sh64_do_pseudo_register, sh_compact_do_registers_info, + sh64_do_registers_info, sh_gdbarch_init): New functions. + +2002-05-10 Elena Zannoni + + * sh-tdep.c (sh_breakpoint_from_pc): Add 'const' to return type. + +2002-05-10 Daniel Jacobowitz + + * linespec.c (decode_line_1): Check for a double quote after + a filename correctly. + +2002-05-10 Jim Blandy + + Properly track the size of the current objfile's .debug_line section. + * dwarf2read.c (struct dwarf2_pinfo): New member: dwarf_line_size. + (DWARF_LINE_SIZE): New macro. + (dwarf2_build_psymtabs_hard): Record the line section's size in + the partial symbol table. + (psymtab_to_symtab_1): Restore dwarf_line_size from the partial + symbol table. + +2002-05-10 Petr Sorfa + + * ia64-tdep.c: Handle breakpoints on L instruction type + in MLX instruction bundle by moving the breakpoint to + the third slot (X instruction type) as L holds only data. + +2002-05-10 Kevin Buettner + + * dbxread.c (discarding_local_symbols_complaint): New complaint. + (process_one_symbol): Complain about discarding local symbols + due to a misplaced N_LBRAC entry. + +2002-05-09 Elena Zannoni + + From Daniel Berlin + * linespec.c (find_toplevel_char): '<' and '>' also increase and + decrease the depth we are at, in the case of templates. + +2002-05-09 Daniel Jacobowitz + + * mips-tdep.c (mips_float_register_type): New function. + (mips_double_register_type): New function. + (mips_print_register): Use them. + (do_fp_register_row): Likewise. + +2002-05-09 Daniel Jacobowitz + + * signals/signals.c (signals): Remove conditional compilation around + Mach-specific signals. Move them to after TARGET_SIGNAL_DEFAULT. + (target_signal_from_name): Loop until TARGET_SIGNAL_LAST. + +2002-05-09 Michael Snyder + + * remote-rdp.c (remote_rdp_can_run): Remove. + +2002-05-09 Tom Tromey + + * jv-valprint.c (java_val_print): Handle `char' as a special case + of TYPE_CODE_INT. + +2002-05-09 Michael Snyder + + * arm-tdep.c (arm_scan_prologue): Accept strb r(0123),[r11,#-nn], + strh r(0123),[r11,#-nn], str r(0123),[r11,#-nn], as well as + strb r(0123),[sp,#nn], strh r(0123),[sp,#nn] and + str r(0123),[sp,#nn]. + (arm_skip_prologue): Ditto. Also make disassembly + order-independent by placing it in a loop. + +2002-05-06 Michael Snyder + + * stabsread.c (read_type): Add recognition for new attribute: + "@V;" means that an array type is actually a vector. + This is analogous to the vector flag that's been added to dwarf2. + +2002-05-09 Mark Kettenis + + * i386-tdep.h (i386_abi): New enum. + (struct gdbarch_tdep): Replace os_ident member with abi. + (i386_gdbarch_register_os_abi): New prototype. + * i386-tdep.c (i386_abi_names): New array. + (process_note_abi_tag_sections): Removed. + (process_note_sections): New function. + (i386_elf_abi_from_note, i386_elf_abi): New functions. + (struct i386_abi_handler): New struct. + (i386_abi_handler_list): New variable. + (i386_gdbarch_register_os_abi): New function. + (i386_gdbarch_init): Adapt for the changes given above. + +2002-05-08 Daniel Jacobowitz + + * gregset.h: Say "GNU/Linux". + +2002-05-08 Elena Zannoni + + * gdbtypes.c : Add new builtin type for 64 bit vectors. + (build_gdbtypes): Build builtin_type_v2_float. + (_initialize_gdbtypes): Register new builtin type. + +2002-05-08 Andrew Cagney + + * gdbarch.sh (init_gdbarch_swap): Do not clear the swap section. + (clear_gdbarch_swap): New function. + (initialize_non_multiarch): Call. + (gdbarch_update_p): Before calling init(), swap out and clear the + existing architecture. + * gdbarch.c: Regenerate. + +2002-05-08 Jason Thorpe + + * config/djgpp/fnchange.lst: Add alphanbsd-nat.c and + alphanbsd-tdep.c. + +2002-05-08 Jason Thorpe + + * sh-nbsd-nat.c: Rename to... + * shnbsd-nat.c: ...this. + * sh-nbsd-tdep.c: Rename to... + * shnbsd-tdep.c: ...this. + * sh-nbsd-tdep.h: Rename to... + * shnbsd-tdep.h: ...this. + * config/sh/nbsd.mh: Use shnbsd-nat.o. + * config/sh/nbsd.mt: Use shnbsd-tdep.o. + +2002-05-08 Richard Earnshaw + + * remote-rdi.c (_initializie_remote_rdi): Use ANSI-style string + concatenation for command help messages. + +2002-05-08 Jason Thorpe + + * NEWS: Note new sh*-*-netbsdelf* configuration. + * configure.host: Set gdb_host_cpu to sh for all sh*. + (sh*-*-netbsdelf*): New host. + * configure.tgt: Set gdb_target_cpu to sh for all sh*. + (sh*-*-netbsdelf*): New target. + * sh-nbsd-nat.c: New file. + * sh-nbsd-tdep.c: New file. + * sh-nbsd-tdep.h: New file. + * config/sh/nbsd.mh: New file. + * config/sh/nbsd.mt: New file. + * config/sh/nm-nbsd.h: New file. + * config/sh/tm-nbsd.h: New file. + +2002-05-08 Jason Thorpe + + * sh-tdep.c (sh_osabi_names): Declare. + (process_note_abi_tag_sections): New function. + (get_elfosabi): Ditto. + (sh_gdbarch_register_os_abi): Ditto. + (sh_dump_tdep): Ditto. + _initialize_sh_tdep): Use gdbarch_register to register + sh_gdbarch_init and sh_dump_tdep. + * config/sh/tm-sh.h (sh_osabi): Declare. + (gdbarch_tdep): Add sh_osabi and osabi_name members. + +2002-05-07 Andrew Cagney + + * arm-tdep.c (arm_skip_prologue): Handle generic dummy frames. + (thumb_scan_prologue): Ditto. + (arm_find_callers_reg): Ditto. + (arm_frame_chain): Ditto. + (arm_init_extra_frame_info): Ditto. + (arm_frame_saved_pc): Ditto. + (arm_pop_frame): Ditto. + (arm_push_return_address): New function. + (arm_gdbarch_init): Initialize use_generic_dummy_frames, + call_dummy_location, call_dummy_breakpoint_offset_p, + call_dummy_breakpoint_offset, call_dummy_p, + call_dummy_stack_adjust_p, call_dummy_words, + sizeof_call_dummy_words, call_dummy_start_offset, + call_dummy_length, fix_call_dummy, pc_in_call_dummy, + call_dummy_address, push_return_address and push_dummy_frame for + generic dummy frames. + +2002-05-07 Jason Thorpe + + * sh-tdep.c (sh_nofp_frame_init_saved_regs): Fix error in + size computation for alloca. + (sh_fp_frame_init_saved_regs): Likewise. + +2002-05-07 Richard Earnshaw + + * arm-tdep.h (ARM_MAX_REGISTER_RAW_SIZE): Define. + (ARM_MAX_REGISTER_VIRTUAL_SIZE): Define. + * arm-tdep.c (arm_store_return_value): Use them. + Use FP_REGISTER_RAW_SIZE when setting the FPA return value. + * remote-rdp.c (remote_rdp_fetch_register): Use + ARM_MAX_REGISTER_RAW_SIZE. + (remote_rdp_store_register): Likewise. + +2002-05-07 Michal Ludvig + + * dwarf2cfi.c: Code cleanup, removed unused variables, + added default labels to switch {} statements. + * x86-64-tdep.c: Ditto. + * x86-64-linux-nat.c: Ditto. + +2002-05-07 Jason Thorpe + + * solib.h: Protect against multiple inclusion. + +2002-05-06 Jim Blandy + + Add first preprocessor macro-expansion files. + * macroexp.c, macroexp.h, macrotab.c, macrotab.h: New files. + * Makefile.in (SFILES): Add macrotab.c, macroexp.c. + (splay_tree_h, macroexp_h, macrotab_h): New variable. + (HFILES_NO_SRCDIR): Add macrotab.h, macroexp.h. + (COMMON_OBS): Add macrotab.o, macroexp.o. + (macroexp.o, macrotab.o): New rules. + + Separate the job of reading the line number info statement program + header (...expialidocious) out into its own function. + * dwarf2read.c (struct line_head, struct filenames, struct + directories): Replace with... + (struct line_header): New structure, containing the full + contents of the statement program header, including the + include directory and file name tables. + (read_file_scope): If we have line number info, instead of just + calling dwarf_decode_lines to do all the work, call + dwarf_decode_line_header first to get a `struct line_header' + containing the data in the statement program header, and then + pass that to dwarf_decode_lines, which will pick up where that + left off. Be sure to clean up the `struct line_header' object. + (dwarf_decode_line_header, free_line_header, add_include_dir, + add_file_name): New functions. + (dwarf_decode_lines): Move all the code to read the statement + program header into dwarf_decode_line_header. Take the line + header it built as the first argument, instead of the offset to + the compilation unit's line number info. Use the new `struct + line_header' type instead of the old structures. No need to do + cleanups here now, since we don't allocate anything. + (dwarf2_statement_list_fits_in_line_number_section, + dwarf2_line_header_too_long): New complaints. + +2002-05-06 Elena Zannoni + + * gdbtypes.c (init_vector_type): New function. + (build_builtin_type_vec128): Simplify the representation of SIMD + registers. + (build_gdbtypes): Initialize new builtin vector types. + (_initialize_gdbtypes): Register new vector types with gdbarch. + (builtin_type_v4_float, builtin_type_v4_int32, + builtin_type_v8_int16, builtin_type_v16_int8, + builtin_type_v2_int32, builtin_type_v4_int16, + builtin_type_v8_int8): New (renamed) SIMD types. + +2002-05-06 Mark Kettenis + + * i387-nat.c (i387_fill_fsave): Use regcache_collect. + (i387_fill_fxsave): Likewise. + +2002-05-05 Alexandre Oliva + + * alpha-tdep.c (alpha_extract_return_value): Don't use + non-constant array size in prototype. + +2002-05-04 Andrew Cagney + + From Brian Taylor : + * ui-out.c (ui_out_field_core_addr): Use the function + longest_local_hex_string_custom'to format addresses > 32 bits + wide. + + * ui-out.c (ui_out_field_core_addr): Update comment. + +2002-05-04 Andrew Cagney + + * stack.c (select_and_print_frame): Make static. Delete the + parameter `level'. + (func_command): Update call. + (select_frame_command): Delete code computing the frame level. + * frame.h (select_and_print_frame): Delete declaration. + +2002-05-04 Andrew Cagney + + * sparc-tdep.c (sparc_get_saved_register): Comment why + get_prev_frame call is safe. + +2002-05-04 Andrew Cagney + + * frame.h (select_frame): Delete level parameter. + * stack.c (select_frame): Update. Use frame_relative_level to + obtain the frame's level. + (select_and_print_frame): Update call. + (select_frame_command): Ditto. + (up_silently_base): Ditto. + (down_silently_base): Ditto. + * ocd.c (ocd_start_remote): Ditto. + * remote-rdp.c (remote_rdp_open): Ditto. + * remote-mips.c (mips_initialize): Ditto. + (common_open): Ditto. + * remote-e7000.c (e7000_start_remote): Ditto. + * m3-nat.c (select_thread): Ditto. + * hppa-tdep.c (child_get_current_exception_event): Ditto. + (child_get_current_exception_event): Ditto. + * varobj.c (varobj_create): Ditto. + (varobj_update): Ditto. + (c_value_of_root): Ditto. + * tracepoint.c (finish_tfind_command): Ditto. + * corelow.c (core_open): Ditto. + * arch-utils.c (generic_prepare_to_proceed): Ditto. + * thread.c (info_threads_command): Ditto. + (switch_to_thread): Ditto. + * infrun.c (normal_stop): Ditto. + (restore_selected_frame): Ditto. + (restore_inferior_status): Ditto. + * breakpoint.c (insert_breakpoints): Ditto. + (watchpoint_check): Ditto. + (bpstat_stop_status): Ditto. + (do_enable_breakpoint): Ditto. + * blockframe.c (flush_cached_frames): Ditto. + (reinit_frame_cache): Ditto. + +2002-05-04 Andrew Cagney + + * MAINTAINERS (Host/Native): Add Jason Thorpe as NetBSD + maintainer. + +2002-05-04 Jim Blandy + + * gdbtypes.c (replace_type): Doc fix. + +2002-05-04 Andrew Cagney + + * valprint.c (strcat_longest): Delete commented out function. + Update copyright. + +2002-05-04 Andrew Cagney + + * MAINTAINERS: Mark a29k as deleted. + * NEWS: Mention that a29k was removed. Add OBSOLETE section. + Move new configurations to the top. + * configure.tgt: Remove a29k. + * config/a29k/tm-vx29k.h: Delete. + * config/a29k/vx29k.mt: Delete. + * config/a29k/tm-a29k.h: Delete. + * config/a29k/a29k-udi.mt: Delete. + * config/a29k/a29k.mt: Delete. + * a29k-tdep.c: Delete. + * remote-udi.c: Delete. + * remote-mm.c: Delete. + * remote-eb.c: Delete. + * remote-adapt.c: Delete. + * Makefile.in: Remove obsolete code. + * config/s390/s390x.mt: Ditto. + * config/s390/s390.mt: Ditto. + * config/sparc/sparclynx.mh: Ditto. + * config/sparc/linux.mh: Ditto. + * config/pa/hppaosf.mh: Ditto. + * config/pa/hppabsd.mh: Ditto. + * config/ns32k/nbsd.mt: Ditto. + * config/mips/vr5000.mt: Ditto. + * config/m68k/sun3os4.mh: Ditto. + * config/m68k/nbsd.mt: Ditto. + * config/m68k/m68klynx.mh: Ditto. + * config/m32r/m32r.mt: Ditto. + * config/i386/x86-64linux.mt: Ditto. + * config/i386/nbsdelf.mt: Ditto. + * config/i386/nbsd.mt: Ditto. + * config/i386/i386lynx.mh: Ditto. + +2002-05-04 Andrew Cagney + + * target.c (debug_print_register): New function. Handle oversize + registers. + (debug_to_fetch_registers): Call. + (debug_to_store_registers): Call. + +2002-05-03 Jim Blandy + + * stabsread.c (cleanup_undefined_types): Use replace_type, not memcpy. + (read_type): Doc fix. + * gdbtypes.c (replace_type): Doc fix. + + * stabsread.c (multiply_defined_struct): New complaint. + (read_struct_type): If the type we were passed isn't empty, or + incomplete, don't read the new struct type into it; complain, + and return the original type unchanged. Take a new `type_code' + argument, which is the type code for the new type. + (read_type): Rather than storing the type's type code here, pass + it as an argument to read_struct_type, and let that take care of + storing it. That way, we don't overwrite the original type code, + so read_struct_type can use it to decide whether we're overwriting + something we shouldn't. + (complain_about_struct_wipeout): New function. + +2002-05-03 Andrew Cagney + + * gdbarch.sh: Assert that gdbarch is non-NULL. + * gdbarch.c: Regenerate. + +2002-05-03 Jason Merrill + + * gnu-v3-abi.c (gnuv3_rtti_type): If we get confused, just warn + and return NULL. + +2002-05-03 Michal Ludvig + + * x86-64-tdep.c (x86_64_dwarf2gdb_regno_map), + (x86_64_dwarf2gdb_regno_map_length), + (x86_64_dwarf2_reg_to_regnum): Added. + (x86_64_gdbarch_init): Added registration of x86_64_dwarf2_reg_to_regnum. + (x86_64_gdbarch_init): Renamed from i386_gdbarch_init. + (_initialize_x86_64_tdep): Synced with the change above. + (x86_64_skip_prologue): Reformulated message. + +2002-05-03 Pierre Muller + + * f-exp.y: Also use new prev_lexptr variable + to improve error reporting. Based on Michael Snyder + 2002-04-24 dated patch to c-exp.y. + * jv-exp.y: Likewise. + * m2-exp.y: Likewise. + +2002-05-02 Elena Zannoni + + * valops.c (value_arg_coerce): Don't coerce arrays to pointers if + we are dealing with vectors. + +2002-05-02 Pierre Muller + + * config/m68k/tm-nbsd.h: Obvious fix, + correct machine name. + +2002-05-02 Pierre Muller + + * p-typeprint.c (pascal_type_print_base): Add support + for TYPE_CODE_STRING and TYPE_CODE_BITSTRING. + +2002-05-02 Pierre Muller + + * p-lang.c (pascal_create_fundamental_type): Use TYPE_CODE_CHAR + for fondamental pascal 'char' type. + +2002-05-02 Pierre Muller + + * p-lang.h (is_pascal_string_type): Declaration changed, + new sixth argument of type char ** added. + * p-lang.c (is_pascal_string_type): Implementation + changed. Args length_pos, length_size, string_pos, char_size + can now be NULL. New argument arrayname set to the field + name of the char array. Return value set to char array + field index plus one. + * p-valprint.c (pascal_val_print): Adapt to new declaration of + is_pascal_string_type function. + +2002-05-02 Andrew Cagney + + * gdbarch.sh (gdbarch_update_p): Revert 2002-05-02 Andrew Cagney + change. + * gdbarch.c: Regenerate. + +2002-05-02 Andrew Cagney + + * gdbarch.sh (gdbarch_update_p): Swap out the old architecture + before probing for a new one. Detect errorenous gdbarch_init + functions. + * gdbarch.c: Regenerate. + +2002-05-01 Andrew Cagney + + * config/mn10200/tm-mn10200.h: Include "symfile.h" and "symtab.h". + * config/mcore/tm-mcore.h: Ditto. Update copyright. + * config/v850/tm-v850.h: Ditto. Update copyright. + +2002-04-30 Andrew Cagney + + * cris-tdep.c (cris_gdbarch_init): Use arches instead of + current_gdbarch. + +2002-04-30 Michael Snyder + + * arm-tdep.c: Whitespace clean-ups. + (arm_skip_prologue): Fix thinko; two lines + should have been removed as part of 4/24 change. + +2002-04-30 Kevin Buettner + + * rs6000-tdep.c: Added comment describing how fpscr register + numbers were chosen. + +2002-04-30 Michael Snyder + + * gnu-nat.c (gnu_find_memory_regions): Fix merge botch. + +2002-04-29 Elena Zannoni + + * hpread.c (DNTT_TYPE_VECTOR): Rename from TYPE_VECTOR. + (DNTT_TYPE_VECTOR_LENGTH): Rename from TYPE_VECTOR_LENGTH. + (hpread_symfile_init, hpread_lookup_type): Substitute throughout. + +2002-04-29 Kevin Buettner + + From Louis Hamilton : + * rs6000-tdep.c (coff/xcoff.h, libxcoff.h): Include. + * xcoffread.c (coff/xcoff.h, libxcoff.h): Likewise. + * rs6000-tdep.c (rs6000_gdbarch_init): Use bfd_xcoff_is_xcoff64(), + not bfd-private xcoff data, to determine wordsize. + * xcoffread.c (read_xcoff_xymtab, read_symbol_lineno): Likewise. + +2002-04-29 Andrew Cagney + + GDB 5.2 released from 5.2 branch. + +2002-04-29 Michal Ludvig + + * x86-64-linux-nat.c (fill_gregset): Explicit cast to avoid warning. + * x86-64-tdep.c (i386_gdbarch_init): Ditto. + (x86_64_register_info_table): Added comments with register numbers. + +2002-04-29 Elena Zannoni + + * rs6000-tdep.c (rs6000_extract_return_value, + rs6000_store_return_value): Handle returning vectors. + (rs6000_gdbarch_init): Use + ppc_sysv_abi_broken_use_struct_convention for native sysv cases. + * ppc-linux-tdep.c (ppc_sysv_abi_broken_use_struct_convention): + New function. + (ppc_sysv_abi_use_struct_convention): Deal with functions returning + vectors. + (ppc_sysv_abi_push_arguments): Handle vector parameters. + * ppc-tdep.h (ppc_sysv_abi_broken_use_struct_convention): Export. + +2002-04-24 Pierre Muller + + * hpread.c (hpread_psymtab_to_symtab_1, + hpread_psymtab_to_symtab): Replace fprintf tab_to_s...) + with fprintf_unfiltered (gdb_stderr,...). + +2002-04-24 Pierre Muller + + * remote-array.c (printf_monitor, write_monitor, + array_insert_breakpoint, array_remove_breakpoint ): + Replace fprintf (stderr,... + with fprintf_unfiltered (gdb_stderr,.... + * remote-es.c: Likewise. + * remote-os9k.c: Likewise. + * remote-st.c: Likewise. + +2002-04-28 Andreas Schwab + + * config/s390/s390.mh (NATDEPFILES): Remove solib.o, add + linux-proc.o and gcore.o. + +2002-04-26 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging + code without frame pointers. + +2002-04-26 Andrew Cagney + + * sparc-tdep.c (sparc_gdbarch_init): Add comment explaining why + ON_STACK is needed. + +2002-04-26 Ben Elliston + + * target.c (do_xfer_memory): Correct reference to the new option + "trust-readonly-sections". + +2002-04-26 Elena Zannoni + + * gdbtypes.h (TYPE_FLAG_VECTOR, TYPE_VECTOR): Define. + * gdbtypes.c (recursive_dump_type): Output the vector flag. + * dwarf2read.c (dwarf_attr_name): Handle new attribute for + vectors. + (read_array_type): Record the fact that this array type is really a + vector (i.e. are passed in by value). + +2002-04-26 Jason Thorpe + + * alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member. + * alpha-tdep.c (alpha_sigcontext_addr): New function. + (alpha_find_saved_regs): Use alpha_sigcontext_addr. + (alpha_gdbarch_init): Initialize tdep->sigcontext_addr. + * alpha-linux-tdep.c: Include frame.h. + (alpha_linux_sigcontext_addr): New function. + (alpha_linux_init_abi): Set tdep->sigcontext_addr to + alpha_linux_sigcontext_addr. + * alpha-osf1-tdep.c: Include gdbcore.h. + (alpha_osf1_sigcontext_addr): New function. + (alpha_osf1_init_abi): Set tdep->sigcontext_addr to + alpha_osf1_sigcontext_addr. + * config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove. + * config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove. + +2002-04-26 Andrew Cagney + + * stack.c (selected_frame_level): + (select_frame): Do not set selected_frame_level. + * frame.h (selected_frame_level): Delete declaration. + +2002-04-26 Andrew Cagney + + * rs6000-tdep.c (rs6000_gdbarch_init): Only set + convert_from_func_ptr-addr when AIX / PowerOpen. + +2002-04-25 Andrew Cagney + + * valops.c (hand_function_call): Call + generic_save_call_dummy_addr. + * frame.h (generic_save_call_dummy_addr): Declare. + * blockframe.c (struct dummy_frame): Add fields call_lo and + call_hi. + (generic_find_dummy_frame): Check for PC in range call_lo to + call_hi instead of entry_point_address. + (generic_pc_in_call_dummy): Search the dummy frames for a PC in + the call_lo to call_hi range. Allow for DECR_PC_AFTER_BREAK. + (generic_save_call_dummy_addr): New function. + +2002-04-24 David S. Miller + + * sparc-tdep.c (sparc_gdbarch_skip_prologue): Kill, duplicates + sparc_skip_prologue. + (sparc_skip_prologue): Kill frameless_p arg, and use line number + information to find prologue when possible. + (sparc_prologue_frameless_p): Call examine_prologue directly. + (sparc_gdbarch_init): Update set_gdbarch_skip_prologue call. + * config/sparc/tm-sparc.h (sparc_skip_prologue): Update for killed + second argument. + (SKIP_PROLOGUE): Likewise. + +2002-04-25 Jason Thorpe + + * alpha-tdep.c (alpha_skip_prologue_internal): Remove + GDB_TARGET_HAS_SHARED_LIBS #ifdef and update comment to + indicate that the condition it was testing is always true. + * config/alpha/nm-linux.h (GDB_TARGET_HAS_SHARED_LIBS): Remove. + * config/alpha/nm-nbsd.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto. + * config/alpha/nm-osf.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto. + +2002-04-25 Jason Thorpe + + * alpha-tdep.h (gdbarch_tdep): Add jb_pc and jb_elt_size members. + * alpha-linux-tdep.c (alpha_linux_init_abi): Initialize + tdep->jb_pc and tdep->jb_elt_size. + * alpha-osf1-tdep.c (alpha_osf1_init_abi): Likewise. + * alphafbsd-tdep.c (alphafbsd_init_abi): Likewise. + * alphanbsd-tdep.c (alphanbsd_init_abi): Likewise. + * alpha-nat.c (get_longjmp_target): Remove. + (JB_ELEMENT_SIZE): Ditto. + (JB_PC): Ditto. + * alpha-tdep.c (alpha_get_longjmp_target): New function. + (alpha_gdbarch_init): Default tdep->jb_pc to -1. If the + OS ABI sets jb_pc to a valid value, set gdbarch_get_longjmp_target + to alpha_get_longjmp_target. + (alpha_dump_tdep): Report tdep->jb_pc and tdep->jb_elt_size. + * config/alpha/nm-linux.h (GET_LONGJMP_TARGET): Remove. + * config/alpha/nm-osf.h (GET_LONGJMP_TARGET): Remove. + +2002-04-25 Andrew Cagney + + * README: Update to GDB 5.2. + +2002-04-25 Andrew Cagney + + * gdbarch.sh (LC_ALL): Set to `c'. + +2002-04-25 Theodore A. Roth + + * avr-tdep.c: Ran through gdb_indent.sh. + +2002-04-25 Theodore A. Roth + + * MAINTAINERS: Add myself as AVR maintainer. + * NEWS: Note new target avr. + +2002-04-25 Theodore A. Roth + + * Makefile.in: Add support for AVR target. + * configure.tgt: Add support for AVR target. + * avr-tdep.c: New file + * config/avr/avr.mt: New file. + +2002-04-25 Theodore A. Roth + + * MAINTAINERS: Add myself to write-after-approval. + +2002-04-24 Pierre Muller + + * f-lang.c (get_bf_for_fcn): Replace fprintf (stderr,... + with fprintf_unfiltered (gdb_stderr,.... + +2002-04-25 Pierre Muller + + Fix PR gdb/508. + * symfile.c (add_filename_language): Fix wrong xrealloc size argument. + +2002-04-25 Pierre Muller + + * p-exp.y: Also use new prev_lexptr variable + to improve error reporting. Based on Michael Snyder + 2002-04-24 dated patch to c-exp.y. + +2002-04-25 Jason Thorpe + + * alpha-tdep.c (alpha_breakpoint_from_pc): New function. + (alpha_gdbarch_init): Set gdbarch_breakpoint_from_pc to + alpha_breakpoint_from_pc. Set gdbarch_function_start_offset + to 0. + * config/alpha/tm-alpha.h: Remove forward decls of struct type + and struct value. + (FUNCTION_START_OFFSET): Remove. + (BREAKPOINT): Ditto. + +2002-04-25 Jason Thorpe + + * MAINTAINERS: Reflect that multi-arch is enabled for VAX. + * NEWS: Ditto. + +2002-04-24 Jason Thorpe + + * alpha-linux-tdep.c (alpha_linux_pc_in_sigtramp): New function. + (alpha_linux_init_abi): Set gdbarch_pc_in_sigtramp to + alpha_linux_pc_in_sigtramp. + * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): New function. + (alpha_osf1_init_abi): Set gdbarch_pc_in_sigtramp to + alpha_osf1_pc_in_sigtramp. + * alpha-tdep.c (alpha_osf_in_sigtramp): Remove. + * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): New function. + (alphafbsd_init_abi): Set gdbarch_pc_in_sigtramp to + alphafbsd_pc_in_sigtramp. + * alphanbsd-tdep.c (alphanbsd_pc_in_sigtramp): New function. + (alphanbsd_init_abi): Set gdbarch_pc_in_sigtramp to + alphanbsd_pc_in_sigtramp. + * config/alpha/tm-alpha.h (IN_SIGTRAMP): Remove. + * config/alpha/tm-alphalinux.h (IN_SIGTRAMP): Remove. + +2002-04-24 Jason Thorpe + + * config/alpha/nbsd.mh (NATDEPFILES): Remove solib-legacy.o. + +2002-04-24 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alphanbsd-nat.c and + alphanbsd-tdep.c. + (alphanbsd-nat.o): New dependency list. + (alphanbsd-tdep.o): Ditto. + * NEWS: Note new native NetBSD/alpha configuration. + * alphanbsd-nat.c: New file. + * alphanbsd-tdep.c: Ditto. + * configure.host (alpha*-*-netbsd*): New host. + * configure.tgt (alpha*-*-netbsd*): New target. + * config/alpha/nbsd.mh: New file. + * config/alpha/nbsd.mt: Ditto. + * config/alpha/nm-nbsd.h: Ditto. + * config/alpha/tm-nbsd.h: Ditto. + +2002-04-24 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alpha-osf1-tdep.c. + (alpha-osf1-tdep.o): New dependency list. + * alpha-tdep.h (gdbarch_tdep): Add dynamic_sigtramp_offset + and skip_sigtramp_frame members. + * alpha-linux-tdep.c: Include gdbcore.h. + (alpha_linux_sigtramp_offset): Change return type to LONGEST. + (alpha_linux_init_abi): Initialize tdep->dynamic_sigtramp_offset. + * alpha-osf1-tdep.c: New file. + * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Moved to + alpha-osf1-dep.c. + (alpha_frame_past_sigtramp_frame): New function. + (alpha_dynamic_sigtramp_offset): Ditto. + (alpha_proc_desc_is_dyn_sigtramp): Ditto. + (alpha_set_proc_desc_is_dyn_sigtramp): Ditto. + (ALPHA_PROC_SIGTRAMP_MAGIC): Define. + (push_sigtramp_desc): Use alpha_set_proc_desc_is_dyn_sigtramp. + (after_prologue): Use alpha_proc_desc_is_dyn_sigtramp. + (find_proc_desc): Use alpha_dynamic_sigtramp_offset. + (alpha_frame_chain): Use alpha_frame_past_sigtramp_frame. + (alpha_init_extra_frame_info): Use alpha_proc_desc_is_dyn_sigtramp. + (alpha_pop_frame): Use alpha_proc_desc_is_dyn_sigtramp. + (alpha_gdbarch_init): Initialize tdep->dynamic_sigtramp_offset + and tdep->skip_sigtramp_frame. Set gdbarch_skip_trampoline_code + to find_solib_trampoline_target. + * config/alpha/alpha-osf1.mt (TDEPFILES): Add alpha-osf1-tdep.o. + * config/alpha/tm-alpha.h: Remove inclusion of regcache.h. + (SKIP_TRAMPOLINE_CODE): Remove. + (PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (DYNAMIC_SIGTRAMP_OFFSET): Ditto. + (FRAME_PAST_SIGTRAMP_FRAME): Ditto. + * config/alpha/tm-alphalinux.h (PROC_DESC_IS_DYN_SIGTRAMP): Remove. + (PROC_SIGTRAMP_MAGIC): Ditto. + (PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto. + (DYNAMIC_SIGTRAMP_OFFSET): Ditto. + (FRAME_PAST_SIGTRAMP_FRAME): Ditto. + +2002-04-24 Jason Thorpe + + * NEWS: Note that Alpha targets are now multi-arch. + +2002-04-24 Michael Snyder + + * parser-defs.h (prev_lexptr): New external variable. + * parse.c (parse_exp_1): Set prev_lexptr to null before + calling the language-specific parser. + * c-exp.y (yylex): Set prev_lexptr to start of current token. + (yyerror): Use prev_lexptr in error reporting. + +2002-04-24 Daniel Jacobowitz + + * config/i386/tm-linux.h: Define FILL_FPXREGSET. + * gregset.h: If FILL_FPXREGSET is defined, provide + gdb_fpxregset_t, supply_fpxregset, and fill_fpxregset. + * linux-proc.c (linux_do_thread_registers): If FILL_FPXREGSET + is defined, call fill_fpxregset. + +2002-04-24 Roland McGrath + + * config/i386/i386gnu.mh (NATDEPFILES): Add core-regset.o here. + * i386gnu-nat.c [HAVE_SYS_PROCFS_H] + (supply_gregset, supply_fpregset): New functions. + + * gnu-nat.c (gnu_find_memory_regions): New function. + (init_gnu_ops): Set `to_find_memory_regions' hook to that. + (gnu_xfer_memory): Add a cast. + +2002-04-24 Michael Snyder + + * arm-tdep.c (arm_scan_prologue): Move "mov ip, sp" into the + loop. Add handling for "str lr, [sp, #-4]!" and for saves + of argument regs ("str r(0123), [r11, #-nn"]). + (arm_skip_prologue): Better handling for frameless functions. + Treat "mov ip, sp" as optional. Recognize "str lr, [sp, #-4]". + (arm_skip_prologue): Recognize str r(0123), [r11, #-nn]. + +Wed Apr 24 14:22:21 2002 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Add comment that NUM_REGS nor + NUM_PSEUDO_REGS can be used. + +2002-04-24 Andrew Cagney + + * arch-utils.h: Update copyright. + + * gdbarch.sh (PC_IN_SIGTRAMP): Add. + * gdbarch.h, gdbarch.c: Re-generate. + + * inferior.h (IN_SIGTRAMP): Delete definition. + * arch-utils.c (legacy_pc_in_sigtramp): New function. + * arch-utils.h (legacy_pc_in_sigtramp): Declare. + + * mips-tdep.c (mips_init_extra_frame_info): Use PC_IN_SIGTRAMP. + (mips_dump_tdep): Do not print value of IN_SIGTRAMP. + * hppa-tdep.c (pc_in_interrupt_handler): Use PC_IN_SIGTRAMP. + (find_proc_framesize): Ditto. + * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Ditto. + (alpha_init_extra_frame_info): Ditto. + * infrun.c (handle_inferior_event): Ditto. + (handle_inferior_event): Ditto. + (check_sigtramp2): Ditto. + * blockframe.c (create_new_frame): Ditto. + (get_prev_frame): Ditto. + * ppc-linux-tdep.c: Update comments. + * i386-linux-tdep.c: Update comments. + * breakpoint.c (bpstat_what): Update comment. + +2002-04-24 David S. Miller + + * i960-tdep.c (register_in_window_p): New function. + (i960_find_saved_register): Use it instead of + REGISTER_IN_WINDOW_P. + * config/i960/tm-i960.h (REGISTER_IN_WINDOW): Delete. + + * symtab.h (find_stab_function_addr): Kill extern. + * minsyms.c (find_stab_function_addr): Remove from here... + * dbxread.c: ... to here, and mark it static. + +2002-04-20 David S. Miller + + * sparc-tdep.c (sparc_pop_frame): Only need to allocate + SPARC_INTREG_SIZE * 16 bytes for reg_temp. + +2002-04-21 David S. Miller + + * remote-vxsparc.c (vx_read_register): Fix typo, we want + REGISTER_RAW_SIZE of SP_REGNUM not CORE_ADDR. + (vx_write_register): Likewise. + +2002-04-23 J. Brobecker + + * source.c (is_regular_file): New function. + (openp): Check wether file to open is a regular file + to avoid opening directories. + +2002-04-22 Jason Thorpe + + * findvar.c (extract_signed_integer): Cast printf argument + to suppress format warning. + (extract_unsigned_integer): Likewise. + * infcmd.c (registers_info): Likewise. + * top.c (get_prompt_1): Likewise. + * valops.c (value_assign): Likewise. + * valprint.c (print_decimal): Likewise. + +2002-04-22 H.J. Lu (hjl@gnu.org) + + * c-exp.y (typebase): Support + + [long|long long|short] [signed|unsigned] [int|] + + and + + signed [long|long long|short] int + +2002-04-22 Jason Thorpe + + * Makefile.in (vax-tdep.o): Add $(arch_utils_h), $(inferior_h), + and vax-tdep.h. + * vax-tdep.h: New file. + * vax-tdep.c: Include inferior.h, arch-utils.h, and vax-tdep.h. + Make several routines static. + (vax_get_saved_register): New function. + (vax_gdbarch_init): New function. + (_initialize_vax_tdep): Register vax_gdbarch_init. + * config/vax/tm-vax.h: Set GDB_MULTI_ARCH to GDB_MULTI_ARCH_PARTIAL. + Remove macros now under the control of gdbarch. + +2002-04-22 Michael Snyder + + * arm-tdep.c (arm_skip_prologue): Recognize "sub sp, sp, #nn". + Some whitespace and coding standards tweaks. + +2002-04-22 Jason Thorpe + + * vax-tdep.c: Include regcache.h. + (vax_call_dummy_words): New. + (sizeof_vax_call_dummy_words): New. + (vax_fix_call_dummy): New function. + (vax_saved_pc_after_call): Ditto. + * config/vax/tm-vax.h: Don't include regcache.h. + (SAVED_PC_AFTER_CALL): Use vax_saved_pc_after_call. + (CALL_DUMMY): Remove. + (CALL_DUMMY_WORDS): Define. + (SIZEOF_CALL_DUMMY_WORDS): Define. + (FIX_CALL_DUMMY): Use vax_fix_call_dummy. + +2002-04-18 Michael Snyder + + * arm-tdep.h: Change regnum defines to enums for ease of debugging. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_frame_chain): New function. + (vax_push_dummy_frame): Ditto. + (vax_pop_frame): Ditto. + * config/vax/tm-vax.h (FRAME_CHAIN): vax_frame_chain. + (FRAMELESS_FUNCTION_INVOCATION): Use + generic_frameless_function_invocation_not. + (PUSH_DUMMY_FRAME): Use vax_push_dummy_frame. + (POP_FRAME): Use vax_pop_frame. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_store_struct_return): New function. + (vax_extract_return_value): Ditto. + (vax_store_return_value): Ditto. + (vax_extract_struct_value_address): Ditto. + * config/vax/tm-vax.h (STORE_STRUCT_RETURN): Use + vax_store_struct_return. + (EXTRACT_RETURN_VALUE): Use vax_extract_return_value. + (STORE_RETURN_VALUE): Use vax_store_return_value. + (EXTRACT_STRUCT_VALUE_ADDRESS): Use vax_extract_struct_value_address. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_frame_saved_pc): New function. + (vax_frame_args_address_correct): Ditto. + (vax_frame_args_address): Ditto. + (vax_frame_locals_address): Ditto. + (vax_frame_num_args): Move code to be in proximity to + other frame-related functions. + * config/vax/tm-vax.h (INNER_THAN): Use core_addr_lessthan. + (FRAME_SAVED_PC): Use vax_frame_saved_pc. + (FRAME_ARGS_ADDRESS_CORRECT): Use vax_frame_args_address_correct. + (FRAME_ARGS_ADDRESS): Use vax_frame_args_address. + (FRAME_LOCALS_ADDRESS): Use vax_frame_locals_address. + +2002-04-22 H.J. Lu (hjl@gnu.org) + + * Makefile.in (FLAGS_TO_PASS): Add libdir, mandir, datadir and + includedir. + +2002-04-22 Jason Thorpe + + * vax-tdep.c (vax_frame_init_saved_regs): New function. + * config/vax/tm-vax.h (FRAME_FIND_SAVED_REGS): Remove. + (FRAME_INIT_SAVED_REGS): New macro. + +2002-04-22 Jason Thorpe + + * MAINTAINERS: Reflect that the Alpha target has been multi-arch'd. + +2002-04-22 Jason Thorpe + + * alpha-nat.c (get_longjmp_target): Use ALPHA_* constants + where needed. + (fetch_osf_core_registers): Likewise. + (supply_gregset): Likewise. + +2002-04-22 J. Brobecker + + * symfile.h (get_section_index): Define. + * symfile.c (get_section_index): New function. + * mdebugread.c (SC_IS_SBSS): New macro. + (SC_IS_BSS): Return true for the scBss storage class only, as + the scSBss storage class refers to the .sbss section. + (parse_partial_symbols): Discard the symbols which associated + section does not exist. + Make sure to use the .sbss section index for symbols which + storage class is scBss, rather than using the .bss section index. + +2002-04-22 Jason Thorpe + + * vax-tdep.c: Update copyright years. + (vax_register_name): New function. + (vax_register_byte): Ditto. + (vax_register_raw_size): Ditto. + (vax_register_virtual_size): Ditto. + (vax_register_virtual_type): Ditto. + * config/vax/tm-vax.h: Update copyright years. + (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define. + (REGISTER_BYTE): Use vax_register_byte. + (REGISTER_RAW_SIZE): Use vax_register_raw_size. + (REGISTER_VIRTUAL_SIZE): Use vax_register_virtual_size. + (REGISTER_VIRTUAL_TYPE): Use vax_register_virtual_type. + +2002-04-21 Andrew Cagney + + * config/sparc/tm-sparc.h (sparc_skip_prologue): Restore + declaration + * arc-tdep.c (arc_prologue_frameless_p): Fix syntax error. + +2002-04-21 David S. Miller + + * arch-utils.c (generic_prologue_frameless_p): Kill + SKIP_PROLOGUE_FRAMELESS_P code. + * config/arc/tm-arc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete + references. + (PROLOGUE_FRAMELESS_P, arc_prologue_frameless_p): New. + * arc-tdep.c (arc_prologue_frameless_p): Implement. + * config/arc/tm-sparc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete + references. + (PROLOGUE_FRAMELESS_P, sparc_prologue_frameless_p): New. + * sparc-tdep.c (sparc_prologue_frameless_p): Implement. + (sparc_gdbarch_init): Pass it to + set_gdbarch_prologue_frameless_p. + +2002-04-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alphabsd-nat.c. + (alphabsd-nat.o): New dependency list. + +2002-04-21 Jason Thorpe + + * Makefile.in (ALLDEPFILES): Add alpha-linux-tdep.c and + alphafbsd-tdep.c. + (alpha-linux-tdep.o): New dependency list. + (alphafbsd-tdep.o): Likewise. + +2002-04-21 Jason Thorpe + + * alpha-linux-tdep.c: New file. Move alpha_linux_sigtramp_offset + to here... + * alpha-tdep.c: ...from here. + * config/alpha/alpha-linux.mt (TDEPFILES): Add alpha-linux-tdep.o. + +2002-04-21 Jason Thorpe + + * config/alpha/tm-alpha.h: Move alpha_software_single_step + prototype from here... + * alpha-tdep.h: ...to here. + +2002-04-21 Andrew Cagney + + * frame.h (selected_frame_level): Document as deprecated. + (frame_relative_level): Declare. + * stack.c (frame_relative_level): New function. + (selected_frame_level): Document as deprecated. + (select_frame): Do not set the selected_frame_level. + + * stack.c (frame_info, record_selected_frame): Update. + (frame_command, current_frame_command): Update. + (up_silently_base, up_command, down_silently_base): Update. + (down_command): Update. + * inflow.c (kill_command): Update. + * tracepoint.c (finish_tfind_command): Update. + * corelow.c (core_open): Update. + * thread.c (info_threads_command): Update. + (do_captured_thread_select): Update. + * infcmd.c (finish_command): Update. + * breakpoint.c (insert_breakpoints, do_enable_breakpoint): Update. + +2002-04-21 Jason Thorpe + + * config/alpha/tm-fbsd.h (FRAME_CHAIN_VALID): Remove. + +2002-04-21 Andrew Cagney + + * arm-tdep.c (arm_breakpoint_from_pc): Make static. Make return + type const. + +2002-04-21 Jason Thorpe + + * alphafbsd-tdep.c: Update copyright years. Include + alpha-tdep.h. + (alphafbsd_use_struct_convention): Make static. + (alphafbsd_init_abi): New function. + (_initialize_alphafbsd_tdep): New function. + * config/alpha/tm-fbsd.h: Update copyright years. + (USE_STRUCT_CONVENTION): Remove. + +2002-04-21 Jason Thorpe + + * alpha-tdep.c (alpha_abi_handler): New structure to describe + an Alpha ABI variant. + (alpha_abi_handler_list): Declare. + (alpha_gdbarch_register_os_abi): New function. + (alpha_gdbarch_init): Give registered ABI variant handlers a + chance to tweak the gdbarch once we have set up defaults. + * alpha-tdep.h: Prototype alpha_gdbarch_register_os_abi. + +2002-04-21 Jason Thorpe + + * alpha-tdep.c (alpha_gdbarch_init): Set coerce_float_to_double + to standard_coerce_float_to_double. + * config/alpha/tm-alpha.h (COERCE_FLOAT_TO_DOUBLE): Remove. + +2002-04-21 Jason Thorpe + + * alpha-tdep.h (gdbarch_tdep): Add vm_min_address member. + * alpha-tdep.c (heuristic_proc_start): Use vm_min_address + from gdbarch_tdep rather than a constant. + (alpha_gdbarch_init): Initialize tdep->vm_min_address to + the default text address for all Alpha Unix ABIs. + (alpha_dump_tdep): Report the value of tdep->vm_min_address. + * config/alpha/tm-alpha.h (VM_MIN_ADDRESS): Delete. + +2002-04-21 Jason Thorpe + + * alpha-tdep.h: New file. Includes several Alpha target constants + taken from... + * config/alpha/tm-alpha.h: ...here. Remove macros that we now + let gdbarch deal with. + (GDB_MULTI_ARCH): Define as GDB_MULTI_ARCH_PARTIAL. + * Makefile.in (alpha-nat.o): Add alpha-tdep.h and $(BFD_SRC)/elf-bfd + to dependency list. + * alpha-nat.c: Include alpha-tdep.h. Update for adjusted + Alpha target register names. + * alphabsd-nat.c: Likewise. + * alpha-tdep.c: Include alpha-tdep.h. Update for adjusted + Alpha target register names. Make serveral routines static. + (alpha_get_saved_register): New function. + (alpha_abi_names): New. + (process_note_abi_tag_sections): New function. + (get_elfosabi): New function. + (alpha_gdbarch_init): New function. + (alpha_dump_tdep): New function. + (_initialize_alpha_tdep): Register alpha_gdbarch_init. + +2002-04-21 Andrew Cagney + + * frame.c (find_saved_register): Delete #ifdef + HAVE_REGISTER_WINDOWS code. + * config/sparc/tm-sparc.h: Update comments. + * config/i960/tm-i960.h (HAVE_REGISTER_WINDOWS): Delete macro. + +2002-04-21 Andrew Cagney + + * i960-tdep.c (i960_find_saved_register): New function. + (i960_get_saved_register): New function. + * config/i960/tm-i960.h (GET_SAVED_REGISTER): Define. + (i960_get_saved_register): Declare. + * config/i960/tm-i960.h, i960-tdep.c: Update copyright. + +2002-04-20 David S. Miller + + * sparc-nat.c (store-inferior_registers): Fix ambiguous else. + +2002-04-20 Andrew Cagney + + * arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs + instead of NUM_PSEUDO_REGS. + +2002-04-20 David S. Miller + + * config/sparc/tm-linux.h (GDB_MULTI_ARCH): Define to + GDB_MULTI_ARCH_PARTIAL + * config/sparc/tm-sp64linux.h (GDB_MULTI_ARCH): Do not + define, let tm-sp64.h do it. + +2002-04-20 Jason Thorpe + + * frame.c (find_saved_register): Avoid a NULL pointer + dereference and actually walk the frame list. + +2002-04-20 Andrew Cagney + + * gdbarch.sh (gdbarch_update_p): Keep the list of architectures + sorted in most most-recent-used order. Document. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-04-19 Andrew Cagney + + * sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame + instead of ->prev. + * z8k-tdep.c (z8k_frame_chain): Do not use ->prev. + * s390-tdep.c (s390_frame_chain): Do not use ->prev. + * rs6000-tdep.c (frame_get_saved_regs): Use rs6000_frame_chain() + instead of ->prev. + +2002-04-19 Elena Zannoni + + Fix PR gdb/471. + * gdbtypes.c (init_simd_type): Rewrite using new functions. + (build_builtin_type_vec128): Ditto. + (append_composite_type_field): Fix calculation of type length in + union case. + +2002-04-19 Eli Zaretskii + + * config/djgpp/README: Update. + + * go32-nat.c (store_register): Cast &a_tss to `char *' to avoid a + compiler warnings. + +2002-04-19 Jason Thorpe + + * alpha-tdep.c (setup_arbitrary_frame): Rename... + (alpha_setup_arbitrary_frame): ...to this. + * config/alpha/tm-alpha.h (SETUP_ARBITRARY_FRAME): Update + for alpha_setup_arbitrary_frame. + +2002-04-18 Andrew Cagney + + * gdbarch.sh (BREAKPOINT_FROM_PC): Return a const buffer. + * gdbarch.h, gdbarch.c: Regenerate. + + * defs.h (breakpoint_from_pc_fn): Delete type definition. + * target.h (memory_breakpoint_from_pc): Update declaration. + * config/mcore/tm-mcore.h (mcore_breakpoint_from_p): Ditto. + + * arch-utils.c (legacy_breakpoint_from_pc): Update return type. + * mcore-tdep.c (mcore_breakpoint_from_pc): Ditto. + * mem-break.c (memory_breakpoint_from_pc): Ditto. + * rs6000-tdep.c (rs6000_breakpoint_from_pc): Ditto. + * s390-tdep.c (s390_breakpoint_from_pc): Ditto + * xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Ditto. + * mn10300-tdep.c (mn10300_breakpoint_from_pc): Ditto. + * mips-tdep.c (mips_breakpoint_from_pc): Ditto. + * m68hc11-tdep.c (m68hc11_breakpoint_from_pc): Ditto. + * ia64-tdep.c (ia64_breakpoint_from_pc): Ditto. + * d10v-tdep.c (d10v_breakpoint_from_pc): Ditto. + * arch-utils.c (legacy_breakpoint_from_pc): Ditto.. + + * mem-break.c (default_memory_insert_breakpoint): Make `bp' a + const pointer. + * monitor.c (monitor_insert_breakpoint): Ditto. + * rs6000-tdep.c (rs6000_software_single_step): Ditto for `breakp'. + + * config/mcore/tm-mcore.h: Update copyright. + * mem-break.c: Ditto. + * xstormy16-tdep.c: Ditto. + +2002-04-18 Pierre Muller + + * p-exp.y: Add precedence rule for '^' token. + This removes the shift/reduce conflicts. + Remove the comment concerning these shift/reduce conflicts. + +2002-04-18 Elena Zannoni + + * rs6000-tdep.c (COMMON_UISA_NOFP_REGS): New macro. + (registers_powerpc_nofp): New register set for processors + without floating point unit. + +2002-04-18 David S. Miller + + * MAINTAINERS: Add myself to write-after-approval. + +2002-04-17 Michael Snyder + + * MAINTAINERS: Add myself as co-maintainer of testsuite/gdb.asm. + +2002-04-17 Andrew Cagney + + * rs6000-tdep.c (frame_initial_stack_address): Use + frame_register_read to read the alloca_reg. + +2002-04-17 Andrew Cagney + + * frame.c (find_saved_register): Find saved registers in the next + not prev frame. + Fix PR gdb/365. + +2002-04-17 Andrew Cagney + + * gdbarch.sh (LANG): Set to ``c''. + +2002-04-15 Andrew Cagney + + * PROBLEMS: Mention hppa2.0-hp-hpux10.20 compile problems. + +2002-04-15 Andrew Cagney + + * bcache.c: Include and after "defs.h". + Update copyright. + + * hpread.c (hpread_get_lntt): Add declaration. + Also fix PR gdb/391. + +2002-04-14 Andrew Cagney + + * acinclude.m4 (AM_PROG_CC_STDC): Import from automake 1.6. + * aclocal.m4, configure: Re-generate. + Fix PR gdb/391. + +2002-04-14 Elena Zannoni + + * mi/mi-cmd-disas.c (dump_insns): Use TARGET_PRINT_INSN + instead of tm_print_insn. + +2002-04-14 Elena Zannoni + + * ppc-bdm.c (bdm_ppc_fetch_registers): Fix typo. + +2002-04-14 Andrew Cagney + + * config/pa/tm-hppa.h (FRAME_CHAIN_COMBINE): Delete macro. + * blockframe.c (FRAME_CHAIN_COMBINE): Delete macro. + (get_prev_frame): Do not call FRAME_CHAIN_COMBINE. + +2002-04-12 Don Howard + + * cli/cli-cmds.c (init_cli_cmds): Add new user settable value: + max_user_call_depth. + (init_cmd_lists): Initialize the new value; + * cli/cli-script.c (execute_user_command): Limit the call depth of + user defined commands. This avoids a core-dump when user commands + are infinitly recursive. + +2002-04-12 Kevin Buettner + + * ppc-tdep.h (struct gdbarch_tdep): Add new member ``lr_frame_offset''. + * rs6000-tdep.c (rs6000_frame_saved_pc): Use ``lr_frame_offset'' + from tdep struct instead of DEFAULT_LR_SAVE. + (rs6000_gdbarch_init): Initialize ``lr_frame_offset''. + * config/powerpc/tm-ppc-eabi.h (DEFAULT_LR_SAVE): Delete. + * config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Delete. + +2002-04-12 Michael Snyder + + * Remote.c: Spelling fix. + * gcore.c (default_derive_heap_segment): Use bfd_section_name. + If no symbol found for "sbrk", try "_sbrk". + (make_output_phdrs): Use bfd_section_name. + (gcore_copy_callback): Use bfd_section_name. + * eval.c: Indentation fix-ups. + * d10v-tdep.c (d10v_make_iaddr): Make it idempotent, + in case it gets applied to an address that is already + in the instruction space. + * cli/cli-decode.c (help_list): Allow long lines to wrap. + * symfile.c: Fix indentation, long lines. + * source.c: White space fix-up. + +2002-04-12 Andrew Cagney + + * defs.h (read_relative_register_raw_bytes): Delete declaration. + * frame.c (frame_register_read): New function. Return non-zero on + success. + (read_relative_register_raw_bytes_for_frame): Delete. + (read_relative_register_raw_bytes): Delete. + * frame.h (frame_register_read): Declare. + * d30v-tdep.c: Update Copyright. Use frame_register_read. + * sh-tdep.c: Ditto. + * infcmd.c (do_registers_info): Ditto. + * hppa-tdep.c: Ditto. + * rs6000-tdep.c: Ditto. + * h8500-tdep.c: Ditto. + * mips-tdep.c: Ditto. + * h8300-tdep.c: Ditto. + * z8k-tdep.c: Ditto. + +2002-04-12 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_gdbarch_init): Use rs6000_* methods for + 64-bit SysV ABI. + +2002-04-12 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_gdbarch_init): Compute ``wordsize'' from + bfd info. + +2002-04-12 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (powerpc64, 630, rs64ii, rs64iii): Define + register sets for these processor variants. + +2002-04-11 Daniel Jacobowitz + + * regformats/reg-ppc.dat: Support FPSCR. + +2002-04-11 Kevin Buettner + + * ppc-tdep.h (struct gdbarch_tdep): Add new field ``ppc_fpscr_regnum''. + * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers): + Add fpscr as an invalid/unfetchable register. + * ppc-linux-nat.c (ppc_register_u_addr, store_register) + (fetch_ppc_registers, store_ppc_registers, supply_fpregset) + (fill_fpregset): Add support for register fpscr. + (fetch_ppc_registers, store_ppc_registers, supply_gregset) + (fill_gregset): Account for the fact that register ``mq'' might + not exist. + * rs6000-tdep.c (PPC_UISA_SPRS): Use (unused) slot 70 for fpscr. + (registers_power): Add fpscr to register set at slot 71. + (rs6000_gdbarch_init): Account for the fact that ``mq'' doesn't + exist on most PPC architectures. Initialize ppc_fpscr_regnum. + +2002-04-11 Michael Snyder + + * configure.in: Autoconfiscate _SYSCALL32 define for solaris. + * configure: Regenerate. + * config.in: Regenerate. + * acconfig.h: Add define for _SYSCALL32. + * core-sol2.c: Remove #define _SYSCALL32. + * solib-legacy.c: Remove #define _SYSCALL32. + +2002-04-10 Andrew Cagney + + * stack.c (select_frame): Cleanup internal error message, do not + use %p. + +2002-04-10 Andrew Cagney + + * stack.c (select_frame): Check that selected_frame and the + specified level are as expected. + * blockframe.c (get_prev_frame): Set the `level' from next_frame. + Update copyright. + * frame.h (struct frame_info): Add field `level'. Update + copyright. + Work-in-progress PR gdb/464. + +2002-04-10 Andrew Cagney + + * maint.c (maint_print_section_info): Rename print_section_info. + (print_bfd_section_info, print_objfile_section_info): Update. + * inferior.h (struct gdbarch): Add opaque declaration. + * gdbarch.sh: Add include of "inferior.h" to gdbarch.sh. + * gdbarch.h: Regenerate. + +2002-04-10 Michal Ludvig + + * x86-64-linux-nat.c (child_resume, child_xfer_memory): Delete. + (PTRACE_XFER_TYPE): Moved to config/i386/nm-x86-64.h. + (kernel_u_size): Added. + * config/i386/nm-x86-64.h (CHILD_XFER_MEMORY, CHILD_RESUME): Delete. + (PTRACE_XFER_TYPE): Moved here from config/i386/nm-x86-64.h. + +2002-04-04 Jim Ingham + + * valarith.c (find_size_for_pointer_math): New function, either returns + the size for a pointer's target, returns 1 for void *, or errors for + incomplete types. + (value_add, value_sub): use find_size_for_pointer_math. + +2002-04-09 Daniel Jacobowitz + + * linux-low.c (linux_look_up_symbols): New hook. + (linux_target_ops): Add linux_look_up_symbols. + * remote-utils.c (decode_address): New function. + (look_up_one_symbol): New function. + * server.c (handle_query): Call target look_up_symbols hook. + * server.h (look_up_one_symbol): Add prototype. + * target.h (struct target_ops): Add look_up_symbols hook. + +2002-04-09 Andrew Cagney + + * frame.c (read_relative_register_raw_bytes_for_frame): Do not + override FP_REGNUM with frame->fp. Update copyright. + * parse.c (num_std_regs, std_regs): Delete. + (target_map_name_to_register): Do not search std_regs. Update + function description. + * parser-defs.h (num_std_regs, std_regs, struct std_regs): Delete + declarations. Update copyright. + Fix PR gdb/251. + +2002-04-09 Daniel Jacobowitz + + * symtab.h (ALL_BLOCK_SYMBOLS): Don't dereference the pointer + after the last symbol in a block. + +2002-04-09 Pierre Muller + + * p-exp.y (yylex): Handle also the fact that is_a_field_of_this + is non zero as a found symbol. + +2002-04-08 Andrew Cagney + + * findvar.c: Include "builtin-regs.h". + (value_of_register): Call value_of_builtin_reg when applicable. + * parse.c: Include "builtin-regs.h" and "gdb_assert.h". + (target_map_name_to_register): Call + builtin_reg_map_name_to_regnum. + * Makefile.in (SFILES): Add builtin-regs.c and std-regs.c. + (COMMON_OBS): Add builtin-regs.o and std-regs.o. + (builtin_regs_h): Define. + (builtin-regs.o): New target. + (findvar.o): Add $(builtin_regs_h). + * builtin-regs.c, builtin-regs.h: New files. + * std-regs.c: New file. + Partial fix for PR gdb/251. + +2002-04-08 Kevin Buettner + + * rs6000-tdep.c (rs6000_gdbarch_init): Don't set tm_print_insn; + it's no longer required. + +2002-04-08 Andrew Cagney + + * Makefile.in (gdbtk-wrapper.o): Add missing dependencies. + +2002-04-08 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_software_single_step): Use + rs6000_breakpoint_from_pc() to fetch breakpoint instruction + and size. Use target_insert_breakpoint() and + target_remove_breakpoint() to insert and remove breakpoints + instead of explicit memory reads and writes. + +2002-04-08 Kevin Buettner + + * config/powerpc/tm-ppc-eabi.h (ELF_OBJECT_FORMAT): Delete. + * rs6000-tdep.c (rs6000_push_arguments): Eliminate + ELF_OBJECT_FORMAT ifdef. + +2002-04-08 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_print_insn(). + +2002-04-08 Kevin Buettner + + From Jimi X : + * rs6000-tdep.c (rs6000_fix_call_dummy): Delete unused macro + definitions for TOC_ADDR_OFFSET and TARGET_ADDR_OFFSET. + +2002-04-07 Mark Kettenis + + * fbsd-proc.c (child_pid_to_exec_file, fbsd_find_memory_regions): + s/asprintf/xasprintf/. + (fbsd_make_corefile_notes): s/strdup/xstrdup/. + +2002-04-07 Andrew Cagney + + I believe Jeff Law denies responsability for this one: + * config/pa/hpux11w.mh (MH_CFLAGS): Add -Dvfork=fork. + * config/pa/hpux11.mh (MH_CFLAGS): Add -Dvfork=fork. + * config/pa/hpux1020.mh (MH_CFLAGS): Add -Dvfork=fork. + Work-around for PR gdb/366. + +2002-04-07 Elena Zannoni + + * remote-e7000.c (write_small, e7000_read_inferior_memory, + e7000_read_inferior_memory_large, e7000_insert_breakpoint, + e7000_remove_breakpoint): Use paddr_nz() to print addresses. + +2002-04-07 Elena Zannoni + + * sh-tdep.c (sh_fp_frame_init_saved_regs, + sh_nofp_frame_init_saved_regs): Use alloca() for 'where' + information. + +2002-04-07 Andrew Cagney + + * MAINTAINERS (Misc): List Daniel Jacobowitz as the GDBSERVER + maintainer. + +2002-04-07 Andrew Cagney + + * README (Reporting Bugs in GDB): Document the bug web page as the + prefered way of submitting bugs. + Fix PR gdb/402. + +2002-04-06 Andrew Cagney + + * gdbarch.sh (FP_REGNUM, PC_REGNUM, SP_REGNUM): Allow default of + -1. Update comment. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-04-07 Andreas Schwab + + * m68klinux-nat.c (fill_fpregset): Properly pass address of + buffer to regcache_collect. + +2002-04-06 Andrew Cagney + + * gdbarch.sh (PS_REGNUM): Add. Document. Default to -1. + * gdbarch.c, gdbarch.h: Re-generate. + +2002-04-06 Andrew Cagney + + * symtab.c (lookup_symtab): Remove ``const'' from ``rp'' + declaration. Fix -Werror. + +2002-04-05 Daniel Jacobowitz + + * gdbarch.sh (initialize_non_multiarch): Call init_gdbarch_swap. + * gdbarch.c: Regenerate. + +2002-04-05 Michael Snyder + + * breakpoint.c (clear_command): Rewrite middle section to + combine two loops with identical control conditions. + Add a cleanup to eliminate a memory leak. + * cli/cli-dump.c (restore_section_callback): Use paddr_nz. + +2002-04-05 H.J. Lu (hjl@gnu.org) + + * solib-svr4.c (bkpt_names): Add "__start". + +2002-04-04 Andrew Cagney + + * sparc-tdep.c (sparc_push_dummy_frame): Use GDB_TARGET_IS_SPARC64 + as test for 64 bit target. + +2002-04-05 Andrew Cagney + + * h8500-tdep.c (h8500_write_fp): Delete function. + * dwarf2cfi.c (cfi_write_fp): Document as not used. + * mips-tdep.c (mips_gdbarch_init): Do not set write_fp. + * ia64-tdep.c (ia64_gdbarch_init): Do not set write_fp. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Do not set write_fp. + * rs6000-tdep.c (rs6000_gdbarch_init): Do not set write_fp. + * s390-tdep.c (s390_gdbarch_init): Do not set write_fp. + (s390_write_fp): + * sh-tdep.c (sh_gdbarch_init): Do not set write_fp. + * x86-64-tdep.c (i386_gdbarch_init): Do not set write_fp. + * d10v-tdep.c (d10v_gdbarch_init): Do not set write_fp. + (d10v_write_fp): Delete function. + * inferior.h (write_fp, generic_target_write_fp): Delete + declarations. + * regcache.c (generic_target_write_fp): Delete function. + (write_fp): Delete function. + * gdbarch.sh (TARGET_WRITE_FP): Delete. + * gdbarch.h, gdbarch.c: Regenerate. + * config/v850/tm-v850.h (TARGET_WRITE_FP): Delete macro. + * config/sparc/tm-sp64.h (TARGET_WRITE_FP): Delete macro. + (sparc64_write_fp): Delete declaration. + * config/h8500/tm-h8500.h (TARGET_WRITE_FP): Delete macro. + (h8500_write_fp): Delete declaration. + +2002-04-04 Andrew Cagney + + * sparc-tdep.c (sparc64_write_fp): Delete. + (sparc_push_dummy_frame): Replace write_fp call with code to store + the FP directly. + (sparc_gdbarch_init): Do not initialize write_fp. + +2002-04-05 Kevin Buettner + + * rs6000-tdep.c (skip_prologue): Eliminate unused/unreachable + clause. + +2002-03-29 Jim Blandy + + * stack.c (get_selected_block): Add new argument `addr_in_block', + used to return the exact code address we used to select the block, + not just the block. + * blockframe.c (get_frame_block, get_current_block): Same. + * frame.h (get_frame_block, get_current_block, + get_selected_block): Update declarations. + * linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c, + linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed. + +2002-04-05 Michael Snyder + + * breakpoint.c (insert_breakpoints): Change 'hw' to 'hardware in + warning message. + +2002-04-05 J. Brobecker + + * utils.c (xfullpath): New function. + * defs.h (xfullpath): Add declaration. + * source.c (openp): Use xfullpath in place of gdb_realpath to + avoid resolving the basename part of filenames when the + associated file is a symbolic link. This fixes a potential + inconsistency between the filenames known to GDB and the + filenames it prints in the annotations. + * symtab.c (lookup_symtab): Use the new xfullpath function, in order + to be able to match a filename with either the real filename, or + the name of any symbolic link to this file. + (lookup_partial_symtab): Ditto. + +2002-04-04 Michael Snyder + + * breakpoint.c: Add support for hardware breakpoints in overlays. + (overlay_events_enabled): New state variable. + (insert_breakpoints): Use overlay_events_enabled to decide + whether to attempt to set a breakpoint at the overlay load addr. + Handle bp_hardware_breakpoint as well as bp_breakpoint. + (remove_breakpoint): Use overlay_events_enabled to decide + whether breakpoints need to be removed from overlay load addr. + Handle bp_hardware_breakpoint as well as bp_breakpoint. + (bpstat_stop_status): Handle bp_hardware_breakpoint in overlays. + (create_overlay_event_breakpoint, enable_overlay_breakpoints, + disable_overlay_breakpoints): Update overlay_events_enabled. + +2002-04-04 Daniel Jacobowitz + + * dwarf2read.c (struct function_range): New. + (cu_first_fn, cu_last_fn, cu_cached_fn): New. + (check_cu_functions): New. + (read_file_scope): Initialize global function lists. + Call dwarf_decode_line after processing children. + (read_func_scope): Add to global function list. + (dwarf_decode_lines): Call check_cu_functions everywhere + record_line is called. Call record_line with a linenumber + of 0 to mark sequence ends. + +2002-04-04 Michal Ludvig + + * x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI + change sync with glibc. + +2002-04-03 Jim Blandy + + * configure.in: Call AC_C_INLINE. + * configure: Regenerated. + +2002-04-01 Daniel Jacobowitz + + * rs6000-tdep.c: Change #include of "bfd/libcoff.h" + and "bfd/libbfd.h" to "libcoff.h" and "libbfd.h". + +2002-03-31 Mark Kettenis + + * NEWS: Mention gcore support on FreeBSD/i386. + + * fbsd-proc.c: New file. + * config/i386/nm-fbsd.h (CHILD_PID_TO_EXEC_FILE): Define. + * config/i386/fbsd.mh (NATDEPFILES): Add gcore.o and fbsd-proc.o. + + * lin-lwp.c (child_wait): Check SAVE_ERRNO instead of ERRNO in + while statement. + +2002-03-29 Jim Blandy + + * cli/cli-dump.c (_initialize_cli_dump): Older GCC's tolerate + unescaped newlines in string literals, but newer ones don't. So + escape them. + +2002-03-26 Michael Snyder + Andrew Cagney + + * cli/cli-dump.c: New file. Dump memory to file, + restore file to memory. + * cli/cli-dump.h: New file. + * Makefile.in: Add rules, dependencies for cli-dump.o. + * NEWS: Mention new commands. + +2002-03-28 Michael Snyder + + * symfile.c (symbol_file_add): Move test for null symbols to later. + +2002-03-27 Andrew Cagney + + From veksler at il.ibm.com: + * utils.c (gdb_realpath): If canonicalize_file_name fails, return + the xstrduped original path. + Fix PR gdb/417. + +2002-03-27 Michael Snyder + + * breakpoint.c (_initialize_breakpoint): Clean up help string. + * infcmd.c (_initialize_infcmd): Ditto. + * language.c (_initialize_language): Ditto. + * symfile.c (_initialize_symfile): Ditto. + * top.c (_init_main): Ditto. + * cli/cli-cmds.c (init_cli_cmds): Ditto. + +2002-03-27 Elena Zannoni + + * rs6000-tdep.c (struct rs6000_framedata): Add fields for AltiVec + vector registers handling. + (skip_prologue): Handle new AltiVec instructions. Fill in new + fields of frame data. + (frame_get_saved_regs): Fill in information for AltiVec registers. + +2002-03-27 Jim Blandy + + * symtab.h (SYMBOL_INIT_MANGLED_NAME): Turn this macro's body into + a function; leave this macro here to invoke that function. + (symbol_init_mangled_name): Declaration for that function. + * symtab.c (symbol_init_mangled_name): New function. + +2002-03-27 Andrew Cagney + + * valarith.c: Replace strerror with safe_strerror. + * tracepoint.c: Ditto. + * lin-lwp.c: Ditto. + * go32-nat.c: Ditto. + * inflow.c: Ditto. + * gnu-nat.c: Ditto. + +2002-03-27 Andreas Schwab + + * event-top.c (command_line_handler): Remove useless if. + +2002-03-27 Andreas Jaeger + + * dwarf2cfi.c: Give credit to Daniel Berlin, reformat copyright + comment. + +2002-03-27 Michal Ludvig + + * x86-64-tdep.h (X86_64_NUM_REGS, X86_64_NUM_GREGS): Delete #defines. + (x86_64_num_regs, x86_64_num_gregs): Added extern variables. + * x86-64-linux-nat.c (x86_64_regmap): Swapped RBX <> RDX, added DS, ES, FS, GS. + (x86_64_linux_dr_get_status, supply_gregset), + (fill_gregset): Changed X86_64_NUM_GREGS to x86_64_num_gregs. + * x86-64-tdep.c (x86_64_register_raw_size_table): Delete. + (x86_64_register_info_table): Add. + (X86_64_NUM_REGS, X86_64_NUM_GREGS): Add. + (x86_64_register_raw_size, x86_64_register_virtual_type), + (x86_64_register_name, _initialize_x86_64_tdep): Changed to reflect new + general x86_64_register_info_table. + (i386_gdbarch_init): gdbarch_register_bytes is now set + dynamicaly during initialization. + * regformats/reg-x86-64.dat: Synced with changes to registers above. + * gdbserver/linux-x86-64-low.c: Ditto. + +2002-03-27 Daniel Jacobowitz + + * gdbserver/server.c (main): Call target_signal_to_host_p + and target_signal_to_host on signals received from the remote. + * gdbserver/remote-utils.c (prepare_resume_reply): Call + target_signal_from_host on signals sent to the remote. + * gdbserver/server.h: Add prototypes. Include "gdb/signals.h". + * gdbserver/Makefile.in: Add signals.o. Add -I${INCLUDE_DIR}. + +2002-03-27 Daniel Jacobowitz + + * signals/signals.c: Include "server.h" in gdbserver build. + (target_signal_from_name): Don't use STREQ. + (_initialize_signals): Likewise. Don't include function in + gdbserver build. + +2002-03-27 Daniel Jacobowitz + + * signals.c: Moved to... + * signals/signals.c: Here. + * Makefile (signals.o): Update. + +2002-03-26 Jeff Law (law@redhat.com) + + * somread.c (som_symtab_read): Remove some commented out code and + updated related comments. Do not set the minimal symbol table to + mst_solib_trampoline for ST_ENTRY symbols with SS_LOCAL scope + in a dynamic executable. + * hppa-tdep.c (find_proc_framesize): Sanely handle the case + where we are unable to find the minimal symbol for the given + PC value. + +2002-03-25 Jeff Law (law@redhat.com) + + * linux-proc.c (read_mapping): Scan up to end of line for filename. + +2002-03-25 Michal Ludvig + + * x86-64-tdep.c (x86_64_skip_prologue): Rewritten from scratch. + +2002-03-23 Andrew Cagney + + * command.h: Update copyright. + (struct cmd_list_element): Replace definition with opaque + declaration. + (enum cmd_types): Document that it will eventually be moved to + cli/cli-decode.h + (CMD_DEPRECATED, DEPRECATED_WARN_USER): Delete macros. + (MALLOCED_REPLACEMENT): Delete macro. + * Makefile.in (cli_decode_h): Add $(command_h). + (top.o, completer.o, maint.o): Add dependency on $(cli_decode_h). + * top.c: Include "cli/cli-decode.h". + * completer.c: Include "cli/cli-decode.h". + * maint.c: Include "cli/cli-decode.h". + * cli/cli-decode.h: Include "command.h". + (enum command_class): Delete. + (enum cmd_types): Comment out. + (enum cmd_auto_boolean): Delete. + (enum var_types): Delete. + +2002-03-23 Andrew Cagney + + * cli/cli-decode.c: Include "gdb_assert.h". + (add_set_or_show_cmd): New static function. + (add_set_cmd): Rewrite. Use add_set_or_show_cmd. + (add_show_from_set): Rewrite. Use add_set_or_show_cmd. Don't copy + all fields, such as func, from the set command. + +2002-03-23 Andrew Cagney + + * MAINTAINERS (sh-elf): Change warning flag to -w. + +2002-03-23 Andrew Cagney + + * defs.h (error): Add printf format attribute. + * thread-db.c (thread_from_lwp): Fix error format string. + * stack.c (parse_frame_specification): Ditto. + * cli/cli-decode.c (undef_cmd_error): Ditto. + * scm-lang.c (scm_lookup_name): Ditto. + * tracepoint.c (trace_error): Ditto. + * remote-utils.c (usage): Ditto. + * remote.c (compare_sections_command): Ditto. + Fix PR gdb/328. + +2002-03-22 Andrew Cagney + + * gdbtypes.c (append_composite_type_field): New function. + (init_composite_type): New function. + * gdbtypes.h (append_composite_type_field): Declare. + (init_composite_type): Ditto. + +2002-03-22 Elena Zannoni + + * ppc-linux-tdep.c (ppc_sysv_abi_use_struct_convention): New + function. + * ppc-tdep.h (ppc_sysv_abi_use_struct_convention): Export. + * rs6000-tdep.c (rs6000_gdbarch_init): Use different + structure returning convention for SYSV ABI case, but not + for GNU/Linux, FreeBSD, or NetBSD. + +2002-03-22 Daniel Jacobowitz + + * symtab.h (lookup_block_symbol): Add mangled_name argument + to prototype. + + * symmisc.c (maintenance_check_symtabs): Call lookup_block_symbol + with new mangled_name argument. + * linespec.c (decode_line_1): Likewise. + * valops (value_of_this): Likewise. + * symtab.c (lookup_transparent_type): Likewise. + (lookup_symbol_aux): Likewise. Accept new mangled_name argument. + (lookup_symbol): If we are given a mangled name, pass it down + to lookup_symbol_aux. + (lookup_block_symbol): If we are given a mangled name to check + against, only return symbols which match it. + +2002-03-22 Christopher Faylor + + * win32-nat.c (child_create_inferior): Check for proper shell to use + here, in case the user changes it on the fly. + (_initialize_inftarg): Remove shell path considerations. + +2002-03-21 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Use correct max size value + for gdbarch_max_register_raw_size and max_register_virtual_size. + Adjust copyright year. + +2002-03-21 Daniel Jacobowitz + + * dbxread.c (process_one_symbol): Extend the first N_SLINE + in a function to cover the entire beginning of the function + as well if it does not already. + +2002-03-21 Tom Rix + + * rs6000-nat.c (rs6000_ptrace32): Renamed from ptrace32. + (rs6000_ptrace64): Renamed from ptrace64. + +2002-03-20 Martin M. Hunt + + * gdbserver/remote-utils.c (remote_open): Don't call + getprotobyname, we're all using TCP here so just use + IPPROTO_TCP. + * gdbserver/gdbreplay.c (remote_open): Ditto. + +2002-03-20 Martin M. Hunt + + * regcache.c (_initialize_regcache): No need to call + build_regcache() at this time; it gets called whenever + the gdbarch changes. + +2002-03-20 David O'Brien + + * sparc-nat.c: Include sys/param.h where possible. + +2002-03-20 Daniel Jacobowitz + + Fix PR gdb/422. + * c-lang.c (c_create_fundamental_type): Handle FT_COMPLEX, + FT_DBL_PREC_COMPLEX, and FT_EXT_PREC_COMPLEX. + * dwarf2read.c (read_base_type): Set TYPE_TARGET_TYPE for + complex types. + * stabsread.c (rs6000_builtin_type): Likewise. + (read_sun_floating_type): Likewise. + +2002-03-19 Peter Schauer + + * stabsread.c (read_member_functions): Remove skip code for duplicate + constructor/destructor methods. Use standard parsing for these + methods and just do not chain them to the list of methods after + parsing. + +2002-03-19 Alexandre Oliva + + * coffread.c: Remove redundant static declarations. Replace + occurrences of `PTR' with `void *'. + * elfread.c, mdebugread.c, minsyms.c, mipsread.c: Likewise. + * top.h (quit_cover): Likewise. + * defs.h (catch_errors): Likewise. + +2002-03-18 Andrew Cagney + + * defs.h (XMALLOC): Define. + * gdb-events.sh (XMALLOC): Delete macro. + * gdb-events.c, gdb-events.h: Regenerate. + * gdbarch.sh (XMALLOC): Delete macro. + * gdbarch.c: Regenerate. + * serial.c (XMALLOC): Delete macro. + * ui-file.c (XMALLOC): Ditto. + * ser-unix.h (XMALLOC): Ditto. + * sh-tdep.c (XMALLOC): Ditto. + * ui-out.c (XMALLOC): Ditto. + * utils.c (XMALLOC): Ditto. + * i386-tdep.c (XMALLOC): Ditto. + * gdb-events.c (XMALLOC): Ditto. + * d10v-tdep.c (XMALLOC): Ditto. + * cli-out.c (XMALLOC): Ditto. + + * cli-out.c, d10v-tdep.c, gdb-events.c: Update copyright. + * gdb-events.sh, i386-tdep.c, ser-unix.h, serial.c: Ditto. + * ui-file.c, ui-out.c: Ditto. + +2002-03-18 Andrew Cagney + + * command.h (struct cmd_list_element): Add field context. + (set_cmd_context, get_cmd_context): Declare. + * cli/cli-decode.h: Ditto. + * cli/cli-decode.c (get_cmd_context): New function. + (set_cmd_context): New function. + (add_cmd): Initialize context. + Part of fixing PR gdb/145 and PR gdb/146. + +2002-03-17 Andrew Cagney + + * cli/cli-decode.c (cmd_type): New function. + * command.h (cmd_type): Declare. + * infrun.c (set_schedlock_func): Call function cmd_type. + * kod.c (kod_set_os): Call cmd_type. + * cris-tdep.c (cris_version_update): Use function cmd_type. + (cris_mode_update, cris_abi_update): Ditto. + + * command.h: (execute_cmd_post_hook): Declare. + (execute_cmd_pre_hook): Declare. + * cli/cli-script.c (clear_hook_in_cleanup): New function. + (execute_cmd_post_hook, execute_cmd_pre_hook): New + functions. Execute pre/post hook while ensuring that afterwords + hook_in is cleared. + * top.c (execute_command): Use execute_cmd_post_hook, and + execute_cmd_pre_hook to execute pre/post commands. + * infrun.c (normal_stop): Pass stop_command and not pre_hook to + hook_stop_stub. + (hook_stop_stub): Call execute_cmd_pre_hook. + +2002-03-17 Andrew Cagney + + * kod.c (kod_set_os): Revert previous change. Is called by ``info + set'' and this leads to a core dump. Move xstrdup of + operating_system to after check that it is not NULL. + +2002-03-17 Andrew Cagney + + * kod.c (kod_set_os): Remove unnecessary check that + ``command->type'' is set_cmd. + + * valprint.c (set_input_radix): Use input_radix. + (set_output_radix): Use output_radix. + (set_input_radix_1, set_output_radix_1): Add FIXME - bad radix + isn't reverted. + +2002-03-16 Andrew Cagney + + * value.h (struct value): Delete field ``substring_addr''. Change + aligner fields to force_doublest_align, force_longest_align, + force_core_addr_align and force_pointer_aligh. + + * value.h (struct value): Fix typo in above change. + +2002-03-16 Peter Schauer + + * ia64-tdep.c (ia64_gdbarch_init): Call set_gdbarch_frame_args_skip, + to fix internal_error from ``maintenance print architecture''. + +2002-03-16 Peter Schauer + + * cp-valprint.c (cp_is_vtbl_ptr_type): Handle vtbl field type + for gcc versions after gcc-2.8.1. + +2002-03-16 Peter Schauer + + * eval.c (evaluate_subexp_standard): Fix setup of ``this'' pointer + for method resolution. Restore adjustment of ``this'' pointer after + calling value_struct_elt, which was accidentally removed during the + HP merge. + +2002-03-15 Andrew Cagney + + * eval.c (evaluate_subexp_standard): Pass ``selected_frame'' to + value_of_register. + * findvar.c (value_of_register): Add ``frame'' parameter. Pass to + get_saved_register. + * value.h (value_of_register): Update. + +2002-03-14 Richard Henderson + + * configure.in: Detect declaration for canonicalize_file_name. + * utils.c (canonicalize_file_name): Declare, if needed. + (gdb_realpath): Prefer realpath if available and usable. + * config.in, configure: Rebuild. + +2002-03-14 Richard Henderson + + * dwarf2read.c (read_array_type): Accept DW_FORM_data8 as + a constant array bound. + + * MAINTAINERS: Add myself to write-after-approval. + +2002-03-14 Michael Snyder + + * symfile.c (syms_from_objfile): Return immediately if no syms. + (symbol_file_add): Return immediately if no syms. + (find_sym_fns): Return immediately if no syms. + +2002-03-13 Michal Ludvig + + * gdbserver/remote-util.c (remote_open): Print remote-side's + IP address when remote debugging over the network. + +2002-03-12 David O'Brien + + * config/sparc/fbsd.mh: Fix copyright. + * config/sparc/fbsd.mt: Likewise. + +2002-03-11 Richard Earnshaw + + * MAINTAINERS: Fix typo in name of gdb warnings option. + (x86-64): Fix formating so that this can be parsed by awk. + +2002-03-10 Daniel Jacobowitz + + * Makefile.in (defs_h): Add $(INCLUDE_DIR)/gdb/signals.h. + * defs.h: Include "gdb/signals.h". + (enum target_signal): Move to $(INCLUDE_DIR)/gdb/signals.h. + +2002-03-10 Michal Ludvig + + * x86-64-tdep.h (sys/reg.h, x86_64_regmap): Moved to x86-64-linux-nat.c + * x86-64-linux-nat.c (sys/reg.h, x86_64_regmap): Moved here + from x86-64-tdep.h + +2002-03-10 Daniel Jacobowitz + Don Howard + + * mips-tdep.c (ST0_FR): Define. + (mips2_fp_compat): New function, temporarily disabled. + (mips_read_fp_register_single): New function. + (mips_read_fp_register_double): New function. + (mips_print_register): Use them. + (do_fp_register_row): Likewise. + +2002-03-09 Andrew Cagney + + * MAINTAINERS: Add Jim Ingham and Klee Dienes to ``write after + approval''. + +2002-03-08 Peter Schauer + + * stabsread.c (read_member_functions): Fix is_stub test for + static member functions, improve comment. + +2002-03-07 Richard Earnshaw + + * remote-rdi.c (myprint): Replace 'PTR' with 'void *'. + (mywrite, mywritec, mypause, myreadc, mygets): Likewise. + (_initialize_remote_rdi): Use add_set_boolean_cmd to register + commands that set boolean values. + (arm_rdi_remove_breakpoint): Rewrite to avoid uninitialized warning. + (arm_rdi_resume): Always initialize PC. + (arm_rdi_open): Don't use rslt as a boolean. + (arm_rdi_create_inferior, arm_rdi_close, arm_rdi_resume) + (arm_rdi_fetch_registers, arm_rdi_store_registers) + (arm_rdi_xfer_memory, arm_rdi_files_info, arm_rdi_kill) + (arm_rdi_insert_breakpoint, arm_rdi_remove_breakpoint): Likewise. + +2002-03-06 Alexandre Oliva + + * configure.in (gdb_cv_bigtoc): Check for -bbigtoc on AIX. + * configure: Rebuilt. + +2002-03-06 Stephane Carrez + + * m68hc11-tdep.c (_initialize_m68hc11_tdep): Don't set tm_print_insn. + (m68hc11_gdbarch_init): But use set_gdbarch_print_insn instead. + +2002-03-06 Andrew Cagney + + * cli/cli-decode.c (set_cmd_completer): New function. + * command.h (set_cmd_completer): Declare. + * cli/cli-decode.h (set_cmd_completer): Ditto. + + * breakpoint.c (_initialize_breakpoint): Use set_cmd_completer. + * cli/cli-cmds.c (init_cli_cmds): Ditto. + * win32-nat.c (_initialize_inftarg): Ditto. + * remote-rdi.c (_initialize_remote_rdi): Ditto. + * proc-api.c (_initialize_proc_api): Ditto. + * hppa-tdep.c (_initialize_hppa_tdep): Ditto. + * source.c (_initialize_source): Ditto. + * exec.c (_initialize_exec): Ditto. + * solib.c (_initialize_solib): Ditto. + * top.c (init_main): Ditto. + * tracepoint.c (_initialize_tracepoint): Ditto. + * symfile.c (_initialize_symfile): Ditto. + * printcmd.c (_initialize_printcmd): Ditto. + * infcmd.c (_initialize_infcmd): Ditto. + * corefile.c (_initialize_core): Ditto. + +2002-03-05 Andrew Cagney + + * MAINTAINERS (Past Maintainers): Add Frank Ch. Eigler. + +2002-03-05 Andrew Cagney + + * MAINTAINERS: Fix Mac OS X and Objective-C/C++. + +2002-03-05 Andrew Cagney + + * NEWS: Update headings, 5.2 has branched. + +2002-03-04 Daniel Jacobowitz + + * gdbserver/linux-low.c (PTRACE_XFER_TYPE): Change to long. + (num_regs, regmap): Move inside HAVE_LINUX_USRREGS. + (register_addr, REGISTER_RAW_SIZE): Likewise. + (usr_store_inferior_registers): Use PTRACE_XFER_TYPE. + * gdbserver/linux-x86-64-low.c: Remove extra #endif. + +2002-03-03 Michal Ludvig + + * MAINTAINERS (x86-64): Add myself. + * x86-64-tdep.c (x86_64_push_arguments): Fixed typo naregs->nregs, + changed value_ptr -> struct value * + +2002-03-01 David O'Brien + + * configure.host (sparc64-*-freebsd): Add. + * configure.tgt: Likewise. + * config/sparc/fbsd.mh: New file. + * config/sparc/fbsd.mt: Likewise. + * config/sparc/nm-fbsd.h: Likewise. + * config/sparc/tm-fbsd.h: Likewise. + +2002-03-01 Daniel Jacobowitz + + * config/djgpp/fnchange.lst: Add regformats/reg-i386-linux.dat and + regformats/reg-s390x.dat. + +2002-03-01 Andrew Cagney + + * utils.c: Add FIXME explaining true/false problem. + +2002-02-28 Andrew Cagney + + * MAINTAINERS (Past Maintainers): Add J.T. Conklin. + +2002-02-28 Michael Chastain + + * MAINTAINERS: Fix typo: gdb.satbs -> gdb.stabs . + +2002-02-28 Daniel Jacobowitz + + * gdbserver/linux-s390-low.c: New file. + * regformats/reg-s390.dat: New file. + * regformats/reg-s390x.dat: New file. + * gdbserver/configure.srv: Add S/390. + * gdbserver/Makefile.in: Add S/390. + * configure.tgt: Enable gdbserver for S/390. + +2002-02-28 Eli Zaretskii + + * go32-nat.c (_initialize_go32_nat): Don't use periods in the + first line of the doc string for "info dos", except at the end of + the sentence, since the short help stops at the first period. + +2002-02-28 Jason Merrill + + * dwarf2read.c (dwarf_cfi_name): Add new codes. + +2002-02-27 Fred Fish + + * blockframe.c (generic_fix_call_dummy): Fix obvious typo in + comment (dumy -> dummy). + +2002-02-27 Peter Schauer + + * symtab.c (gdb_mangle_name): Handle fully mangled v3 abi physnames. + +2002-02-27 Rodney Brown + + * utils.c (gdb_realpath): Add pathconf fallback for sco3.2v5. + +2002-02-27 Daniel Jacobowitz + + * gdbserver/acconfig.h: New file. + * gdbserver/i387-fp.c: New file. + * gdbserver/i387-fp.h: New file. + * gdbserver/linux-x86-64.c: New file. + * regformats/reg-x86-64.dat: New file. + * configure.tgt: Add x86_64-*-linux* gdbserver support. + * gdbserver/configure.srv: Add x86_64-*-linux* and regset support. + * gdbserver/configure.in: Add support for regsets. + * gdbserver/config.in: Regenerate. + * gdbserver/configure: Regenerate. + * gdbserver/Makefile.in: Likewise. Add $(linux_low_h). + * gdbserver/linux-low.h: New file. + * gdbserver/linux-low.c: Include "linux-low.h". Add support + for regsets. + * gdbserver/linux-arm-low.c: Include "linux-low.h". + * gdbserver/linux-ia64-low.c: Include "linux-low.h". + * gdbserver/linux-m68k-low.c: Include "linux-low.h". + * gdbserver/linux-mips-low.c: Include "linux-low.h". + * gdbserver/linux-ppc-low.c: Include "linux-low.h". + * gdbserver/linux-sh-low.c: Include "linux-low.h". + * gdbserver/linux-i386-low.c: Include "linux-low.h". Include + "i387-fp.h". Add PTRACE_GETREGS and friends. + * gdbserver/regcache.c (supply_register): New function. + (supply_register_by_name): New function. + (collect_register): New function. + (collect_register_by_name): New function. + +2002-02-27 Daniel Jacobowitz + + * gdbserver/Makefile.in (INTERNAL_CFLAGS): Remove -DGDBSERVER. + (config.status): Add configure.srv dependency. + (server_h): Add config.h dependency. + +2002-02-27 Daniel Jacobowitz + + * regformats/reg-i386-linux.dat: New file, with $orig_eax. + * gdbserver/Makefile.in: Add rules for reg-i386-linux.o. + * gdbserver/configure.srv: Change i386-*-linux* to use + reg-i386-linux.o. + +2002-02-26 Andrew Cagney + + * x86-64-tdep.c: Re-indent. Update copyright date. + +2002-02-26 Andrew Cagney + + From Michal Ludvig : + * x86-64-tdep.c (value.h): Delete. + (gdb_assert.h): Include. + (x86_64_register_convert_to_virtual, + x86_64_register_convert_to_raw ): Add check which lets only + floating-point values to be converted. + (value_push): Delete. + (x86_64_push_arguments): Order of arguments pushed on stack fixed. + (i386_gdbarch_init): Number of register_bytes fixed. + +2002-02-26 Andrew Cagney + + * MAINTAINERS: Add x86-64 target. + +2002-02-26 Andrew Cagney + + * memattr.c (mem_command): Eliminate ``true'' and ``false''. + * osfsolib.c (solib_map_sections): Ditto. + * irix5-nat.c (solib_map_sections): Ditto. + * corelow.c (gdb_check_format): Ditto. + * symfile.c (symfile_bfd_open): Ditto. + * solib.c (solib_map_sections): Ditto. + Fix PR gdb/354. + +2002-02-26 Andrew Cagney + + * remote.c (_initialize_remote): By default, disable ``e'' and + ``E'' step out-of-range packets. + +2002-02-26 Andreas Schwab + + * config/m68k/tm-linux.h (FRAME_SAVED_PC): Define as + m68k_linux_frame_saved_pc. + (IN_SIGTRAMP): Define as m68k_linux_in_sigtramp instead of + in_sigtramp. + (SIGCONTEXT_PC_OFFSET): Remove. + * m68klinux-nat.c (m68k_linux_frame_saved_pc, + m68k_linux_sigtramp_saved_pc): New functions. + (IS_SIGTRAMP, IS_RT_SIGTRAMP): Define. + (SIGCONTEXT_PC_OFFSET): Moved here from config/m68k/tm-linux.h. + (UCONTEXT_PC_OFFSET): Define. + (m68k_linux_in_sigtramp): Renamed from in_sigtramp, handle both + non-RT and RT signal trampolines. + +2002-02-26 Richard Earnshaw + + * config/arm/tm-embed.h (TARGET_UPAGES): Delete. + (TARGET_NBPG, STACK_END_ADDR): Delete + (VARIABLES_INSIDE_BLOCK): Delete. + +2002-02-25 Andrew Cagney + + * utils.c (perror_with_name): Make string parameter constant. + (print_sys_errmsg): Ditto. + (query): Ditto. + * defs.h (perror_with_name): Update. + (print_sys_errmsg): Update. + (query): Update. + +2002-02-25 Daniel Jacobowitz + + From Eliot Dresselhaus : + * gdbserver/linux-mips-low.c (cannot_fetch_register): Fix typo. + +2002-02-25 Peter Schauer + + * rs6000-nat.c (set_host_arch): Do not switch to a new architecture + if it already matches the current architecture from the exec file. + Include arch-utils.h for gdbarch_info_init prototype. + * Makefile.in (rs6000-nat.o): Update dependencies. + +2002-02-25 Eli Zaretskii + + * config/djgpp/djconfig.sh: Set NM=nm and CFLAGS="-g -O2" in the + list of exported variables. + +2002-02-24 Daniel Jacobowitz + + * gdbserver/configure.srv: New file. + * gdbserver/configure.in: Use configure.srv instead + of the host/target makefile fragments. Set GDBSERVER_DEPFILES + from it. + * gdbserver/configure: Regenerated. + * gdbserver/terminal.h: New file. + * gdbserver/Makefile.in: Update for configure changes. Remove + more unneeded include paths. + +2002-02-24 Andrew Cagney + + From wiz at danbala: + * config/sparc/tm-sp64.h: Fix grammar and typos. + Fix PR gdb/287. + +2002-02-24 Andrew Cagney + + * lin-lwp.c, thread-db.c, defs.h, cris-tdep.c: Replace ``Linux'' + with either ``GNU/Linux'' or ``Linux kernel''. Update copyright. + * m68klinux-nat.c, sparc-linux-nat.c, x86-64-linux-nat.c: Ditto. + * x86-64-linux-tdep.c, gregset.h, gdb_wait.h: Ditto. + * ia64-linux-nat.c, infrun.c, linux-proc.c: Ditto. + * proc-service.c, i386-linux-tdep.c, ppc-linux-tdep.c: Ditto. + * s390-tdep.c: Ditto. + * config/nm-linux.h, config/alpha/nm-linux.h: Ditto. + * config/alpha/tm-alpha.h, config/alpha/tm-alphalinux.h: + * config/alpha/xm-alphalinux.h, config/i386/nm-linux.h: Ditto. + * config/i386/nm-x86-64.h, config/i386/tm-linux.h: Ditto. + * config/m68k/tm-linux.h, config/mips/nm-linux.h: Ditto. + * config/mips/tm-linux.h, config/mips/xm-linux.h: Ditto. + * config/powerpc/tm-linux.h, config/s390/nm-linux.h: Ditto. + * config/s390/tm-linux.h, config/sh/tm-linux.h: Ditto. + * config/sparc/nm-linux.h, config/sparc/tm-linux.h: Ditto. + * config/sparc/tm-sp64linux.h, config/sparc/xm-linux.h: Ditto. + Fix PR gdb/378. + +2002-02-23 Andrew Cagney + + * lin-thread.c: Delete file. + * configure.in (gdb_cv_struct_reg_r_gs): Update comment to refer + to gdb_proc_service.h. + * configure: Re-generate. + + * ocd.c (ocd_open): Do not try to open the "ocd" device. + * serial.c (serial_open): Delete check for "ocd". + Fix PR gdb/349. + + * Makefile.in (linux-thread.o): Delete target. + * linux-thread.c: Delete file. + + * config/djgpp/fnchange.lst: Rename bfd/elf32-sh64.c. Tweak other + renamed SH files to be consistent. + + * symtab.c (sort_search_symbols): Use xfree. + +2002-02-23 Richard Earnshaw + + * arm-linux-tdep.c (arm_linux_init_abi): Register + IN_SOLIB_CALL_TRAMPOLINE and SKIP_TRAMPOLINE_CODE + * config/arm/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE): Replace old + definition with undef, since we don't want the sysvr4 definition. + (SKIP_TRAMPOLINE_CODE): Likewise. + +2002-02-23 Andrew Cagney + + From 2002-02-22 Alfred M. Szmidt : + + * configure.in: (AC_CHECK_FUNCS) Added test for + canonicalize_file_name Regenerated. + * config.in, configure: Regenerated. + * utils.c: (gdb_realpath) If HAVE_CANONICALIZE_FILE_NAME is + defined use canonicalize_file_name. + +2002-02-23 Michael Chastain + + * MAINTAINERS: Remove Michael Chastain from "paper trail" list. + +2002-02-23 Andrew Cagney + + * README: Remove references to cygnus.com. + * MAINTAINERS: Change Past Maintainer addresses to ``foo at bar + dot com'' form. Remove references to cygnus.com and sourceware. + +2002-02-23 Andrew Cagney + + From 2002-02-19 Paul Eggert : + * Makefile.in (VER): Change "head -1" to "sed q", since POSIX + 1003.1-2001 no longer allows "head -1". + * gdb/Makefile.in (version.c): Likewise. + * gdb/doc/Makefile.in (GDBvn.texi): Likewise. + * gdb/CONTRIBUTE: Change "diff -c3" to "diff -c", which is + equivalent. POSIX 1003.1-2001 no longer allows "diff -c3". + +2002-02-23 Andrew Cagney + + * cli/cli-decode.c (cmd_cfunc_eq): New function. + * command.h (cmd_cfunc_eq): Declare. + * cli/cli-decode.h (cmd_cfunc_eq): Ditto. + + * cli/cli-cmds.h (is_complete_command): Change parameter to a + ``struct cmd_list_element *''. + * cli/cli-cmds.c (is_complete_command): Update. Use + cmd_cfunc_eq. + * top.c (execute_command): Pass the command to + is_complete_command. + * tracepoint.c: Replace function.cfunc with cmd_cfunc_eq. + +2002-02-23 Andrew Cagney + + From 2002-02-20 Martin Schwidefsky : + * config/s390/tm-s390.h (GDB_TARGET_IS_ESAME): Use renamed + architecture defines. + * s390-tdep.c (s390_gdbarch_init): Likewise. + +2002-02-23 Richard Earnshaw + + * arm-linux-tdep.c (arm_linux_extract_return_value): Make static. + (arm_linux_push_arguments): Likewise. + (arm_linux_init_abi): Register them. Also register linux-specific + call_dummy_words. + (find_minsym_and_objfile): Use strcmp, not STREQ. + * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Delete. + (arm_linux_call_dummy_words): Delete declaration. + (EXTRACT_RETURN_VALUE, PUSH_ARGUMENTS): Delete. + (arm_linux_extract_return_value, arm_linux_push_arguments): Delete + declarations. + (LOWEST_PC): Delete. + +2002-02-23 Peter Schauer + + * maint.c (print_section_info): Do not prepend `0x' to filepos + output, it will be handled by local_hex_string_custom. + +2002-02-23 Richard Earnshaw + + * arm-linux-nat.c (store_newfpe_single): Use regcache_collect. + (store_newfpe_double, store_newfpe_extended, store_fpregister) + (store_register, store_regs, fill_gregset, fill_fpregset): Likewise. + +2002-02-22 Jim Blandy + + Indicate that the bcache functions don't change the strings + they're passed. + * bcache.h (bcache, hash): Add `const' keywords to declarations. + * bcache.c (bcache, hash): Add `const' keywords to definitions. + +2002-02-22 Pierre Muller + + * win32-nat.c (child_create_inferior): Fix create flags setting bug. + +2002-02-21 Christopher Faylor + + * win32-nat.c (register_loaded_dll): Just use raw name when we can't + find the complete path to a loaded DLL. + +2002-02-21 Fred Fish + + * dbxread.c (process_one_symbol): When finding an N_FUN symbol + that marks the end of the range of a function, enter a line number + entry that has a line number of zero and a PC offset that matches + the end of the function. This starts a range of PC's for which no + line number information is known. + * symtab.c (find_pc_sect_line): If our best fit is in a range of + PC's for which no line number info is found (line number is zero) + then we didn't find any valid line information. + * symtab.h: Document use of zero line number entry. + +2002-02-21 Elena Zannoni + + * ppc-linux-nat.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Define. + (have_ptrace_getvrregs): Define for run time checks. + (gdb_vrregset_t): New type for Altivec register handling. + (fetch_register, store_register): Fetch/store altivec register + when needed. + (fetch_altivec_register, store_altivec_register): New functions. + (supply_vrregset, fill_vrregset): New functions. + (fetch_altivec_registers, store_altivec_registers): New functions. + (fetch_ppc_registers, store_ppc_registers): Fetch/store altivec + registers as well. + +2002-02-21 Jiri Smid + + * config/i386/x86-64linux.mh (NATDEPFILES): Remove x86-64-nat.o. + +2002-02-21 Richard Earnshaw + + * Makefile.in (armnbsd-nat.o): Update dependencies. + * armnbsd-nat.c (supply_gregset): New function. Common code to + supply the integer register set. + (supply_fparegset): New function. Similar for FPA registers. + (fetch_regs, fetch_fp_regs): Use them. + (fetch_core_registers): Likewise. + (fetch_elfcore_registers): New function. + (arm_netbsd_elfcore_fns): New core-file type specification. + (_initialize_arm_netbsd_nat): Register it. + +2002-02-21 Richard Earnshaw + + * armnbsd-nat.c: Include gdbcore.h. + (FETCH_INFERIOR_REGISTERS): Just error if this isn't defined. + (fetch_regs, fetch_fp_regs, store_regs, store_fp_regs): Add explicit + 'void' to declaration, to shut up ARI. + (fetch_core_registers): Make static. Rewrite using supply_register. + (arm_netbsd_core_fns): New core-file type specification. + (_initialize_arm_netbsd_nat): New function. + +2002-02-21 Christopher Faylor + + * win32-nat.c (register_loaded_dll): Correctly check for invalid handle + value. + +2002-02-20 Christopher Faylor + + * win32-nat.c (register_loaded_dll): Handle case where FindFirstFile + fails. + +2002-02-20 Daniel Jacobowitz + + * jv-exp.y (parse_number): Change type of implicit longs + to builtin_type_uint64. + +2002-02-20 Daniel Jacobowitz + + * gdbserver/linux-low.c (mywait): Change argument to waitpid + to be an integer instead of a `union wait'. + +2002-02-20 Daniel Jacobowitz + + * mips-linux-nat.c: Call the operating system GNU/Linux. + * mips-linux-tdep.c: Likewise. + * mips-tdep.c: Likewise. + +2002-02-20 Daniel Jacobowitz + + Fix PR gdb/265. + * jv-exp.y (parse_number): Handle 64-bit integers. + +2002-02-20 Daniel Jacobowitz + + * gdbserver/configure.in: Remove AM_PROC_CC_STDC. Change + AC_STDC_HEADERS to AC_HEADER_STDC. + * gdbserver/configure: Regenerated. + +2002-02-20 Richard Earnshaw + + * arc-tdep.c (get_longjmp_target): Only compile this function if JB_PC + is defined. + * sparc-tdep.c (get_longjmp_target): Likewise. + +2002-02-20 Richard Earnshaw + + * News: Add news about ARM and Multi-arch. Mention the new target + arm*-*-netbsd*. + +2002-02-19 Jim Blandy + + * stabsread.c (error_type_complaint): Improve error message. + +2002-02-19 Daniel Jacobowitz + + * gdbserver/README: Update documentation. + * gdbserver/configure.in: Update configury to match documentation. + * gdbserver/Makefile.in: Likewise. + * gdbserver/configure: Regenerated. + * gdbserver/aclocal.m4: New file, generated by aclocal. + * gdbserver/config.in: New file, generated by autoheader. + +2002-02-19 Richard Earnshaw + + * config/djgpp/fnchange.lst: Add change rules for armnbsd-tdep.c and + armnbsd-nat.c. + +2002-02-19 Richard Earnshaw + + * arm-tdep.h (enum arm_float_model): New enum. + (struct gdbarch_tdep): Add fp_model. + * arm-tdep.c (arm_gdbarch_init): Set fp_model in tdep. Defer setting + up floating-point conversions until we know the floating-point model + in use by the inferior. Don't complain about being unable to + determine the ABI of the inferior when we don't have one. + (arm_extract_return_value): Support different floating-point models. + (arm_store_return_value): Likewise. + * armnbsd-tdep.c (arm_netbsd_aout_init_abi): Set fp_model in tdep to + ARM_FLOAT_SOFT. + (arm_netbsd_elf_init_abi): Set fp_model to ARM_FLOAT_SOFT_VFP. + +2002-02-19 Peter Schauer + + * i386-tdep.c (i386_gdbarch_init): Eliminate incorrect use + of ``current_gdbarch''. + +2002-02-19 Richard Earnshaw + + * armnbsd-nat.c : ANSIfy all function declarations. + (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs): New. + (fetch_inferior_registers): Re-implement in terms of above. + (store_register, store_regs, store_fp_register, store_fp_regs): New. + (store_inferior_registers): Re-implement in terms of above. + +2002-02-19 Richard Earnshaw + + * arm-linux-nat.c: Linux -> GNU/Linux when not talking about the + kernel. + * arm-linux-tdep.c: Likewise. + * config/arm/tm-linux.h: Likewise. + +2002-02-19 Richard Earnshaw + + * configure.tgt (arm*-*-netbsd*): This variant is now fully multi-arch. + * config/arm/nbsd.mt (TM_FILE): Delete. + * config/arm/tm-nbsd.h: Delete. + +2002-02-19 Richard Earnshaw + + * arm-tdep.c (arm_gdbarch_init): Initialize TARGET_CHAR_SIGNED. + Initialize CALL_DUMMY_LENGTH. + +2002-02-19 Richard Earnshaw + + * armnbsd-tdep.c (arm_netbsd_aout_in_solib_call_trampoline): New + function. + (arm_netbsd_aout_init_abi): Initialize IN_SOLIB_CALL_TRAMPOLINE. + * config/arm/tm-nbsd.h: Don't include config/tm-nbsd.h, it only + defines one thing and that is incorrect for this port. + (IN_SOLIB_CALL_TRAMPOLINE): Delete. + +2002-02-18 Pierre Muller + + * go32-nat.c: add i386-tdep.h include to import FP_REGNUM_P macro. + +2002-02-18 Pierre Muller + + * win32-nat.c (display_selector): New function. Displays information + about the information returned by GetThreadSelectorEntry API function. + (display_selectors): New function. Displays the infomation of + the selector given as argument, or of CS, DS ans FS selectors + if no argument is given. + ( _initialize_inftarg): Add "w32" as info prefix command. + Add "info w32 selector" as command calling display_selectors. + +2002-02-19 Pierre Muller + + * i386-tdep.c (get_longjmp_target): Fix compilation failure + by setting dummy values to JB_PC and JB_ELEMENT_SIZE + if not defined. + +2002-02-18 Richard Earnshaw + + * config/arm/nbsd.mt (TDEPFILES): Add solib-sunos.o. + +2002-02-18 Richard Earnshaw + + * arm-tdep.c (arm_set_call_dummy_breakpoint_offset): New function. + (arm_fix_call_dummy): Call it. + (arm_call_dummy_breakpoint_offset): Delete. + (arm_gdbarch_init): Initialize call_dummy_breakpoint_offset. + * config/arm/tm-arm.h (CALL_DUMMY_BREAKPOINT_OFFSET): Delete. + +2002-02-18 Andrew Cagney + + * gdbarch.sh (FRAME_CHAIN_VALID): Only require at level 2. + Default to func_frame_chain_valid. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.h (FRAME_CHAIN_VALID): Delete definition. + +2002-02-18 Elena Zannoni + + * ppc-linux-nat.c: Update copyright. + (fetch_register, store_register): Add tid parameter, don't compute + tid here. + (fetch_ppc_registers, store_ppc_registers): Add tid + parameter. Pass it along to callees. + (fetch_inferior_registers, store_inferior_registers): Compute tid + here, and pass it to calleed functions. + (fill_gregset, supply_fpregset): Clean up formatting. + +2002-02-18 Richard Earnshaw + + * arm-tdep.c (arm_gdbarch_init): Initialize coerce_float_to_double. + * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Delete. + +2002-02-18 Richard Earnshaw + + * gdbarch.sh (GET_LONGJMP_TARGET): Add rule. + * gdbarch.c gdbarch.h: Regenerate. + * breakpoint.c (create_longjmp_breakpoint): Always compile this + function. + (breakpoint_reset): Test GET_LONGJMP_TARGET_P(). + * infrun.c (GET_LONGJMP_TARGET): Delete default definition. + (handle_inferior_event): Test GET_LONGJMP_TARGET_P(). + + * arm-tdep.h (struct gdbarch_tdep): Add jb_pc and jb_elt_size fields. + * arm-tdep.c (arm_get_longjmp_target): New function. + (arm_gdbarch_init): Initialize jb_pc to -1. If ABI handler changes + this to a positive value register arm_get_longjmp_target as the + longjmp handler. + * arm-linux-tdep.c (arm_get_longjmp_target): Delete. + (arm_linux_init_abi): Set up longjmp description in tdep. + * armnbsd-nat.c (get_longjmp_target): Delete. + * armnbsd-tdep.c (arm_netbsd_init_abi_common): Set up longjmp + description in tdep. + * config/arm/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC): Delete. + (get_longjmp_target): Delete declaration. + (GET_LONGJMP_TARGET): Delete. + * config/arm/tm-linux.h (arm_get_longjmp_target): Delete declaration. + (GET_LONGJMP_TARGET): Delete. + +2002-02-17 Kevin Buettner + + From Peter Schauer : + * ia64-tdep.c (ia64_gdbarch_init): Eliminate incorrect use + of ``current_gdbarch''. + +2002-02-17 Tom Tromey + + * cli/cli-cmds.c (compare_strings): New function. + (complete_command): Only print each unique item once. + * completer.h (complete_line): Declare. + * completer.c (complete_line): New function. + (line_completion_function): Use it. + +2002-02-16 Andrew Cagney + + * gdbarch.sh (TARGET_LONG_DOUBLE_BIT): Default to 64. + * gdbarch.h, gdbarch.c: Re-generate. + +2002-02-16 Daniel Jacobowitz + + * valarith.c (value_x_unop): Fix decrement; support post-decrement. + +2002-02-16 Daniel Jacobowitz + + From Peter Schauer : + * valops.c (value_arg_coerce): Don't take the address of a reference + to convert an argument to a reference. + +2002-02-15 Christopher Faylor + + * win32-nat.c (get_image_name): New function. + (handle_load_dll): Use get_image_name function. + (get_child_debug_event): Avoid registering debug events until possibly + execed process is started. + (child_create_inferior): Allow invocation via shell so that command + line redirection, etc. works ok. + (_initialize_inftarg): Add new command: "set shell" to control whether + a shell is used to start a process. + +2002-02-15 Daniel Jacobowitz + + * gdbserver/linux-mips-low.c (cannot_fetch_register): Use find_regno + instead of find_register_by_number. + (cannot_store_register): Likewise. + +2002-02-14 Pierre Muller + + * dwarf2read.c: Replace fprintf (stderr, ...) by + fprintf_unfiltered (gdb_stderr, ...). + +2002-02-15 Daniel Jacobowitz + + * gdbserver/gdbserver.1: Document --attach. + +2002-02-15 Richard Earnshaw + + * arm-tdep.h (struct gdbarch_tdep): Add fields for breakpoint + descriptions. + * arm-tdep.c (arm_default_arm_le_breakpoint) + (arm_default_arm_be_breakpoint, arm_default_thumb_le_breakpoint) + (arm_default_thumb_be_breakpoint): New. Initialize them from + traditional breakpoint defines. + (arm_breakpoint_from_pc): Use new gdbarch_tdep entries. + (arm_gdbarch_init): Initialize new breakpoint variables. + * arm-linux-tdep.c (arm_linux_arm_le_breakpoint): New. + (arm_linux_init_abi): Initialize linux-specific breakpoint. + * armnbsd-tdep.c (arm_nbsd_arm_le_breakpoint): New. + (arm_netbsd_aout_init_abi, arm_netbsd_elf_init_abi): Split common + code out to ... + (arm_netbsd_init_abi_common): ... here; new function. + * config/arm/tm-arm.h (ARM_LE_BREAKPOINT, ARM_BE_BREAKPOINT) + (THUMB_LE_BREAKPOINT, THUMB_BE_BREAKPOINT): Delete. + * config/arm/tm-linux.h (ARM_LE_BREAKPOINT): Delete. + * config/arm/tm-nbsd.h (ARM_LE_BREAKPOINT): Delete. + +2002-02-15 Richard Earnshaw + + * arm-tdep.h (enum arm_abi): New enum. + (struct gdbarch_tdep): New structure. + (LOWEST_PC): Provide a default. + (arm_gdbarch_register_os_abi): Declare new function. + * arm-tdep.c (arm_abi_names): New array. + (process_note_abi_tag_sections): New function. + (get_elfosabi): New function. + (arm_gdbarch_register_os_abi): New function. + (arm_gdbarch_init): Try to determine the ABI of the inferior. If + support for that ABI has been built in, then call the appropriate + configuration routine. Use gdbarch_num_regs() to get the number + of registers. + (arm_dump_tdep): New function. + (arm_init_abi_eabi_v1, arm_init_abi_eabi_v2, arm_init_abi_apcs): New + place-holder functions. + (_initialize_arm_tdep): Register them. + * config/arm/tm-arm.h (LOWEST_PC): Delete. + + * armnbsd-tdep.c: New file. + * Makefile.in (armnbsd-tdep.o): Add dependencies. + * config/arm/nbsd.mt (TDEPFILES): Add it. + * config/arm/tm-nbsd.h (LOWEST_PC): Delete. + + * armnbsd-nat.c: Include regcache.h. + * Makefile.in (armnbsd-nat.o): Update dependency list. + + * arm-tdep.c (arm_get_next_pc): Use printf_filtered for error message. + +2002-02-14 Daniel Jacobowitz + + * gdbserver/Makefile.in: Fix typos in target rules. + +2002-02-14 Daniel Jacobowitz + + Fix part of PR gdb/267. + * linespec.c (find_methods): Handle constructors specially for now. + +2002-02-14 Corinna Vinschen + + * arm-tdep.c (arm_push_arguments): Eliminate special float type + handling. + * config/arm/tm-arm.h (COERCE_FLOAT_TO_DOUBLE): Define to call + standard_coerce_float_to_double(). + +2002-02-14 Christopher Faylor + + * config/i386/xm-cygwin.h: Revert inadvertent reinclusion of + GDBINIT_FILENAME. + +2002-02-14 Elena Zannoni + + * rs6000-tdep.c (rs6000_gdbarch_init): Don't call + find_variant_by_name, because it confuses the multiarch + framework. Return NULL if there isn't an architecture with the + user supplied name, instead of forcing a different one without + recording the change with the multiarch machinery. + (find_variant_by_name): Delete. + +2002-02-14 Peter Schauer + + * config/i386/i386sol2.mh (NATDEPFILES): Add i387-nat.o, needed by + i386v4-nat.o now. Add gcore.o, Solaris x86 supports gcore. + +2002-02-13 Martin M. Hunt + + * stack.c (print_frame_info_base): When calling + print_frame_info_listing_hook, set current_source_symtab. + +2002-02-14 Daniel Jacobowitz + + * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS, + and remove unused $(INCLUDE_DIR). + Add regcache.c to OBS. + Add generated register protocol files to clean target. + Update dependencies for new objects, obsolete old target code. + + * gdbserver/linux-low.c: Remove all platform-specific code to + new files. Remove various dead code. Update to use regcache + functionality. + * gdbserver/remote-utils.c (fromhex): Add return statement + to quiet warning. + (putpkt): Dynamically allocate buf2 because PBUFSIZ is no longer + constant. + (input_interrupt): Add integer parameter to match prototype + of a signal handler. + (outreg): Use register_data (). + (prepare_resume_reply): Use gdbserver_expedite_regs. + * gdbserver/server.c (main): Dynamically allocate own_buf because + PBUFSIZ is no longer constant. Use registers_to_string () and + registers_from_string (). + * gdbserver/server.h: No longer include "defs.h". Add prototypes + for error (), fatal (), and warning (). Update definition of + PBUFSIZ to use regcache functionality. Add include guard. + * gdbserver/utils.c (fatal): Add missing ``const''. + (warning): New function. + + * regformats/regdat.sh: Include "regcache.h" in generated files. + Provide init_registers () function. + * regformats/regdef.h: Add prototype for set_register_cache (). + Add include guard. + + * gdbserver/linux-arm-low.c: New file. + * gdbserver/linux-i386-low.c: New file. + * gdbserver/linux-ia64-low.c: New file. + * gdbserver/linux-m68k-low.c: New file. + * gdbserver/linux-mips-low.c: New file. + * gdbserver/linux-ppc-low.c: New file. + * gdbserver/linux-sh-low.c: New file. + + * gdbserver/regcache.c: New file. + * gdbserver/regcache.h: New file. + + * gdbserver/low-linux.c: Removed obsolete file. + +2002-02-14 Daniel Jacobowitz + + * config/arm/linux.mt: Update GDBSERVER_DEPFILES. + * config/i386/linux.mt: Likewise. + * config/ia64/linux.mt: Likewise. + * config/m68k/linux.mh: Likewise. + * config/powerpc/linux.mh: Likewise. + * config/mips/linux.mt: Likewise. + + * config/sh/linux.mt: Add GDBSERVER_DEPFILES. + + * config/i386/i386lynx.mh: Mark gdbserver variables + as (currently) obsolete for this target. + * config/i386/nbsd.mt: Likewise. + * config/i386/nbsdelf.mt: Likewise. + * config/m32r/m32r.mt: Likewise. + * config/m68k/m68klynx.mh: Likewise. + * config/m68k/nbsd.mt: Likewise. + * config/m68k/sun3os4.mh: Likewise. + * config/mips/vr5000.mt: Likewise. + * config/ns32k/nbsd.mt: Likewise. + * config/pa/hppabsd.mh: Likewise. + * config/pa/hppaosf.mh: Likewise. + * config/powerpc/nbsd.mt: Likewise. + * config/rs6000/rs6000lynx.mh: Likewise. + * config/s390/s390.mt: Likewise. + * config/s390/s390x.mt: Likewise. + * config/sparc/sparclynx.mh: Likewise. + * config/sparc/sun4os4.mh: Likewise. + * config/i386/x86-64linux.mt: Likewise. + * config/sparc/linux.mh: Likewise. + +2002-02-14 Daniel Jacobowitz + + * configure.tgt: Configure gdbserver only for known working + targets. Set ${build_gdbserver} instead of modifying ${configdirs}. + * configure.in: Check ${build_gdbserver}. Put gdbserver/ into + SUBDIRS if it is configured. Update comment for ${nativefile}. + * configure: Regenerated. + +2002-02-13 Michael Snyder + + * config/i386/i386v42mp.mh: Add gcore.o to NATDEPFILES. + + * gcore.c (gcore_command): Use gcore_default_target instead of NULL. + (default_gcore_mach): Just return 0, work around a problem in bfd. + (default_gcore_target): OK to return NULL if exec_bfd is null. + (make_mem_sec): Use a cast, avoid a warning. + + * procfs.c (find_memory_regions_callback): Use a cast instead of + calling host_pointer_to_address (which complains if + sizeof (host pointer) != sizeof (target pointer)). + (procfs_make_note_section): Avoid overflow in psargs string. + + * procfs.c (procfs_make_note_section): Make the default + implementation return an error. + +2002-02-13 Rodney Brown + + * procfs.c (procfs_make_note_section): Provide a default definition + (for alpha-dec-osf4.0f). Fix typos. + +2002-02-13 Elena Zannoni + + * linux-proc.c: Add include of regcache.h. + * Makefile.in (linux-proc.o): Add dependency on regcache.h. + +2002-02-13 Andrew Cagney + + From 2002-01-18 Greg McGary : + * memattr.c (create_mem_region): Disallow useless empty region. + Regions are half-open intervals, so allow [A..B) [B..C) as + non-overlapping. + +2002-02-13 Michael Chastain + + * defs.h: Kill CONST_PTR. + * c-lang.h (c_builtin_types): Change CONST_PTR to simple "const". + * c-lang.c (c_builtin_types): Likewise. + * ch-lang.c (ch_builtin_types): Likewise. + * f-lang.c (f_builtin_types): Likewise. + * language.c (unknown_builtin_types): Likewise. + * m2-lang.c (m2_builtin_types): Likewise. + * p-lang.c (pascal_builtin_types): Likewise. + * scm-lang.c (c_builtin_types): Likewise. + +2002-02-13 Keith Seitz + + * arm-tdep.h (arm_get_next_pc): Add declaration. + +2002-02-13 Richard Earnshaw + + * arm-tdep.c (arm_use_struct_convention): Make static. Move to be + with other related struct-returning functions. + (arm_extract_struct_value_address): New function. + (arm_gdbarch_init): Initialize the above in multi-arch vector. Also + initialize float_format, double_format and long_double_format as + appropriate to the endianness of the target. + * config/arm/tm-arm.h (TARGET_DOUBLE_FORMAT): Delete. + (arm_use_struct_convention): Delete declaration. + (USE_STRUCT_CONVENTION, EXTRACT_STRUCT_VALUE_ADDRESS): Delete. + +2002-02-13 Keith Seitz + + * defs.h (core_addr_to_string_nz): New function. + +2002-02-13 Mark Kettenis + + Apply missing bits of 2002-01-15 patch. + * i386v4-nat.c (supply_fpregset): Use i387_supply_fsave. + (fill_fpregset): Use i387_fill_fsave. + +2002-02-12 Keith Seitz + + * utils.c (core_addr_to_string): Use phex instead of phex_nz. + (core_addr_to_string_nz): New function. + +2002-02-11 Richard Earnshaw + + * arm-linux-nat.c: Really include arm-tdep.h. + * config/arm/tm-linux.h (struct type, struct value): Declare. + +2002-02-11 Michael Snyder + + * procfs.c: Include elf-bfd.h (for elfcore_write functions). + (gcore section): Ifdef for Solaris and Unixware only. + (procfs_do_thread_registers): Unixware needs one lwpstatus + per thread (not one prstatus or pstatus). + (procfs_make_note_section): Iterate only over kernel threads (lwps), + not over all gdb threads. For unixware, call elfcore_write_pstatus + once before iterating over threads. + +2002-02-11 Richard Earnshaw + + * arm-tdep.h: New file. + * arm-tdep.c: Include arm-tdep.h. + (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) + (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) + (arm_print_float_info, arm_register_type, convert_to_extended) + (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) + (arm_extract_return_value, arm_register_name): Make static. + (arm_software_single_step): Similarly. Fix types in declaration. + (arm_register_byte, arm_register_raw_size, arm_register_virtual_size) + (arm_store_return_value, arm_store_struct_return): New functions. + (arm_gdbarch_init): Register the above functions. Also register + call_dummy_start_offset, sizeof_call_dummy_words, + function_start_offset, inner_than, decr_pc_after_break, fp_regnum, + sp_regnum, pc_regnum, register_bytes, num_regs, max_register_raw_size, + max_register_virtual_size, register_size. Set up + prologue_cache.saved_regs here, rather than ... + (_initialize_arm_tdep): ... here. + * config/arm/tm-arm.h (struct type, struct value): Delete forward + declarations. + (arm_addr_bits_remove, arm_smash_text_address, arm_saved_pc_after_call) + (arm_skip_prologue, arm_call_dummy_words, arm_fix_call_dummy) + (arm_print_float_info, arm_register_type, convert_to_extended) + (arm_elf_make_msymbols_special, arm_coff_make_msymbol_special) + (arm_extract_return_value, arm_register_name): Delete declarations. + (SMASH_TEXT_ADDRESS, ADDR_BITS_REMOVE, FUNCTION_START_OFFSET) + (SKIP_PROLOGUE, SAVED_PC_AFTER_CALL, INNER_THAN, BREAKPOINT_FROM_PC) + (DECR_PC_AFTER_BREAK, PRINT_FLOAT_INFO, REGISTER_SIZE, NUM_REGS) + (REGISTER_NAME, REGISTER_BYTES, REGISTER_BYTE, REGISTER_RAW_SIZE) + (REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE) + (MAX_REGISTER_VIRTUAL_SIZE, REGISTER_VIRTUAL_TYPE, STORE_STRUCT_RETURN) + (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, CALL_DUMMY_WORDS) + (SIZEOF_CALL_DUMMY_WORDS, CALL_DUMMY_START_OFFSET, FIX_CALL_DUMMY) + (SOFTWARE_SINGLE_STEP_P, SOFTWARE_SINGLE_STEP) + (ELF_MAKE_MSYMBOL_SPECIAL, COFF_MAKE_MSYMBOL_SPECIAL) Delete. + (arm_pc_is_thumb, arm_pc_is_thumb_dummy, thumb_get_next_pc) + (arm_get_next_pc): No-longer static -- these are needed by the RDI + interface. + * arm-linux-nat.c arm-linux-tdep.c armnbsd-nat.c: Include arm-tdep.h. + * remote-rdi.c remote-rdp.c: Likewise. + * Makefile.in (arm-linux-nat.o, arm-linux-tdep.o arm-tdep.o) + (armnbsd-nat.o, remote-rdi.o, remote_rdp.o): Update dependencies. + * config/arm/tm-nbsd.h (SOFTWARE_SINGLE_STEP_P): Delete bogus + definition. + + * arm-tdep.h (ARM_A1_REGNUM, ARM_A4_REGNUM, ARM_AP_REGNUM) + (ARM_SP_REGNUM, ARM_LR_REGNUM, ARM_PC_REGNUM, ARM_F0_REGNUM) + (ARM_F3_REGNUM, ARM_F7_REGNUM, ARM_FPS_REGNUM, ARM_PS_REGNUM): Renamed + from non-ARM_ prefixed definitions. + * arm-tdep.c armnbsd-nat.c arm-linux-nat.c arm-linux-tdep.c: Update + all uses of above. + * remote-rdi.c remote-rdp.c: Likewise. + * arm-linux-nat.c (ARM_CPSR_REGNUM): Renamed from CPSR_REGNUM. + +2002-02-11 Richard Earnshaw + + * arm-tdep.c (arm_frameless_function_invocation) + (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args) + (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc) + (arm_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame) + (arm_pop_frame, arm_get_next_pc): Make static. + (arm_gdbarch_init): Register above in gdbarch structure. + (arm_read_fp): Renamed from arm_target_read_fp. + (arm_pc_is_thumb, arm_pc_is_thumb_dummy): Make static. + * config/arm/tm-arm.h (arm_frameless_function_invocation) + (arm_frame_args_address, arm_frame_locals_address, arm_frame_num_args) + (arm_frame_chain, arm_init_extra_frame_info, arm_frame_saved_pc) + (arm_target_read_fp, arm_frame_init_saved_regs, arm_push_dummy_frame) + (arm_pop_frame, arm_get_next_pc, arm_pc_is_thumb) + (arm_pc_is_thumb_dummy): Delete declarations. + (INIT_EXTRA_FRAME_INFO, TARGET_READ_FP, FRAME_CHAIN) + (FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC, FRAME_ARGS_ADDRESS) + (FRAME_LOCALS_ADDRESS, FRAME_NUM_ARGS, FRAME_ARGS_SKIP) + (FRAME_INIT_SAVED_REGS, PUSH_DUMMY_FRAME, POP_FRAME): Delete. + +2002-02-10 Daniel Jacobowitz + + * symtab.c (compare_search_syms): New function. + (sort_search_symbols): New function. + (search_symbols): Sort symbols after searching rather than + before. + +2002-02-10 Andrew Cagney + + * NEWS: Linux -> GNU/Linux. + +2002-02-10 Andrew Cagney + + * gdbarch.sh: For for level one methods, disallow a definition + when partially multi-arched. Add comments explaining rationale. + * gdbarch.h: Re-generate. + +2002-02-10 Andrew Cagney + + * gdbarch.sh (EXTRA_STACK_ALIGNMENT_NEEDED): Don't require when + multi-arch partial. + +2002-02-10 Andrew Cagney + + * gdbarch.sh: Map LEVEL onto a symbolic GT_LEVEL. Exit on bad + field. Use diff -u. + * gdbarch.c: Re-generate. + +2002-02-10 Andrew Cagney + + * config/mips/tm-mips.h (CALL_DUMMY_LOCATION): Delete. + * gdbarch.sh (PUSH_RETURN_ADDRESS): Don't require when multi-arch + partial. + +2002-02-10 Andrew Cagney + + * gdbarch.sh (REGISTER_CONVERTIBLE): Don't require when + multi-arch partial. + (PUSH_ARGUMENTS): Switch to using predefault. + * gdbarch.c: Regenerate. + +2002-02-10 Andrew Cagney + + * valops.c (PUSH_ARGUMENTS): Delete definition. + * gdbarch.sh (PUSH_ARGUMENTS): Don't require when multi-arch + partial. Default to default_push_arguments. + * gdbarch.h, gdbarch.c: Regenerate. + +2002-02-09 Andrew Cagney + + * defs.h (throw_exception): Rename return_to_top_level. Update + comments. + * utils.c (error_stream, internal_verror, quit): Ditto. + * top.c (throw_exception, catcher): Ditto. + * sparclet-rom.c (sparclet_load): Ditto. + * remote.c (interrupt_query, minitelnet): Ditto. + * remote-sds.c (interrupt_query): Ditto. + * remote-mips.c (mips_error, mips_kill): Ditto. + * ocd.c (interrupt_query): Ditto. + * monitor.c (monitor_interrupt_query): Ditto. + * m3-nat.c (suspend_all_threads, thread_resume_command): Ditto. + * target.h: Update comment. + + * m3-nat.c, ocd.c, sparclet-rom.c: Update copyright. + +2002-02-09 Andrew Cagney + + * gdbarch.sh (TARGET_LONG_DOUBLE_FORMAT): Default to + default_double_format. + * gdbarch.h, gdbarch.c: Re-generate. + * findvar.c (floatformat_unknown): Delete variable definition. + * doublest.h (floatformat_unknown): Delete variable declaration. + +2002-02-09 Jim Blandy + + * stabsread.c (read_type): Add code to parse Sun's syntax for + prototyped function types. + +2002-02-09 Andrew Cagney + + * Makefile.in (SUBDIR_CLI_INITS): Set to SUBDIR_CLI_SRCS. + (SUBDIR_MI_INITS): Set to SUBDIR_MI_SRCS. + +2002-02-09 Peter Schauer + + * xcoffsolib.c (_initialize_xcoffsolib): Renamed from + _initialize_solib. Fixes name clash with solib.c:_initialize_solib, + now _initialize_xcoffsolib gets called again and overrides the + commands from solib.c in a native configuration. + +2002-02-09 Mark Kettenis + + * doublest.c (store_typed_floating): Don't try to return a value. + Fixes PR gdb/290. + +2002-02-08 Jim Blandy + + * c-typeprint.c (c_type_print_varspec_suffix): If a function type + is prototyped and has no arguments, print its argument list as + `(void)'. + +2002-02-08 Chris Demetriou + + * MAINTAINERS (write-after-approval): Add myself. + (paper-trail): I've escaped! + +2002-02-08 Christopher Faylor + + * win32-nat.c (cygwin_pid_to_str): Revert 2002-02-08 change xasprintf + changes. + (_initialize_check_for_gdb_ini): Ditto. + +2002-02-08 Martin M. Hunt + + * win32-nat.c (cygwin_pid_to_str): Fix typo. + xaprintf -> xasprintf. + +2002-02-08 Pierre Muller + + * win32-nat.c: Remove use of printf and sprintf functions. + +2002-02-08 Richard Earnshaw + + * arm-tdep.c (arm_frame_chain_valid): Make static. + (arm_push_arguments): Likewise. + (arm_gdbarch_init): New function. + (_initialize_arm_tdep): Call it. + * config/arm/tm-arm.h (GDB_MULTI_ARCH): Set to 1. + (TARGET_DOUBLE_FORMAT): Test TARGET_BYTE_ORDER, not target_byte_order. + (FRAME_CHAIN_VALID): Delete. + (arm_frame_chain_valid): Delete declaration. + (PUSH_ARGUMENTS): Delete. + (arm_push_arguments): Delete declaration. + (CALL_DUMMY_P): Delete. + +2002-02-08 Andrew Cagney + Corinna Vinschen + + * gdbtypes.c (build_gdbtypes): Disable setting a specific float format + on builtin float types. + +2002-02-08 Daniel Jacobowitz + + * utils.c: Include before "bfd.h". + * tui/tui-hooks.c: Likewise. + * tui/tui.c: Likewise. + * tui/tuiCommand.c: Likewise. + * tui/tuiData.c: Likewise. + * tui/tuiDataWin.c: Likewise. + * tui/tuiDisassem.c: Likewise. + * tui/tuiGeneralWin.c: Likewise. + * tui/tuiIO.c: Likewise. + * tui/tuiLayout.c: Likewise. + * tui/tuiRegs.c: Likewise. + * tui/tuiSource.c: Likewise. + * tui/tuiSourceWin.c: Likewise. + * tui/tuiStack.c: Likewise. + * tui/tuiWin.c: Likewise. + +2002-02-07 Elena Zannoni + + * sh-tdep.c (sh_nofp_frame_init_saved_regs): Extend where[] array + to include space for pseudoregs as well. Update loops accordingly. + (sh_fp_frame_init_saved_regs): Ditto. + (sh_init_extra_frame_info, sh_pop_frame): Split long lines. + +2002-02-07 Andrew Cagney + + * MAINTAINERS: Andreas Schwab is GNU/Linux m68k maintainer. + Add Richard Earnshaw to Arm maintainers. + +2002-02-07 Andrew Cagney + + * defs.h (warning_begin): Delete declaration. + + * config/powerpc/tm-ppcle-eabi.h (TARGET_BYTE_ORDER_DEFAULT): + Delete macro. + +2002-02-07 Michael Snyder + + * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): + Logic bug, remove misplaced else. + +2002-02-07 Klee Dienes + + * fork-inferior.c (fork_inferior): Add '!' to the list of + characters that need to be quoted when building a string for the + shell. Quote '!' specifically with a backslash, since CSH chokes + when trying to evaluate "str!str". + +2002-02-06 Nick Clifton + + * rdi-share/host.h: Only provide a typedef for bool if it is not + defined. + +2002-02-04 Michael Snyder + + * breakpoint.h (enum bptype): Add new overlay event bp type. + (enable_overlay_breakpoints, disable_overlay_breakpoints): Export. + + * breakpoint.c (create_internal_breakpoint): New function. + (internal_breakpoint_number): Moved into create_internal_breakpoint. + (create_longjmp_breakpoint): Use create_internal_breakpoint. + (create_thread_event_breakpoint): Ditto. + (create_solib_event_breakpoint): Ditto. + (create_overlay_event_breakpoint): New function. + (enable_overlay_breakpoints, disable_overlay_breakpoints): New funcs. + (update_breakpoints_after_exec): Delete and re-initialize + overlay event breakpoints after an exec. Add FIXME comment + about longjmp breakpoint. + (print_it_typical): Ignore overlay event breakpoints. + (print_one_breakpoint): Ditto. + (mention): Ditto. + (bpstat_what): Do not stop for overlay event breakpoints. + (delete_breakpoint): Don't delete overlay event breakpoints. + (breakpoint_re_set_one): Delete the overlay event breakpoint. + (breakpoint_re_set): Re-create overlay event breakpoint. + + * symfile.c (overlay_auto_command): Enable overlay breakpoints. + (overlay_manual_command): Disable overlay breakpoints. + (overlay_off_command): Disable overlay breakpoints. + +2002-02-06 Richard Earnshaw + + * arm-tdep.c: Include elf-bfd.h and coff/internal.h. + (MSYMBOL_SET_SPECIAL, MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Move defines + to here from config/tm-arm.h. + (coff_sym_is_thumb): Make static. + (arm_elf_make_msymbol_special): New function. + (arm_coff_make_msymbol_special): New function. + * config/arm/tm-arm.h (MSYMBOL_SET_SPECIAL): Delete definition. + (MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): Likewise. + (coff_sym_is_thumb): Delete declaration. + (arm_elf_make_msymbol_special): Declare. + (arm_coff_make_msymbol_special): Declare. + (ELF_MAKE_MSYMBOL_SPECIAL): Call arm_elf_make_msymbol_special. + (COFF_MAKE_MSYMBOL_SPECIAL): Call arm_coff_make_msymbol_special. + +2002-02-06 Richard Earnshaw + + * arm-tdep.c (arm_software_single_step): ANSIfy function declaration. + +2002-02-06 Richard Earnshaw + + * gdbarch.sh (PRINT_FLOAT_INFO): Add rule. + * gdbarch.c gdbarch.h: Regenerate. + * arch-utils.c (default_print_float_info): New function. + * arch-utils.h (default_print_float_info): Prototype it. + * infcmd.c (float_info): Call PRINT_FLOAT_INFO. + * doc/gdbint.texinfo (FLOAT_INFO): Mark as deprecated. + (PRINT_FLOAT_INFO): Document it. + + * arm-tdep.c (arm_print_float_info): Renamed from arm_float_info. + * config/arm/tm-arm.h (FLOAT_INFO): Delete. + (PRINT_FLOAT_INFO): Define. + +2002-02-06 Pierre Muller + + * win32-nat.c (_initialize_check_for_gdb_ini): + Add typecast to sprintf argument to suppress a warning. + +2002-02-05 Pierre Muller + + * win32-nat.c (last_sig): Changed type of variable to target_signal, + to allow easier handling of pass state. + (DEBUG_EXCEPTION_SIMPLE): New macro, used in handle_exception, + that gives exception name and address. + (handle_exception): Use DEBUG_EXCEPTION_SIMPLE macro + and set last_sig value to ourstatus->value.sig. Some missing + exceptions added. + (child_continue): Correctly report continue_status. + (get_child_debug_event,do_initial_child_stuff): Set last_sig to + TARGET_SIGNAL_0 (new default value). + (child_resume): consider sig argument passed to decide if + the exception should be passed to debuggee or not. + +2002-02-05 Michael Snyder + + * regcache.c (fetch_register): Call target_fetch_register + only if we don't call FETCH_PSEUDO_REGISTER. + (store_register): Call target_store_register only if we + don't call STORE_PSEUDO_REGISTER. + +2002-02-05 Elena Zannoni + + * gdbarch.sh: Add definitions for COFF_MAKEMSYMBOL_SPECIAL and + ELF_MAKE_MSYMBOL_SPECIAL. + * gdbarch.c, gdbarch.h: Regenerate. + * arch-utils.c (default_make_msymbol_special): New function. + * arch-utils.h (default_make_msymbol_special): Export. + * elfread.c (elf_symtab_read): Compile use of + ELF_MAKE_MSYMBOL_SPECIAL unconditionally because it is now + multiarched. + * coffread.c (coff_symtab_read): Ditto, for + COFF_MAKE_MSYMBOL_SPECIAL. + +2002-02-05 Jim Blandy + + * solib-svr4.c (svr4_truncate_ptr): New function. + (svr4_relocate_section_addresses): Do the address arithmetic with + the appropriate truncation for target addresses, even when + CORE_ADDR is larger than a target address. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c (mywait): Cast second argument of waitpid + to (int *). + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c (kill_inferior): Remove commented out + code. + +2002-02-05 Daniel Jacobowitz + + * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c: Remove unused include files. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c: Define PTRACE_ARG3_TYPE. + (read_inferior_memory): Use it. + (write_inferior_memory): Likewise. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c (create_inferior): Call strerror instead of + grubbing through sys_errlist. + +2002-02-05 Daniel Jacobowitz + + * gdbserver/linux-low.c: New file, copied exactly from low-linux.c. + +2002-02-04 Pierre Muller + * win32-nat.c (handle_exception): Handle Ctrl-Break exception. + +2002-02-04 Andrew Cagney + + * cli/cli-decode.c (do_cfunc, set_cmd_cfunc): New functions. + (do_sfunc, set_cmd_sfunc): New functions. + + * command.h (struct cmd_list_element): Add field func. + * cli/cli-decode.h (struct cmd_list_element): Ditto. + * command.h (set_cmd_sfunc, set_cmd_cfunc): Declare. + * cli/cli-decode.h: Ditto. + + * cli/cli-decode.c (help_cmd): Test for func not cfunc/sfunc. + (help_all, help_cmd_list): Ditto. + (find_cmd, complete_on_cmdlist): Ditto. + * top.c (execute_command): Ditto. + + * cli/cli-setshow.c (do_setshow_command): Call func instead of + function.sfunc. + + * infcmd.c (notice_args_read): Fix function signature. + + * cli/cli-cmds.c (init_cli_cmds): Use set_cmd_sfunc. + * cli/cli-decode.c (add_set_cmd): Ditto. + * utils.c (initialize_utils): Ditto. + * maint.c (_initialize_maint_cmds): Ditto. + * infrun.c (_initialize_infrun): Ditto. + * demangle.c (_initialize_demangler): Ditto. + * remote.c (add_packet_config_cmd): Ditto. + * mips-tdep.c (_initialize_mips_tdep): Ditto. + * cris-tdep.c (_initialize_cris_tdep): Ditto. + * proc-api.c (_initialize_proc_api): Ditto. + * kod.c (_initialize_kod): Ditto. + * valprint.c (_initialize_valprint): Ditto. + * top.c (init_main): Ditto. + * infcmd.c (_initialize_infcmd): Ditto. + * corefile.c (_initialize_core): Ditto. + * arm-tdep.c (_initialize_arm_tdep): Ditto. + * arch-utils.c (initialize_current_architecture): Ditto. + (_initialize_gdbarch_utils): Ditto. + * alpha-tdep.c (_initialize_alpha_tdep): Ditto. + + * cli/cli-decode.c (add_cmd): Use set_cmd_cfunc. + * wince.c (_initialize_inftarg): Ditto. + * symfile.c (_initialize_symfile): Ditto. + * mips-tdep.c (_initialize_mips_tdep): Ditto. + * language.c (_initialize_language): Ditto. + * arc-tdep.c (_initialize_arc_tdep): Ditto. + +2002-02-04 Michael Snyder + + * memattr.c (_initialize_mem): Elaborate the help for 'mem' command. + +2002-02-04 Daniel Jacobowitz + + * gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS. + Add rules for building the register data files. + +2002-02-04 Daniel Jacobowitz + + * regformats/regdat.sh: Add braces to the definition of + expedite_regs_${arch}. + +2002-02-04 Daniel Jacobowitz + + * regformats/regdef.h (struct reg): Add comment describing the + requirements for offset and size fields. + +2002-02-04 Andreas Schwab + + * config/ia64/linux.mh: Don't set NAT_CLIBS and REGEX. + * config/ia64/linux.mt: Don't set GDBSERVER_LIBS. + +2002-02-04 Richard Earnshaw + + * gdbarch.sh (copyright): Update years in generated header. + (SMASH_TEXT_ADDRESS): Add rule. + * gdbarch.h, gdbarch.c: Re-generate. + * coffread.c: Multi-arch uses of SMASH_TEXT_ADDRESS. + * dbxread.c: Likewise. + * dwarfread.c: Likewise. + * elfread.c: Likewise. + * somread.c: Likewise. + + * arm-tdep.c (arm_smash_text_address): New function. + * config/arm/tm-arm.h (SMASH_TEXT_ADDRESS): Define in terms of above. + +2002-02-04 Pierre Muller + + Add support for hardware watchpoints on win32 native. + * win32-nat.c (CONTEXT_DEBUG_DR macro): Add use of + CONTEXT_DEBUG_REGISTERS. + (dr variable): New variable. Static array containing a local copy + of debug registers. + (debug_registers_changed): New variable. Reflects when debug registers + are changed and need to be written to inferior. + (debug_registers_used): New variable. Reflects when any debug register + was set, used when new threads are created. + (cygwin_set_dr, cygwin_set_dr7, cygwin_get_dr6): New functions used by + i386-nat code. + (thread_rec): Set dr array if id is the thread of current_event . + (child_continue, child_resume): Change the debug registers for all + threads if debug_registers_changed. + (child_add_thread): Change the debug registers if debug_registers_used. + * config/i386/cygwin.mh: Add use of i386-nat.o file. + Link nm.h to new nm-cygwin.h file. + + config/i386/nm-cygwin.h: New file. Contains the macros used for use + of hardware registers. + +2002-02-03 Andrew Cagney + + * valprint.c (print_floating): Allow non TYPE_CODE_FLT types. + Restore behavour broken by 2002-01-20 Andrew Cagney + IEEE_FLOAT removal. + +2002-02-03 Daniel Jacobowitz + + * c-valprint.c (c_val_print): Pass a proper valaddr to + cp_print_class_method. + * valops.c (search_struct_method): If there is only one method + and args is NULL, return that method. + +2002-02-03 Daniel Jacobowitz + + * gdbtypes.c (init_simd_type): Use TYPE_TAG_NAME instead of + accessing tag_name directly. + +2002-02-03 Daniel Jacobowitz + + * ax-gdb.c (find_field): Use TYPE_TAG_NAME instead + of accessing tag_name directly. + +2002-02-03 Daniel Jacobowitz + + PR gdb/280 + * gdbtypes.c (replace_type): New function. + * gdbtypes.h (replace_type): Add prototype. + * stabsread.c (read_type): Use replace_type. + +2002-02-03 Richard Earnshaw + + * Makefile.in (memattr.o): Add missing dependencies rule. + +2002-02-03 Peter Schauer + + * breakpoint.c (break_at_finish_command): Really export. + (break_at_finish_at_depth_command): Ditto. + (tbreak_at_finish_command): Ditto. + * hppa-tdep.c: Include completer.h. + * Makefile.in (hppa-tdep.o): Add dependency on $(completer_h). + (COMMON_OBS): Remove duplicate ui-file.o, frame.o, doublest.o. + +2002-02-01 Andrew Cagney + + * utils.c (do_write): New function. + (error_stream): Rewrite combining the code from error_begin and + verror. + (verror): Rewrite using error_stream. + (error_begin): Delete function. + +2002-02-01 Andrew Cagney + + * utils.c (error_begin): Make static. + * defs.h (error_begin): Delete declaration. + + * linespec.c (cplusplus_error): Replace cplusplus_hint. + (decode_line_1): Use cplusplus_error instead of error_begin, + cplusplus_hint and return_to_top_level. + * coffread.c (coff_symfile_read): Use error instead of error_begin + and return_to_top_level. + * infrun.c (default_skip_permanent_breakpoint): Ditto. + +2002-02-01 Andrew Cagney + + * language.h (type_error, range_error): Make string parameter + constant. + * language.c (warning_pre_print): Delete extern declaration. + * dwarfread.c (warning_pre_print): Ditto. + * language.c (type_error, range_error): Rewrite to use verror and + vwarning instead of warning_begin. + +2002-02-01 Michael Snyder + + * breakpoint.c (breakpoint_re_set): Delete ancient #if 0 code. + (set_ignore_count): Move misplaced comment back where it belongs. + +2002-02-01 Andrew Cagney + + * command.h (NO_FUNCTION): Delete macro. + * cli/cli-decode.h (NO_FUNCTION): Ditto. + * top.c (execute_command): Replace NO_FUNCTION with NULL. + * tracepoint.c (_initialize_tracepoint): Ditto. + * cli/cli-decode.c (add_set_cmd): Ditto. + * cli/cli-cmds.c (init_cli_cmds): Ditto. + +2002-02-01 Daniel Jacobowitz + + * gnu-v3-abi.c (gnuv3_virtual_fn_field): Update comments. + Update ``this'' pointer when calling virtual functions. + +2002-02-01 Michael Snyder + + * breakpoint.c (create_temp_exception_breakpoint): Delete. + * hppa-tdep.c: Deprecate xbreak, txbreak and bx commands. + +2002-02-01 Daniel Jacobowitz + + * regformats/reg-arm.dat: New file. + * regformats/reg-i386.dat: New file. + * regformats/reg-ia64.dat: New file. + * regformats/reg-m68k.dat: New file. + * regformats/reg-mips.dat: New file. + * regformats/reg-ppc.dat: New file. + * regformats/reg-sh.dat: New file. + * regformats/regdef.h: New file. + * regformats/regdat.sh: New file. + +2002-02-01 Richard Earnshaw + + * arm-tdep.c (arm_frameless_function_invocation): Add some comments. + (arm_frame_args_address, arm_frame_locals_address): New functions. + (arm_frame_num_args): New function. + * config/tm-arm.h (FRAME_ARGS_ADDRESS): Call arm_frame_args_address. + (FRAME_LOCALS_ADDRESS): Call arm_frame_locals_address. + (FRMA_NUM_ARGS): Call arm_frame_num_args. + +2002-01-31 Michael Snyder + + * breakpoint.c (break_at_finish_command): Export. + (break_at_finish_at_depth_command): Export. + (tbreak_at_finish_command): Export. + (_initialize_breakpoint): Delete "xbreak" and "tbreak" commands. + * hppa-tdep.c (_initialize_hppa_tdep): Add "xbreak" and + "tbreak" commands, which are HPPA specific. + + * printcmd.c (disassemble_command): Remove an ancient + artifact of an old merge. + + * symfile.h (enum overlay_debugging_state): + Define enum constant values for overlay mode. + * symfile.c (overlay_debugging): Use enums instead of literals. + (overlay_is_mapped, overlay_auto_command, + overlay_manual_command): Ditto. + + * breakpoint.c (insert_breakpoints, remove_breakpoint, + breakpoint_here_p, breakpoint_inserted_here_p, + breakpoint_thread_match, bpstat_stop_status, + describe_other_breakpoints, check_duplicates, clear_command): + Coding standard fixes. + + * target.c (target_xfer_memory): Add spaces, coding standard. + (do_xfer_memory): Add missing line to trust-readonly + code: check bfd SEC_READONLY flag for section. + +2002-01-31 Andrew Cagney + + * PROBLEMS: Fix typo, 5.1->5.1.1. + +2002-01-30 Daniel Jacobowitz + + * symtab.c (find_pc_sect_psymtab): Do not search psymtabs for + data symbols, since we search based on textlow and texthigh. + (find_pc_sect_symtab): Likewise. + +2002-01-30 Andrew Cagney + + * defs.h (vwarning): Declare. + * utils.c (vwarning): New function. + (warning): Call vwarning. + (warning_begin): Delete function. + + * rs6000-nat.c (vmap_ldinfo): Use the function warning to print + the warning message. + * d10v-tdep.c (d10v_address_to_pointer) [0]: Delete call to + warning_begin. + +2002-01-30 Michael Snyder + + * NEWS: Mention "set trust-readonly-sections" command. + Mention generate-core-file command. + +2002-01-15 Michael Snyder + + * target.c: New command, "set trust-readonly-sections on". + (do_xfer_memory): Honor the suggestion to trust readonly sections + by reading them from the object file instead of from the target. + (initialize_targets): Register command "set trust-readonly-sections". + +2002-01-29 Andrew Cagney + + * parse.c (target_map_name_to_register): Simplify, search regs and + pseudo-regs using a single loop. + +2002-01-30 Andrew Cagney + + * PROBLEMS: Note that the i386 fix was missing from 5.1.1. + +2002-01-15 Rodney Brown + + * config/i386/tm-i386v4.h: Define HAVE_I387_REGS. + * config/i386/i386v42mp.mh: Add i387-nat.o . + * i386v4-nat.c: Include i387-nat.h. + (supply_fpregset): Use i387_supply_fsave. + (fill_fpregset): Use i387_fill_fsave. + +2002-01-30 Richard Earnshaw + + * arm-tdep.c (arm_call_dummy_words): Define. + * arm-linux-tdep.c (arm_linux_call_dummy_words): Define. + * config/arm/tm-arm.h (CALL_DUMMY_P): Define. + (CALL_DUMMY_WORDS): Define. + (arm_call_dummy_words): Declare. + * config/arm/tm-linux.h (CALL_DUMMY_WORDS): Define. + (arm_linux_call_dummy_words): Declare. + +2002-01-30 Andreas Schwab + + * m68klinux-nat.c: Fix last change to use regcache_collect + instead of referencing registers[] directly. + +2002-01-29 Andrew Cagney + + * parse.c (target_map_name_to_register): Delete code wrapped in + #ifdef REGISTER_NAME_ALIAS_HOOK. + +2002-01-28 Michael Snyder + + * regcache.c (legacy_read_register_gen): Need to be able to + read pseudo-register as well as real register. + (legacy_write_register_gen): Ditto. + +2002-01-28 Andrew Cagney + + * config/mips/tm-wince.h (TARGET_BYTE_ORDER): Delete. + * config/sparc/tm-sparc.h (TARGET_BYTE_ORDER): Delete. + * config/ns32k/tm-umax.h (TARGET_BYTE_ORDER): Delete. + * config/ia64/tm-ia64.h (TARGET_BYTE_ORDER): Delete. + * config/m32r/tm-m32r.h (TARGET_BYTE_ORDER): Delete. + * config/m68k/tm-m68k.h (TARGET_BYTE_ORDER): Delete. + * config/m88k/tm-m88k.h (TARGET_BYTE_ORDER): Delete. + * config/mn10200/tm-mn10200.h (TARGET_BYTE_ORDER): Delete. + * config/pa/tm-hppa.h (TARGET_BYTE_ORDER): Delete. + * config/sh/tm-wince.h (TARGET_BYTE_ORDER): Delete. + * config/v850/tm-v850.h (TARGET_BYTE_ORDER): Delete. + * config/vax/tm-vax.h (TARGET_BYTE_ORDER): Delete. + * config/z8k/tm-z8k.h (TARGET_BYTE_ORDER): Delete. + * config/i960/tm-i960.h (TARGET_BYTE_ORDER): Delete. + * config/i386/tm-i386.h (TARGET_BYTE_ORDER): Delete. + * config/h8500/tm-h8500.h (TARGET_BYTE_ORDER): Delete. + * config/h8300/tm-h8300.h (TARGET_BYTE_ORDER): Delete. + * config/fr30/tm-fr30.h (TARGET_BYTE_ORDER): Delete. + * config/d30v/tm-d30v.h (TARGET_BYTE_ORDER): Delete. + * config/alpha/tm-alpha.h (TARGET_BYTE_ORDER): Delete. + +2002-01-28 Andrew Cagney + + * arch-utils.c (TARGET_BYTE_ORDER_DEFAULT): Delete macro. + (target_byte_order): Initialize to BFD_ENDIAN_BIG. + (initialize_current_architecture): Update target_byte_order using + information from BFD. + * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_DEFAULT): + * config/arm/tm-arm.h (TARGET_BYTE_ORDER_DEFAULT): Delete. + +2002-01-28 Andrew Cagney + + * config/vax/tm-vax.h (INVALID_FLOAT): Move macro from here... + * vax-tdep.c (INVALID_FLOAT): To here. Document why it is broken. + + * rs6000-tdep.c (rs6000_do_registers_info): Delete code wrapped in + #ifdef INVALID_FLOAT. + * infcmd.c (do_registers_info): Ditto. + * values.c (unpack_double): Ditto. Add comment. + + * config/ns32k/tm-umax.h (INVALID_FLOAT): Delete macro that was + already commented out. + +2002-01-26 Andreas Schwab + + * config/m68k/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define. + * m68klinux-nat.c: Update ptrace interface for fetching/storing + registers and add support for PTRACE_GETREGS. + +2002-01-24 Andrew Cagney + + GDB 5.1.1 released from 5.1 branch. + * NEWS: Add 5.1.1 news. + * README: Sync with 5.1 branch. + +2002-01-23 Fred Fish + + * mdebugread.c (parse_partial_symbols): Only copy stabstring1 to + stabstring on initial malloc. Reallocing will copy it for us, + if necessary. + +2002-01-23 Elena Zannoni + + * Makefile.in (hpread_h): Delete. + (HFILES_NO_SRCDIR): Remove hpread.h. + (ALLDEPFILES): Remove hp-psymtab-read.c and hp-symtab-read.c. + (hpread.o): Update dependencies. + (hp-psymtab-read.o, hp-symtab-read.o): Remove. + + * hp-psymtab-read.c: Remove file. + * hp-symtab-read.c: Remove file. + * hpread.h: Remove file. + + * hpread.c: Merge all contents of hp-psymtab-read.c, + hp-symtab-read.c and hpread.h into this file, as it was prior to + January 1999. + + * config/pa/hpux11w.mh, config/pa/hpux11.mh, + config/pa/hpux1020.mh, config/pa/hppaosf.mh, + config/pa/hppahpux.mh, config/pa/hppabsd.mh (NATDEPFILES): + Remove hp-psymtab-read.o and hp-symtab-read.o, add hpread.o. + +2002-01-23 Elena Zannoni + + * ppc-linux-nat.c (ppc_register_u_addr, supply_gregset, + fill_gregset): Call gdbarch_tdep() just once, assign result to + variable and use that, instead of calling the function several + times. + +2002-01-24 Alexandre Oliva + + * configure.host: Accept sparcv9 as alias for sparc64. + * configure.tgt: Likewise. + +2002-01-22 Kevin Buettner + + * solib-aix5.c (build_so_list_from_mapfile) + (aix5_relocate_main_executable): Fix xcalloc() calls so order of + arguments is not reversed. + * solib-sunos.c (sunos_relocate_main_executable): Likewise. + * solib-svr4.c (svr4_relocate_main_executable): Likewise. + +2002-01-22 Elena Zannoni + + * sh-tdep.c (sh_pseudo_register_read): New function. Renamed and + modified version of obsolete sh_fetch_pseudo_register. + (sh_fetch_pseudo_register): Rename to sh_pseudo_register_read. + (sh4_register_read): New function. + (sh_pseudo_register_write): New function. Renamed and modified + version of obsolete sh_store_pseudo_register. + (sh_store_pseudo_register): Rename to sh_pseudo_register_write. + (sh4_register_write): New function. + (sh_gdbarch_init): Remove setting of gdbarch function + fetch_pseudo_register and store_pseudo_register. Remove setting of + register_convert_to_raw, register_convert_to_virtual, + register_convertible. + (sh_sh4_register_convertible): Delete. No longer needed. All is + taken care by architecture specific functions + register_read/register_write. + (sh_sh4_register_convert_to_virtual): Make static. + (sh_sh4_register_convert_to_raw): Ditto. + +2002-01-22 Andrew Cagney + + * doublest.c (floatformat_is_negative): Assert FMT is non NULL. + (floatformat_is_nan, floatformat_mantissa): Ditto. + + * gdbtypes.c (_initialize_gdbtypes): Initialize TYPE_FLOATFORMAT + for builtin_type_ieee_single_little, builtin_type_ieee_double_big, + builtin_type_ieee_double_little, + builtin_type_ieee_double_littlebyte_bigword, + builtin_type_m68881_ext, builtin_type_i960_ext, + builtin_type_m88110_ext, builtin_type_m88110_harris_ext, + builtin_type_arm_ext_big, builtin_type_arm_ext_littlebyte_bigword, + builtin_type_ia64_spill_big, builtin_type_ia64_spill_little and + builtin_type_ia64_quad_big, builtin_type_ia64_quad_little. + +2002-01-22 Corinna Vinschen + + * xstormy16-tdep.c (xstormy16_scan_prologue): Add frameless + parameter. Set frameless flag if it exists and depended of + whether the scanned function is frameless or not. + (xstormy16_skip_prologue): If function is frameless, return + result of xstormy16_scan_prologue(). + (xstormy16_frame_init_saved_regs): Adjust xstormy16_scan_prologue() + call. + +2002-01-21 Elena Zannoni + + * sh-tdep.c (sh_fp_frame_init_saved_regs, sh_push_arguments, + sh_generic_show_regs, sh3_show_regs, sh3e_show_regs, + sh3_dsp_show_regs, sh4_show_regs, sh_dsp_show_regs, + sh_sh4_register_byte, sh_sh4_register_raw_size, + sh_sh3e_register_virtual_type, sh_sh4_register_virtual_type, + sh_sh4_register_convertible, sh_sh4_register_convert_to_virtual, + sh_sh4_register_convert_to_raw, sh_fetch_pseudo_register, + sh_store_pseudo_register, sh_do_pseudo_register): Call + gdbarch_tdep() just once, assign result to variable and use that, + instead of calling the function several times. + +2002-01-20 Mark Kettenis + + * go32-nat.c (fetch_register): Use FP_REGNUM_P and FPC_REGNUM_P + macros instead of LAST_FPU_CTRL_REGNUM. + (store_register): Likewise. + +2002-01-21 Jim Blandy + + * infcmd.c (run_command): Check that the `exec' target layer's BFD + is up-to-date before running the program, not just when a program + exits. + +2002-01-21 Fred Fish + + * arm-tdep.c (thumb_skip_prologue): Quit scanning prologue + when we have found all instructions we are looking for. + +2002-01-21 Richard Earnshaw + + * arm-tdep.c (arm_register_name): New function. + (arm_registers_names): Make static. + * config/arm/tm-arm.h (arm_register_names): Delete declaration. + (arm_register_name): Declare. + (REGISTER_NAME): Use it. + +2002-01-21 Richard Earnshaw + Kevin Buettner + + Convert arm targets to new FRAME interface. + * arm-tdep.c (struct frame_extra_info): Remove fsr. + (arm_frame_find_save_regs): Delete. + (arm_frame_init_saved_regs): New. + (arm_init_extra_frame_info): Alloacte saved_regs as required. + Allocate extra_info as required. Convert all uses of fsr.regs + to use saved_regs, similarly all uses of EXTRA_FRAME_INFO fields + to use extra_info. + (thumb_scan_prologue, arm_scan_prologue, arm_find_callers_reg) + (arm_frame_chain, arm_frame_saved_pc, arm_pop_frame): Likewise. + (check_prologue_cache, save_prologue_cache): Likewise. + (_initialize_arm_tdep): Ensure prologue_cache is correctly set up. + * config/arm/tm-arm.h (EXTRA_FRAME_INFO): Delete. + (FRAME_FIND_SAVED_REGS): Delete. + (arm_frame_find_saved_regs): Delete prototype. + (arm_frame_init_saved_regs): New prototype. + (FRAME_INIT_SAVED_REGS): Define. + +2002-01-20 Andrew Cagney + + * config/arc/tm-arc.h (IEEE_FLOAT): Delete. + +2002-01-20 Andrew Cagney + + From Jeff Law : + * infttrace.c: Include . + (child_pid_to_exec_file): Revamp. Use pstat call to get the + exec file if the ttrace equivalent fails. + +2002-01-20 Andrew Cagney + + * rdi-share/devsw.c (openLogFile): Delete unused ``struct tm lt''. + (closeLogFile): Ditto. + +2002-01-20 Michael Chastain + + * top.c (print_gdb_version): Bump copyright year to 2002. + +2002-01-20 Andrew Cagney + + * MAINTAINERS (Blanket Write Privs): Add Kevin Buettner, Elena + Zannoni and Eli Zaretskii. + +2002-01-20 Daniel Jacobowitz + + * buildsym.c: Update copyright years. + * c-typeprint.c: Likewise. + * dwarf2read.c: Likewise. + * f-typeprint.c: Likewise. + * gdbtypes.c: Likewise. + * gdbtypes.h: Likewise. + * hp-symtab-read.c: Likewise. + * hpread.c: Likewise. + * mdebugread.c: Likewise. + * p-typeprint.c: Likewise. + +2002-01-20 Andrew Cagney + + * remote-sim.c (gdbsim_open): Simplify code testing the macro + TARGET_BYTE_ORDER_SELECTABLE_P. Assume the target is always + byte-order selectable. + * sparc-tdep.c (sparc_target_architecture_hook): Ditto. + * arch-utils.c: Ditto. + (set_endian): Ditto. + (set_endian_from_file): Ditto. + * gdbserver/low-sim.c (create_inferior): Ditto. + * gdbarch.sh: Ditto. + * gdbarch.h: Re-generate. + * config/powerpc/tm-ppc-eabi.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/sparc/tm-sparclite.h (TARGET_BYTE_ORDER_SELECTABLE): + * config/sparc/tm-sparclet.h (TARGET_BYTE_ORDER_SELECTABLE): + * config/mcore/tm-mcore.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/arm/tm-wince.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/arm/tm-linux.h (TARGET_BYTE_ORDER_SELECTABLE_P): + * config/arc/tm-arc.h (TARGET_BYTE_ORDER_SELECTABLE): + * config/arm/tm-arm.h (TARGET_BYTE_ORDER_SELECTABLE_P): Delete + macro definition. + * config/mips/tm-wince.h: Remove #undef of macro + TARGET_BYTE_ORDER_SELECTABLE. + * config/sh/tm-wince.h: Ditto. + +2002-01-20 Daniel Jacobowitz + + * gdbtypes.h (struct cplus_struct_type): Add is_artificial to + member function fields. Add accessor macro + TYPE_FN_FIELD_ARTIFICIAL. + * dwarf2read.c (dwarf2_add_member_fn): Check for artificial methods. + * c-typeprint.c (c_type_print_base): Skip artificial member + functions. + +2002-01-20 Daniel Jacobowitz + + * f-typeprint.c: Delete unused function f_type_print_args. + * p-typeprint.c: Delete unused function pascal_type_print_args. + +2002-01-20 Daniel Jacobowitz + + * gdbtypes.h (struct type): Fix whitespace. Remove obsolete + comment. Add ``artificial'' to ``union field_location''. + + * dwarf2read.c: Remove ad-hoc TYPE_FIELD_ARTIFICIAL. + + * buildsym.c (finish_block): Initialize TYPE_FIELD_ARTIFICIAL to 0. + * mdebugread.c (parse_symbol): Likewise. + * stabsread.c (define_symbol): Likewise. + * hp-symtab-read.c (hpread_function_type): Likewise, instead of + initializing TYPE_FIELD_BITPOS to n (obsolete). + (hpread_doc_function_type): Likewise. + * hpread.c (hpread_function_type): Likewise. + +2002-01-20 Andrew Cagney + + * configure.in (host_makefile_frag): Only require a host makefile + fragment when a native build. + * configure: Re-generate. + +2002-01-20 Andrew Cagney + + * doublest.h (floatformat_from_type): Declare. + * doublest.c (floatformat_from_type): New function. + (convert_typed_floating): Use. + + * valprint.c (print_floating): Replace checks for IEEE_FLOAT with + call to function floatformat_from_type. + + * gdbarch.sh (IEEE_FLOAT): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * config/i960/tm-i960.h (IEEE_FLOAT): Delete macro. + * config/i386/tm-i386.h (IEEE_FLOAT): Ditto. + * config/z8k/tm-z8k.h (IEEE_FLOAT): Ditto. + * config/sparc/tm-sparc.h (IEEE_FLOAT): Ditto. + * config/pa/tm-hppa.h (IEEE_FLOAT): Ditto. + * config/m88k/tm-m88k.h (IEEE_FLOAT): Ditto. + * config/m68k/tm-m68k.h (IEEE_FLOAT): Ditto. + * config/h8500/tm-h8500.h (IEEE_FLOAT): Ditto. + * config/h8300/tm-h8300.h (IEEE_FLOAT): Ditto. + * config/fr30/tm-fr30.h (IEEE_FLOAT): Ditto. + * config/arm/tm-arm.h (IEEE_FLOAT): Ditto. + * config/alpha/tm-alpha.h (IEEE_FLOAT): Ditto. + + * s390-tdep.c (s390_gdbarch_init): Do not set ieee_float. + * x86-64-tdep.c (i386_gdbarch_init): Ditto. + * sparc-tdep.c (sparc_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * mips-tdep.c (mips_gdbarch_init): Ditto. + * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + +2002-01-20 Jiri Smid + + * configure.host, configure.tgt: Support x86-64. + * NEWS: Note new target x86-64. + + * config/i386/x86-64linux.mh (NATDEPFILES): x86-64-nat.o removed. + * x86-64-linux-nat.c (x86_64_register_u_addr): New function. + * config/i386/nm-x86-64.h (ATTACH_LWP): Removed. + * Makefile.in (x86-64-tdep.o, x86-64-linux-tdep.o, + x86-64-linux-nat.o): Fix dependencies. + +2002-01-19 Andrew Cagney + + * utils.c: Remove #ifndef MALLOC_INCOMPATIBLE. + * config/sparc/xm-sun4os4.h (PTRACE_ARG3_TYPE): Move macro .... + * config/sparc/nm-sun4os4.h (PTRACE_ARG3_TYPE): ... to here. + * config/sparc/xm-sun4os4.h: Delete file. + * config/sparc/sun4os4.mh (XM_FILE): Delete makefile variable. + +2002-01-19 Andrew Cagney + + * config/sparc/sparclynx.mh (XM_FILE): Delete. + * config/rs6000/rs6000lynx.mh (XM_FILE): Delete. + * config/m68k/m68klynx.mh (XM_FILE): Delete. + * config/i386/i386lynx.mh (XM_FILE): Delete. + * config/rs6000/xm-rs6000ly.h: Delete file. + * config/sparc/xm-sparclynx.h: Delete file. + * config/m68k/xm-m68klynx.h: Delete file. + * config/i386/xm-i386lynx.h: Delete file. + * config/xm-lynx.h: Delete file. + * config/djgpp/fnchange.lst: Update. + +2002-01-19 Jason Thorpe + + * alpha-tdep.c (alpha_register_byte): New function. + (alpha_register_raw_size): Ditto. + (alpha_register_virtual_size): Ditto. + (alpha_skip_prologue_internal): Renamed from + alpha_skip_prologue. + (alpha_skip_prologue): New version that calls + alpha_skip_prologue_internal. + (alpha_in_lenient_prologue): Use alpha_skip_prologue_internal. + * config/alpha/tm-alpha.h (SKIP_PROLOGUE): Remove + second argument from alpha_skip_prologue. + (REGISTER_BYTE): Use alpha_register_byte. + (REGISTER_RAW_SIZE): Use alpha_register_raw_size. + (REGISTER_VIRTUAL_SIZE): Use alpha_register_virtual_size. + (FRAMELESS_FUNCTION_INVOCATION): Use + generic_frameless_function_invocation_not. + (FRAME_NUM_ARGS): Use frame_num_args_unknown. + (COERCE_FLOAT_TO_DOUBLE): Use standard_coerce_float_to_double. + +2002-01-19 Andrew Cagney + + * config/mips/xm-news-mips.h: Delete file. + * config/mips/news-mips.mh (XM_FILE): Delete makefile variable. + + * config/m88k/xm-m88k.h: Delete file. + * config/m88k/xm-dgux.h: Do not include xm-m88k.h. + * config/m88k/xm-delta88v4.h: Ditto. + * config/m88k/xm-delta88.h: Ditto. + + * config/alpha/xm-fbsd.h: Delete file. + * config/alpha/fbsd.mh (XM_FILE): Delete makefile variable. + + * config/sparc/xm-sparc.h: Delete file. + * Makefile.in (xm-sun4os4.h): Delete dependency. + * config/sparc/xm-sun4sol2.h: Do not include xm-sparc.h. + * config/sparc/xm-sun4os4.h: Ditto. + * config/sparc/xm-linux.h: Ditto. + + * config/i386/xm-windows.h: Delete file. + +2002-01-19 Andrew Cagney + + * utils.c: Include for MAXPATHLEN. + (gdb_realpath): Use MAXPATHLEN when PATH_MAX is not defined. + +2002-01-19 Jason Thorpe + + * alpha-tdep.c (alpha_call_dummy_words): New. + * config/alpha/tm-alpha.h (CALL_DUMMY): Remove. + (CALL_DUMMY_P): Define. + (CALL_DUMMY_WORDS): Define. + (SIZEOF_CALL_DUMMY_WORDS): Define. + +2002-01-19 Per Bothner + + * gnu-v3-abi.c (gnuv3_rtti_type): Guard that vtable_symbol_name + isn't NULL, which can happen with some gcj-3.x-produced code. + +2002-01-19 Jason Thorpe + + * alpha-tdep.c (alpha_register_virtual_type): New function. + (alpha_init_frame_pc_first): Ditto. + (alpha_fix_call_dummy): Ditto. + (alpha_store_struct_return): Ditto. + (alpha_extract_struct_value_address): Ditto. + * config/alpha/tm-alpha.h (REGISTER_VIRTUAL_TYPE): Use + alpha_register_virtual_type. + (STORE_STRUCT_RETURN): Use alpha_store_struct_return. + (EXTRACT_STRUCT_VALUE_ADDRESS): Use + alpha_extract_struct_value_address. + (FIX_CALL_DUMMY): Use alpha_fix_call_dummy. + (INIT_FRAME_PC): Use init_frame_pc_noop. + (INIT_FRAME_PC_FIRST): Use alpha_init_frame_pc_first. + +2002-01-19 Mark Kettenis + + * i386gnu-nat.c: Include "i386-tdep.h". + (fetch_fpregs): Simplify code dealing with uninitialized floating + point states such that it doesn't require FP7_REGNUM. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c (frame_extra_info): New. + (alpha_find_saved_regs): Make static. Use + frame->extra_info. + (alpha_frame_init_saved_regs): New function. + (alpha_frame_saved_pc): Use frame->extra_info. + (temp_saved_regs): Don't declare as struct frame_saved_regs. + (heuristic_proc_desc): Adjust for temp_saved_regs changes. + (init_extra_frame_info): Rename to... + (alpha_init_extra_frame_info): ...this. Use frame->extra_info. + (alpha_print_extra_frame_info): New function. + (alpha_frame_locals_address): Ditto. + (alpha_frame_args_address): Ditto. + (alpha_pop_frame): Use frame->extra_info. + * config/alpha/tm-alpha.h (FRAME_ARGS_ADDRESS): Use + alpha_frame_args_address. + (FRAME_LOCALS_ADDRESS): Use alpha_frame_locals_address. + (alpha_find_saved_regs): Remove prototype. + (FRAME_INIT_SAVED_REGS): Use alpha_frame_init_saved_regs. + (EXTRA_FRAME_INFO): Remove. + (INIT_EXTRA_FRAME_INFO): Use alpha_init_extra_frame_info. + (PRINT_EXTRA_FRAME_INFO): Use alpha_print_extra_frame_info. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c (alpha_osf_in_sigtramp): New function. + (alpha_cannot_fetch_register): Ditto. + (alpha_cannot_store_register): Ditto. + (alpha_register_convertible): Ditto. + (alpha_use_struct_convention): Ditto. + * config/alpha/tm-alpha.h: Update copyright years. + (IN_SIGTRAMP): Use alpha_osf_in_sigtramp. + (INNER_THAN): Use core_addr_lessthan. + (CANNOT_FETCH_REGISTER): Use alpha_cannot_fetch_register. + (CANNOT_STORE_REGISTER): Use alpha_cannot_store_register. + (REGISTER_CONVERTIBLE): Use alpha_register_convertible. + (USE_STRUCT_CONVENTION): Use alpha_use_struct_convention. + (FRAME_CHAIN): Remove unnecessary cast. + +2002-01-18 Andrew Cagney + + * NEWS: Document that testsuite/gdb.hp/gdb.threads-hp/ is + obsolete. + +2002-01-18 Andrew Cagney + + * infptrace.c: Remove ATTRIBUTE_UNUSED. Update copyright. + * monitor.c, remote-array.c, remote-bug.c: Ditto. + * remote-e7000.c, remote-es.c, remote-mips.c: Ditto. + * remote-nindy.c, remote-os9k.c, remote-rdi.c: Ditto. + * remote-rdp.c, remote-sds.c, remote-sim.c: Ditto. + * remote-st.c, remote-vx.c, remote.c, win32-nat.c: Ditto. + * x86-64-linux-nat.c: Ditto. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c (alpha_register_name): New function. + * config/alpha/tm-alpha.h (REGISTER_NAMES): Remove. + (REGISTER_NAME): Define. + +2002-01-18 Jason Thorpe + + * config/nm-nbsd.h (KERNEL_U_ADDR): Remove. + +2002-01-18 Jason Thorpe + + * alpha-tdep.c: Update copyright years. + (alpha_next_pc): New function. + (alpha_software_single_step): Ditto. + * config/alpha/tm-alpha.h: Add prototype for + alpha_software_single_step. + +2002-01-18 Jason Thorpe + + * alphabsd-nat.c: Update copyright years. + (fill_gregset): Use regcache_collect. + (fill_fpregset): Likewise. + (fetch_inferior_registers): Only fetch integer registers + if requested to do so. + (store_inferior_registers): Only store integer registers + if requested to do so. + +2002-01-17 Andrew Cagney + + * config/alpha/alpha-osf3.mh (XDEPFILES): Delete. + * config/alpha/alpha-osf2.mh (XDEPFILES): Delete. + * config/alpha/alpha-osf1.mh (XDEPFILES): Delete. + * config/alpha/alpha-linux.mh (XDEPFILES): Delete. + * config/alpha/fbsd.mh (XDEPFILES): Delete. + * config/arm/linux.mh (XDEPFILES): Delete. + * config/arm/nbsd.mh (XDEPFILES): Delete. + * config/i386/i386dgux.mh (XDEPFILES): Delete. + * config/i386/i386sol2.mh (XDEPFILES): Delete. + * config/i386/i386m3.mh (XDEPFILES): Delete. + (NATDEPFILES): Move i387-tdep.o and core-aout.o to here. + * config/i386/i386gnu.mh (XDEPFILES): Delete. + * config/i386/fbsd.mh (XDEPFILES): Delete. + * config/i386/i386bsd.mh (XDEPFILES): Delete. + * config/i386/i386sco5.mh (XDEPFILES): Delete. + * config/i386/i386v4.mh (XDEPFILES): Delete. + * config/i386/i386v42mp.mh (XDEPFILES): Delete. + * config/i386/i386sco4.mh (XDEPFILES): Delete. + * config/i386/i386aix.mh (XDEPFILES): Delete. + * config/i386/go32.mh (XDEPFILES): Delete. + * config/i386/cygwin.mh (XDEPFILES): Delete. + * config/i386/i386lynx.mh (XDEPFILES): Delete. + * config/i386/i386mach.mh (XDEPFILES): Delete. + * config/i386/i386v32.mh (XDEPFILES): Delete. + * config/i386/linux.mh (XDEPFILES): Delete. + * config/i386/nbsdelf.mh (XDEPFILES): Delete. + * config/i386/ncr3000.mh (XDEPFILES): Delete. + * config/i386/i386mk.mh (NATDEPFILES): Rename XDEPFILES. + * config/i386/i386sco.mh (XDEPFILES): Delete. + * config/i386/i386v.mh (XDEPFILES): Delete. + * config/i386/nbsd.mh (XDEPFILES): Delete. + * config/i386/ptx.mh (NATDEPFILES): Rename XDEPFILES. + * config/i386/ptx4.mh (NATDEPFILES): Rename XDEPFILES. + * config/i386/symmetry.mh (XDEPFILES): Delete. + * config/i386/obsd.mh (XDEPFILES): Delete. + * config/i386/x86-64linux.mh (XDEPFILES): Delete. + * config/ia64/linux.mh (XDEPFILES): Delete. + * config/ia64/aix.mh (XDEPFILES): Delete. + * config/m68k/apollo68b.mh (XDEPFILES): Delete. + * config/m68k/dpx2.mh (XDEPFILES): Delete. + * config/m68k/3b1.mh (NATDEPFILES): Rename XDEPFILES. + * config/m68k/apollo68v.mh (XDEPFILES): Delete. + * config/m68k/hp300bsd.mh (XDEPFILES): Delete. + * config/m68k/linux.mh (XDEPFILES): Delete. + * config/m68k/m68klynx.mh (XDEPFILES): Delete. + * config/m68k/m68kv4.mh (XDEPFILES): Delete. + * config/m68k/nbsd.mh (XDEPFILES): Delete. + * config/m68k/sun2os3.mh (XDEPFILES): Delete. + * config/m68k/sun2os4.mh (XDEPFILES): Delete. + * config/m68k/sun3os3.mh (XDEPFILES): Delete. + * config/m68k/sun3os4.mh (XDEPFILES): Delete. + * config/m88k/delta88.mh (XDEPFILES): Delete. + * config/m88k/delta88v4.mh (XDEPFILES): Delete. + * config/m88k/m88k.mh (XDEPFILES): Delete. + * config/mips/littlemips.mh (NATDEPFILES): Rename XDEPFILES. + * config/mips/linux.mh (XDEPFILES): Delete. + * config/mips/irix6.mh (XDEPFILES): Delete. + * config/mips/irix5.mh (XDEPFILES): Delete. + * config/mips/irix4.mh (XDEPFILES): Delete. + * config/mips/irix3.mh (XDEPFILES): Delete. + * config/mips/decstation.mh (XDEPFILES): Delete. + * config/mips/mipsm3.mh (XDEPFILES): Delete. + (NATDEPFILES): Move core-aout.o to here. + * config/ns32k/nbsd.mh (XDEPFILES): Delete. + * config/pa/hpux1020.mh (XDEPFILES): Delete. + * config/pa/hppabsd.mh (XDEPFILES): Delete. + * config/pa/hppahpux.mh (XDEPFILES): Delete. + * config/pa/hpux11w.mh (XDEPFILES): Delete. + * config/pa/hppaosf.mh (XDEPFILES): Delete. + * config/pa/hpux11.mh (XDEPFILES): Delete. + * config/powerpc/aix.mh (XDEPFILES): Delete. + * config/powerpc/nbsd.mh (XDEPFILES): Delete. + * config/powerpc/linux.mh (XDEPFILES): Delete. + * config/romp/rtbsd.mh: Rename XDEPFILES. + * config/rs6000/rs6000lynx.mh (XDEPFILES): Delete. + * config/rs6000/aix4.mh (XDEPFILES): Delete. + * config/rs6000/rs6000.mh (XDEPFILES): Delete. + * config/s390/s390.mh (XDEPFILES): Delete. + * config/vax/vaxbsd.mh (NATDEPFILES): Rename XDEPFILES. + * config/sparc/sun4sol2.mh (XDEPFILES): Delete. + * config/sparc/sun4os4.mh (XDEPFILES): Delete. + * config/sparc/sparclynx.mh (XDEPFILES): Delete. + * config/sparc/nbsdelf.mh (XDEPFILES): Delete. + * config/sparc/nbsd.mh (XDEPFILES): Delete. + * config/sparc/linux.mh (XDEPFILES): Delete. + * config/vax/vaxult.mh (XDEPFILES): Delete. + * config/vax/vaxult2.mh (XDEPFILES): Delete. + * Makefile.in (DEPFILES): Remove XDEPFILES. + +2002-01-17 Andrew Cagney + + * utils.c (internal_verror): Fix comments, default is yes not no. + Update queries to match. Default to quit and dump core. + +2002-01-17 Andrew Cagney + + * breakpoint.c: Update assuming #if UI_OUT is always true. Update + copyright. + * defs.h, event-top.c, gdbcmd.h: Ditto. + * infcmd.c, infrun.c, main.c, printcmd.c, remote.c: Ditto. + * source.c, stack.c, symfile.c, symtab.c, thread.c: Ditto. + * top.c, cli/cli-cmds.c, cli/cli-decode.c: Ditto. + * cli/cli-script.c, cli/cli-script.h, cli/cli-setshow.c: Ditto. + * mi/ChangeLog, mi/mi-cmd-break.c, mi/mi-cmd-stack.c: Ditto. + * mi/mi-main.c:Ditto. + + * stack.c, symfile.c: Update copyright. + +2002-01-17 Daniel Jacobowitz + + * gdbserver/low-hppabsd.c, gdbserver/low-lynx.c, + gdbserver/low-nbsd.c, gdbserver/low-sim.c, + gdbserver/low-sparc.c, gdbserver/low-sun3.c, + gdbserver/low-linux.c, gdbserver/server.c: Correct copyright notices. + +2002-01-17 Daniel Jacobowitz + + * gdbserver/low-hppabsd.c (myattach): New function, returning -1. + * gdbserver/low-lynx.c (myattach): Likewise. + * gdbserver/low-nbsd.c (myattach): Likewise. + * gdbserver/low-sim.c (myattach): Likewise. + * gdbserver/low-sparc.c (myattach): Likewise. + * gdbserver/low-sun3.c (myattach): Likewise. + + * gdbserver/low-linux.c (myattach): New function. + + * gdbserver/server.c (attach_inferior): New function. + (main): Handle "--attach". + +2002-01-16 Andrew Cagney + + * MAINTAINERS (language support): Daniel Jacobwitz is C++ + maintainer. + +2002-01-15 Daniel Jacobowitz + + * c-typeprint.c (is_type_conversion_operator): Add additional + check for non-conversion operators. + +2002-01-15 Michael Snyder + + * linux-proc.c: Add "info proc" command, a la procfs.c. + (read_mapping): New function, abstract and re-use code. + (linux_find_memory_regions): Use new func read_mapping. + (linux_info_proc_cmd): New function, implement "info proc". + (_initialize_linux_proc): Add new command "info proc". + +2002-01-15 Michael Snyder + + * symfile.c (generic_load): Use bfd_map_over_sections method + instead of manipulating bfd structure members directly. + (add_section_size_callback): New function, bfd sections callback + used by generic_load. + (load_sections_callback): New function, bfd sections callback + used by generic_load. + +2002-01-15 Elena Zannoni + + [Based on work by Jim Blandy] + * gdbtypes.h (builtin_type_v16qi, builtin_type_v8hi): Export. + (builtin_type_vec128): Export. + * gdbtypes.c (builtin_type_v16qi, builtin_type_v8hi): New SIMD + types. + (builtin_type_vec128): New builtin type for 128 bit vector + registers. + (build_gdbtypes): Initialize builtin_type_v16qi and + builtin_type_v8hi. Create the vec128 register builtin type + structure. + (build_builtin_type_vec128): New function. + (_initialize_gdbtypes): Register builtin_type_v16qi and + builtin_type_v8hi with gdbarch. Same for builtin_type_vec128. + * rs6000-tdep.c (rs6000_register_virtual_type): Change type of + AltiVec register to new builtin type. + +2001-01-15 Daniel Jacobowitz + + * stabsread.c (read_type): Pass dbx_lookup_type (typenums) + to make_cv_type. + +2002-01-14 Andrew Cagney + + * config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Rename + CLEAN_UP_REGISTER_VALUE. + * regcache.c (supply_register): Update only call. + +2002-01-14 Andrew Cagney + + * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*, + a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and + a29k-*-vxworks* targets as obsolete. + +2002-01-14 Michael Snyder + + * linux-proc.c (linux_do_thread_registers): Ignore fpxregs + until we can resolve portability issues. + * gregset.h: Remove references to fpxregs. + * gcore.c (gcore_command): Initialize note_sec to NULL. + +2002-01-13 Andrew Cagney + + * signals.c (target_signal_to_name): Rewrite. Only use + signals[].name when in bounds and non-NULL. + +2002-01-13 Andrew Cagney + + From Petr Ledvina : + * signals.c (target_signal_to_name): Verify that SIG is within the + bounds of the signals array. + +2002-01-13 Andrew Cagney + + * MAINTAINERS: Remove arm-coff and arm-pe from target list. + +2002-01-13 Keith Seitz + + * stack.c (print_frame_info_base): Print the frame's pc + only if when print_frame_info_listing_hook is not defined. + +2002-01-13 Keith Seitz + + * varobj.c (varobj_set_value): Make sure that there were no + errors evaluating the object before attempting to set its + value. + value_cast now properly adjusts VALUE_ADDRESS for baseclasses, + so this offset adjustment is no longer necessary. + (create_child): Don't set the error flag if the child is + a CPLUS_FAKE_CHILD. + (value_of_child): If value_fetch_lazy fails, return NULL + so that callers will be notified that an error occurred. + (c_value_of_variable): Delay check of variable's validity + until later. We actually want all structs and unions to have + the value "{...}". + Do not return "???" for variables which could not be evaluated. + This error condition must be returned to the caller so that it + can get the error condition from gdb. + (cplus_name_of_child): Adjust index for vptr before figuring + out the name of the child. + (cplus_value_of_child): If a child's (real) parent is not valid, + don't even bother trying to give a value for it. Just return + an error. Change all instances in this function. + (cplus_type_of_child): If our parent is one of the "fake" + parents, we need to get at the type of the real parent, and + derive the child's true type using this information. + +2002-01-13 Andrew Cagney + + From 2002-01-09 John Marshall : + * CONTRIBUTE, README, TODO: Change sourceware.cygnus.com to + sources.redhat.com, and tweak some related URLs which had + suffered from linkrot. + +2002-01-13 Andrew Cagney + + From Jeff law: + * hppa-tdep.c (hppa_push_arguments): Correct handling of 5-7 byte + structures passed in registers. + +2002-01-13 Eli Zaretskii + + * go32-nat.c (save_npx) [__DJGPP_MINOR__ < 3]: Remove extraneous + white space which prevented compilation. Reported by DSK + . + +2002-01-11 Michael Snyder + + * symfile.c (build_section_addr_info_from_section_tab): + Use bfd access method instead of manipulating bfd directly. + (syms_from_objfile): Ditto. + (simple_overlay_update_1): Ditto. + (simple_overlay_update): Ditto. + (generic_load): Ditto. + (overlay_unmapped_address): FIXME comment, bfd access methods. + (sections_overlap): FIXME comment, bfd access methods. + (pc_in_mapped_range): FIXME comment, bfd access methods. + (pc_in_unmapped_range): FIXME comment, bfd access methods. + (section_is_mapped): FIXME comment, bfd access methods. + (section_is_overlay): FIXME comment, bfd access methods. + + * symfile.c (generic_load): Whitespace and long line cleanups. + Remove duplicate variable, change several local variables to + more appropriate data types. + (print_transfer_performance): Use %lu instead of %ld for ulongs. + +2002-01-12 Andrew Cagney + + From Peter Schauer: + * language.c (longest_local_hex_string_custom): Use phex_nz to + convert NUM to a hex string. + +2002-01-12 Elena Zannoni + + * sh-tdep.c (sh_gdbarch_init): Move setting of long_bit earlier in + the function. + Update Copyright year. + +2002-01-12 Andrew Cagney + + * language.c (longest_raw_hex_string): Delete unused function. + +2002-01-11 Petr Sorfa + + * MAINTAINERS (write-after-approval): Add myself. + * dwarf2read.c (read_tag_string_type): Handling of + DW_AT_byte_size. + (read_tag_string_type): FORTRAN fix to prevent propagation of + first string size. + (set_cu_language): Handling of DW_LANG_Fortran95 + +2002-01-11 Richard Earnshaw + + * armnbsd-nat.c (fetch_inferior_registers): Change inferior_pid -> + GETPID(inferior_ptid). + (store_inferior_registers): Likewise. + +2002-01-10 Jason Merrill + + * dwarf2read.c (decode_locdesc): Implement DW_OP_litn, DW_OP_dup. + Fix DW_OP_minus. + +2002-01-10 Andrew Cagney + + * config/djgpp/fnchange.lst: Add renames for bfd/ChangeLog-0001 + and bfd/elf32-sh-nbsd.c. + +2002-01-10 Michael Snyder + + * NEWS: Mention --pid and corefile/proc-id behavior change. + + * Makefile.in: Add rules for gcore.o and linux-proc.o. + * gcore.c: Include cli/cli-decode.h instead of command.h. + + * main.c (captured_main): Add new command line option "--pid". + If the second command line argument (following the symbol-file) + begins with a digit, try to attach to it before trying to open + it as a corefile. + (print_gdb_help): Document the "--pid" argument. + +2002-01-10 Eli Zaretskii + + * completer.c (command_completer): New function. + + * completer.h : Add prototype. + + * cli/cli-cmds.c (init_cli_cmds): Make command_completer be the + completer for the "help" command. + +2002-01-09 Jason Merrill + + * c-typeprint.c (is_type_conversion_operator): Fix thinko. + +2002-01-09 Michael Snyder + + * i386-linux-nat.c (fill_fpxregset): Make global. + (store_fpxregset): Ditto. + + * gregset.h (gdb_fpxregset_t): Define. + (supply_fpxregset): Prototype. + (fill_fpxregset): Prototype. + + * exec.c (exec_make_note_section): Don't call elfcore_write_prpsinfo. + +2002-01-09 Richard Earnshaw + + * config/arm/arm-tdep.h (arm_software_single_step): Remove PARAMS. + * config/arm/nm-nbsd.h (arm_register_u_addr): Likewise. + * config/arm/tm-nbsd.h (get_longjmp_target): Likewise. + +2002-01-09 Andrew Cagney + + * MAINTAINERS: Update target maintainer rules so that any + Maintainer can approve a tested patch for a maintenance-only + target. + +2002-01-09 Richard Earnshaw + + * MAINTAINERS (write-after-approval): Add myself. + + * arm-tdep.c (arm_init_extra_frame_info): Cast NULL argument to + IN_SIGTRAMP. + +2002-01-08 Michael Snyder + + * linux-proc.c (child_pid_to_exec_file): Use readlink to get the + real name of the executable, rather than the /proc name. + +2002-01-03 Michael Snyder + + Implement a "generate-core-file" command in gdb, save target state. + * gcore.c: New file. Implement new command 'generate-core-file'. + Save a corefile image of the current state of the inferior. + * linux-proc.c: Add linux-specific code for saving corefiles. + * target.h (struct target_ops): Add new target vectors for saving + corefiles; to_find_memory_regions and to_make_corefile_notes. + (target_find_memory_regions): New macro. + (target_make_corefile_notes): New macro. + * target.c (update_current_target): Inherit new target methods. + (dummy_find_memory_regions): New place-holder method. + (dummy_make_corefile_notes): New place-holder method. + (init_dummy_target): Initialize new dummy target vectors. + * exec.c (exec_set_find_memory_regions): New function. + Allow the exec_ops vector for memory regions to be taken over. + (exec_make_note_section): New function, target vector method. + * defs.h (exec_set_find_memory_regions): Export prototype. + * procfs.c (proc_find_memory_regions): New function, corefile method. + (procfs_make_note_section): New function, corefile method. + (init_procfs_ops): Set new target vector pointers. + (find_memory_regions_callback): New function. + (procfs_do_thread_registers): New function. + (procfs_corefile_thread_callback): New function. + * sol-thread.c (sol_find_memory_regions): New function. + (sol_make_note_section): New function. + (init_sol_thread_ops): Initialize new target vectors. + * inftarg.c (inftarg_set_find_memory_regions): New function. + Allow to_find_memory_regions vector to be taken over. + (inftarg_set_make_corefile_notes): New function. + Allow to_make_corefile_notes vector to be taken over. + * thread-db.c (thread_db_new_objfile): Don't activate thread-db + interface layer if not target_has_execution (may be a corefile). + * config/i386/linux.mh: Add gcore.o to NATDEPFILES. + * config/sparc/sun4sol2.mh: Ditto. + * config/alpha/alpha-linux.mh: Ditto. + * config/arm/linux.mh: Ditto. + * config/i386/x86-64linux.mh: Ditto. + * config/ia64/linux.mh: Ditto. + * config/m68k/linux.mh: Ditto. + * config/mips/linux.mh: Ditto. + * config/powerpc/linux.mh: Ditto. + * config/sparc/linux.mh: Ditto. + +2002-01-07 Michael Snyder + + * arm-linux-nat.c: Remove references to regcache.c internal data + (registers[] and register_valid[]). + +2002-01-07 Michael Snyder + + * linux-proc.c: New file. Implement child_pid_to_exec_file, + so that attaching to a pid will automatically read the process's + symbol file and shlibs. + * Makefile.in: Add rule for linux-proc.o. + * config/nm-linux.h: Define CHILD_PID_TO_EXEC_FILE. + * config/alpha/alpha-linux.mh: Add linux-proc.o to NATDEPFILES. + * config/arm/linux.mh: Ditto. + * config/i386/linux.mh: Ditto. + * config/i386/x86-64linux.mh: Ditto. + * config/ia64/linux.mh: Ditto. + * config/m68k/linux.mh: Ditto. + * config/mips/linux.mh: Ditto. + * config/powerpc/linux.mh: Ditto. + * config/sparc/linux.mh: Ditto. + +2002-01-06 Pierre Muller + + * win32-nat.c: Add i386-tdep.h dependency. + +2002-01-07 Michael Snyder + + * solib.c (info_sharedlibrary_command): Use TARGET_PTR_BIT + instead of bfd_get_arch_size. Don't bail out just because + there's no exec_bfd. + + * cp-valprint.c (cp_print_value): FIXME comment, alloca size. + * p-valprint.c (pascal_object_print_value): Ditto. + * somread.c (som_symtab_read): Ditto. + * symfile.c (simple_free_overlay_region_table): Ditto. + * valops.c (value_assign): Ditto. + + * tracepoint.c (tracepoint_save_command): From Klee Dienes -- + use tilde_expand and strerror for opening save-tracepoints file. + + * thread-db.c (thread_db_new_objfile): Indendation fix. + + * infptrace.c (GDB_MAX_ALLOCA): New define. + (child_xfer_memory): Use xmalloc/xfree instead of alloca if the + size of the buffer exceeds GDB_MAX_ALLOCA (default 1 megabyte, + can be overridden with whatever value is appropriate to the host). + * infttrace.c (child_xfer_memory): Add FIXME warning about use of + alloca to allocate potentially large buffer. + * rs6000-nat.c (child_xfer_memory): Ditto. + * symm-nat.c (child_xfer_memory): Ditto. + * x86-64-linux-nat.c (child_xfer_memory): Ditto. + +2002-01-07 Jackie Smith Cashion + + From Nick Clifton + * d10v-tdep.c: Set STACK_START to 0x200bffe. + +2002-01-07 Michael Snyder + + * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): + Don't use exec_bfd if it's NULL. + +2002-01-06 Mark Kettenis + + * valops.c (value_arg_coerce): Fix formatting. + +2002-01-06 Andrew Cagney + + * hp-psymtab-read.c: Include "gdb_string.h" instead of . + * gnu-nat.c: Ditto. + +2002-01-06 Andrew Cagney + + * MAINTAINERS: Note that alpha-dec-osf4.0a, arc-elf, arm-coff, + arm-elf, arm-pe, d30v-elf, fr30-elf, h8300hms, h8500hms, + i960-coff, m32r-elf, m68k-elf, m88k, mcore-elf, mn10200-elf, + ns32k-netbsd, hppa1.1-hp-proelf, v850-elf, vax-dec-vms5.5 and + z8k-coff have not been multi-arched. Update z8k-coff build + status. + +2002-01-06 Andrew Cagney + + * MAINTAINERS: Mark a29k target as obsolete. + * Makefile.in (a29k-tdep.o, remote-adapt.o, remote-eb.o) + (remote-mm.o, remote-udi.o): Obsolete. Remove references in + comments. + * NEWS: Note that a29k targets are obsolete. + * a29k-tdep.c: Mark as obsolete. + * configure.tgt: Mark a29k-*-aout*, a29k-*-coff*, a29k-*-elf*, + a29k-*-ebmon*, a29k-*-kern*, a29k-*-none*, a29k-*-udi* and + a29k-*-vxworks* targets as obsolete. + * remote-adapt.c: Obsolete. + * remote-eb.c: Obsolete. + * remote-mm.c: Obsolete. + * remote-udi.c: Obsolete. + * config/a29k/a29k-udi.mt: Obsolete. + * config/a29k/a29k.mt: Obsolete. + * config/a29k/tm-a29k.h: Obsolete. + * config/a29k/tm-vx29k.h: Obsolete. + * config/a29k/vx29k.mt: Obsolete. + +2002-01-05 Andrew Cagney + + * rs6000-tdep.c (rs6000_do_registers_info): Replace BIG_ENDIAN + with BFD_ENDIAN_BIG. + +2002-01-05 Andrew Cagney + + * configure.in (AC_CHECK_HEADERS): Do not check for . + * configure, config.in: Re-generate. + * config/vax/xm-vaxbsd.h: Do not include . + * defs.h: Do not include . + +2002-01-05 Jason Thorpe + + * acconfig.h (HAVE_PT_GETXMMREGS): New. + * config.in: Regenerate. + * configure.in: Update copyright years. + Add test for PT_GETXMMREGS supplied by . + * configure: Regenerate. + * i386bsd-nat.c: Update copyright years. + (fill_gregset): Use regcache_collect. + (fetch_inferior_registers): Only fetch integer registers + if requested to do so. Add support for XMM registers + using PT_GETXMMREGS. + (store_inferior_registers): Only store integer registers + if requested to do so. Add support for XMM registers + using PT_SETXMMREGS. + * i386nbsd-nat.c (fetch_inferior_registers): Remove. + (store_inferior_registers): Remove. + (fetch_core_registers): Use supply_gregset and i387_supply_fsave. + (fetch_elfcore_registers): New function. + (i386nbsd_elfcore_fns): New. + (_initialize_i386nbsd_nat): Register i386nbsd_elfcore_fns. + * config/i386/nbsd.mh (NATDEPFILES): Add i387-nat.o and + i386bsd-nat.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Likewise. + * config/i386/nbsd.mt (TDEPFILES): Add i386bsd-nat.o. + * config/i386/nbsdelf.mt (TDEPFILES): Likewise. + * config/i386/tm-nbsd.h: Update copyright years. + (HAVE_SSE_REGS): Define. + (IN_SIGTRAMP): Define as i386bsd_in_sigtramp. + (SIGTRAMP_START): Redefine as i386bsd_sigtramp_start. + (SIGTRAMP_END): Redefine as i386bsd_sigtramp_end. + (SIGCONTEXT_PC_OFFSET): Remove. + (FRAME_SAVED_PC): Define as i386bsd_frame_saved_pc. + +2002-01-05 Andrew Cagney + + * configure.tgt: Remove powerpc-*-macos* target. + * config/m68k/xm-mpw.h: Delete file. + * config/xm-mpw.h: Delete file. + * ser-mac.c: Delete file. + * mpw-make.sed: Delete file. + * mpw-config.in: Delete file. + * mac-xdep.c: Delete file. + * mac-gdb.r: Delete file. + * mac-defs.h: Delete file. + * mac-nat.c: Delete file. + * config/powerpc/macos.mh: Delete file. + * config/powerpc/macos.mt: Delete file. + * config/powerpc/nm-macos.h: Delete file. + * config/powerpc/tm-macos.h: Delete file. + * source.c (openp, open_source_file): Remove obsolete code. + * top.c (gdb_readline): Ditto. + * utils.c (query): Ditto. + * event-top.c (display_gdb_prompt): Ditto. + * Makefile.in (ser-mac.o): Delete obsolete target. + * NEWS: Update. + +2002-01-04 Andrew Cagney + + * defs.h (BIG_ENDIAN): Delete macro definition. + * a29k-tdep.c, arch-utils.c, arm-tdep.c, ax-gdb.c, ch-exp.c, + coffread.c, cris-tdep.c, d10v-tdep.c, d30v-tdep.c, defs.h, + findvar.c, infcmd.c, mem-break.c, mips-tdep.c, mn10300-tdep.c, + printcmd.c, remote-os9k.c, remote-rdi.c, remote-rdp.c, + remote-sim.c, remote.c, rs6000-tdep.c, sh-tdep.c, sparcl-tdep.c, + stabsread.c, valops.c, valprint.c, config/a29k/tm-a29k.h, + config/a29k/tm-vx29k.h, config/arm/tm-arm.h, + config/d30v/tm-d30v.h, config/fr30/tm-fr30.h, + config/h8300/tm-h8300.h, config/h8500/tm-h8500.h, + config/m32r/tm-m32r.h, config/m68k/tm-m68k.h, + config/m88k/tm-m88k.h, config/mips/tm-mips.h, config/pa/tm-hppa.h, + config/sparc/tm-sparc.h, config/z8k/tm-z8k.h, mi/mi-cmd-disas.c, + mi/mi-main.c: Replace BIG_ENDIAN with BFD_ENDIAN_BIG. + * gdbarch.sh: Replace BIG_ENDIAN with BFD_ENDIAN_BIG. + * gdbarch.c: Re-generate. + +2002-01-04 Daniel Jacobowitz + + * thread-db.c (thread_db_new_objfile): Do not enable thread_db + for core files. + +2002-01-04 Jason Thorpe + + * config/arm/nbsd.mh (XDEPFILES): Remove ser-tcp.o. + +2002-01-04 Andrew Cagney + + * value.h (value_ptr): Delete typedef. + +2002-01-04 Jason Thorpe + + * i386nbsd-nat.c: Update copyright years. + Include i386-tdep.h. + +2002-01-04 Elena Zannoni + + * stabsread.c: Update copyright years. + + From Debashis Mahata : + (read_struct_fields): Deal with Sun C compiler erroneous stab + output for structs and unions. + Fix PR gdb/269. + +2002-01-04 Daniel Jacobowitz + + * p-valprint.c: Include "cp-abi.h" for baseclass_offset + prototype. + +2002-01-04 Daniel Jacobowitz + + * cp-abi.c: Fix whitespace. + (baseclass_offset): New wrapper function. + * cp-abi.h (baseclass_offset): Add prototype. + (struct cp_abi_ops): Add baseclass_offset pointer. + + * valops.c (vb_match): Move to... + * gnu-v2-abi.c (vb_match): here. + * valops.c (baseclass_offset): Move to... + * gnu-v2-abi.c (gnuv2_baseclass_offset): here, and rename. + + * gnu-v3-abi.c (gnuv3_baseclass_offset): New function. + + * gnu-v2-abi.c (init_gnuv2_ops): Initialize baseclass_offset. + * gnu-v3-abi.c (init_gnuv3_ops): Likewise. + * hpacc-abi.c (init_hpacc_ops): Likewise. + +2002-01-04 Daniel Jacobowitz + + * valops.c (find_overload_match): Accept obj as a + reference parameter. Update it before returning. + * value.h (find_overload_match): Update prototype. + * eval.c (evaluate_subexp_standard): Pass object to + find_overload_match by reference. + +2002-01-03 Andrew Cagney + + * valarith.c: Replace value_ptr with struct value pointer. Remove + register attribute from value declarations. + * valops.c: Ditto. + * value.h: Ditto. + * scm-lang.c (scm_lookup_name): Ditto. + +2002-01-03 Michael Snyder + + Abstract the functionality of iterating over mapped memory + regions into a general purpose iterator function. + * procfs.c (iterate_over_mappings): New function, general purpose + iterator for memory sections. + (proc_iterate_over_mappings): Reimplement using iterate_over_mappings. + (solib_mappings_callback): New function, callback for above. + (info_proc_mappings): Reimpliment using iterate_over_mappings. + (info_mappings_callback): New function, callback for above. + + * procfs.c (proc_set_watchpoint): Add cast to suppress warning. + +2002-01-01 Mark Kettenis + + * i386-tdep.h (struct gdbarch_tdep): Add `os_ident' member. + * i386-tdep.c: Include "elf-bfd.h". + (process_note_abi_tag_sections): New function. + (i386_gdbarch_init): Add code to recognize various OS/ABI + combinations. + + * maint.c (_initialize_maint_cmds): Add missing \ in + string-literal. + +For older changes see ChangeLog-2001 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/gdb/Makefile.in b/gdb/Makefile.in new file mode 100644 index 0000000..ca17a2b --- /dev/null +++ b/gdb/Makefile.in @@ -0,0 +1,2595 @@ +# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +# 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This file is part of GDB. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +host_alias = @host_alias@ +target_alias = @target_alias@ +program_transform_name = @program_transform_name@ +bindir = @bindir@ +libdir = @libdir@ +tooldir = $(libdir)/$(target_alias) + +datadir = @datadir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +man3dir = $(mandir)/man3 +man4dir = $(mandir)/man4 +man5dir = $(mandir)/man5 +man6dir = $(mandir)/man6 +man7dir = $(mandir)/man7 +man8dir = $(mandir)/man8 +man9dir = $(mandir)/man9 +infodir = @infodir@ +htmldir = $(prefix)/html +includedir = @includedir@ + +# This can be referenced by `INTLDEPS' as computed by CY_GNU_GETTEXT. +top_builddir = . + +SHELL = @SHELL@ +EXEEXT = @EXEEXT@ + +AWK = @AWK@ +LN_S = @LN_S@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +AR = @AR@ +AR_FLAGS = qv +RANLIB = @RANLIB@ +DLLTOOL = @DLLTOOL@ +WINDRES = @WINDRES@ +MIG = @MIG@ + +# Flags that describe where you can find the termcap library. +# This can be overridden in the host Makefile fragment file. +TERMCAP = @TERM_LIB@ + +# If you are compiling with GCC, make sure that either 1) You have the +# fixed include files where GCC can reach them, or 2) You use the +# -traditional flag. Otherwise the ioctl calls in inflow.c +# will be incorrectly compiled. The "fixincludes" script in the gcc +# distribution will fix your include files up. +CC=@CC@ + +# Directory containing source files. +srcdir = @srcdir@ +VPATH = @srcdir@ + +YACC=@YACC@ + +# This is used to rebuild ada-lex.c from ada-lex.l. If the program is +# not defined, but ada-lex.c is present, compilation will continue, +# possibly with a warning. +FLEX = flex + +YLWRAP = $(srcdir)/../ylwrap + +# where to find makeinfo, preferably one designed for texinfo-2 +MAKEINFO=makeinfo + +MAKEHTML = texi2html + +MAKEHTMLFLAGS = -glossary -menu -split_chapter + +# Set this up with gcc if you have gnu ld and the loader will print out +# line numbers for undefined references. +#CC_LD=gcc -static +CC_LD=$(CC) + +# Where is our "include" directory? Typically $(srcdir)/../include. +# This is essentially the header file directory for the library +# routines in libiberty. +INCLUDE_DIR = $(srcdir)/../include +INCLUDE_CFLAGS = -I$(INCLUDE_DIR) + +# Where is the "-liberty" library? Typically in ../libiberty. +LIBIBERTY = ../libiberty/libiberty.a + +# Configured by the --with-mmalloc option to configure. +MMALLOC = @MMALLOC@ +MMALLOC_CFLAGS = @MMALLOC_CFLAGS@ + +# Configured by the --with-uiout option to configure. +UIOUT_CFLAGS = @UIOUT_CFLAGS@ + +# Where is the BFD library? Typically in ../bfd. +BFD_DIR = ../bfd +BFD = $(BFD_DIR)/libbfd.a +BFD_SRC = $(srcdir)/$(BFD_DIR) +BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) + +# Where is the READLINE library? Typically in ../readline. +READLINE_DIR = ../readline +READLINE = $(READLINE_DIR)/libreadline.a +READLINE_SRC = $(srcdir)/$(READLINE_DIR) +READLINE_CFLAGS = -I$(READLINE_SRC)/.. + +WARN_CFLAGS = @WARN_CFLAGS@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +GDB_WARN_CFLAGS = $(WARN_CFLAGS) +GDB_WERROR_CFLAGS = $(WERROR_CFLAGS) + +# Where is the INTL library? Typically in ../intl. +INTL_DIR = ../intl +INTL = @INTLLIBS@ +INTL_DEPS = @INTLDEPS@ +INTL_SRC = $(srcdir)/$(INTL_DIR) +INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC) + +# Where is the ICONV library? This can be empty if libc has iconv. +LIBICONV = @LIBICONV@ + +# +# CLI sub directory definitons +# +SUBDIR_CLI_OBS = \ + cli-dump.o \ + cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o +SUBDIR_CLI_SRCS = \ + cli/cli-dump.c \ + cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \ + cli/cli-utils.c +SUBDIR_CLI_DEPS = +SUBDIR_CLI_INITS = \ + $(SUBDIR_CLI_SRCS) +SUBDIR_CLI_LDFLAGS= +SUBDIR_CLI_CFLAGS= +SUBDIR_CLI_ALL= +SUBDIR_CLI_CLEAN= +SUBDIR_CLI_INSTALL= +SUBDIR_CLI_UNINSTALL= + +# +# MI sub directory definitons +# +SUBDIR_MI_OBS = \ + mi-out.o mi-console.o \ + mi-cmds.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \ + mi-cmd-disas.o \ + mi-main.o mi-parse.o mi-getopt.o +SUBDIR_MI_SRCS = \ + mi/mi-out.c mi/mi-console.c \ + mi/mi-cmds.c \ + mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \ + mi/mi-cmd-disas.c \ + mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c +SUBDIR_MI_DEPS = +SUBDIR_MI_INITS = \ + $(SUBDIR_MI_SRCS) +SUBDIR_MI_LDFLAGS= +SUBDIR_MI_CFLAGS= \ + -DMI_OUT=1 +SUBDIR_MI_ALL= +SUBDIR_MI_CLEAN= +SUBDIR_MI_INSTALL= +SUBDIR_MI_UNINSTALL= + +# +# TUI sub directory definitions +# +SUBDIR_TUI_OBS = \ + tui-file.o tui.o tuiData.o tuiSource.o tuiStack.o tuiIO.o \ + tuiGeneralWin.o tuiLayout.o tuiWin.o tuiCommand.o \ + tuiDisassem.o tuiSourceWin.o tuiRegs.o tuiDataWin.o \ + tui-out.o tui-hooks.o +SUBDIR_TUI_SRCS = \ + tui/tui-file.c tui/tui.c tui/tuiData.c tui/tuiSource.c \ + tui/tuiStack.c tui/tuiIO.c \ + tui/tuiGeneralWin.c tui/tuiLayout.c \ + tui/tuiWin.c tui/tuiCommand.c \ + tui/tuiDisassem.c tui/tuiSourceWin.c \ + tui/tuiRegs.c tui/tuiDataWin.c tui/tui-out.c tui/tui-hooks.c +SUBDIR_TUI_DEPS = +SUBDIR_TUI_INITS = \ + $(SUBDIR_TUI_SRCS) +SUBDIR_TUI_LDFLAGS= +SUBDIR_TUI_CFLAGS= \ + -DTUI=1 -I${srcdir}/tui +SUBDIR_TUI_ALL= +SUBDIR_TUI_CLEAN= +SUBDIR_TUI_INSTALL= +SUBDIR_TUI_UNINSTALL= + + + +# Opcodes currently live in one of two places. Either they are in the +# opcode library, typically ../opcodes, or they are in a header file +# in INCLUDE_DIR. +# Where is the "-lopcodes" library, with (some of) the opcode tables and +# disassemblers? +OPCODES_DIR = ../opcodes +OPCODES_SRC = $(srcdir)/$(OPCODES_DIR) +OPCODES = $(OPCODES_DIR)/libopcodes.a +# Where are the other opcode tables which only have header file +# versions? +OP_INCLUDE = $(INCLUDE_DIR)/opcode +OPCODES_CFLAGS = -I$(OP_INCLUDE) + +# The simulator is usually nonexistent; targets that include one +# should set this to list all the .o or .a files to be linked in. +SIM = + +WIN32LIBS = @WIN32LIBS@ + +# Where is the TCL library? Typically in ../tcl. +LIB_INSTALL_DIR = $(libdir) +# This variable is needed when doing dynamic linking. +LIB_RUNTIME_DIR = $(libdir) +TCL = @TCL_LD_SEARCH_FLAGS@ @TCL_BUILD_LIB_SPEC@ +TCL_CFLAGS = @TCLHDIR@ +TCL_DEPS = @TCL_DEPS@ +GDBTKLIBS = @GDBTKLIBS@ +# Extra flags that the GDBTK files need: +GDBTK_CFLAGS = @GDBTK_CFLAGS@ + +# Where is the TK library? Typically in ../tk. +TK = @TK_BUILD_LIB_SPEC@ +TK_CFLAGS = @TKHDIR@ @TK_BUILD_INCLUDES@ +TK_DEPS = @TK_DEPS@ + +# Where is Itcl? Typically in ../itcl/itcl. +ITCL_CFLAGS = @ITCLHDIR@ +ITCL = @ITCLLIB@ +ITCL_DEPS = @ITCL_DEPS@ + +# Where is Itk? Typically in ../itcl/itk. +ITK_CFLAGS = @ITKHDIR@ +ITK = @ITKLIB@ +ITK_DEPS = @ITK_DEPS@ + +# Where is Tix? Typically in ../tix. +TIX_CFLAGS = @TIXHDIR@ +TIX = @TIXLIB@ +TIX_DEPS = @TIX_DEPS@ + +X11_CFLAGS = @TK_XINCLUDES@ +X11_LDFLAGS = +X11_LIBS = + +WIN32LDAPP = @WIN32LDAPP@ + +LIBGUI = @LIBGUI@ +GUI_CFLAGS_X = @GUI_CFLAGS_X@ +IDE_CFLAGS=$(GUI_CFLAGS_X) $(IDE_CFLAGS_X) + +# The version of gdbtk we're building. This should be kept +# in sync with GDBTK_VERSION and friends in gdbtk.h. +GDBTK_VERSION = 1.0 +GDBTK_LIBRARY = $(datadir)/insight$(GDBTK_VERSION) + +# Gdbtk requires an absolute path to the source directory or +# the testsuite won't run properly. +GDBTK_SRC_DIR = @GDBTK_SRC_DIR@ + +SUBDIR_GDBTK_OBS = \ + gdbtk.o gdbtk-bp.o gdbtk-cmds.o gdbtk-hooks.o \ + gdbtk-register.o gdbtk-stack.o gdbtk-varobj.o gdbtk-wrapper.o +SUBDIR_GDBTK_SRCS = \ + gdbtk/generic/gdbtk.c gdbtk/generic/gdbtk-bp.c \ + gdbtk/generic/gdbtk-cmds.c gdbtk/generic/gdbtk-hooks.c \ + gdbtk/generic/gdbtk-register.c gdbtk/generic/gdbtk-stack.c \ + gdbtk/generic/gdbtk-varobj.c gdbtk/generic/gdbtk-wrapper.c +SUBDIR_GDBTK_DEPS = \ + $(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS) +SUBDIR_GDBTK_INITS = gdbtk/generic/gdbtk.c +SUBDIR_GDBTK_LDFLAGS= +SUBDIR_GDBTK_CFLAGS= -DGDBTK +SUBDIR_GDBTK_ALL= +SUBDIR_GDBTK_CLEAN= +SUBDIR_GDBTK_INSTALL= install-gdbtk +SUBDIR_GDBTK_UNINSTALL= + +CONFIG_OBS= @CONFIG_OBS@ +CONFIG_LIB_OBS= @CONFIG_LIB_OBS@ +CONFIG_SRCS= @CONFIG_SRCS@ +CONFIG_DEPS= @CONFIG_DEPS@ +CONFIG_INITS= @CONFIG_INITS@ +CONFIG_LDFLAGS = @CONFIG_LDFLAGS@ +ENABLE_CFLAGS= @ENABLE_CFLAGS@ +CONFIG_ALL= @CONFIG_ALL@ +CONFIG_CLEAN= @CONFIG_CLEAN@ +CONFIG_CLEAN= @CONFIG_CLEAN@ +CONFIG_INSTALL = @CONFIG_INSTALL@ +CONFIG_UNINSTALL = @CONFIG_UNINSTALL@ + +# -I. for config files. +# -I$(srcdir) for gdb internal headers. +# -I$(srcdir)/config for more generic config files. + +# It is also possible that you will need to add -I/usr/include/sys if +# your system doesn't have fcntl.h in /usr/include (which is where it +# should be according to Posix). +DEFS = @DEFS@ +GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config -DLOCALEDIR="\"$(prefix)/share/locale\"" $(DEFS) + +# M{H,T}_CFLAGS, if defined, have host- and target-dependent CFLAGS +# from the config directory. +GLOBAL_CFLAGS = $(MT_CFLAGS) $(MH_CFLAGS) +#PROFILE_CFLAGS = -pg + +# CFLAGS is specifically reserved for setting from the command line +# when running make. I.E. "make CFLAGS=-Wmissing-prototypes". +CFLAGS = @CFLAGS@ + +# Need to pass this to testsuite for "make check". Probably should be +# consistent with top-level Makefile.in and gdb/testsuite/Makefile.in +# so "make check" has the same result no matter where it is run. +CXXFLAGS = -g -O + +# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. +INTERNAL_WARN_CFLAGS = \ + $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ + $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \ + $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \ + $(INTL_CFLAGS) $(ENABLE_CFLAGS) $(UIOUT_CFLAGS) \ + $(GDB_WARN_CFLAGS) +INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS) + +# LDFLAGS is specifically reserved for setting from the command line +# when running make. +LDFLAGS = @LDFLAGS@ + +# Profiling options need to go here to work. +# I think it's perfectly reasonable for a user to set -pg in CFLAGS +# and have it work; that's why CFLAGS is here. +INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS) @HLDFLAGS@ +HLDENV = @HLDENV@ + +# If your system is missing alloca(), or, more likely, it's there but +# it doesn't work, then refer to libiberty. + +# Libraries and corresponding dependencies for compiling gdb. +# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs. +# TERMCAP comes after readline, since readline depends on it. +# MMALLOC comes after anything else that might want an allocation function. +# LIBIBERTY appears twice on purpose. +# If you have the Cygnus libraries installed, +# you can use 'CLIBS=$(INSTALLED_LIBS)' 'CDEPS=' +INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty \ + $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ + -lmmalloc -lintl -liberty +CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(INTL) $(LIBIBERTY) \ + $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ + $(LIBICONV) \ + $(MMALLOC) $(LIBIBERTY) $(WIN32LIBS) +CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ + $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) + +ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) +ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) + +DIST=gdb + +LINT=/usr/5bin/lint +LINTFLAGS= $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \ + $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \ + $(INTL_CFLAGS) + +RUNTEST = `if [ -f $${rootsrc}/../dejagnu/runtest ] ; then \ + echo $${rootsrc}/../dejagnu/runtest ; else echo runtest; \ + fi` + +RUNTESTFLAGS= + +# This is ser-unix.o for any system which supports a v7/BSD/SYSV/POSIX +# interface to the serial port. Hopefully if get ported to OS/2, VMS, +# etc., then there will be (as part of the C library or perhaps as +# part of libiberty) a POSIX interface. But at least for now the +# host-dependent makefile fragment might need to use something else +# besides ser-unix.o +SER_HARDWIRE = @SER_HARDWIRE@ + +# The `remote' debugging target is supported for most architectures, +# but not all (e.g. 960) +REMOTE_OBS = remote.o dcache.o remote-utils.o tracepoint.o ax-general.o ax-gdb.o + +# This is remote-sim.o if a simulator is to be linked in. +SIM_OBS = + +ANNOTATE_OBS = annotate.o + +# Host and target-dependent makefile fragments come in here. +@host_makefile_frag@ +@target_makefile_frag@ +# End of host and target-dependent makefile fragments + +# Possibly ignore the simulator. If the simulator is being ignored, +# these expand into SIM= and SIM_OBJ=, overriding the entries from +# target_makefile_frag +# +@IGNORE_SIM@ +@IGNORE_SIM_OBS@ + +FLAGS_TO_PASS = \ + "prefix=$(prefix)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "mandir=$(mandir)" \ + "datadir=$(datadir)" \ + "includedir=$(includedir)" \ + "against=$(against)" \ + "AR=$(AR)" \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC=$(CC)" \ + "CFLAGS=$(CFLAGS)" \ + "CXX=$(CXX)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "DLLTOOL=$(DLLTOOL)" \ + "RANLIB=$(RANLIB)" \ + "MAKEINFO=$(MAKEINFO)" \ + "MAKEHTML=$(MAKEHTML)" \ + "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" + +# Flags that we pass when building the testsuite. + +# empty for native, $(target_alias)/ for cross +target_subdir = @target_subdir@ + +CC_FOR_TARGET = ` \ + if [ -f $${rootme}/../gcc/xgcc ] ; then \ + if [ -f $${rootme}/../$(target_subdir)newlib/Makefile ] ; then \ + echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -idirafter $${rootme}/$(target_subdir)newlib/targ-include -idirafter $${rootsrc}/../$(target_subdir)newlib/libc/include -nostdinc -B$${rootme}/../$(target_subdir)newlib/; \ + else \ + echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \ + fi; \ + else \ + if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + echo $(CC); \ + else \ + t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ + fi; \ + fi` + +CXX = gcc +CXX_FOR_TARGET = ` \ + if [ -f $${rootme}/../gcc/xgcc ] ; then \ + if [ -f $${rootme}/../$(target_subdir)newlib/Makefile ] ; then \ + echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -idirafter $${rootme}/$(target_subdir)newlib/targ-include -idirafter $${rootsrc}/../$(target_subdir)newlib/libc/include -nostdinc -B$${rootme}/../$(target_subdir)newlib/; \ + else \ + echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \ + fi; \ + else \ + if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ + echo $(CXX); \ + else \ + t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ + fi; \ + fi` + +# OBSOLETE CHILLFLAGS = $(CFLAGS) +# OBSOLETE CHILL = gcc +# OBSOLETE CHILL_FOR_TARGET = ` \ +# OBSOLETE if [ -f $${rootme}/../gcc/Makefile ] ; then \ +# OBSOLETE echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -L$${rootme}/../gcc/ch/runtime/; \ +# OBSOLETE else \ +# OBSOLETE if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ +# OBSOLETE echo $(CC); \ +# OBSOLETE else \ +# OBSOLETE t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ +# OBSOLETE fi; \ +# OBSOLETE fi` +# OBSOLETE CHILL_LIB = ` \ +# OBSOLETE if [ -f $${rootme}/../gcc/ch/runtime/libchill.a ] ; then \ +# OBSOLETE echo $${rootme}/../gcc/ch/runtime/chillrt0.o \ +# OBSOLETE $${rootme}/../gcc/ch/runtime/libchill.a; \ +# OBSOLETE else \ +# OBSOLETE echo -lchill; \ +# OBSOLETE fi` + +# The use of $$(x_FOR_TARGET) reduces the command line length by not +# duplicating the lengthy definition. +TARGET_FLAGS_TO_PASS = \ + "prefix=$(prefix)" \ + "exec_prefix=$(exec_prefix)" \ + "against=$(against)" \ + 'CC=$$(CC_FOR_TARGET)' \ + "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ + "CFLAGS=$(CFLAGS)" \ + 'CXX=$$(CXX_FOR_TARGET)' \ + "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "MAKEINFO=$(MAKEINFO)" \ + "MAKEHTML=$(MAKEHTML)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" + +# All source files that go into linking GDB. +# Links made at configuration time should not be specified here, since +# SFILES is used in building the distribution archive. + +SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ + ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \ + charset.c \ + buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \ + coffread.c \ + complaints.c completer.c corefile.c cp-valprint.c dbxread.c \ + demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \ + event-loop.c event-top.c \ + expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \ + findvar.c regcache.c gdbarch.c arch-utils.c gdbtypes.c osabi.c \ + inf-loop.c infcmd.c inflow.c infrun.c language.c \ + kod.c kod-cisco.c \ + ui-out.c cli-out.c \ + varobj.c wrapper.c \ + jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \ + m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \ + memattr.c mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c \ + p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c \ + macrotab.c macroexp.c macrocmd.c macroscope.c \ + printcmd.c remote.c scm-exp.c scm-lang.c \ + scm-valprint.c source.c stabsread.c stack.c symfile.c \ + symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \ + typeprint.c utils.c valarith.c valops.c valprint.c values.c \ + serial.c ser-unix.c mdebugread.c \ + tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \ + tui/tuiData.c tui/tuiData.h tui/tuiDataWin.c tui/tuiDataWin.h \ + tui/tuiDisassem.c tui/tuiDisassem.h tui/tuiGeneralWin.c \ + tui/tuiGeneralWin.h tui/tuiIO.c tui/tuiIO.h tui/tuiLayout.c \ + tui/tuiLayout.h tui/tuiRegs.c tui/tuiRegs.h tui/tuiSource.c \ + tui/tuiSource.h tui/tuiSourceWin.c tui/tuiSourceWin.h \ + tui/tuiStack.c tui/tuiStack.h tui/tuiWin.c tui/tuiWin.h \ + tui/tui-file.h tui/tui-file.c tui/tui-out.c tui/tui-hooks.c \ + ui-file.h ui-file.c \ + frame.c doublest.c \ + builtin-regs.c std-regs.c \ + gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c cp-support.c + +LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c + +# "system" headers. Using these in dependencies is a rather personal +# choice. (-rich, summer 1993) +# (Why would we not want to depend on them? If one of these changes in a +# non-binary-compatible way, it is a real pain to remake the right stuff +# without these dependencies -kingdon, 13 Mar 1994) +aout_aout64_h = $(INCLUDE_DIR)/aout/aout64.h +aout_stabs_gnu_h = $(INCLUDE_DIR)/aout/stabs_gnu.h +getopt_h = $(INCLUDE_DIR)/getopt.h +floatformat_h = $(INCLUDE_DIR)/floatformat.h +bfd_h = $(BFD_DIR)/bfd.h +callback_h = $(INCLUDE_DIR)/gdb/callback.h +coff_sym_h = $(INCLUDE_DIR)/coff/sym.h +coff_symconst_h = $(INCLUDE_DIR)/coff/symconst.h +coff_ecoff_h = $(INCLUDE_DIR)/coff/ecoff.h +dis_asm_h = $(INCLUDE_DIR)/dis-asm.h +elf_sh_h = $(INCLUDE_DIR)/elf/sh.h +elf_bfd_h = $(BFD_SRC)/elf-bfd.h +libaout_h = $(BFD_SRC)/libaout.h +remote_sim_h = $(INCLUDE_DIR)/gdb/remote-sim.h +demangle_h = $(INCLUDE_DIR)/demangle.h +obstack_h = $(INCLUDE_DIR)/obstack.h +opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h +sh_opc_h = $(OPCODES_SRC)/sh-opc.h +gdb_sim_arm_h = $(INCLUDE_DIR)/gdb/sim-arm.h +gdb_sim_d10v_h = $(INCLUDE_DIR)/gdb/sim-d10v.h +gdb_sim_sh_h = $(INCLUDE_DIR)/gdb/sim-sh.h +splay_tree_h = $(INCLUDE_DIR)/splay-tree.h + +readline_headers = \ + $(READLINE_SRC)/chardefs.h \ + $(READLINE_SRC)/history.h \ + $(READLINE_SRC)/keymaps.h \ + $(READLINE_SRC)/readline.h + +xm_h = @xm_h@ +tm_h = @tm_h@ +nm_h = @nm_h@ + +# +# gdb/ header files +# + +acconfig_h = acconfig.h +ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h) +alpha_tdep_h = alpha-tdep.h $(osabi_h) +alphabsd_tdep_h = alphabsd-tdep.h +annotate_h = annotate.h $(symtab_h) $(gdbtypes_h) +arch_utils_h = arch-utils.h +arm_tdep_h = arm-tdep.h $(osabi_h) +ax_gdb_h = ax-gdb.h +ax_h = ax.h $(doublest_h) +bcache_h = bcache.h +breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h) +buildsym_h = buildsym.h +builtin_regs_h = builtin-regs.h +c_lang_h = c-lang.h $(value_h) $(macroexp_h) +call_cmds_h = call-cmds.h +ch_lang_h = ch-lang.h +cli_out_h = cli-out.h +coff_solib_h = coff-solib.h +command_h = command.h +complaints_h = complaints.h +completer_h = completer.h +cp_abi_h = cp-abi.h +cp_support_h = cp-support.h +dcache_h = dcache.h +defs_h = defs.h $(config_h) $(gdb_locale_h) $(gdb_signals_h) $(ansidecl_h) \ + $(libiberty_h) $(progress_h) $(bfd_h) $(tui_h) $(ui_file_h) $(xm_h) \ + $(nm_h) $(tm_h) $(fopen_same_h) $(gdbarch_h) $(arch_utils_h) +doublest_h = doublest.h $(floatformat_h) +dst_h = dst.h +dwarf2cfi_h = dwarf2cfi.h +environ_h = environ.h +event_loop_h = event-loop.h +event_top_h = event-top.h +expression_h = expression.h $(symtab_h) $(doublest_h) +f_lang_h = f-lang.h +frame_h = frame.h +gdb_events_h = gdb-events.h +gdb_stabs_h = gdb-stabs.h +gdb_h = gdb.h +gdb_assert_h = gdb_assert.h +gdb_dirent_h = gdb_dirent.h +gdb_locale_h = gdb_locale.h +gdb_obstack_h = gdb_obstack.h $(obstack_h) +gdb_proc_service_h = gdb_proc_service.h $(gregset_h) +gdb_regex_h = gdb_regex.h $(xregex_h) +gdb_stat_h = gdb_stat.h +gdb_string_h = gdb_string.h +gdb_thread_db_h = gdb_thread_db.h +gdb_vfork_h = gdb_vfork.h +gdb_wait_h = gdb_wait.h +gdbarch_h = gdbarch.h $(dis_asm_h) $(value_h) $(inferior_h) +gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h) +gdbcore_h = gdbcore.h $(bfd_h) +gdbthread_h = gdbthread.h $(breakpoint_h) +gdbtypes_h = gdbtypes.h +gnu_nat_h = gnu-nat.h +gregset_h = gregset.h +i386_linux_tdep_h = i386-linux-tdep.h +i386_tdep_h = i386-tdep.h $(osabi_h) +i387_tdep_h = i387-tdep.h +inf_loop_h = inf-loop.h +inferior_h = inferior.h $(breakpoint_h) $(target_h) +jv_lang_h = jv-lang.h +kod_h = kod.h +language_h = language.h +linespec_h = linespec.h +m2_lang_h = m2-lang.h +macroexp_h = macroexp.h +macroscope_h = macroscope.h $(macrotab_h) $(symtab_h) +macrotab_h = macrotab.h +memattr_h = memattr.h +minimon_h = minimon.h +mipsnbsd_tdep_h = mipsnbsd-tdep.h +monitor_h = monitor.h +nbsd_tdep_h = nbsd-tdep.h +ns32k_tdep_h = ns32k-tdep.h $(osabi_h) +objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) +ocd_h = ocd.h +osabi_h = osabi.h +p_lang_h = p-lang.h +pa64solib_h = pa64solib.h +parser_defs_h = parser-defs.h $(doublest_h) +ppc_tdep_h = ppc-tdep.h $(osabi_h) +ppcnbsd_tdep_h = ppcnbsd-tdep.h +proc_utils_h = proc-utils.h +regcache_h = regcache.h +remote_utils_h = remote-utils.h $(target_h) +remote_h = remote.h +scm_lang_h = scm-lang.h $(scm_tags_h) +scm_tags_h = scm-tags.h +ser_unix_h = ser-unix.h +serial_h = serial.h +sh_tdep_h = sh-tdep.h $(osabi_h) +shnbsd_tdep_h = shnbsd-tdep.h +sim_regno_h = sim-regno.h +solib_svr4_h = solib-svr4.h +solib_h = solib.h +solist_h = solist.h +somsolib_h = somsolib.h +source_h = source.h +sparcnbsd_tdep_h = sparcnbsd-tdep.h +srec_h = srec.h +stabsread_h = stabsread.h +symfile_h = symfile.h +symtab_h = symtab.h +target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) +terminal_h = terminal.h +top_h = top.h +tracepoint_h = tracepoint.h +typeprint_h = typeprint.h +ui_file_h = ui-file.h +ui_out_h = ui-out.h +valprint_h = valprint.h +value_h = value.h $(doublest_h) $(symtab_h) $(gdbtypes_h) $(expression_h) +varobj_h = varobj.h $(symtab_h) $(gdbtypes_h) +vax_tdep_h = vax-tdep.h $(osabi_h) +version_h = version.h +wince_stub_h = wince-stub.h +wrapper_h = wrapper.h $(gdb_h) +x86_64_tdep_h = x86-64-tdep.h $(i386_tdep_h) +xcoffsolib_h = xcoffsolib.h +xmodem_h = xmodem.h + +# +# gdb/cli/ headers +# + +cli_cmds_h = $(srcdir)/cli/cli-cmds.h +cli_decode_h = $(srcdir)/cli/cli-decode.h $(gdb_regex_h) $(command_h) +cli_dump_h = $(srcdir)/cli/cli-dump.h +cli_script_h = $(srcdir)/cli/cli-script.h +cli_setshow_h = $(srcdir)/cli/cli-setshow.h +cli_utils_h = $(srcdir)/cli/cli-utils.h + +# +# gdb/mi/ headers +# + +mi_cmds_h = $(srcdir)/mi/mi-cmds.h +mi_console_h = $(srcdir)/mi/mi-console.h +mi_getopt_h = $(srcdir)/mi/mi-getopt.h +mi_out_h = $(srcdir)/mi/mi-out.h +mi_parse_h = $(srcdir)/mi/mi-parse.h + +# +# gdb/tui/ headers +# + +tui_file_h = $(srcdir)/tui/tui-file.h +tui_h = $(srcdir)/tui/tui.h $(ansidecl_h) +tuiCommand_h = $(srcdir)/tui/tuiCommand.h +tuiData_h = $(srcdir)/tui/tuiData.h +tuiDataWin_h = $(srcdir)/tui/tuiDataWin.h +tuiDisassem_h = $(srcdir)/tui/tuiDisassem.h +tuiGeneralWin_h = $(srcdir)/tui/tuiGeneralWin.h +tuiIO_h = $(srcdir)/tui/tuiIO.h +tuiLayout_h = $(srcdir)/tui/tuiLayout.h +tuiRegs_h = $(srcdir)/tui/tuiRegs.h +tuiSource_h = $(srcdir)/tui/tuiSource.h $(defs_h) +tuiSourceWin_h = $(srcdir)/tui/tuiSourceWin.h +tuiStack_h = $(srcdir)/tui/tuiStack.h +tuiWin_h = $(srcdir)/tui/tuiWin.h + +charset_h = charset.h + +# Header files that need to have srcdir added. Note that in the cases +# where we use a macro like $(gdbcmd_h), things are carefully arranged +# so that each .h file is listed exactly once (M-x tags-search works +# wrong if TAGS has files twice). Because this is tricky to get +# right, it is probably easiest just to list .h files here directly. + +HFILES_NO_SRCDIR = bcache.h buildsym.h call-cmds.h coff-solib.h defs.h \ + environ.h $(gdbcmd_h) gdb.h gdbcore.h \ + gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \ + objfiles.h parser-defs.h serial.h solib.h \ + symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \ + macrotab.h macroexp.h macroscope.h \ + c-lang.h f-lang.h \ + jv-lang.h \ + m2-lang.h p-lang.h \ + complaints.h valprint.h \ + nindy-share/b.out.h \ + nindy-share/block_io.h nindy-share/coff.h \ + nindy-share/env.h nindy-share/stop.h \ + vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \ + vx-share/vxWorks.h vx-share/wait.h vx-share/xdr_ld.h \ + vx-share/xdr_ptrace.h vx-share/xdr_rdb.h gdbthread.h \ + dcache.h remote-utils.h top.h somsolib.h + +# Header files that already have srcdir in them, or which are in objdir. + +HFILES_WITH_SRCDIR = ../bfd/bfd.h + + +# GDB "info" files, which should be included in their entirety +INFOFILES = gdb.info* + +REMOTE_EXAMPLES = m68k-stub.c i386-stub.c sparc-stub.c rem-multi.shar + +# {X,T,NAT}DEPFILES are something of a pain in that it's hard to +# default their values the way we do for SER_HARDWIRE; in the future +# maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other +# variables analogous to SER_HARDWIRE which get defaulted in this +# Makefile.in + +DEPFILES = $(TDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) \ + $(REMOTE_OBS) $(SIM_OBS) $(CONFIG_LIB_OBS) + +SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) $(CONFIG_SRCS) +# Don't include YYFILES (*.tab.c) because we already include *.y in SFILES, +# and it's more useful to see it in the .y file. +TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \ + $(SUBDIR_CLI_SRCS) +TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR) + +COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ + charset.o \ + source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ + symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \ + expprint.o environ.o stack.o thread.o \ + macrotab.o macrocmd.o macroexp.o macroscope.o \ + event-loop.o event-top.o inf-loop.o completer.o \ + gdbarch.o arch-utils.o gdbtypes.o osabi.o copying.o $(DEPFILES) \ + memattr.o mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \ + builtin-regs.o std-regs.o \ + signals.o \ + kod.o kod-cisco.o \ + gdb-events.o \ + exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \ + dbxread.o coffread.o elfread.o \ + dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \ + c-lang.o f-lang.o \ + ui-out.o cli-out.o \ + varobj.o wrapper.o \ + jv-lang.o jv-valprint.o jv-typeprint.o \ + m2-lang.o p-lang.o p-typeprint.o p-valprint.o \ + scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o \ + c-typeprint.o f-typeprint.o m2-typeprint.o \ + c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \ + nlmread.o serial.o mdebugread.o top.o utils.o \ + ui-file.o \ + frame.o doublest.o \ + gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o + +OBS = $(COMMON_OBS) $(ANNOTATE_OBS) + +TSOBS = inflow.o + +SUBDIRS = @SUBDIRS@ + +# For now, shortcut the "configure GDB for fewer languages" stuff. +YYFILES = c-exp.tab.c \ + ada-exp.tab.c \ + jv-exp.tab.c \ + f-exp.tab.c m2-exp.tab.c p-exp.tab.c +YYOBJ = c-exp.tab.o \ + jv-exp.tab.o \ + f-exp.tab.o m2-exp.tab.o p-exp.tab.o + +# Things which need to be built when making a distribution. + +DISTSTUFF = $(YYFILES) + +# Prevent Sun make from putting in the machine type. Setting +# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. +.c.o: + $(CC) -c $(INTERNAL_CFLAGS) $< + +all: gdb$(EXEEXT) $(CONFIG_ALL) + @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do + +installcheck: + +# The check target can not use subdir_do, because subdir_do does not +# use TARGET_FLAGS_TO_PASS. +check: force + @if [ -f testsuite/Makefile ]; then \ + rootme=`pwd`; export rootme; \ + rootsrc=`cd $(srcdir); pwd`; export rootsrc; \ + cd testsuite; \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \ + else true; fi + +info dvi install-info clean-info html install-html: force + @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do + +gdb.z:gdb.1 + nroff -man $(srcdir)/gdb.1 | col -b > gdb.t + pack gdb.t ; rm -f gdb.t + mv gdb.t.z gdb.z + +# Traditionally "install" depends on "all". But it may be useful +# not to; for example, if the user has made some trivial change to a +# source file and doesn't care about rebuilding or just wants to save the +# time it takes for make to check that all is up to date. +# install-only is intended to address that need. +install: all install-only +install-only: $(CONFIG_INSTALL) + transformed_name=`t='$(program_transform_name)'; \ + echo gdb | sed -e $$t` ; \ + if test "x$$transformed_name" = x; then \ + transformed_name=gdb ; \ + else \ + true ; \ + fi ; \ + $(srcdir)/../mkinstalldirs $(bindir) ; \ + $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \ + $(srcdir)/../mkinstalldirs $(man1dir) ; \ + $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1 + @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do + +uninstall: force $(CONFIG_UNINSTALL) + transformed_name=`t='$(program_transform_name)'; \ + echo gdb | sed -e $$t` ; \ + if test "x$$transformed_name" = x; then \ + transformed_name=gdb ; \ + else \ + true ; \ + fi ; \ + rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1 + rm -rf $(GDBTK_LIBRARY) + @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do + +install-gdbtk: + $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \ + $(SHELL) $(srcdir)/../mkinstalldirs $(libdir)/insight$(GDBTK_VERSION) ; \ + $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl $(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \ + $(SHELL) $(srcdir)/../mkinstalldirs \ + $(GDBTK_LIBRARY)/images \ + $(GDBTK_LIBRARY)/images2 ; \ + $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY)/help \ + $(GDBTK_LIBRARY)/help/images \ + $(GDBTK_LIBRARY)/help/trace ; \ + cd $(srcdir)/gdbtk/library ; \ + for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html help/trace/*.html help/trace/index.toc help/images/*.gif; \ + do \ + $(INSTALL_DATA) $$i $(GDBTK_LIBRARY)/$$i ; \ + done ; + +# We do this by grepping through sources. If that turns out to be too slow, +# maybe we could just require every .o file to have an initialization routine +# of a given name (top.o -> _initialize_top, etc.). +# +# Formatting conventions: The name of the _initialize_* routines must start +# in column zero, and must not be inside #if. +# +# Note that the set of files with init functions might change, or the names +# of the functions might change, so this files needs to depend on all the +# object files that will be linked into gdb. +# +# FIXME: There are 2 problems with this approach. First, if the INIT_FILES +# list includes a file twice (because of some mistake somewhere else) +# the _initialize_* function will be included twice in init.c. Second, +# init.c may force unnecessary files to be linked in. + +# FIXME: cagney/2002-06-09: gdb/564: gdb/563: Force the order so that +# the first call is to _initialize_gdbtypes. This is a hack to ensure +# that all the architecture dependant global builtin_type_* variables +# are initialized before anything else (per-architecture code is +# called in the same order that it is registered). The ``correct +# fix'' is to have all the builtin types made part of the architecture +# and initialize them on-demand (using gdbarch_data) just like +# everything else. The catch is that other modules still take the +# address of these builtin types forcing them to be variables, sigh! + +INIT_FILES = $(OBS) $(TSOBS) $(CONFIG_OBS) $(CONFIG_INITS) +init.c: $(INIT_FILES) + @echo Making init.c + @rm -f init.c-tmp init.l-tmp + @-echo $(INIT_FILES) | \ + tr ' ' '\012' | \ + sed -e '/^Onindy.o/d' \ + -e '/^init.o/d' \ + -e '/^nindy.o/d' \ + -e '/ttyflush.o/d' \ + -e '/xdr_ld.o/d' \ + -e '/xdr_ptrace.o/d' \ + -e '/xdr_rdb.o/d' \ + -e '/udr.o/d' \ + -e '/udip2soc.o/d' \ + -e '/udi2go32.o/d' \ + -e '/version.o/d' \ + -e '/^[a-z0-9A-Z_]*_[SU].o/d' \ + -e '/[a-z0-9A-Z_]*-exp.tab.o/d' \ + -e 's/\.o/.c/' \ + -e 's,signals\.c,signals/signals\.c,' \ + -e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \ + while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \ + sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' | \ + ( echo _initialize_gdbtypes ; grep -v '^_initialize_gdbtypes$$' ) > init.l-tmp + @echo '/* Do not modify this file. */' >>init.c-tmp + @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp + @echo '#include "defs.h"' >>init.c-tmp + @echo '#include "call-cmds.h"' >>init.c-tmp + @sed -e 's/\(.*\)/extern initialize_file_ftype \1;/' >init.c-tmp + @echo 'void' >>init.c-tmp + @echo 'initialize_all_files (void)' >>init.c-tmp + @echo '{' >>init.c-tmp + @sed -e 's/\(.*\)/ \1 ();/' >init.c-tmp + @echo '}' >>init.c-tmp + @rm init.l-tmp + @mv init.c-tmp init.c + +.PRECIOUS: init.c + +init.o: init.c $(defs_h) $(call_cmds_h) + +# Removing the old gdb first works better if it is running, at least on SunOS. +gdb$(EXEEXT): main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) + rm -f gdb$(EXEEXT) + $(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o gdb$(EXEEXT) \ + main.o libgdb.a $(CONFIG_OBS) $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS)\ + $(LOADLIBES) + +nlm: force + rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=all DODIRS=nlm subdir_do + +# Create a library of the gdb object files and build GDB by linking +# against that. +# +# init.o is very important. It pulls in the rest of GDB. +LIBGDB_OBS= $(OBS) $(TSOBS) $(ADD_FILES) init.o +libgdb.a: $(LIBGDB_OBS) + -rm -f libgdb.a + $(AR) q libgdb.a $(LIBGDB_OBS) + $(RANLIB) libgdb.a + +saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c + #setopt load_flags $(CFLAGS) $(BFD_CFLAGS) -DHOST_SYS=SUN4_SYS + #load ./init.c $(SFILES) + #unload $(srcdir)/c-exp.y + #unload $(srcdir)/jv-exp.y + #unload $(srcdir)/m2-exp.y + #unload $(srcdir)/p-exp.y + #unload vx-share/*.h + #unload nindy-share/[A-Z]* + #load c-exp.tab.c + #load jv-exp.tab.c + #load m2-exp.tab.c + #load p-exp.tab.c + #load copying.c version.c + #load ../opcodes/libopcodes.a + #load ../libiberty/libiberty.a + #load ../bfd/libbfd.a + #load ../readline/libreadline.a + #load ../mmalloc/libmmalloc.a + #load ../intl/libintl.a + #load -ltermcap + #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'` + echo "Load .c corresponding to:" $(DEPFILES) + + +# A Mach 3.0 program to force gdb back to command level + +stop-gdb: stop-gdb.o + ${CC_LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o stop-gdb \ + stop-gdb.o $(CLIBS) $(LOADLIBES) + +# This is useful when debugging GDB, because some Unix's don't let you run GDB +# on itself without copying the executable. So "make gdb1" will make +# gdb and put a copy in gdb1, and you can run it with "gdb gdb1". +# Removing gdb1 before the copy is the right thing if gdb1 is open +# in another process. +gdb1$(EXEEXT): gdb$(EXEEXT) + rm -f gdb1$(EXEEXT) + cp gdb$(EXEEXT) gdb1$(EXEEXT) + +# FIXME. These are not generated by "make depend" because they only are there +# for some machines. +# But these rules don't do what we want; we want to hack the foo.o: tm.h +# dependency to do the right thing. +tm-sun3.h tm-hp300bsd.h tm-altos.h: tm-m68k.h +tm-hp300hpux.h tm-sun2.h tm-3b1.h: tm-m68k.h +xm-i386-sv32.h: xm-i386.h +tm-i386gas.h: tm-i386.h +tm-sun4os4.h: tm-sparc.h +xm-vaxult.h: xm-vax.h +xm-vaxbsd.h: xm-vax.h + +# Put the proper machine-specific files first, so M-. on a machine +# specific routine gets the one for the correct machine. (FIXME: those +# files go in twice; we should be removing them from the main list). + +# TAGS depends on all the files that go into it so you can rebuild TAGS +# with `make TAGS' and not have to say `rm TAGS' first. + +TAGS: $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR) + @echo Making TAGS + @etags $(srcdir)/$(TM_FILE) \ + $(srcdir)/$(XM_FILE) \ + $(srcdir)/$(NAT_FILE) \ + `(for i in $(DEPFILES) $(TAGFILES_NO_SRCDIR); do \ + echo $(srcdir)/$$i ; \ + done ; for i in $(TAGFILES_WITH_SRCDIR); do \ + echo $$i ; \ + done) | sed -e 's/\.o$$/\.c/'` \ + `find $(srcdir)/config -name '*.h' -print` + +tags: TAGS + +clean mostlyclean: $(CONFIG_CLEAN) + @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do + rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp + rm -f init.c version.c + rm -f gdb$(EXEEXT) core make.log + rm -f gdb[0-9]$(EXEEXT) + +# This used to depend on c-exp.tab.c m2-exp.tab.c TAGS +# I believe this is wrong; the makefile standards for distclean just +# describe removing files; the only sort of "re-create a distribution" +# functionality described is if the distributed files are unmodified. +# NB: While GDBSERVER might be configured on native systems, it isn't +# always included in SUBDIRS. Remove the gdbserver files explictly. +distclean: clean + @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do + rm -f gdbserver/config.status gdbserver/config.log + rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h + rm -f gdbserver/Makefile gdbserver/config.cache + rm -f nm.h tm.h xm.h config.status config.h stamp-h .gdbinit + rm -f y.output yacc.acts yacc.tmp y.tab.h + rm -f config.log config.cache + rm -f Makefile + +maintainer-clean: local-maintainer-clean do-maintainer-clean distclean +realclean: maintainer-clean + +local-maintainer-clean: + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f c-exp.tab.c \ + ada-lex.c ada-exp.tab.c \ + jv-exp.tab \ + f-exp.tab.c m2-exp.tab.c p-exp.tab.c + rm -f TAGS $(INFOFILES) + rm -f $(YYFILES) + rm -f nm.h tm.h xm.h config.status + +do-maintainer-clean: + @$(MAKE) $(FLAGS_TO_PASS) DO=maintainer-clean "DODIRS=$(SUBDIRS)" \ + subdir_do + +diststuff: $(DISTSTUFF) + cd doc; $(MAKE) $(MFLAGS) diststuff + +subdir_do: force + @for i in $(DODIRS); do \ + if [ -f ./$$i/Makefile ] ; then \ + if (cd ./$$i; \ + $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \ + else exit 1 ; fi ; \ + else true ; fi ; \ + done + +Makefile: Makefile.in config.status @frags@ + $(SHELL) config.status + +config.h: stamp-h ; @true +stamp-h: config.in config.status + CONFIG_HEADERS=config.h:config.in $(SHELL) config.status + +config.status: configure + $(SHELL) config.status --recheck + +force: + +# Documentation! +# GDB QUICK REFERENCE (TeX dvi file, CM fonts) +doc/refcard.dvi: + cd doc; $(MAKE) refcard.dvi $(FLAGS_TO_PASS) + +# GDB QUICK REFERENCE (PostScript output, common PS fonts) +doc/refcard.ps: + cd doc; $(MAKE) refcard.ps $(FLAGS_TO_PASS) + +# GDB MANUAL: TeX dvi file +doc/gdb.dvi: + cd doc; $(MAKE) gdb.dvi $(FLAGS_TO_PASS) + +# GDB MANUAL: info file +doc/gdb.info: + cd doc; $(MAKE) gdb.info $(FLAGS_TO_PASS) + +# Make copying.c from COPYING +$(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ \ + $(srcdir)/COPYING $(srcdir)/copying.awk + awk -f $(srcdir)/copying.awk \ + < $(srcdir)/COPYING > $(srcdir)/copying.tmp + mv $(srcdir)/copying.tmp $(srcdir)/copying.c + +version.c: Makefile version.in + rm -f version.c-tmp version.c + echo '#include "version.h"' >> version.c-tmp + echo 'const char version[] = "'"`sed q ${srcdir}/version.in`"'";' >> version.c-tmp + echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp + echo 'const char target_name[] = "$(target_alias)";' >> version.c-tmp + mv version.c-tmp version.c +version.o: version.c $(version_h) + + +# LANG-exp.tab.c is generated in objdir from LANG-exp.y if it doesn't +# exist in srcdir, then compiled in objdir to LANG-exp.tab.o. + +# If we said LANG-exp.tab.c rather than ./c-exp.tab.c some makes would +# sometimes re-write it into $(srcdir)/c-exp.tab.c. + +# Remove bogus decls for malloc/realloc/free which conflict with +# everything else. Strictly speaking c-exp.tab.c should therefore +# depend on Makefile.in, but that was a pretty big annoyance. + +# See comments above ... +.PRECIOUS: c-exp.tab.c +c-exp.tab.o: c-exp.tab.c +c-exp.tab.c: c-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/c-exp.y y.tab.c c-exp.tmp -- $(YFLAGS) + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + -e '/^#line.*y.tab.c/d' \ + < c-exp.tmp > c-exp.new + -rm c-exp.tmp + mv c-exp.new ./c-exp.tab.c + +# See comments above ... +.PRECIOUS: jv-exp.tab.c +jv-exp.tab.o: jv-exp.tab.c +jv-exp.tab.c: jv-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/jv-exp.y y.tab.c jv-exp.tmp -- $(YFLAGS) + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + -e '/^#line.*y.tab.c/d' \ + < jv-exp.tmp > jv-exp.new + -rm jv-exp.tmp + mv jv-exp.new ./jv-exp.tab.c + +# See comments above ... +.PRECIOUS: f-exp.tab.c +f-exp.tab.o: f-exp.tab.c +f-exp.tab.c: f-exp.y c-exp.tab.c + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/f-exp.y y.tab.c f-exp.tmp -- $(YFLAGS) + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + -e '/^#line.*y.tab.c/d' \ + < f-exp.tmp > f-exp.new + -rm f-exp.tmp + mv f-exp.new ./f-exp.tab.c + +# See comments above ... +.PRECIOUS: m2-exp.tab.c +m2-exp.tab.o: m2-exp.tab.c +m2-exp.tab.c: m2-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/m2-exp.y y.tab.c m2-exp.tmp -- $(YFLAGS) + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + -e '/^#line.*y.tab.c/d' \ + < m2-exp.tmp > m2-exp.new + -rm m2-exp.tmp + mv m2-exp.new ./m2-exp.tab.c + +# See comments above ... +.PRECIOUS: ada-exp.tab.c +ada-exp.tab.o: ada-exp.tab.c +ada-exp.tab.c: ada-exp.y + $(YACC) $(YFLAGS) $(srcdir)/ada-exp.y + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + < y.tab.c > ada-exp.new + -rm y.tab.c + mv ada-exp.new ./ada-exp.tab.c + +# See comments above ... +.PRECIOUS: ada-lex.c +ada-lex.o: ada-lex.c +ada-lex.c: ada-lex.l + @if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \ + echo $(FLEX) -Isit $(srcdir)/ada-lex.l ">" ada-lex.c; \ + $(FLEX) -Isit $(srcdir)/ada-lex.l > ada-lex.c; \ + elif [ ! -f ada-lex.c -a ! -f $(srcdir)/ada-lex.c ]; then \ + echo "ada-lex.c missing and flex not available."; \ + false; \ + elif [ ! -f ada-lex.c ]; then \ + echo "Warning: ada-lex.c older than ada-lex.l and flex not available."; \ + fi + +# See comments above ... +.PRECIOUS: p-exp.tab.c +p-exp.tab.o: p-exp.tab.c +p-exp.tab.c: p-exp.y + $(SHELL) $(YLWRAP) "$(YACC)" $(srcdir)/p-exp.y y.tab.c p-exp.tmp -- $(YFLAGS) + -sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/malloc/xmalloc/g' \ + -e 's/realloc/xrealloc/g' \ + -e '/^#line.*y.tab.c/d' \ + < p-exp.tmp > p-exp.new + -rm p-exp.tmp + mv p-exp.new ./p-exp.tab.c + +lint: $(LINTFILES) + $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \ + `echo $(DEPFILES) | sed 's/\.o /\.c /g'` + +gdb.cxref: $(SFILES) + cxref -I. $(SFILES) >gdb.cxref + +force_update: + +# GNU Make has an annoying habit of putting *all* the Makefile variables +# into the environment, unless you include this target as a circumvention. +# Rumor is that this will be fixed (and this target can be removed) +# in GNU Make 4.0. +.NOEXPORT: + +# GNU Make 3.63 has a different problem: it keeps tacking command line +# overrides onto the definition of $(MAKE). This variable setting +# will remove them. +MAKEOVERRIDES= + +## This is ugly, but I don't want GNU make to put these variables in +## the environment. Older makes will see this as a set of targets +## with no dependencies and no actions. +# OBSOLETE unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET : + +ALLDEPFILES = a68v-nat.c \ + aix-thread.c \ + alpha-nat.c alphabsd-nat.c \ + alpha-tdep.c alpha-linux-tdep.c alphabsd-tdep.c alphanbsd-tdep.c \ + alpha-osf1-tdep.c alphafbsd-tdep.c \ + arm-linux-nat.c arm-linux-tdep.c arm-tdep.c \ + armnbsd-nat.c armnbsd-tdep.c \ + avr-tdep.c \ + coff-solib.c \ + core-sol2.c core-regset.c core-aout.c corelow.c \ + dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \ + go32-nat.c h8300-tdep.c h8500-tdep.c \ + hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c hpread.c \ + i386-tdep.c i386b-nat.c i386v-nat.c i386-linux-nat.c \ + i386v4-nat.c i386ly-tdep.c \ + i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c \ + i387-tdep.c \ + i386-linux-tdep.c i386-nat.c \ + i386gnu-nat.c i386gnu-tdep.c \ + ia64-linux-nat.c ia64-linux-tdep.c ia64-tdep.c \ + infptrace.c inftarg.c irix4-nat.c irix5-nat.c \ + lynx-nat.c m3-nat.c \ + m68hc11-tdep.c \ + m68k-tdep.c \ + mcore-tdep.c \ + mips-linux-nat.c mips-linux-tdep.c \ + mips-nat.c \ + mips-irix-tdep.c \ + mips-tdep.c mipsm3-nat.c mipsv4-nat.c \ + mipsnbsd-nat.c mipsnbsd-tdep.c \ + nbsd-tdep.c \ + nindy-share/Onindy.c nindy-share/nindy.c \ + nindy-share/ttyflush.c nindy-tdep.c \ + ns32k-tdep.c solib-osf.c \ + somread.c somsolib.c $(HPREAD_SOURCE) \ + ppc-sysv-tdep.o ppc-linux-nat.c ppc-linux-tdep.c \ + ppcnbsd-nat.o ppcnbsd-tdep.o \ + procfs.c \ + remote-array.c remote-e7000.c \ + remote-es.c remote-hms.c remote-mips.c \ + remote-rdp.c remote-sim.c \ + remote-st.c remote-utils.c dcache.c \ + remote-vx.c \ + rs6000-nat.c rs6000-tdep.c \ + s390-tdep.c s390-nat.c \ + ser-go32.c ser-pipe.c ser-tcp.c \ + sh-tdep.c shnbsd-tdep.c shnbsd-nat.c \ + solib.c solib-irix.c solib-svr4.c solib-sunos.c sparc-linux-nat.c \ + sparc-nat.c \ + sparc64nbsd-nat.c sparcnbsd-nat.c sparcnbsd-tdep.c \ + sparc-tdep.c sparcl-tdep.c sun3-nat.c \ + symm-tdep.c symm-nat.c \ + vax-tdep.c \ + vx-share/xdr_ld.c vx-share/xdr_ptrace.c vx-share/xdr_rdb.c \ + win32-nat.c \ + xcoffread.c xcoffsolib.c \ + xstormy16-tdep.c \ + z8k-tdep.c + +# Some files need explict build rules (due to -Werror problems) or due +# to sub-directory fun 'n' games. + +# Provide explicit rule/dependency - works for more makes. +copying.o: $(srcdir)/copying.c + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/copying.c + +hpux-thread.o: $(srcdir)/hpux-thread.c + $(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \ + -I$(srcdir)/osf-share/HP800 -I/usr/include/dce \ + $(srcdir)/hpux-thread.c + +# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't +# match output format strings. +procfs.o: $(srcdir)/procfs.c + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/procfs.c + +v850ice.o: $(srcdir)/v850ice.c + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(GDBTK_CFLAGS) \ + $(srcdir)/v850ice.c + +# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't +# declared -Wimplicit fails. It should be using the GDBARCH framework. +# cagney 1999-09-02. +z8k-tdep.o: $(srcdir)/z8k-tdep.c + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \ + $(srcdir)/z8k-tdep.c + +# +# Generated YACC/LEX dependencies +# + +c-exp.tab.o: c-exp.tab.c $(defs_h) $(gdb_string_h) $(expression_h) \ + $(value_h) $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) \ + $(charset_h) \ + $(symfile_h) $(objfiles_h) + +jv-exp.tab.o: jv-exp.tab.c jv-lang.h $(defs_h) $(expression_h) \ + $(gdbtypes_h) $(language_h) $(parser_defs_h) $(symtab_h) $(value_h) \ + $(bfd_h) $(objfiles_h) $(symfile_h) + +f-exp.tab.o: f-exp.tab.c f-lang.h $(defs_h) $(expression_h) \ + $(language_h) $(parser_defs_h) $(value_h) $(bfd_h) $(objfiles_h) \ + $(symfile_h) + +m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ + $(language_h) m2-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ + $(bfd_h) $(objfiles_h) $(symfile_h) + +p-exp.tab.o: p-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \ + $(language_h) p-lang.h $(parser_defs_h) $(symtab_h) $(value_h) \ + $(bfd_h) $(objfiles_h) $(symfile_h) + +ada-exp.tab.o: ada-exp.tab.c ada-lex.c ada-lang.h \ + $(defs_h) $(expression_h) \ + $(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h) \ + $(bfd_h) objfiles.h symfile.h + +# +# The dependencies. In aphabetic order. +# + +a68v-nat.o: a68v-nat.c $(defs_h) $(inferior_h) $(regcache_h) +abug-rom.o: abug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +ada-lang.o: ada-lang.c $(gdb_string_h) $(demangle_h) $(defs_h) $(symtab_h) \ + $(gdbtypes_h) $(gdbcmd_h) $(expression_h) $(parser_defs_h) \ + $(language_h) $(c_lang_h) $(inferior_h) $(symfile_h) $(objfiles_h) \ + $(breakpoint_h) $(gdbcore_h) $(ada_lang_h) $(ui_out_h) +ada-tasks.o: ada-tasks.c $(defs_h) $(command_h) $(value_h) $(language_h) \ + $(inferior_h) $(symtab_h) $(target_h) $(gdbcore_h) $(gregset_h) \ + $(ada_lang_h) +ada-typeprint.o: ada-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) \ + $(symtab_h) $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) \ + $(target_h) $(command_h) $(gdbcmd_h) $(language_h) $(demangle_h) \ + $(c_lang_h) $(typeprint_h) $(ada_lang_h) $(gdb_string_h) +ada-valprint.o: ada-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(value_h) $(demangle_h) $(valprint_h) $(language_h) \ + $(annotate_h) $(ada_lang_h) $(c_lang_h) +aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \ + $(target_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) $(language_h) \ + $(ppc_tdep_h) +alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ + $(value_h) $(alpha_tdep_h) +alpha-nat.o: alpha-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ + $(regcache_h) $(alpha_tdep_h) $(gregset_h) +alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ + $(value_h) $(alpha_tdep_h) +alpha-tdep.o: alpha-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(value_h) $(gdbcmd_h) $(gdbcore_h) $(dis_asm_h) $(symfile_h) \ + $(objfiles_h) $(gdb_string_h) $(linespec_h) $(regcache_h) \ + $(doublest_h) $(arch_utils_h) $(elf_bfd_h) $(alpha_tdep_h) +alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(alpha_tdep_h) $(alphabsd_tdep_h) $(gregset_h) +alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \ + $(alphabsd_tdep_h) +alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) $(alpha_tdep_h) +alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ + $(regcache_h) $(value_h) $(solib_svr4_h) $(alpha_tdep_h) \ + $(alphabsd_tdep_h) $(nbsd_tdep_h) +annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \ + $(gdbtypes_h) $(breakpoint_h) +# OBSOLETE arc-tdep.o: arc-tdep.c +arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) \ + $(inferior_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \ + $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(annotate_h) \ + $(gdb_string_h) $(regcache_h) $(gdb_assert_h) $(sim_regno_h) \ + $(version_h) $(floatformat_h) +arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(gregset_h) +arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ + $(gdbtypes_h) $(floatformat_h) $(gdbcore_h) $(frame_h) $(regcache_h) \ + $(doublest_h) $(arm_tdep_h) $(symtab_h) $(symfile_h) $(objfiles_h) +arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ + $(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \ + $(doublest_h) $(value_h) $(arch_utils_h) $(solib_svr4_h) \ + $(arm_tdep_h) $(gdb_sim_arm_h) $(elf_bfd_h) $(coff_internal_h) \ + $(elf_arm_h) $(gdb_assert_h) $(bfd_in2_h) $(libcoff_h) +armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \ + $(regcache_h) $(gdbcore_h) +armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(arm_tdep_h) $(nbsd_tdep_h) \ + $(solib_svr4_h) +avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ + $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h) +ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \ + $(value_h) $(expression_h) $(command_h) $(gdbcmd_h) $(frame_h) \ + $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) +ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h) +bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h) +blockframe.o: blockframe.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(frame_h) $(gdbcore_h) $(value_h) $(target_h) \ + $(inferior_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) +breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \ + $(gdbtypes_h) $(expression_h) $(gdbcore_h) $(gdbcmd_h) $(value_h) \ + $(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \ + $(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \ + $(objfiles_h) $(linespec_h) $(completer_h) $(gdb_h) $(ui_out_h) \ + $(cli_script_h) $(gdb_events_h) $(source_h) +buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(complaints_h) \ + $(gdb_string_h) $(expression_h) $(language_h) $(bcache_h) \ + $(filenames_h) $(macrotab_h) $(demangle_h) $(buildsym_h) \ + $(stabsread_h) +builtin-regs.o: builtin-regs.c $(defs_h) $(builtin_regs_h) $(gdbtypes_h) \ + $(gdb_string_h) $(gdb_assert_h) +c-lang.o: c-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(c_lang_h) $(valprint_h) \ + $(macroscope_h) $(gdb_assert_h) +c-typeprint.o: c-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ + $(language_h) $(demangle_h) $(c_lang_h) $(typeprint_h) $(cp_abi_h) \ + $(gdb_string_h) +c-valprint.o: c-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \ + $(c_lang_h) $(cp_abi_h) +# OBSOLETE ch-exp.o: ch-exp.c +# OBSOLETE ch-lang.o: ch-lang.c +# OBSOLETE ch-typeprint.o: ch-typeprint.c +# OBSOLETE ch-valprint.o: ch-valprint.c +cli-out.o: cli-out.c $(defs_h) $(ui_out_h) $(cli_out_h) $(gdb_string_h) \ + $(gdb_assert_h) +coff-solib.o: coff-solib.c $(defs_h) $(frame_h) $(bfd_h) $(gdbcore_h) \ + $(symtab_h) $(symfile_h) $(objfiles_h) +coffread.o: coffread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(demangle_h) \ + $(breakpoint_h) $(bfd_h) $(gdb_obstack_h) $(gdb_string_h) \ + $(coff_internal_h) $(libcoff_h) $(symfile_h) $(objfiles_h) \ + $(buildsym_h) $(gdb_stabs_h) $(stabsread_h) $(complaints_h) \ + $(target_h) $(gdb_assert_h) +complaints.o: complaints.c $(defs_h) $(complaints_h) $(gdb_assert_h) \ + $(command_h) $(gdbcmd_h) +completer.o: completer.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(filenames_h) $(cli_decode_h) $(gdbcmd_h) $(completer_h) +copying.o: copying.c $(defs_h) $(command_h) $(gdbcmd_h) +core-aout.o: core-aout.c $(defs_h) $(gdbcore_h) $(value_h) $(regcache_h) \ + $(gdb_dirent_h) $(gdb_stat_h) +core-regset.o: core-regset.c $(defs_h) $(gdb_string_h) $(inferior_h) \ + $(target_h) $(command_h) $(gdbcore_h) $(gregset_h) +core-sol2.o: core-sol2.c $(defs_h) $(gdb_string_h) $(regcache_h) \ + $(inferior_h) $(target_h) $(command_h) $(gdbcore_h) $(gregset_h) +corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \ + $(command_h) $(gdbcmd_h) $(bfd_h) $(target_h) $(gdbcore_h) \ + $(dis_asm_h) $(gdb_stat_h) $(completer_h) +corelow.o: corelow.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(symtab_h) $(command_h) $(bfd_h) $(target_h) $(gdbcore_h) \ + $(gdbthread_h) $(regcache_h) $(symfile_h) +cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(gdb_string_h) +cp-support.o: cp-support.c $(defs_h) $(cp_support_h) +cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \ + $(demangle_h) $(annotate_h) $(gdb_string_h) $(c_lang_h) $(target_h) \ + $(cp_abi_h) +cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(monitor_h) $(serial_h) $(regcache_h) +cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \ + $(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(value_h) \ + $(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(symfile_h) \ + $(solib_h) $(solib_svr4_h) +# OBSOLETE cxux-nat.o: cxux-nat.c +d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ + $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) $(inferior_h) \ + $(dis_asm_h) $(symfile_h) $(objfiles_h) $(language_h) \ + $(arch_utils_h) $(regcache_h) $(floatformat_h) $(gdb_sim_d10v_h) \ + $(sim_regno_h) +# OBSOLETE d30v-tdep.o: d30v-tdep.c +dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) \ + $(gdb_stat_h) $(symtab_h) $(breakpoint_h) $(target_h) $(gdbcore_h) \ + $(libaout_h) $(symfile_h) $(objfiles_h) $(buildsym_h) $(stabsread_h) \ + $(gdb_stabs_h) $(demangle_h) $(language_h) $(complaints_h) \ + $(cp_abi_h) $(aout_aout64_h) $(aout_stab_gnu_h) +dcache.o: dcache.c $(defs_h) $(dcache_h) $(gdbcmd_h) $(gdb_string_h) \ + $(gdbcore_h) $(target_h) +delta68-nat.o: delta68-nat.c $(defs_h) +demangle.o: demangle.c $(defs_h) $(command_h) $(gdbcmd_h) $(demangle_h) \ + $(gdb_string_h) +dink32-rom.o: dink32-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(symfile_h) $(inferior_h) $(regcache_h) +doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \ + $(gdb_assert_h) $(gdb_string_h) $(gdbtypes_h) +dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h) +dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h) +# OBSOLETE dstread.o: dstread.c +dve3900-rom.o: dve3900-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(inferior_h) $(command_h) $(gdb_string_h) $(regcache_h) +dwarf2cfi.o: dwarf2cfi.c $(defs_h) $(gdbcore_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(target_h) $(elf_dwarf2_h) $(inferior_h) \ + $(regcache_h) $(dwarf2cfi_h) $(gdb_assert_h) +dwarf2read.o: dwarf2read.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \ + $(symfile_h) $(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) \ + $(demangle_h) $(expression_h) $(filenames_h) $(macrotab_h) \ + $(language_h) $(complaints_h) $(bcache_h) $(gdb_string_h) \ + $(gdb_assert_h) +dwarfread.o: dwarfread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \ + $(objfiles_h) $(elf_dwarf_h) $(buildsym_h) $(demangle_h) \ + $(expression_h) $(language_h) $(complaints_h) $(gdb_string_h) +elfread.o: elfread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(elf_bfd_h) \ + $(elf_mips_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \ + $(stabsread_h) $(gdb_stabs_h) $(complaints_h) $(demangle_h) +environ.o: environ.c $(defs_h) $(environ_h) $(gdb_string_h) +eval.o: eval.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(expression_h) $(target_h) $(frame_h) $(language_h) \ + $(f_lang_h) $(cp_abi_h) +event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \ + $(gdb_string_h) +event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \ + $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) +exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \ + $(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \ + $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) +expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(value_h) $(language_h) $(parser_defs_h) +f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(parser_defs_h) $(language_h) $(f_lang_h) \ + $(valprint_h) +f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ + $(f_lang_h) $(gdb_string_h) +f-valprint.o: f-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \ + $(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) +fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(gdb_string_h) $(elf_bfd_h) $(gregset_h) +findvar.o: findvar.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(frame_h) \ + $(value_h) $(gdbcore_h) $(inferior_h) $(target_h) $(gdb_string_h) \ + $(gdb_assert_h) $(floatformat_h) $(symfile_h) $(regcache_h) \ + $(builtin_regs_h) +fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \ + $(terminal_h) $(gdbthread_h) $(command_h) +# OBSOLETE fr30-tdep.o: fr30-tdep.c +frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ + $(regcache_h) $(gdb_assert_h) +frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ + $(arch_utils_h) $(regcache_h) +gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \ + $(elf_bfd_h) $(symfile_h) $(objfiles_h) +gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h) +gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \ + $(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \ + $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(gdbthread_h) \ + $(annotate_h) $(symfile_h) $(value_h) $(symcat_h) $(floatformat_h) \ + $(gdb_assert_h) $(gdb_string_h) $(gdb_events_h) +gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \ + $(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \ + $(gdbcmd_h) $(wrapper_h) $(cp_abi_h) $(gdb_assert_h) +gnu-nat.o: gnu-nat.c $(gdb_string_h) $(defs_h) $(inferior_h) $(symtab_h) \ + $(value_h) $(language_h) $(target_h) $(gdb_wait_h) $(gdbcmd_h) \ + $(gdbcore_h) $(gdbthread_h) $(gdb_assert_h) $(gnu_nat_h) \ + $(exc_request_S_h) $(notify_S_h) $(process_reply_S_h) \ + $(msg_reply_S_h) $(exc_request_U_h) $(msg_U_h) +gnu-v2-abi.o: gnu-v2-abi.c $(defs_h) $(gdb_string_h) $(symtab_h) \ + $(gdbtypes_h) $(value_h) $(demangle_h) $(cp_abi_h) +gnu-v3-abi.o: gnu-v3-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(demangle_h) \ + $(gdb_assert_h) $(gdb_string_h) +go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) $(gdb_wait_h) $(gdbcore_h) \ + $(command_h) $(gdbcmd_h) $(floatformat_h) $(buildsym_h) \ + $(i387_tdep_h) $(i386_tdep_h) $(value_h) $(regcache_h) \ + $(gdb_string_h) +h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_h) \ + $(gdbcmd_h) $(gdbtypes_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \ + $(regcache_h) +h8500-tdep.o: h8500-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \ + $(gdbcmd_h) $(value_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h) +hp300ux-nat.o: hp300ux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ + $(regcache_h) +hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \ + $(gdbtypes_h) $(gdbcore_h) $(cp_abi_h) +hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \ + $(value_h) $(regcache_h) $(completer_h) $(symtab_h) $(a_out_encap_h) \ + $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) \ + $(symfile_h) $(objfiles_h) +hppab-nat.o: hppab-nat.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h) +hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(gdb_wait_h) $(regcache_h) +hppam3-nat.o: hppam3-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \ + $(regcache_h) +hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \ + $(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \ + $(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \ + $(gdb_string_h) +hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \ + $(inferior_h) $(regcache_h) $(gdbcore_h) +i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gregset_h) \ + $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) +i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ + $(value_h) $(regcache_h) $(inferior_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(solib_svr4_h) $(i386_tdep_h) $(i386_linux_tdep_h) +i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h) +i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(i386_tdep_h) +i386-stub.o: i386-stub.c +i386-tdep.o: i386-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(gdbcore_h) $(objfiles_h) $(target_h) $(floatformat_h) $(symfile_h) \ + $(symtab_h) $(gdbcmd_h) $(command_h) $(arch_utils_h) $(regcache_h) \ + $(doublest_h) $(value_h) $(gdb_assert_h) $(i386_tdep_h) \ + $(i387_tdep_h) +# OBSOLETE i386aix-nat.o: i386aix-nat.c +i386b-nat.o: i386b-nat.c $(defs_h) +i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(gdb_assert_h) $(gregset_h) $(i386_tdep_h) $(i387_tdep_h) +i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ + $(gdbcore_h) $(regcache_h) $(gdb_string_h) $(i386_tdep_h) +i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) +i386gnu-nat.o: i386gnu-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \ + $(regcache_h) $(gdb_assert_h) $(i386_tdep_h) $(gnu_nat_h) \ + $(i387_tdep_h) +i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) $(i386_tdep_h) +i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(regcache_h) $(target_h) $(i386_tdep_h) +# OBSOLETE i386m3-nat.o: i386m3-nat.c +# OBSOLETE i386mach-nat.o: i386mach-nat.c +i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(gdbtypes_h) $(gdbcore_h) \ + $(regcache_h) $(arch_utils_h) $(i386_tdep_h) $(i387_tdep_h) \ + $(nbsd_tdep_h) $(solib_svr4_h) +i386obsd-nat.o: i386obsd-nat.c $(defs_h) +i386v-nat.o: i386v-nat.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \ + $(gdbcore_h) $(gdb_stat_h) $(floatformat_h) $(target_h) +i386v4-nat.o: i386v4-nat.c $(defs_h) $(value_h) $(inferior_h) $(regcache_h) \ + $(i386_tdep_h) $(i387_tdep_h) $(gregset_h) +i387-tdep.o: i387-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \ + $(value_h) $(gdbcore_h) $(floatformat_h) $(regcache_h) \ + $(gdb_assert_h) $(gdb_string_h) $(doublest_h) $(i386_tdep_h) +# OBSOLETE i960-tdep.o: i960-tdep.c +ia64-aix-nat.o: ia64-aix-nat.c $(defs_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(gdb_stat_h) +ia64-aix-tdep.o: ia64-aix-tdep.c $(defs_h) +ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) $(gregset_h) +ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h) +ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \ + $(arch_utils_h) $(floatformat_h) $(regcache_h) $(doublest_h) \ + $(value_h) $(objfiles_h) $(elf_common_h) $(elf_bfd_h) +inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \ + $(event_top_h) $(inf_loop_h) $(remote_h) +infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(frame_h) $(inferior_h) $(environ_h) $(value_h) $(gdbcmd_h) \ + $(symfile_h) $(gdbcore_h) $(target_h) $(language_h) $(symfile_h) \ + $(objfiles_h) $(completer_h) $(ui_out_h) $(event_top_h) \ + $(parser_defs_h) $(regcache_h) +inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \ + $(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) +infptrace.o: infptrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdb_string_h) $(regcache_h) $(gdb_wait_h) $(command_h) \ + $(gdb_dirent_h) $(gdbcore_h) $(gdb_stat_h) +infrun.o: infrun.c $(defs_h) $(gdb_string_h) $(symtab_h) $(frame_h) \ + $(inferior_h) $(breakpoint_h) $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) \ + $(cli_script_h) $(target_h) $(gdbthread_h) $(annotate_h) \ + $(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) +inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) +infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbcore_h) +irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) \ + $(gregset_h) +irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ + $(regcache_h) $(gdb_string_h) $(gregset_h) +jv-lang.o: jv-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(gdbtypes_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(gdb_string_h) $(value_h) $(c_lang_h) \ + $(jv_lang_h) $(gdbcore_h) +jv-typeprint.o: jv-typeprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(demangle_h) $(jv_lang_h) $(gdb_string_h) $(typeprint_h) \ + $(c_lang_h) $(cp_abi_h) +jv-valprint.o: jv-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(gdbcore_h) $(expression_h) $(value_h) $(demangle_h) $(valprint_h) \ + $(language_h) $(jv_lang_h) $(c_lang_h) $(annotate_h) $(gdb_string_h) +kod-cisco.o: kod-cisco.c $(defs_h) $(gdb_string_h) $(kod_h) +kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) $(target_h) $(gdb_string_h) \ + $(kod_h) +language.o: language.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(gdbcmd_h) $(expression_h) $(language_h) $(target_h) \ + $(parser_defs_h) $(jv_lang_h) +lin-lwp.o: lin-lwp.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) \ + $(gdbthread_h) $(inferior_h) $(target_h) $(regcache_h) $(gdbcmd_h) +linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ + $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(completer_h) \ + $(cp_abi_h) $(source_h) +linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \ + $(cli_decode_h) $(gdb_string_h) +lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) +m2-lang.o: m2-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(m2_lang_h) $(c_lang_h) \ + $(valprint_h) +m2-typeprint.o: m2-typeprint.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(value_h) $(gdbcore_h) $(target_h) $(m2_lang_h) +m2-valprint.o: m2-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(m2_lang_h) +m3-nat.o: m3-nat.c $(defs_h) $(inferior_h) $(symtab_h) $(value_h) \ + $(language_h) $(target_h) $(gdb_wait_h) $(gdbcmd_h) $(gdbcore_h) \ + $(regcache_h) +m32r-rom.o: m32r-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(symtab_h) $(command_h) $(gdbcmd_h) $(symfile_h) \ + $(gdb_string_h) $(objfiles_h) $(inferior_h) $(regcache_h) +m32r-stub.o: m32r-stub.c $(syscall_h) +m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ + $(regcache_h) +m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(symtab_h) \ + $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \ + $(inferior_h) $(dis_asm_h) $(symfile_h) $(objfiles_h) \ + $(arch_utils_h) $(regcache_h) $(target_h) $(opcode_m68hc11_h) \ + $(elf_m68hc11_h) $(elf_bfd_h) +m68k-stub.o: m68k-stub.c +m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h) \ + $(value_h) $(gdb_string_h) $(inferior_h) $(regcache_h) \ + $(arch_utils_h) $(gregset_h) +m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ + $(language_h) $(gdbcore_h) $(regcache_h) $(gdb_stat_h) \ + $(floatformat_h) $(target_h) $(gregset_h) +m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(regcache_h) +m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h) +# OBSOLETE m88k-nat.o: m88k-nat.c +# OBSOLETE m88k-tdep.o: m88k-tdep.c +macrocmd.o: macrocmd.c $(defs_h) $(macrotab_h) $(macroexp_h) $(macroscope_h) \ + $(command_h) $(gdbcmd_h) +macroexp.o: macroexp.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(macrotab_h) \ + $(macroexp_h) $(gdb_assert_h) +macroscope.o: macroscope.c $(defs_h) $(macroscope_h) $(symtab_h) $(target_h) \ + $(frame_h) $(inferior_h) $(source_h) +macrotab.o: macrotab.c $(defs_h) $(gdb_obstack_h) $(splay_tree_h) \ + $(symtab_h) $(symfile_h) $(objfiles_h) $(macrotab_h) $(gdb_assert_h) \ + $(bcache_h) $(complaints_h) +main.o: main.c $(defs_h) $(top_h) $(target_h) $(inferior_h) $(symfile_h) \ + $(gdbcore_h) $(getopt_h) $(gdb_stat_h) $(gdb_string_h) \ + $(event_loop_h) $(ui_out_h) +maint.o: maint.c $(defs_h) $(command_h) $(gdbcmd_h) $(symtab_h) \ + $(gdbtypes_h) $(demangle_h) $(gdbcore_h) $(expression_h) \ + $(language_h) $(symfile_h) $(objfiles_h) $(value_h) $(cli_decode_h) +mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(gdb_string_h) $(regcache_h) $(serial_h) +mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \ + $(gdbcmd_h) $(regcache_h) $(symfile_h) $(gdbcore_h) $(inferior_h) \ + $(arch_utils_h) +mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ + $(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \ + $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \ + $(coff_sym_h) $(coff_symconst_h) $(gdb_stat_h) $(gdb_string_h) \ + $(bfd_h) $(coff_ecoff_h) $(libaout_h) $(aout_aout64_h) \ + $(aout_stab_gnu_h) $(expression_h) $(language_h) +mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \ + $(target_h) +memattr.o: memattr.c $(defs_h) $(command_h) $(gdbcmd_h) $(memattr_h) \ + $(target_h) $(value_h) $(language_h) $(gdb_string_h) +minsyms.o: minsyms.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(cp_abi_h) +mips-irix-tdep.o: mips-irix-tdep.c $(defs_h) $(osabi_h) $(elf_bfd_h) +mips-linux-nat.o: mips-linux-nat.c $(defs_h) +mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(solib_svr4_h) +mips-nat.o: mips-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) +mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(symtab_h) $(value_h) $(gdbcmd_h) $(language_h) $(gdbcore_h) \ + $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(target_h) $(arch_utils_h) \ + $(regcache_h) $(osabi_h) $(opcode_mips_h) $(elf_mips_h) $(elf_bfd_h) \ + $(symcat_h) +mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) +mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(mipsnbsd_tdep_h) +mipsnbsd-tdep.o: mipsnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(value_h) $(osabi_h) $(mipsnbsd_tdep_h) $(solib_svr4_h) \ + $(nbsd_tdep_h) +mipsread.o: mipsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(buildsym_h) $(stabsread_h) \ + $(coff_sym_h) $(coff_internal_h) $(coff_ecoff_h) $(libcoff_h) \ + $(libecoff_h) $(elf_common_h) $(elf_mips_h) +mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ + $(regcache_h) $(gregset_h) +mn10200-tdep.o: mn10200-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ + $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \ + $(symfile_h) $(regcache_h) +mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ + $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \ + $(symfile_h) $(regcache_h) $(arch_utils_h) +mon960-rom.o: mon960-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(srec_h) $(xmodem_h) $(symtab_h) $(symfile_h) \ + $(inferior_h) $(gdb_string_h) +monitor.o: monitor.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \ + $(command_h) $(serial_h) $(monitor_h) $(gdbcmd_h) $(inferior_h) \ + $(gdb_regex_h) $(srec_h) $(regcache_h) +nbsd-tdep.o: nbsd-tdep.c $(defs_h) $(gdb_string_h) $(solib_svr4_h) +nindy-tdep.o: nindy-tdep.c $(defs_h) $(symtab_h) $(frame_h) $(gdbcore_h) +nlmread.o: nlmread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(buildsym_h) $(stabsread_h) +ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \ + $(inferior_h) $(regcache_h) $(target_h) $(arch_utils_h) \ + $(ns32k_tdep_h) +ns32knbsd-nat.o: ns32knbsd-nat.c $(defs_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) +ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(ns32k_tdep_h) +objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \ + $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) +ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \ + $(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h) +op50-rom.o: op50-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) +# OBSOLETE os9kread.o: os9kread.c +osabi.o: osabi.c $(defs_h) $(gdb_string_h) $(osabi_h) $(elf_bfd_h) +p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \ + $(valprint_h) +p-typeprint.o: p-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ + $(language_h) $(p_lang_h) $(typeprint_h) $(gdb_string_h) +p-valprint.o: p-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(command_h) $(gdbcmd_h) \ + $(gdbcore_h) $(demangle_h) $(valprint_h) $(typeprint_h) \ + $(language_h) $(target_h) $(annotate_h) $(p_lang_h) $(cp_abi_h) +pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_h) $(libhppa_h) \ + $(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \ + $(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \ + $(regcache_h) +parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \ + $(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \ + $(doublest_h) $(builtin_regs_h) $(gdb_assert_h) +ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ + $(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(ppc_tdep_h) \ + $(regcache_h) +ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ + $(gdbcore_h) $(regcache_h) $(gregset_h) $(ppc_tdep_h) +ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ + $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \ + $(objfiles_h) $(regcache_h) $(value_h) $(solib_svr4_h) $(ppc_tdep_h) +ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(regcache_h) $(value_h) $(ppc_tdep_h) +ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(ppc_tdep_h) \ + $(ppcnbsd_tdep_h) +ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(breakpoint_h) $(value_h) $(ppc_tdep_h) \ + $(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h) +printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ + $(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \ + $(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \ + $(annotate_h) $(symfile_h) $(objfiles_h) $(completer_h) $(ui_out_h) \ + $(gdb_assert_h) +proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(proc_utils_h) +proc-events.o: proc-events.c $(defs_h) +proc-flags.o: proc-flags.c $(defs_h) +proc-service.o: proc-service.c $(defs_h) $(gdb_proc_service_h) $(inferior_h) \ + $(symtab_h) $(target_h) $(gregset_h) +proc-why.o: proc-why.c $(defs_h) $(proc_utils_h) +procfs.o: procfs.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(elf_bfd_h) $(gdbcmd_h) $(gdbthread_h) $(gdb_dirent_h) $(X_OK) \ + $(gdb_stat_h) $(proc_utils_h) $(gregset_h) +ptx4-nat.o: ptx4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) \ + $(gregset_h) +regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \ + $(gdbcmd_h) $(regcache_h) $(gdb_assert_h) $(gdb_string_h) \ + $(gdbcmd_h) +remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) \ + $(remote_utils_h) $(inferior_h) $(version_h) $(regcache_h) +# OBSOLETE remote-bug.o: remote-bug.c +remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(gdbarch_h) \ + $(inferior_h) $(target_h) $(value_h) $(command_h) $(gdb_string_h) \ + $(gdbcmd_h) $(serial_h) $(remote_utils_h) $(symfile_h) $(regcache_h) +remote-es.o: remote-es.c $(defs_h) $(gdb_string_h) $(frame_h) $(inferior_h) \ + $(target_h) $(command_h) $(symfile_h) $(remote_utils_h) $(gdbcore_h) \ + $(serial_h) $(regcache_h) $(value_h) +remote-est.o: remote-est.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +remote-hms.o: remote-hms.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) +remote-mips.o: remote-mips.c $(defs_h) $(inferior_h) $(bfd_h) $(symfile_h) \ + $(gdbcmd_h) $(gdbcore_h) $(serial_h) $(target_h) $(remote_utils_h) \ + $(gdb_string_h) $(gdb_stat_h) $(regcache_h) +# OBSOLETE remote-nindy.o: remote-nindy.c +# OBSOLETE remote-nrom.o: remote-nrom.c +# OBSOLETE remote-os9k.o: remote-os9k.c +remote-rdi.o: remote-rdi.c $(defs_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ + $(objfiles_h) $(gdb_stabs_h) $(gdbthread_h) $(gdbcore_h) \ + $(breakpoint_h) $(completer_h) $(regcache_h) $(arm_tdep_h) \ + $(rdi_share_ardi_h) $(rdi_share_adp_h) $(rdi_share_hsys_h) +remote-rdp.o: remote-rdp.c $(defs_h) $(inferior_h) $(value_h) \ + $(gdb_callback_h) $(command_h) $(symfile_h) $(remote_utils_h) \ + $(gdb_string_h) $(gdbcore_h) $(regcache_h) $(serial_h) $(arm_tdep_h) +remote-sds.o: remote-sds.c $(defs_h) $(gdb_string_h) $(frame_h) \ + $(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \ + $(objfiles_h) $(gdb_stabs_h) $(gdbthread_h) $(gdbcore_h) \ + $(regcache_h) $(serial_h) +remote-sim.o: remote-sim.c $(defs_h) $(inferior_h) $(value_h) \ + $(gdb_string_h) $(terminal_h) $(target_h) $(gdbcore_h) \ + $(gdb_callback_h) $(gdb_remote_sim_h) $(remote_utils_h) $(command_h) \ + $(regcache_h) $(gdb_assert_h) $(sim_regno_h) +remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \ + $(serial_h) $(regcache_h) +remote-utils.o: remote-utils.c $(defs_h) $(gdb_string_h) $(gdbcmd_h) \ + $(target_h) $(serial_h) $(gdbcore_h) $(inferior_h) $(remote_utils_h) \ + $(regcache_h) +remote-vx.o: remote-vx.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(command_h) $(symtab_h) $(complaints_h) $(gdbcmd_h) \ + $(bfd_h) $(symfile_h) $(objfiles_h) $(gdb_stabs_h) $(regcache_h) \ + $(gdb_string_h) $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) \ + $(vx_share_xdr_ld_h) $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h) +remote-vx68.o: remote-vx68.c $(defs_h) $(vx_share_regPacket_h) $(frame_h) \ + $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) $(symtab_h) \ + $(symfile_h) $(regcache_h) $(gdb_string_h) $(vx_share_ptrace_h) \ + $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) $(vx_share_xdr_rdb_h) \ + $(vx_share_dbgRpcLib_h) +# OBSOLETE remote-vx960.o: remote-vx960.c +remote-vxmips.o: remote-vxmips.c $(defs_h) $(vx_share_regPacket_h) \ + $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) \ + $(symtab_h) $(symfile_h) $(regcache_h) $(gdb_string_h) \ + $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) \ + $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h) +remote-vxsparc.o: remote-vxsparc.c $(defs_h) $(vx_share_regPacket_h) \ + $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) $(command_h) \ + $(symtab_h) $(symfile_h) $(regcache_h) $(gdb_string_h) \ + $(vx_share_ptrace_h) $(vx_share_xdr_ptrace_h) $(vx_share_xdr_ld_h) \ + $(vx_share_xdr_rdb_h) $(vx_share_dbgRpcLib_h) +remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \ + $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \ + $(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \ + $(event_loop_h) $(event_top_h) $(inf_loop_h) $(serial_h) \ + $(gdbcore_h) +rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(regcache_h) $(value_h) +rs6000-nat.o: rs6000-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(xcoffsolib_h) $(symfile_h) $(objfiles_h) $(libbfd_h) $(bfd_h) \ + $(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(language_h) \ + $(ppc_tdep_h) $(gdb_stat_h) +rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) $(objfiles_h) \ + $(arch_utils_h) $(regcache_h) $(doublest_h) $(value_h) \ + $(parser_defs_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \ + $(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \ + $(ppc_tdep_h) +s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) +s390-tdep.o: s390-tdep.c $(arch_utils_h) $(frame_h) $(inferior_h) \ + $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \ + $(objfiles_h) $(tm_h) $(__bfd_bfd_h) $(floatformat_h) $(regcache_h) \ + $(value_h) $(gdb_assert_h) +scm-exp.o: scm-exp.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(value_h) $(c_lang_h) $(scm_lang_h) \ + $(scm_tags_h) +scm-lang.o: scm-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ + $(parser_defs_h) $(language_h) $(value_h) $(c_lang_h) $(scm_lang_h) \ + $(scm_tags_h) $(gdb_string_h) $(gdbcore_h) $(source_h) +scm-valprint.o: scm-valprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(parser_defs_h) $(language_h) $(value_h) \ + $(scm_lang_h) $(valprint_h) $(gdbcore_h) +ser-e7kpc.o: ser-e7kpc.c $(defs_h) $(serial_h) $(gdb_string_h) +ser-go32.o: ser-go32.c $(defs_h) $(gdbcmd_h) $(serial_h) $(gdb_string_h) +ser-pipe.o: ser-pipe.c $(defs_h) $(serial_h) $(ser_unix_h) $(gdb_vfork_h) \ + $(gdb_string_h) +ser-tcp.o: ser-tcp.c $(defs_h) $(serial_h) $(ser_unix_h) $(gdb_string_h) +ser-unix.o: ser-unix.c $(defs_h) $(serial_h) $(ser_unix_h) $(terminal_h) \ + $(gdb_string_h) $(event_loop_h) +serial.o: serial.c $(defs_h) $(serial_h) $(gdb_string_h) $(gdbcmd_h) +sh-stub.o: sh-stub.c +sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \ + $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) \ + $(inferior_h) $(gdb_string_h) $(arch_utils_h) $(floatformat_h) \ + $(regcache_h) $(doublest_h) $(sh_tdep_h) $(elf_bfd_h) \ + $(solib_svr4_h) $(elf_sh_h) $(gdb_sim_sh_h) +sh3-rom.o: sh3-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(srec_h) $(arch_utils_h) $(regcache_h) $(sh_tdep_h) +shnbsd-nat.o: shnbsd-nat.c $(defs_h) $(inferior_h) $(shnbsd_tdep_h) +shnbsd-tdep.o: shnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) $(value_h) \ + $(solib_svr4_h) $(nbsd_tdep_h) $(sh_tdep_h) $(shnbsd_tdep_h) +sol-thread.o: sol-thread.c $(defs_h) $(gdbthread_h) $(target_h) \ + $(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(regcache_h) $(symfile_h) \ + $(gregset_h) +solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \ + $(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(gdbcore_h) \ + $(command_h) $(target_h) $(frame_h) $(gdb_regex_h) $(inferior_h) \ + $(environ_h) $(language_h) $(gdbcmd_h) $(solist_h) +solib-irix.o: solib-irix.c $(defs_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h) +solib-legacy.o: solib-legacy.c $(defs_h) $(gdbcore_h) $(solib_svr4_h) +solib-osf.o: solib-osf.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ + $(symfile_h) $(objfiles_h) $(target_h) $(inferior_h) $(solist_h) +solib-sunos.o: solib-sunos.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(gdbcore_h) $(inferior_h) $(solist_h) +solib-svr4.o: solib-svr4.c $(defs_h) $(elf_external_h) $(elf_common_h) \ + $(elf_mips_h) $(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ + $(gdbcore_h) $(target_h) $(inferior_h) $(solist_h) $(solib_svr4_h) +solib.o: solib.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(gdbcore_h) $(command_h) $(target_h) $(frame_h) \ + $(gdb_regex_h) $(inferior_h) $(environ_h) $(language_h) $(gdbcmd_h) \ + $(completer_h) $(filenames_h) $(solist_h) +somread.o: somread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ + $(objfiles_h) $(buildsym_h) $(stabsread_h) $(gdb_stabs_h) \ + $(complaints_h) $(gdb_string_h) $(demangle_h) $(som_h) $(libhppa_h) +somsolib.o: somsolib.c $(defs_h) $(frame_h) $(bfd_h) $(som_h) $(libhppa_h) \ + $(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \ + $(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \ + $(regcache_h) +source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \ + $(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \ + $(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \ + $(symfile_h) $(objfiles_h) $(annotate_h) $(gdbtypes_h) $(linespec_h) \ + $(filenames_h) $(completer_h) $(ui_out_h) +sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(gregset_h) +sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(regcache_h) +sparc-stub.o: sparc-stub.c +sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ + $(inferior_h) $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) \ + $(regcache_h) $(osabi_h) $(gregset_h) $(gdbcore_h) $(symfile_h) +sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(sparcnbsd_tdep_h) +sparcl-stub.o: sparcl-stub.c +sparcl-tdep.o: sparcl-tdep.c $(defs_h) $(gdbcore_h) $(breakpoint_h) \ + $(target_h) $(serial_h) $(regcache_h) +sparclet-rom.o: sparclet-rom.c $(defs_h) $(gdbcore_h) $(target_h) \ + $(monitor_h) $(serial_h) $(srec_h) $(symtab_h) $(symfile_h) \ + $(regcache_h) +sparclet-stub.o: sparclet-stub.c +sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(sparcnbsd_tdep_h) +sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(value_h) $(osabi_h) $(sparcnbsd_tdep_h) $(nbsd_tdep_h) \ + $(solib_svr4_h) +stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \ + $(symtab_h) $(gdbtypes_h) $(expression_h) $(symfile_h) $(objfiles_h) \ + $(aout_stab_gnu_h) $(libaout_h) $(aout_aout64_h) $(gdb_stabs_h) \ + $(buildsym_h) $(complaints_h) $(demangle_h) $(language_h) \ + $(doublest_h) $(stabsread_h) $(cp_abi_h) $(cp_support_h) +stack.o: stack.c $(defs_h) $(gdb_string_h) $(value_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(language_h) $(frame_h) $(gdbcmd_h) \ + $(gdbcore_h) $(target_h) $(breakpoint_h) $(demangle_h) $(inferior_h) \ + $(annotate_h) $(ui_out_h) $(source_h) +standalone.o: standalone.c $(gdb_stat_h) $(defs_h) $(symtab_h) $(frame_h) \ + $(inferior_h) $(gdb_wait_h) +std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) $(gdbtypes_h) \ + $(value_h) $(gdb_string_h) +stop-gdb.o: stop-gdb.c $(defs_h) +sun3-nat.o: sun3-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) +symfile.o: symfile.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ + $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ + $(gdbcmd_h) $(breakpoint_h) $(language_h) $(complaints_h) \ + $(demangle_h) $(inferior_h) $(gdb_stabs_h) $(gdb_obstack_h) \ + $(completer_h) $(bcache_h) $(gdb_string_h) $(gdb_stat_h) $(source_h) +symm-nat.o: symm-nat.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(target_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) $(gdbcore_h) +symm-tdep.o: symm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ + $(gdb_stat_h) $(gdbcore_h) +symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ + $(gdb_obstack_h) $(language_h) $(bcache_h) $(gdb_string_h) +symtab.o: symtab.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ + $(frame_h) $(target_h) $(value_h) $(symfile_h) $(objfiles_h) \ + $(gdbcmd_h) $(call_cmds_h) $(gdb_regex_h) $(expression_h) \ + $(language_h) $(demangle_h) $(inferior_h) $(linespec_h) \ + $(filenames_h) $(gdb_obstack_h) $(gdb_string_h) $(gdb_stat_h) \ + $(cp_abi_h) $(source_h) +target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \ + $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ + $(gdb_wait_h) $(dcache_h) $(regcache_h) +thread-db.o: thread-db.c $(defs_h) $(gdb_assert_h) $(gdb_proc_service_h) \ + $(gdb_thread_db_h) $(bfd_h) $(gdbthread_h) $(inferior_h) \ + $(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) +thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \ + $(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(command_h) \ + $(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) $(ui_out_h) +top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \ + $(cli_script_h) $(cli_setshow_h) $(cli_decode_h) $(symtab_h) \ + $(inferior_h) $(target_h) $(breakpoint_h) $(gdbtypes_h) \ + $(expression_h) $(value_h) $(language_h) $(terminal_h) $(annotate_h) \ + $(completer_h) $(top_h) $(version_h) $(serial_h) $(doublest_h) \ + $(gdb_assert_h) $(event_top_h) $(gdb_string_h) $(gdb_stat_h) \ + $(ui_out_h) $(cli_out_h) +tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ + $(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \ + $(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \ + $(linespec_h) $(regcache_h) $(completer_h) $(gdb_events_h) $(ax_h) \ + $(ax_gdb_h) +typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ + $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(gdb_string_h) +ui-file.o: ui-file.c $(defs_h) $(ui_file_h) $(gdb_string_h) +ui-out.o: ui-out.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ + $(ui_out_h) $(gdb_assert_h) +utils.o: utils.c $(config_h) $(defs_h) $(gdb_assert_h) $(gdb_string_h) \ + $(event_top_h) $(gdbcmd_h) $(serial_h) $(bfd_h) $(target_h) \ + $(demangle_h) $(expression_h) $(language_h) $(annotate_h) \ + $(filenames_h) $(inferior_h) $(mmalloc_h) +uw-thread.o: uw-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \ + $(regcache_h) $(gregset_h) +v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \ + $(arch_utils_h) $(regcache_h) $(symtab_h) +v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ + $(inferior_h) $(breakpoint_h) $(symfile_h) $(target_h) $(objfiles_h) \ + $(gdbcore_h) $(value_h) $(command_h) $(regcache_h) +valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \ + $(expression_h) $(target_h) $(language_h) $(gdb_string_h) \ + $(doublest_h) +valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \ + $(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \ + $(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(gdb_string_h) \ + $(gdb_assert_h) +valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(language_h) \ + $(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h) +values.o: values.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ + $(value_h) $(gdbcore_h) $(command_h) $(gdbcmd_h) $(target_h) \ + $(language_h) $(scm_lang_h) $(demangle_h) $(doublest_h) \ + $(gdb_assert_h) $(regcache_h) +varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \ + $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h) +vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \ + $(inferior_h) $(regcache_h) $(frame_h) $(value_h) $(arch_utils_h) \ + $(vax_tdep_h) +w89k-rom.o: w89k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ + $(serial_h) $(xmodem_h) $(regcache_h) +win32-nat.o: win32-nat.c $(defs_h) $(tm_h) $(frame_h) $(inferior_h) \ + $(target_h) $(gdbcore_h) $(command_h) $(completer_h) $(regcache_h) \ + $(top_h) $(i386_tdep_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \ + $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) +wince-stub.o: wince-stub.c $(wince_stub_h) +wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \ + $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \ + $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \ + $(regcache_h) +wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h) +x86-64-linux-nat.o: x86-64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(regcache_h) $(gdb_assert_h) $(x86_64_tdep_h) +x86-64-linux-tdep.o: x86-64-linux-tdep.c $(defs_h) $(inferior_h) \ + $(gdbcore_h) $(regcache_h) $(x86_64_tdep_h) $(dwarf2cfi_h) +x86-64-tdep.o: x86-64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(gdbcmd_h) $(arch_utils_h) $(regcache_h) $(symfile_h) $(objfiles_h) \ + $(x86_64_tdep_h) $(dwarf2cfi_h) $(gdb_assert_h) +xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_h) \ + $(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) $(libxcoff_h) \ + $(coff_rs6000_h) $(symtab_h) $(gdbtypes_h) $(symfile_h) \ + $(objfiles_h) $(buildsym_h) $(stabsread_h) $(expression_h) \ + $(complaints_h) $(gdb_stabs_h) $(aout_stab_gnu_h) +xcoffsolib.o: xcoffsolib.c $(defs_h) $(bfd_h) $(xcoffsolib_h) $(inferior_h) \ + $(gdbcmd_h) $(symfile_h) $(frame_h) $(gdb_regex_h) +xmodem.o: xmodem.c $(defs_h) $(serial_h) $(target_h) $(xmodem_h) +xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \ + $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdbcore_h) \ + $(objfiles_h) +z8k-tdep.o: z8k-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcmd_h) \ + $(gdbtypes_h) $(dis_asm_h) $(gdbcore_h) $(regcache_h) $(value_h) + +# +# gdb/cli/ dependencies +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(defs_h) $(completer_h) $(target_h) \ + $(gdb_wait_h) $(gdb_regex_h) $(gdb_string_h) $(filenames_h) \ + $(ui_out_h) $(top_h) $(cli_decode_h) $(cli_script_h) \ + $(cli_setshow_h) $(cli_cmds_h) $(source_h) $(linespec_h) \ + $(expression_h) $(language_h) $(objfiles_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c +cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ + $(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \ + $(cli_decode_h) $(gdb_assert_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c +cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) \ + $(cli_decode_h) $(cli_cmds_h) $(value_h) $(completer_h) \ + $(cli_dump_h) $(gdb_assert_h) $(target_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c +cli-script.o: $(srcdir)/cli/cli-script.c $(defs_h) $(value_h) $(language_h) \ + $(ui_out_h) $(gdb_string_h) $(top_h) $(cli_cmds_h) $(cli_decode_h) \ + $(cli_script_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-script.c +cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(defs_h) $(value_h) \ + $(gdb_string_h) $(ui_out_h) $(cli_decode_h) $(cli_cmds_h) \ + $(cli_setshow_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-setshow.c +cli-utils.o: $(srcdir)/cli/cli-utils.c $(defs_h) $(cli_utils_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-utils.c + +# +# GDBTK sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico + $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o + +gdbtk.o: $(srcdir)/gdbtk/generic/gdbtk.c \ + $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \ + $(symtab_h) $(inferior_h) $(command_h) \ + $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \ + $(tracepoint_h) $(top_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(ITK_CFLAGS) $(TIX_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ + $(srcdir)/gdbtk/generic/gdbtk.c \ + -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" -DSRC_DIR=\"$(GDBTK_SRC_DIR)\" + +gdbtk-bp.o: $(srcdir)/gdbtk/generic/gdbtk-bp.c \ + $(srcdir)/gdbtk/generic/gdbtk.h \ + $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ + $(defs_h) $(breakpoint_h) $(tracepoint_h) \ + $(symfile_h) $(symtab_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-bp.c \ + -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" + +gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ + $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ + $(defs_h) $(symtab_h) $(inferior_h) \ + $(command_h) $(bfd_h) $(top_h) $(symfile_h) $(objfiles_h) $(target_h) \ + $(gdb_string_h) $(tracepoint_h) $(source_h) $(regcache_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \ + -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" + +gdbtk-hooks.o: $(srcdir)/gdbtk/generic/gdbtk-hooks.c \ + $(srcdir)/gdbtk/generic/gdbtk.h $(defs_h) \ + $(symtab_h) $(inferior_h) $(command_h) \ + $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) $(gdb_string_h) \ + $(tracepoint_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ + $(srcdir)/gdbtk/generic/gdbtk-hooks.c -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" + +gdbtk-register.o: $(srcdir)/gdbtk/generic/gdbtk-register.c \ + $(srcdir)/gdbtk/generic/gdbtk.h \ + $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ + $(defs_h) $(frame_h) $(value_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-register.c \ + -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" + +gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \ + $(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \ + $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \ + $(defs_h) $(frame_h) $(value_h) $(target_h) $(breakpoint_h) \ + $(linespec_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \ + $(TIX_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \ + $(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-stack.c \ + -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" + +gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \ + $(srcdir)/gdbtk/generic/gdbtk.h \ + $(defs_h) $(value_h) $(varobj_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) $(TIX_CFLAGS) \ + $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\ + $(srcdir)/gdbtk/generic/gdbtk-varobj.c + +gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \ + $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \ + $(defs_h) $(frame_h) $(value_h) + $(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\ + $(srcdir)/gdbtk/generic/gdbtk-wrapper.c + +# +# gdb/mi/ dependencies +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \ + $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \ + $(mi_getopt_h) $(gdb_events_h) $(gdb_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c +mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \ + $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c +mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \ + $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c +mi-cmd-var.o: $(srcdir)/mi/mi-cmd-var.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \ + $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-var.c +mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmds.c +mi-console.o: $(srcdir)/mi/mi-console.c $(defs_h) $(mi_console_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c +mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(defs_h) $(mi_getopt_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c +mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(target_h) $(inferior_h) \ + $(gdb_string_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) $(mi_parse_h) \ + $(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) \ + $(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) $(regcache_h) \ + $(gdb_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c +mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c +mi-parse.o: $(srcdir)/mi/mi-parse.c $(defs_h) $(mi_cmds_h) $(mi_parse_h) \ + $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-parse.c + +# +# nindy-share sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +Onindy.o: nindy-share/Onindy.c $(gdb_wait_h) nindy-share/block_io.h \ + nindy-share/env.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/Onindy.c + +nindy.o: nindy-share/nindy.c $(gdb_wait_h) nindy-share/block_io.h \ + nindy-share/env.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/nindy.c + +ttyflush.o: nindy-share/ttyflush.c $(srcdir)/nindy-share/ttyflush.c + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/nindy-share/ttyflush.c + +# +# rdi-share sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +rdi-share/libangsd.a: force + @dir=rdi-share; \ + if [ -f ./$${dir}/Makefile ] ; then \ + r=`pwd`; export r; \ + srcroot=`cd $(srcdir); pwd`; export srcroot; \ + (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ + else \ + true; \ + fi + +# +# Signals sub-directory +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +signals.o: $(srcdir)/signals/signals.c $(defs_h) $(target_h) $(gdb_string_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/signals/signals.c + +# +# TUI dependencies +# +# Need to explicitly specify the compile rule as make will do nothing +# or try to compile the object file into the mi directory. + +tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(ui_file_h) $(tui_file_h) \ + $(tui_tuiIO_h) $(tui_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-file.c +tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(config_h) $(defs_h) $(symtab_h) \ + $(inferior_h) $(command_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ + $(target_h) $(gdbcore_h) $(event_loop_h) $(frame_h) $(breakpoint_h) \ + $(gdb_events_h) $(tui_h) $(tuiData_h) $(tuiLayout_h) $(tuiIO_h) \ + $(tuiRegs_h) $(tuiWin_h) $(tuiStack_h) $(tuiDataWin_h) \ + $(tuiSourceWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c +tui-out.o: $(srcdir)/tui/tui-out.c $(defs_h) $(ui_out_h) $(tui_h) \ + $(gdb_string_h) $(gdb_assert_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-out.c +tui.o: $(srcdir)/tui/tui.c $(config_h) $(defs_h) $(gdbcmd_h) $(tui_h) \ + $(tuiData_h) $(tuiLayout_h) $(tuiIO_h) $(tuiRegs_h) $(tuiStack_h) \ + $(tuiWin_h) $(tuiSourceWin_h) $(readline_h) $(target_h) $(frame_h) \ + $(breakpoint_h) $(inferior_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui.c +tuiCommand.o: $(srcdir)/tui/tuiCommand.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(tuiWin_h) $(tuiIO_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiCommand.c +tuiData.o: $(srcdir)/tui/tuiData.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(tuiGeneralWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiData.c +tuiDataWin.o: $(srcdir)/tui/tuiDataWin.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(tuiGeneralWin_h) $(tuiRegs_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDataWin.c +tuiDisassem.o: $(srcdir)/tui/tuiDisassem.c $(config_h) $(defs_h) $(symtab_h) \ + $(breakpoint_h) $(frame_h) $(value_h) $(tui_h) $(tuiData_h) \ + $(tuiWin_h) $(tuiLayout_h) $(tuiSourceWin_h) $(tuiStack_h) \ + $(tui_file_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiDisassem.c +tuiGeneralWin.o: $(srcdir)/tui/tuiGeneralWin.c $(config_h) $(defs_h) \ + $(tui_h) $(tuiData_h) $(tuiGeneralWin_h) $(tuiWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiGeneralWin.c +tuiIO.o: $(srcdir)/tui/tuiIO.c $(config_h) $(defs_h) $(terminal_h) \ + $(target_h) $(event_loop_h) $(command_h) $(top_h) $(readline_h) \ + $(tui_h) $(tuiData_h) $(tuiIO_h) $(tuiCommand_h) $(tuiWin_h) \ + $(tuiGeneralWin_h) $(tui_file_h) $(ui_out_h) $(cli_out_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiIO.c +tuiLayout.o: $(srcdir)/tui/tuiLayout.c $(config_h) $(defs_h) $(command_h) \ + $(symtab_h) $(frame_h) $(tui_h) $(tuiData_h) $(tuiDataWin_h) \ + $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) $(tuiWin_h) \ + $(tuiSourceWin_h) $(tuiDisassem_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiLayout.c +tuiRegs.o: $(srcdir)/tui/tuiRegs.c $(config_h) $(defs_h) $(tui_h) \ + $(tuiData_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(frame_h) \ + $(inferior_h) $(target_h) $(tuiLayout_h) $(tuiWin_h) $(tuiDataWin_h) \ + $(tuiGeneralWin_h) $(tui_file_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiRegs.c +tuiSource.o: $(srcdir)/tui/tuiSource.c $(config_h) $(defs_h) $(symtab_h) \ + $(frame_h) $(breakpoint_h) $(source_h) $(symtab_h) $(tui_h) \ + $(tuiData_h) $(tuiStack_h) $(tuiSourceWin_h) $(tuiSource_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSource.c +tuiSourceWin.o: $(srcdir)/tui/tuiSourceWin.c $(config_h) $(defs_h) \ + $(symtab_h) $(frame_h) $(breakpoint_h) $(value_h) $(tui_h) \ + $(tuiData_h) $(tuiStack_h) $(tuiWin_h) $(tuiGeneralWin_h) \ + $(tuiSourceWin_h) $(tuiSource_h) $(tuiDisassem_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiSourceWin.c +tuiStack.o: $(srcdir)/tui/tuiStack.c $(config_h) $(defs_h) $(symtab_h) \ + $(breakpoint_h) $(frame_h) $(command_h) $(tui_h) $(tuiData_h) \ + $(tuiStack_h) $(tuiGeneralWin_h) $(tuiSource_h) $(tuiSourceWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiStack.c +tuiWin.o: $(srcdir)/tui/tuiWin.c $(config_h) $(defs_h) $(command_h) \ + $(symtab_h) $(breakpoint_h) $(frame_h) $(cli_cmds_h) $(tui_h) \ + $(tuiData_h) $(tuiGeneralWin_h) $(tuiStack_h) $(tuiRegs_h) \ + $(tuiDisassem_h) $(tuiSource_h) $(tuiSourceWin_h) $(tuiDataWin_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tuiWin.c + +# +# vx-share sub-directory +# + +xdr_ld.o: vx-share/xdr_ld.c $(defs_h) vx-share/vxTypes.h \ + vx-share/vxWorks.h vx-share/xdr_ld.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ld.c + +xdr_ptrace.o: vx-share/xdr_ptrace.c $(defs_h) vx-share/vxTypes.h \ + vx-share/vxWorks.h vx-share/xdr_ptrace.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_ptrace.c + +xdr_rdb.o: vx-share/xdr_rdb.c $(defs_h) vx-share/vxTypes.h \ + vx-share/vxWorks.h vx-share/xdr_rdb.h + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/vx-share/xdr_rdb.c + +charset.o: charset.c $(defs_h) $(charset_h) $(gdbcmd_h) gdb_assert.h + +c-lang.o: $(charset_h) +utils.o: $(charset_h) +### end of the gdb Makefile.in. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c new file mode 100644 index 0000000..2838df7 --- /dev/null +++ b/gdb/ada-lang.c @@ -0,0 +1,8311 @@ +/* Ada language support routines for GDB, the GNU debugger. Copyright + 1992, 1993, 1994, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + +This file is part of GDB. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include "gdb_string.h" +#include +#include +#include "demangle.h" +#include "defs.h" +#include "symtab.h" +#include "gdbtypes.h" +#include "gdbcmd.h" +#include "expression.h" +#include "parser-defs.h" +#include "language.h" +#include "c-lang.h" +#include "inferior.h" +#include "symfile.h" +#include "objfiles.h" +#include "breakpoint.h" +#include "gdbcore.h" +#include "ada-lang.h" +#ifdef UI_OUT +#include "ui-out.h" +#endif + +struct cleanup *unresolved_names; + +void extract_string (CORE_ADDR addr, char *buf); + +static struct type *ada_create_fundamental_type (struct objfile *, int); + +static void modify_general_field (char *, LONGEST, int, int); + +static struct type *desc_base_type (struct type *); + +static struct type *desc_bounds_type (struct type *); + +static struct value *desc_bounds (struct value *); + +static int fat_pntr_bounds_bitpos (struct type *); + +static int fat_pntr_bounds_bitsize (struct type *); + +static struct type *desc_data_type (struct type *); + +static struct value *desc_data (struct value *); + +static int fat_pntr_data_bitpos (struct type *); + +static int fat_pntr_data_bitsize (struct type *); + +static struct value *desc_one_bound (struct value *, int, int); + +static int desc_bound_bitpos (struct type *, int, int); + +static int desc_bound_bitsize (struct type *, int, int); + +static struct type *desc_index_type (struct type *, int); + +static int desc_arity (struct type *); + +static int ada_type_match (struct type *, struct type *, int); + +static int ada_args_match (struct symbol *, struct value **, int); + +static struct value *place_on_stack (struct value *, CORE_ADDR *); + +static struct value *convert_actual (struct value *, struct type *, + CORE_ADDR *); + +static struct value *make_array_descriptor (struct type *, struct value *, + CORE_ADDR *); + +static void ada_add_block_symbols (struct block *, const char *, + namespace_enum, struct objfile *, int); + +static void fill_in_ada_prototype (struct symbol *); + +static int is_nonfunction (struct symbol **, int); + +static void add_defn_to_vec (struct symbol *, struct block *); + +static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab + *, const char *, int, + namespace_enum, int); + +static struct symtab *symtab_for_sym (struct symbol *); + +static struct value *ada_resolve_subexp (struct expression **, int *, int, + struct type *); + +static void replace_operator_with_call (struct expression **, int, int, int, + struct symbol *, struct block *); + +static int possible_user_operator_p (enum exp_opcode, struct value **); + +static const char *ada_op_name (enum exp_opcode); + +static int numeric_type_p (struct type *); + +static int integer_type_p (struct type *); + +static int scalar_type_p (struct type *); + +static int discrete_type_p (struct type *); + +static char *extended_canonical_line_spec (struct symtab_and_line, + const char *); + +static struct value *evaluate_subexp (struct type *, struct expression *, + int *, enum noside); + +static struct value *evaluate_subexp_type (struct expression *, int *); + +static struct type *ada_create_fundamental_type (struct objfile *, int); + +static int is_dynamic_field (struct type *, int); + +static struct type *to_fixed_variant_branch_type (struct type *, char *, + CORE_ADDR, struct value *); + +static struct type *to_fixed_range_type (char *, struct value *, + struct objfile *); + +static struct type *to_static_fixed_type (struct type *); + +static struct value *unwrap_value (struct value *); + +static struct type *packed_array_type (struct type *, long *); + +static struct type *decode_packed_array_type (struct type *); + +static struct value *decode_packed_array (struct value *); + +static struct value *value_subscript_packed (struct value *, int, + struct value **); + +static struct value *coerce_unspec_val_to_type (struct value *, long, + struct type *); + +static struct value *get_var_value (char *, char *); + +static int lesseq_defined_than (struct symbol *, struct symbol *); + +static int equiv_types (struct type *, struct type *); + +static int is_name_suffix (const char *); + +static int wild_match (const char *, int, const char *); + +static struct symtabs_and_lines find_sal_from_funcs_and_line (const char *, + int, + struct symbol + **, int); + +static int find_line_in_linetable (struct linetable *, int, struct symbol **, + int, int *); + +static int find_next_line_in_linetable (struct linetable *, int, int, int); + +static struct symtabs_and_lines all_sals_for_line (const char *, int, + char ***); + +static void read_all_symtabs (const char *); + +static int is_plausible_func_for_line (struct symbol *, int); + +static struct value *ada_coerce_ref (struct value *); + +static struct value *value_pos_atr (struct value *); + +static struct value *value_val_atr (struct type *, struct value *); + +static struct symbol *standard_lookup (const char *, namespace_enum); + +extern void markTimeStart (int index); +extern void markTimeStop (int index); + + + +/* Maximum-sized dynamic type. */ +static unsigned int varsize_limit; + +static const char *ada_completer_word_break_characters = + " \t\n!@#$%^&*()+=|~`}{[]\";:?/,-"; + +/* The name of the symbol to use to get the name of the main subprogram */ +#define ADA_MAIN_PROGRAM_SYMBOL_NAME "__gnat_ada_main_program_name" + + /* Utilities */ + +/* extract_string + * + * read the string located at ADDR from the inferior and store the + * result into BUF + */ +void +extract_string (CORE_ADDR addr, char *buf) +{ + int char_index = 0; + + /* Loop, reading one byte at a time, until we reach the '\000' + end-of-string marker */ + do + { + target_read_memory (addr + char_index * sizeof (char), + buf + char_index * sizeof (char), sizeof (char)); + char_index++; + } + while (buf[char_index - 1] != '\000'); +} + +/* Assuming *OLD_VECT points to an array of *SIZE objects of size + ELEMENT_SIZE, grow it to contain at least MIN_SIZE objects, + updating *OLD_VECT and *SIZE as necessary. */ + +void +grow_vect (void **old_vect, size_t * size, size_t min_size, int element_size) +{ + if (*size < min_size) + { + *size *= 2; + if (*size < min_size) + *size = min_size; + *old_vect = xrealloc (*old_vect, *size * element_size); + } +} + +/* True (non-zero) iff TARGET matches FIELD_NAME up to any trailing + suffix of FIELD_NAME beginning "___" */ + +static int +field_name_match (const char *field_name, const char *target) +{ + int len = strlen (target); + return + STREQN (field_name, target, len) + && (field_name[len] == '\0' + || (STREQN (field_name + len, "___", 3) + && !STREQ (field_name + strlen (field_name) - 6, "___XVN"))); +} + + +/* The length of the prefix of NAME prior to any "___" suffix. */ + +int +ada_name_prefix_len (const char *name) +{ + if (name == NULL) + return 0; + else + { + const char *p = strstr (name, "___"); + if (p == NULL) + return strlen (name); + else + return p - name; + } +} + +/* SUFFIX is a suffix of STR. False if STR is null. */ +static int +is_suffix (const char *str, const char *suffix) +{ + int len1, len2; + if (str == NULL) + return 0; + len1 = strlen (str); + len2 = strlen (suffix); + return (len1 >= len2 && STREQ (str + len1 - len2, suffix)); +} + +/* Create a value of type TYPE whose contents come from VALADDR, if it + * is non-null, and whose memory address (in the inferior) is + * ADDRESS. */ +struct value * +value_from_contents_and_address (struct type *type, char *valaddr, + CORE_ADDR address) +{ + struct value *v = allocate_value (type); + if (valaddr == NULL) + VALUE_LAZY (v) = 1; + else + memcpy (VALUE_CONTENTS_RAW (v), valaddr, TYPE_LENGTH (type)); + VALUE_ADDRESS (v) = address; + if (address != 0) + VALUE_LVAL (v) = lval_memory; + return v; +} + +/* The contents of value VAL, beginning at offset OFFSET, treated as a + value of type TYPE. The result is an lval in memory if VAL is. */ + +static struct value * +coerce_unspec_val_to_type (struct value *val, long offset, struct type *type) +{ + CHECK_TYPEDEF (type); + if (VALUE_LVAL (val) == lval_memory) + return value_at_lazy (type, + VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset, + NULL); + else + { + struct value *result = allocate_value (type); + VALUE_LVAL (result) = not_lval; + if (VALUE_ADDRESS (val) == 0) + memcpy (VALUE_CONTENTS_RAW (result), VALUE_CONTENTS (val) + offset, + TYPE_LENGTH (type) > TYPE_LENGTH (VALUE_TYPE (val)) + ? TYPE_LENGTH (VALUE_TYPE (val)) : TYPE_LENGTH (type)); + else + { + VALUE_ADDRESS (result) = + VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset; + VALUE_LAZY (result) = 1; + } + return result; + } +} + +static char * +cond_offset_host (char *valaddr, long offset) +{ + if (valaddr == NULL) + return NULL; + else + return valaddr + offset; +} + +static CORE_ADDR +cond_offset_target (CORE_ADDR address, long offset) +{ + if (address == 0) + return 0; + else + return address + offset; +} + +/* Perform execute_command on the result of concatenating all + arguments up to NULL. */ +static void +do_command (const char *arg, ...) +{ + int len; + char *cmd; + const char *s; + va_list ap; + + va_start (ap, arg); + len = 0; + s = arg; + cmd = ""; + for (; s != NULL; s = va_arg (ap, const char *)) + { + char *cmd1; + len += strlen (s); + cmd1 = alloca (len + 1); + strcpy (cmd1, cmd); + strcat (cmd1, s); + cmd = cmd1; + } + va_end (ap); + execute_command (cmd, 0); +} + + + /* Language Selection */ + +/* If the main program is in Ada, return language_ada, otherwise return LANG + (the main program is in Ada iif the adainit symbol is found). + + MAIN_PST is not used. */ + +enum language +ada_update_initial_language (enum language lang, + struct partial_symtab *main_pst) +{ + if (lookup_minimal_symbol ("adainit", (const char *) NULL, + (struct objfile *) NULL) != NULL) + /* return language_ada; */ + /* FIXME: language_ada should be defined in defs.h */ + return language_unknown; + + return lang; +} + + + /* Symbols */ + +/* Table of Ada operators and their GNAT-mangled names. Last entry is pair + of NULLs. */ + +const struct ada_opname_map ada_opname_table[] = { + {"Oadd", "\"+\"", BINOP_ADD}, + {"Osubtract", "\"-\"", BINOP_SUB}, + {"Omultiply", "\"*\"", BINOP_MUL}, + {"Odivide", "\"/\"", BINOP_DIV}, + {"Omod", "\"mod\"", BINOP_MOD}, + {"Orem", "\"rem\"", BINOP_REM}, + {"Oexpon", "\"**\"", BINOP_EXP}, + {"Olt", "\"<\"", BINOP_LESS}, + {"Ole", "\"<=\"", BINOP_LEQ}, + {"Ogt", "\">\"", BINOP_GTR}, + {"Oge", "\">=\"", BINOP_GEQ}, + {"Oeq", "\"=\"", BINOP_EQUAL}, + {"One", "\"/=\"", BINOP_NOTEQUAL}, + {"Oand", "\"and\"", BINOP_BITWISE_AND}, + {"Oor", "\"or\"", BINOP_BITWISE_IOR}, + {"Oxor", "\"xor\"", BINOP_BITWISE_XOR}, + {"Oconcat", "\"&\"", BINOP_CONCAT}, + {"Oabs", "\"abs\"", UNOP_ABS}, + {"Onot", "\"not\"", UNOP_LOGICAL_NOT}, + {"Oadd", "\"+\"", UNOP_PLUS}, + {"Osubtract", "\"-\"", UNOP_NEG}, + {NULL, NULL} +}; + +/* True if STR should be suppressed in info listings. */ +static int +is_suppressed_name (const char *str) +{ + if (STREQN (str, "_ada_", 5)) + str += 5; + if (str[0] == '_' || str[0] == '\000') + return 1; + else + { + const char *p; + const char *suffix = strstr (str, "___"); + if (suffix != NULL && suffix[3] != 'X') + return 1; + if (suffix == NULL) + suffix = str + strlen (str); + for (p = suffix - 1; p != str; p -= 1) + if (isupper (*p)) + { + int i; + if (p[0] == 'X' && p[-1] != '_') + goto OK; + if (*p != 'O') + return 1; + for (i = 0; ada_opname_table[i].mangled != NULL; i += 1) + if (STREQN (ada_opname_table[i].mangled, p, + strlen (ada_opname_table[i].mangled))) + goto OK; + return 1; + OK:; + } + return 0; + } +} + +/* The "mangled" form of DEMANGLED, according to GNAT conventions. + * The result is valid until the next call to ada_mangle. */ +char * +ada_mangle (const char *demangled) +{ + static char *mangling_buffer = NULL; + static size_t mangling_buffer_size = 0; + const char *p; + int k; + + if (demangled == NULL) + return NULL; + + GROW_VECT (mangling_buffer, mangling_buffer_size, + 2 * strlen (demangled) + 10); + + k = 0; + for (p = demangled; *p != '\0'; p += 1) + { + if (*p == '.') + { + mangling_buffer[k] = mangling_buffer[k + 1] = '_'; + k += 2; + } + else if (*p == '"') + { + const struct ada_opname_map *mapping; + + for (mapping = ada_opname_table; + mapping->mangled != NULL && + !STREQN (mapping->demangled, p, strlen (mapping->demangled)); + p += 1) + ; + if (mapping->mangled == NULL) + error ("invalid Ada operator name: %s", p); + strcpy (mangling_buffer + k, mapping->mangled); + k += strlen (mapping->mangled); + break; + } + else + { + mangling_buffer[k] = *p; + k += 1; + } + } + + mangling_buffer[k] = '\0'; + return mangling_buffer; +} + +/* Return NAME folded to lower case, or, if surrounded by single + * quotes, unfolded, but with the quotes stripped away. Result good + * to next call. */ +char * +ada_fold_name (const char *name) +{ + static char *fold_buffer = NULL; + static size_t fold_buffer_size = 0; + + int len = strlen (name); + GROW_VECT (fold_buffer, fold_buffer_size, len + 1); + + if (name[0] == '\'') + { + strncpy (fold_buffer, name + 1, len - 2); + fold_buffer[len - 2] = '\000'; + } + else + { + int i; + for (i = 0; i <= len; i += 1) + fold_buffer[i] = tolower (name[i]); + } + + return fold_buffer; +} + +/* Demangle: + 1. Discard final __{DIGIT}+ or ${DIGIT}+ + 2. Convert other instances of embedded "__" to `.'. + 3. Discard leading _ada_. + 4. Convert operator names to the appropriate quoted symbols. + 5. Remove everything after first ___ if it is followed by + 'X'. + 6. Replace TK__ with __, and a trailing B or TKB with nothing. + 7. Put symbols that should be suppressed in <...> brackets. + 8. Remove trailing X[bn]* suffix (indicating names in package bodies). + The resulting string is valid until the next call of ada_demangle. + */ + +char * +ada_demangle (const char *mangled) +{ + int i, j; + int len0; + const char *p; + char *demangled; + int at_start_name; + static char *demangling_buffer = NULL; + static size_t demangling_buffer_size = 0; + + if (STREQN (mangled, "_ada_", 5)) + mangled += 5; + + if (mangled[0] == '_' || mangled[0] == '<') + goto Suppress; + + p = strstr (mangled, "___"); + if (p == NULL) + len0 = strlen (mangled); + else + { + if (p[3] == 'X') + len0 = p - mangled; + else + goto Suppress; + } + if (len0 > 3 && STREQ (mangled + len0 - 3, "TKB")) + len0 -= 3; + if (len0 > 1 && STREQ (mangled + len0 - 1, "B")) + len0 -= 1; + + /* Make demangled big enough for possible expansion by operator name. */ + GROW_VECT (demangling_buffer, demangling_buffer_size, 2 * len0 + 1); + demangled = demangling_buffer; + + if (isdigit (mangled[len0 - 1])) + { + for (i = len0 - 2; i >= 0 && isdigit (mangled[i]); i -= 1) + ; + if (i > 1 && mangled[i] == '_' && mangled[i - 1] == '_') + len0 = i - 1; + else if (mangled[i] == '$') + len0 = i; + } + + for (i = 0, j = 0; i < len0 && !isalpha (mangled[i]); i += 1, j += 1) + demangled[j] = mangled[i]; + + at_start_name = 1; + while (i < len0) + { + if (at_start_name && mangled[i] == 'O') + { + int k; + for (k = 0; ada_opname_table[k].mangled != NULL; k += 1) + { + int op_len = strlen (ada_opname_table[k].mangled); + if (STREQN + (ada_opname_table[k].mangled + 1, mangled + i + 1, + op_len - 1) && !isalnum (mangled[i + op_len])) + { + strcpy (demangled + j, ada_opname_table[k].demangled); + at_start_name = 0; + i += op_len; + j += strlen (ada_opname_table[k].demangled); + break; + } + } + if (ada_opname_table[k].mangled != NULL) + continue; + } + at_start_name = 0; + + if (i < len0 - 4 && STREQN (mangled + i, "TK__", 4)) + i += 2; + if (mangled[i] == 'X' && i != 0 && isalnum (mangled[i - 1])) + { + do + i += 1; + while (i < len0 && (mangled[i] == 'b' || mangled[i] == 'n')); + if (i < len0) + goto Suppress; + } + else if (i < len0 - 2 && mangled[i] == '_' && mangled[i + 1] == '_') + { + demangled[j] = '.'; + at_start_name = 1; + i += 2; + j += 1; + } + else + { + demangled[j] = mangled[i]; + i += 1; + j += 1; + } + } + demangled[j] = '\000'; + + for (i = 0; demangled[i] != '\0'; i += 1) + if (isupper (demangled[i]) || demangled[i] == ' ') + goto Suppress; + + return demangled; + +Suppress: + GROW_VECT (demangling_buffer, demangling_buffer_size, strlen (mangled) + 3); + demangled = demangling_buffer; + if (mangled[0] == '<') + strcpy (demangled, mangled); + else + sprintf (demangled, "<%s>", mangled); + return demangled; + +} + +/* Returns non-zero iff SYM_NAME matches NAME, ignoring any trailing + * suffixes that encode debugging information or leading _ada_ on + * SYM_NAME (see is_name_suffix commentary for the debugging + * information that is ignored). If WILD, then NAME need only match a + * suffix of SYM_NAME minus the same suffixes. Also returns 0 if + * either argument is NULL. */ + +int +ada_match_name (const char *sym_name, const char *name, int wild) +{ + if (sym_name == NULL || name == NULL) + return 0; + else if (wild) + return wild_match (name, strlen (name), sym_name); + else + { + int len_name = strlen (name); + return (STREQN (sym_name, name, len_name) + && is_name_suffix (sym_name + len_name)) + || (STREQN (sym_name, "_ada_", 5) + && STREQN (sym_name + 5, name, len_name) + && is_name_suffix (sym_name + len_name + 5)); + } +} + +/* True (non-zero) iff in Ada mode, the symbol SYM should be + suppressed in info listings. */ + +int +ada_suppress_symbol_printing (struct symbol *sym) +{ + if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE) + return 1; + else + return is_suppressed_name (SYMBOL_NAME (sym)); +} + + + /* Arrays */ + +/* Names of MAX_ADA_DIMENS bounds in P_BOUNDS fields of + array descriptors. */ + +static char *bound_name[] = { + "LB0", "UB0", "LB1", "UB1", "LB2", "UB2", "LB3", "UB3", + "LB4", "UB4", "LB5", "UB5", "LB6", "UB6", "LB7", "UB7" +}; + +/* Maximum number of array dimensions we are prepared to handle. */ + +#define MAX_ADA_DIMENS (sizeof(bound_name) / (2*sizeof(char*))) + +/* Like modify_field, but allows bitpos > wordlength. */ + +static void +modify_general_field (char *addr, LONGEST fieldval, int bitpos, int bitsize) +{ + modify_field (addr + sizeof (LONGEST) * bitpos / (8 * sizeof (LONGEST)), + fieldval, bitpos % (8 * sizeof (LONGEST)), bitsize); +} + + +/* The desc_* routines return primitive portions of array descriptors + (fat pointers). */ + +/* The descriptor or array type, if any, indicated by TYPE; removes + level of indirection, if needed. */ +static struct type * +desc_base_type (struct type *type) +{ + if (type == NULL) + return NULL; + CHECK_TYPEDEF (type); + if (type != NULL && TYPE_CODE (type) == TYPE_CODE_PTR) + return check_typedef (TYPE_TARGET_TYPE (type)); + else + return type; +} + +/* True iff TYPE indicates a "thin" array pointer type. */ +static int +is_thin_pntr (struct type *type) +{ + return + is_suffix (ada_type_name (desc_base_type (type)), "___XUT") + || is_suffix (ada_type_name (desc_base_type (type)), "___XUT___XVE"); +} + +/* The descriptor type for thin pointer type TYPE. */ +static struct type * +thin_descriptor_type (struct type *type) +{ + struct type *base_type = desc_base_type (type); + if (base_type == NULL) + return NULL; + if (is_suffix (ada_type_name (base_type), "___XVE")) + return base_type; + else + { + struct type *alt_type = ada_find_parallel_type (base_type, "___XVE"); + if (alt_type == NULL) + return base_type; + else + return alt_type; + } +} + +/* A pointer to the array data for thin-pointer value VAL. */ +static struct value * +thin_data_pntr (struct value *val) +{ + struct type *type = VALUE_TYPE (val); + if (TYPE_CODE (type) == TYPE_CODE_PTR) + return value_cast (desc_data_type (thin_descriptor_type (type)), + value_copy (val)); + else + return value_from_longest (desc_data_type (thin_descriptor_type (type)), + VALUE_ADDRESS (val) + VALUE_OFFSET (val)); +} + +/* True iff TYPE indicates a "thick" array pointer type. */ +static int +is_thick_pntr (struct type *type) +{ + type = desc_base_type (type); + return (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT + && lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL); +} + +/* If TYPE is the type of an array descriptor (fat or thin pointer) or a + pointer to one, the type of its bounds data; otherwise, NULL. */ +static struct type * +desc_bounds_type (struct type *type) +{ + struct type *r; + + type = desc_base_type (type); + + if (type == NULL) + return NULL; + else if (is_thin_pntr (type)) + { + type = thin_descriptor_type (type); + if (type == NULL) + return NULL; + r = lookup_struct_elt_type (type, "BOUNDS", 1); + if (r != NULL) + return check_typedef (r); + } + else if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + { + r = lookup_struct_elt_type (type, "P_BOUNDS", 1); + if (r != NULL) + return check_typedef (TYPE_TARGET_TYPE (check_typedef (r))); + } + return NULL; +} + +/* If ARR is an array descriptor (fat or thin pointer), or pointer to + one, a pointer to its bounds data. Otherwise NULL. */ +static struct value * +desc_bounds (struct value *arr) +{ + struct type *type = check_typedef (VALUE_TYPE (arr)); + if (is_thin_pntr (type)) + { + struct type *bounds_type = + desc_bounds_type (thin_descriptor_type (type)); + LONGEST addr; + + if (desc_bounds_type == NULL) + error ("Bad GNAT array descriptor"); + + /* NOTE: The following calculation is not really kosher, but + since desc_type is an XVE-encoded type (and shouldn't be), + the correct calculation is a real pain. FIXME (and fix GCC). */ + if (TYPE_CODE (type) == TYPE_CODE_PTR) + addr = value_as_long (arr); + else + addr = VALUE_ADDRESS (arr) + VALUE_OFFSET (arr); + + return + value_from_longest (lookup_pointer_type (bounds_type), + addr - TYPE_LENGTH (bounds_type)); + } + + else if (is_thick_pntr (type)) + return value_struct_elt (&arr, NULL, "P_BOUNDS", NULL, + "Bad GNAT array descriptor"); + else + return NULL; +} + +/* If TYPE is the type of an array-descriptor (fat pointer), the bit + position of the field containing the address of the bounds data. */ +static int +fat_pntr_bounds_bitpos (struct type *type) +{ + return TYPE_FIELD_BITPOS (desc_base_type (type), 1); +} + +/* If TYPE is the type of an array-descriptor (fat pointer), the bit + size of the field containing the address of the bounds data. */ +static int +fat_pntr_bounds_bitsize (struct type *type) +{ + type = desc_base_type (type); + + if (TYPE_FIELD_BITSIZE (type, 1) > 0) + return TYPE_FIELD_BITSIZE (type, 1); + else + return 8 * TYPE_LENGTH (check_typedef (TYPE_FIELD_TYPE (type, 1))); +} + +/* If TYPE is the type of an array descriptor (fat or thin pointer) or a + pointer to one, the type of its array data (a + pointer-to-array-with-no-bounds type); otherwise, NULL. Use + ada_type_of_array to get an array type with bounds data. */ +static struct type * +desc_data_type (struct type *type) +{ + type = desc_base_type (type); + + /* NOTE: The following is bogus; see comment in desc_bounds. */ + if (is_thin_pntr (type)) + return lookup_pointer_type + (desc_base_type (TYPE_FIELD_TYPE (thin_descriptor_type (type), 1))); + else if (is_thick_pntr (type)) + return lookup_struct_elt_type (type, "P_ARRAY", 1); + else + return NULL; +} + +/* If ARR is an array descriptor (fat or thin pointer), a pointer to + its array data. */ +static struct value * +desc_data (struct value *arr) +{ + struct type *type = VALUE_TYPE (arr); + if (is_thin_pntr (type)) + return thin_data_pntr (arr); + else if (is_thick_pntr (type)) + return value_struct_elt (&arr, NULL, "P_ARRAY", NULL, + "Bad GNAT array descriptor"); + else + return NULL; +} + + +/* If TYPE is the type of an array-descriptor (fat pointer), the bit + position of the field containing the address of the data. */ +static int +fat_pntr_data_bitpos (struct type *type) +{ + return TYPE_FIELD_BITPOS (desc_base_type (type), 0); +} + +/* If TYPE is the type of an array-descriptor (fat pointer), the bit + size of the field containing the address of the data. */ +static int +fat_pntr_data_bitsize (struct type *type) +{ + type = desc_base_type (type); + + if (TYPE_FIELD_BITSIZE (type, 0) > 0) + return TYPE_FIELD_BITSIZE (type, 0); + else + return TARGET_CHAR_BIT * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)); +} + +/* If BOUNDS is an array-bounds structure (or pointer to one), return + the Ith lower bound stored in it, if WHICH is 0, and the Ith upper + bound, if WHICH is 1. The first bound is I=1. */ +static struct value * +desc_one_bound (struct value *bounds, int i, int which) +{ + return value_struct_elt (&bounds, NULL, bound_name[2 * i + which - 2], NULL, + "Bad GNAT array descriptor bounds"); +} + +/* If BOUNDS is an array-bounds structure type, return the bit position + of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper + bound, if WHICH is 1. The first bound is I=1. */ +static int +desc_bound_bitpos (struct type *type, int i, int which) +{ + return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); +} + +/* If BOUNDS is an array-bounds structure type, return the bit field size + of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper + bound, if WHICH is 1. The first bound is I=1. */ +static int +desc_bound_bitsize (struct type *type, int i, int which) +{ + type = desc_base_type (type); + + if (TYPE_FIELD_BITSIZE (type, 2 * i + which - 2) > 0) + return TYPE_FIELD_BITSIZE (type, 2 * i + which - 2); + else + return 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 2 * i + which - 2)); +} + +/* If TYPE is the type of an array-bounds structure, the type of its + Ith bound (numbering from 1). Otherwise, NULL. */ +static struct type * +desc_index_type (struct type *type, int i) +{ + type = desc_base_type (type); + + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + return lookup_struct_elt_type (type, bound_name[2 * i - 2], 1); + else + return NULL; +} + +/* The number of index positions in the array-bounds type TYPE. 0 + if TYPE is NULL. */ +static int +desc_arity (struct type *type) +{ + type = desc_base_type (type); + + if (type != NULL) + return TYPE_NFIELDS (type) / 2; + return 0; +} + + +/* Non-zero iff type is a simple array type (or pointer to one). */ +int +ada_is_simple_array (struct type *type) +{ + if (type == NULL) + return 0; + CHECK_TYPEDEF (type); + return (TYPE_CODE (type) == TYPE_CODE_ARRAY + || (TYPE_CODE (type) == TYPE_CODE_PTR + && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)); +} + +/* Non-zero iff type belongs to a GNAT array descriptor. */ +int +ada_is_array_descriptor (struct type *type) +{ + struct type *data_type = desc_data_type (type); + + if (type == NULL) + return 0; + CHECK_TYPEDEF (type); + return + data_type != NULL + && ((TYPE_CODE (data_type) == TYPE_CODE_PTR + && TYPE_TARGET_TYPE (data_type) != NULL + && TYPE_CODE (TYPE_TARGET_TYPE (data_type)) == TYPE_CODE_ARRAY) + || + TYPE_CODE (data_type) == TYPE_CODE_ARRAY) + && desc_arity (desc_bounds_type (type)) > 0; +} + +/* Non-zero iff type is a partially mal-formed GNAT array + descriptor. (FIXME: This is to compensate for some problems with + debugging output from GNAT. Re-examine periodically to see if it + is still needed. */ +int +ada_is_bogus_array_descriptor (struct type *type) +{ + return + type != NULL + && TYPE_CODE (type) == TYPE_CODE_STRUCT + && (lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL + || lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL) + && !ada_is_array_descriptor (type); +} + + +/* If ARR has a record type in the form of a standard GNAT array descriptor, + (fat pointer) returns the type of the array data described---specifically, + a pointer-to-array type. If BOUNDS is non-zero, the bounds data are filled + in from the descriptor; otherwise, they are left unspecified. If + the ARR denotes a null array descriptor and BOUNDS is non-zero, + returns NULL. The result is simply the type of ARR if ARR is not + a descriptor. */ +struct type * +ada_type_of_array (struct value *arr, int bounds) +{ + if (ada_is_packed_array_type (VALUE_TYPE (arr))) + return decode_packed_array_type (VALUE_TYPE (arr)); + + if (!ada_is_array_descriptor (VALUE_TYPE (arr))) + return VALUE_TYPE (arr); + + if (!bounds) + return + check_typedef (TYPE_TARGET_TYPE (desc_data_type (VALUE_TYPE (arr)))); + else + { + struct type *elt_type; + int arity; + struct value *descriptor; + struct objfile *objf = TYPE_OBJFILE (VALUE_TYPE (arr)); + + elt_type = ada_array_element_type (VALUE_TYPE (arr), -1); + arity = ada_array_arity (VALUE_TYPE (arr)); + + if (elt_type == NULL || arity == 0) + return check_typedef (VALUE_TYPE (arr)); + + descriptor = desc_bounds (arr); + if (value_as_long (descriptor) == 0) + return NULL; + while (arity > 0) + { + struct type *range_type = alloc_type (objf); + struct type *array_type = alloc_type (objf); + struct value *low = desc_one_bound (descriptor, arity, 0); + struct value *high = desc_one_bound (descriptor, arity, 1); + arity -= 1; + + create_range_type (range_type, VALUE_TYPE (low), + (int) value_as_long (low), + (int) value_as_long (high)); + elt_type = create_array_type (array_type, elt_type, range_type); + } + + return lookup_pointer_type (elt_type); + } +} + +/* If ARR does not represent an array, returns ARR unchanged. + Otherwise, returns either a standard GDB array with bounds set + appropriately or, if ARR is a non-null fat pointer, a pointer to a standard + GDB array. Returns NULL if ARR is a null fat pointer. */ +struct value * +ada_coerce_to_simple_array_ptr (struct value *arr) +{ + if (ada_is_array_descriptor (VALUE_TYPE (arr))) + { + struct type *arrType = ada_type_of_array (arr, 1); + if (arrType == NULL) + return NULL; + return value_cast (arrType, value_copy (desc_data (arr))); + } + else if (ada_is_packed_array_type (VALUE_TYPE (arr))) + return decode_packed_array (arr); + else + return arr; +} + +/* If ARR does not represent an array, returns ARR unchanged. + Otherwise, returns a standard GDB array describing ARR (which may + be ARR itself if it already is in the proper form). */ +struct value * +ada_coerce_to_simple_array (struct value *arr) +{ + if (ada_is_array_descriptor (VALUE_TYPE (arr))) + { + struct value *arrVal = ada_coerce_to_simple_array_ptr (arr); + if (arrVal == NULL) + error ("Bounds unavailable for null array pointer."); + return value_ind (arrVal); + } + else if (ada_is_packed_array_type (VALUE_TYPE (arr))) + return decode_packed_array (arr); + else + return arr; +} + +/* If TYPE represents a GNAT array type, return it translated to an + ordinary GDB array type (possibly with BITSIZE fields indicating + packing). For other types, is the identity. */ +struct type * +ada_coerce_to_simple_array_type (struct type *type) +{ + struct value *mark = value_mark (); + struct value *dummy = value_from_longest (builtin_type_long, 0); + struct type *result; + VALUE_TYPE (dummy) = type; + result = ada_type_of_array (dummy, 0); + value_free_to_mark (dummy); + return result; +} + +/* Non-zero iff TYPE represents a standard GNAT packed-array type. */ +int +ada_is_packed_array_type (struct type *type) +{ + if (type == NULL) + return 0; + CHECK_TYPEDEF (type); + return + ada_type_name (type) != NULL + && strstr (ada_type_name (type), "___XP") != NULL; +} + +/* Given that TYPE is a standard GDB array type with all bounds filled + in, and that the element size of its ultimate scalar constituents + (that is, either its elements, or, if it is an array of arrays, its + elements' elements, etc.) is *ELT_BITS, return an identical type, + but with the bit sizes of its elements (and those of any + constituent arrays) recorded in the BITSIZE components of its + TYPE_FIELD_BITSIZE values, and with *ELT_BITS set to its total size + in bits. */ +static struct type * +packed_array_type (struct type *type, long *elt_bits) +{ + struct type *new_elt_type; + struct type *new_type; + LONGEST low_bound, high_bound; + + CHECK_TYPEDEF (type); + if (TYPE_CODE (type) != TYPE_CODE_ARRAY) + return type; + + new_type = alloc_type (TYPE_OBJFILE (type)); + new_elt_type = packed_array_type (check_typedef (TYPE_TARGET_TYPE (type)), + elt_bits); + create_array_type (new_type, new_elt_type, TYPE_FIELD_TYPE (type, 0)); + TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits; + TYPE_NAME (new_type) = ada_type_name (type); + + if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0), + &low_bound, &high_bound) < 0) + low_bound = high_bound = 0; + if (high_bound < low_bound) + *elt_bits = TYPE_LENGTH (new_type) = 0; + else + { + *elt_bits *= (high_bound - low_bound + 1); + TYPE_LENGTH (new_type) = + (*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; + } + + /* TYPE_FLAGS (new_type) |= TYPE_FLAG_FIXED_INSTANCE; */ + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + return new_type; +} + +/* The array type encoded by TYPE, where ada_is_packed_array_type (TYPE). + */ +static struct type * +decode_packed_array_type (struct type *type) +{ + struct symbol **syms; + struct block **blocks; + const char *raw_name = ada_type_name (check_typedef (type)); + char *name = (char *) alloca (strlen (raw_name) + 1); + char *tail = strstr (raw_name, "___XP"); + struct type *shadow_type; + long bits; + int i, n; + + memcpy (name, raw_name, tail - raw_name); + name[tail - raw_name] = '\000'; + + /* NOTE: Use ada_lookup_symbol_list because of bug in some versions + * of gcc (Solaris, e.g.). FIXME when compiler is fixed. */ + n = ada_lookup_symbol_list (name, get_selected_block (NULL), + VAR_NAMESPACE, &syms, &blocks); + for (i = 0; i < n; i += 1) + if (syms[i] != NULL && SYMBOL_CLASS (syms[i]) == LOC_TYPEDEF + && STREQ (name, ada_type_name (SYMBOL_TYPE (syms[i])))) + break; + if (i >= n) + { + warning ("could not find bounds information on packed array"); + return NULL; + } + shadow_type = SYMBOL_TYPE (syms[i]); + + if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY) + { + warning ("could not understand bounds information on packed array"); + return NULL; + } + + if (sscanf (tail + sizeof ("___XP") - 1, "%ld", &bits) != 1) + { + warning ("could not understand bit size information on packed array"); + return NULL; + } + + return packed_array_type (shadow_type, &bits); +} + +/* Given that ARR is a struct value* indicating a GNAT packed array, + returns a simple array that denotes that array. Its type is a + standard GDB array type except that the BITSIZEs of the array + target types are set to the number of bits in each element, and the + type length is set appropriately. */ + +static struct value * +decode_packed_array (struct value *arr) +{ + struct type *type = decode_packed_array_type (VALUE_TYPE (arr)); + + if (type == NULL) + { + error ("can't unpack array"); + return NULL; + } + else + return coerce_unspec_val_to_type (arr, 0, type); +} + + +/* The value of the element of packed array ARR at the ARITY indices + given in IND. ARR must be a simple array. */ + +static struct value * +value_subscript_packed (struct value *arr, int arity, struct value **ind) +{ + int i; + int bits, elt_off, bit_off; + long elt_total_bit_offset; + struct type *elt_type; + struct value *v; + + bits = 0; + elt_total_bit_offset = 0; + elt_type = check_typedef (VALUE_TYPE (arr)); + for (i = 0; i < arity; i += 1) + { + if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY + || TYPE_FIELD_BITSIZE (elt_type, 0) == 0) + error + ("attempt to do packed indexing of something other than a packed array"); + else + { + struct type *range_type = TYPE_INDEX_TYPE (elt_type); + LONGEST lowerbound, upperbound; + LONGEST idx; + + if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0) + { + warning ("don't know bounds of array"); + lowerbound = upperbound = 0; + } + + idx = value_as_long (value_pos_atr (ind[i])); + if (idx < lowerbound || idx > upperbound) + warning ("packed array index %ld out of bounds", (long) idx); + bits = TYPE_FIELD_BITSIZE (elt_type, 0); + elt_total_bit_offset += (idx - lowerbound) * bits; + elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type)); + } + } + elt_off = elt_total_bit_offset / HOST_CHAR_BIT; + bit_off = elt_total_bit_offset % HOST_CHAR_BIT; + + v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off, + bits, elt_type); + if (VALUE_LVAL (arr) == lval_internalvar) + VALUE_LVAL (v) = lval_internalvar_component; + else + VALUE_LVAL (v) = VALUE_LVAL (arr); + return v; +} + +/* Non-zero iff TYPE includes negative integer values. */ + +static int +has_negatives (struct type *type) +{ + switch (TYPE_CODE (type)) + { + default: + return 0; + case TYPE_CODE_INT: + return !TYPE_UNSIGNED (type); + case TYPE_CODE_RANGE: + return TYPE_LOW_BOUND (type) < 0; + } +} + + +/* Create a new value of type TYPE from the contents of OBJ starting + at byte OFFSET, and bit offset BIT_OFFSET within that byte, + proceeding for BIT_SIZE bits. If OBJ is an lval in memory, then + assigning through the result will set the field fetched from. OBJ + may also be NULL, in which case, VALADDR+OFFSET must address the + start of storage containing the packed value. The value returned + in this case is never an lval. + Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT. */ + +struct value * +ada_value_primitive_packed_val (struct value *obj, char *valaddr, long offset, + int bit_offset, int bit_size, + struct type *type) +{ + struct value *v; + int src, /* Index into the source area. */ + targ, /* Index into the target area. */ + i, srcBitsLeft, /* Number of source bits left to move. */ + nsrc, ntarg, /* Number of source and target bytes. */ + unusedLS, /* Number of bits in next significant + * byte of source that are unused. */ + accumSize; /* Number of meaningful bits in accum */ + unsigned char *bytes; /* First byte containing data to unpack. */ + unsigned char *unpacked; + unsigned long accum; /* Staging area for bits being transferred */ + unsigned char sign; + int len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8; + /* Transmit bytes from least to most significant; delta is the + * direction the indices move. */ + int delta = BITS_BIG_ENDIAN ? -1 : 1; + + CHECK_TYPEDEF (type); + + if (obj == NULL) + { + v = allocate_value (type); + bytes = (unsigned char *) (valaddr + offset); + } + else if (VALUE_LAZY (obj)) + { + v = value_at (type, + VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset, NULL); + bytes = (unsigned char *) alloca (len); + read_memory (VALUE_ADDRESS (v), bytes, len); + } + else + { + v = allocate_value (type); + bytes = (unsigned char *) VALUE_CONTENTS (obj) + offset; + } + + if (obj != NULL) + { + VALUE_LVAL (v) = VALUE_LVAL (obj); + if (VALUE_LVAL (obj) == lval_internalvar) + VALUE_LVAL (v) = lval_internalvar_component; + VALUE_ADDRESS (v) = VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset; + VALUE_BITPOS (v) = bit_offset + VALUE_BITPOS (obj); + VALUE_BITSIZE (v) = bit_size; + if (VALUE_BITPOS (v) >= HOST_CHAR_BIT) + { + VALUE_ADDRESS (v) += 1; + VALUE_BITPOS (v) -= HOST_CHAR_BIT; + } + } + else + VALUE_BITSIZE (v) = bit_size; + unpacked = (unsigned char *) VALUE_CONTENTS (v); + + srcBitsLeft = bit_size; + nsrc = len; + ntarg = TYPE_LENGTH (type); + sign = 0; + if (bit_size == 0) + { + memset (unpacked, 0, TYPE_LENGTH (type)); + return v; + } + else if (BITS_BIG_ENDIAN) + { + src = len - 1; + if (has_negatives (type) && + ((bytes[0] << bit_offset) & (1 << (HOST_CHAR_BIT - 1)))) + sign = ~0; + + unusedLS = + (HOST_CHAR_BIT - (bit_size + bit_offset) % HOST_CHAR_BIT) + % HOST_CHAR_BIT; + + switch (TYPE_CODE (type)) + { + case TYPE_CODE_ARRAY: + case TYPE_CODE_UNION: + case TYPE_CODE_STRUCT: + /* Non-scalar values must be aligned at a byte boundary. */ + accumSize = + (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT; + /* And are placed at the beginning (most-significant) bytes + * of the target. */ + targ = src; + break; + default: + accumSize = 0; + targ = TYPE_LENGTH (type) - 1; + break; + } + } + else + { + int sign_bit_offset = (bit_size + bit_offset - 1) % 8; + + src = targ = 0; + unusedLS = bit_offset; + accumSize = 0; + + if (has_negatives (type) && (bytes[len - 1] & (1 << sign_bit_offset))) + sign = ~0; + } + + accum = 0; + while (nsrc > 0) + { + /* Mask for removing bits of the next source byte that are not + * part of the value. */ + unsigned int unusedMSMask = + (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) - + 1; + /* Sign-extend bits for this byte. */ + unsigned int signMask = sign & ~unusedMSMask; + accum |= + (((bytes[src] >> unusedLS) & unusedMSMask) | signMask) << accumSize; + accumSize += HOST_CHAR_BIT - unusedLS; + if (accumSize >= HOST_CHAR_BIT) + { + unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT); + accumSize -= HOST_CHAR_BIT; + accum >>= HOST_CHAR_BIT; + ntarg -= 1; + targ += delta; + } + srcBitsLeft -= HOST_CHAR_BIT - unusedLS; + unusedLS = 0; + nsrc -= 1; + src += delta; + } + while (ntarg > 0) + { + accum |= sign << accumSize; + unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT); + accumSize -= HOST_CHAR_BIT; + accum >>= HOST_CHAR_BIT; + ntarg -= 1; + targ += delta; + } + + return v; +} + +/* Move N bits from SOURCE, starting at bit offset SRC_OFFSET to + TARGET, starting at bit offset TARG_OFFSET. SOURCE and TARGET must + not overlap. */ +static void +move_bits (char *target, int targ_offset, char *source, int src_offset, int n) +{ + unsigned int accum, mask; + int accum_bits, chunk_size; + + target += targ_offset / HOST_CHAR_BIT; + targ_offset %= HOST_CHAR_BIT; + source += src_offset / HOST_CHAR_BIT; + src_offset %= HOST_CHAR_BIT; + if (BITS_BIG_ENDIAN) + { + accum = (unsigned char) *source; + source += 1; + accum_bits = HOST_CHAR_BIT - src_offset; + + while (n > 0) + { + int unused_right; + accum = (accum << HOST_CHAR_BIT) + (unsigned char) *source; + accum_bits += HOST_CHAR_BIT; + source += 1; + chunk_size = HOST_CHAR_BIT - targ_offset; + if (chunk_size > n) + chunk_size = n; + unused_right = HOST_CHAR_BIT - (chunk_size + targ_offset); + mask = ((1 << chunk_size) - 1) << unused_right; + *target = + (*target & ~mask) + | ((accum >> (accum_bits - chunk_size - unused_right)) & mask); + n -= chunk_size; + accum_bits -= chunk_size; + target += 1; + targ_offset = 0; + } + } + else + { + accum = (unsigned char) *source >> src_offset; + source += 1; + accum_bits = HOST_CHAR_BIT - src_offset; + + while (n > 0) + { + accum = accum + ((unsigned char) *source << accum_bits); + accum_bits += HOST_CHAR_BIT; + source += 1; + chunk_size = HOST_CHAR_BIT - targ_offset; + if (chunk_size > n) + chunk_size = n; + mask = ((1 << chunk_size) - 1) << targ_offset; + *target = (*target & ~mask) | ((accum << targ_offset) & mask); + n -= chunk_size; + accum_bits -= chunk_size; + accum >>= chunk_size; + target += 1; + targ_offset = 0; + } + } +} + + +/* Store the contents of FROMVAL into the location of TOVAL. + Return a new value with the location of TOVAL and contents of + FROMVAL. Handles assignment into packed fields that have + floating-point or non-scalar types. */ + +static struct value * +ada_value_assign (struct value *toval, struct value *fromval) +{ + struct type *type = VALUE_TYPE (toval); + int bits = VALUE_BITSIZE (toval); + + if (!toval->modifiable) + error ("Left operand of assignment is not a modifiable lvalue."); + + COERCE_REF (toval); + + if (VALUE_LVAL (toval) == lval_memory + && bits > 0 + && (TYPE_CODE (type) == TYPE_CODE_FLT + || TYPE_CODE (type) == TYPE_CODE_STRUCT)) + { + int len = + (VALUE_BITPOS (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; + char *buffer = (char *) alloca (len); + struct value *val; + + if (TYPE_CODE (type) == TYPE_CODE_FLT) + fromval = value_cast (type, fromval); + + read_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, len); + if (BITS_BIG_ENDIAN) + move_bits (buffer, VALUE_BITPOS (toval), + VALUE_CONTENTS (fromval), + TYPE_LENGTH (VALUE_TYPE (fromval)) * TARGET_CHAR_BIT - + bits, bits); + else + move_bits (buffer, VALUE_BITPOS (toval), VALUE_CONTENTS (fromval), + 0, bits); + write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, + len); + + val = value_copy (toval); + memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS (fromval), + TYPE_LENGTH (type)); + VALUE_TYPE (val) = type; + + return val; + } + + return value_assign (toval, fromval); +} + + +/* The value of the element of array ARR at the ARITY indices given in IND. + ARR may be either a simple array, GNAT array descriptor, or pointer + thereto. */ + +struct value * +ada_value_subscript (struct value *arr, int arity, struct value **ind) +{ + int k; + struct value *elt; + struct type *elt_type; + + elt = ada_coerce_to_simple_array (arr); + + elt_type = check_typedef (VALUE_TYPE (elt)); + if (TYPE_CODE (elt_type) == TYPE_CODE_ARRAY + && TYPE_FIELD_BITSIZE (elt_type, 0) > 0) + return value_subscript_packed (elt, arity, ind); + + for (k = 0; k < arity; k += 1) + { + if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY) + error ("too many subscripts (%d expected)", k); + elt = value_subscript (elt, value_pos_atr (ind[k])); + } + return elt; +} + +/* Assuming ARR is a pointer to a standard GDB array of type TYPE, the + value of the element of *ARR at the ARITY indices given in + IND. Does not read the entire array into memory. */ + +struct value * +ada_value_ptr_subscript (struct value *arr, struct type *type, int arity, + struct value **ind) +{ + int k; + + for (k = 0; k < arity; k += 1) + { + LONGEST lwb, upb; + struct value *idx; + + if (TYPE_CODE (type) != TYPE_CODE_ARRAY) + error ("too many subscripts (%d expected)", k); + arr = value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), + value_copy (arr)); + get_discrete_bounds (TYPE_INDEX_TYPE (type), &lwb, &upb); + if (lwb == 0) + idx = ind[k]; + else + idx = value_sub (ind[k], value_from_longest (builtin_type_int, lwb)); + arr = value_add (arr, idx); + type = TYPE_TARGET_TYPE (type); + } + + return value_ind (arr); +} + +/* If type is a record type in the form of a standard GNAT array + descriptor, returns the number of dimensions for type. If arr is a + simple array, returns the number of "array of"s that prefix its + type designation. Otherwise, returns 0. */ + +int +ada_array_arity (struct type *type) +{ + int arity; + + if (type == NULL) + return 0; + + type = desc_base_type (type); + + arity = 0; + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + return desc_arity (desc_bounds_type (type)); + else + while (TYPE_CODE (type) == TYPE_CODE_ARRAY) + { + arity += 1; + type = check_typedef (TYPE_TARGET_TYPE (type)); + } + + return arity; +} + +/* If TYPE is a record type in the form of a standard GNAT array + descriptor or a simple array type, returns the element type for + TYPE after indexing by NINDICES indices, or by all indices if + NINDICES is -1. Otherwise, returns NULL. */ + +struct type * +ada_array_element_type (struct type *type, int nindices) +{ + type = desc_base_type (type); + + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) + { + int k; + struct type *p_array_type; + + p_array_type = desc_data_type (type); + + k = ada_array_arity (type); + if (k == 0) + return NULL; + + /* Initially p_array_type = elt_type(*)[]...(k times)...[] */ + if (nindices >= 0 && k > nindices) + k = nindices; + p_array_type = TYPE_TARGET_TYPE (p_array_type); + while (k > 0 && p_array_type != NULL) + { + p_array_type = check_typedef (TYPE_TARGET_TYPE (p_array_type)); + k -= 1; + } + return p_array_type; + } + else if (TYPE_CODE (type) == TYPE_CODE_ARRAY) + { + while (nindices != 0 && TYPE_CODE (type) == TYPE_CODE_ARRAY) + { + type = TYPE_TARGET_TYPE (type); + nindices -= 1; + } + return type; + } + + return NULL; +} + +/* The type of nth index in arrays of given type (n numbering from 1). Does + not examine memory. */ + +struct type * +ada_index_type (struct type *type, int n) +{ + type = desc_base_type (type); + + if (n > ada_array_arity (type)) + return NULL; + + if (ada_is_simple_array (type)) + { + int i; + + for (i = 1; i < n; i += 1) + type = TYPE_TARGET_TYPE (type); + + return TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0)); + } + else + return desc_index_type (desc_bounds_type (type), n); +} + +/* Given that arr is an array type, returns the lower bound of the + Nth index (numbering from 1) if WHICH is 0, and the upper bound if + WHICH is 1. This returns bounds 0 .. -1 if ARR_TYPE is an + array-descriptor type. If TYPEP is non-null, *TYPEP is set to the + bounds type. It works for other arrays with bounds supplied by + run-time quantities other than discriminants. */ + +LONGEST +ada_array_bound_from_type (struct type * arr_type, int n, int which, + struct type ** typep) +{ + struct type *type; + struct type *index_type_desc; + + if (ada_is_packed_array_type (arr_type)) + arr_type = decode_packed_array_type (arr_type); + + if (arr_type == NULL || !ada_is_simple_array (arr_type)) + { + if (typep != NULL) + *typep = builtin_type_int; + return (LONGEST) - which; + } + + if (TYPE_CODE (arr_type) == TYPE_CODE_PTR) + type = TYPE_TARGET_TYPE (arr_type); + else + type = arr_type; + + index_type_desc = ada_find_parallel_type (type, "___XA"); + if (index_type_desc == NULL) + { + struct type *range_type; + struct type *index_type; + + while (n > 1) + { + type = TYPE_TARGET_TYPE (type); + n -= 1; + } + + range_type = TYPE_INDEX_TYPE (type); + index_type = TYPE_TARGET_TYPE (range_type); + if (TYPE_CODE (index_type) == TYPE_CODE_UNDEF) + index_type = builtin_type_long; + if (typep != NULL) + *typep = index_type; + return + (LONGEST) (which == 0 + ? TYPE_LOW_BOUND (range_type) + : TYPE_HIGH_BOUND (range_type)); + } + else + { + struct type *index_type = + to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, n - 1), + NULL, TYPE_OBJFILE (arr_type)); + if (typep != NULL) + *typep = TYPE_TARGET_TYPE (index_type); + return + (LONGEST) (which == 0 + ? TYPE_LOW_BOUND (index_type) + : TYPE_HIGH_BOUND (index_type)); + } +} + +/* Given that arr is an array value, returns the lower bound of the + nth index (numbering from 1) if which is 0, and the upper bound if + which is 1. This routine will also work for arrays with bounds + supplied by run-time quantities other than discriminants. */ + +struct value * +ada_array_bound (struct value *arr, int n, int which) +{ + struct type *arr_type = VALUE_TYPE (arr); + + if (ada_is_packed_array_type (arr_type)) + return ada_array_bound (decode_packed_array (arr), n, which); + else if (ada_is_simple_array (arr_type)) + { + struct type *type; + LONGEST v = ada_array_bound_from_type (arr_type, n, which, &type); + return value_from_longest (type, v); + } + else + return desc_one_bound (desc_bounds (arr), n, which); +} + +/* Given that arr is an array value, returns the length of the + nth index. This routine will also work for arrays with bounds + supplied by run-time quantities other than discriminants. Does not + work for arrays indexed by enumeration types with representation + clauses at the moment. */ + +struct value * +ada_array_length (struct value *arr, int n) +{ + struct type *arr_type = check_typedef (VALUE_TYPE (arr)); + struct type *index_type_desc; + + if (ada_is_packed_array_type (arr_type)) + return ada_array_length (decode_packed_array (arr), n); + + if (ada_is_simple_array (arr_type)) + { + struct type *type; + LONGEST v = + ada_array_bound_from_type (arr_type, n, 1, &type) - + ada_array_bound_from_type (arr_type, n, 0, NULL) + 1; + return value_from_longest (type, v); + } + else + return + value_from_longest (builtin_type_ada_int, + value_as_long (desc_one_bound (desc_bounds (arr), + n, 1)) + - value_as_long (desc_one_bound (desc_bounds (arr), + n, 0)) + 1); +} + + + /* Name resolution */ + +/* The "demangled" name for the user-definable Ada operator corresponding + to op. */ + +static const char * +ada_op_name (enum exp_opcode op) +{ + int i; + + for (i = 0; ada_opname_table[i].mangled != NULL; i += 1) + { + if (ada_opname_table[i].op == op) + return ada_opname_table[i].demangled; + } + error ("Could not find operator name for opcode"); +} + + +/* Same as evaluate_type (*EXP), but resolves ambiguous symbol + references (OP_UNRESOLVED_VALUES) and converts operators that are + user-defined into appropriate function calls. If CONTEXT_TYPE is + non-null, it provides a preferred result type [at the moment, only + type void has any effect---causing procedures to be preferred over + functions in calls]. A null CONTEXT_TYPE indicates that a non-void + return type is preferred. The variable unresolved_names contains a list + of character strings referenced by expout that should be freed. + May change (expand) *EXP. */ + +void +ada_resolve (struct expression **expp, struct type *context_type) +{ + int pc; + pc = 0; + ada_resolve_subexp (expp, &pc, 1, context_type); +} + +/* Resolve the operator of the subexpression beginning at + position *POS of *EXPP. "Resolving" consists of replacing + OP_UNRESOLVED_VALUE with an appropriate OP_VAR_VALUE, replacing + built-in operators with function calls to user-defined operators, + where appropriate, and (when DEPROCEDURE_P is non-zero), converting + function-valued variables into parameterless calls. May expand + EXP. The CONTEXT_TYPE functions as in ada_resolve, above. */ + +static struct value * +ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, + struct type *context_type) +{ + int pc = *pos; + int i; + struct expression *exp; /* Convenience: == *expp */ + enum exp_opcode op = (*expp)->elts[pc].opcode; + struct value **argvec; /* Vector of operand types (alloca'ed). */ + int nargs; /* Number of operands */ + + argvec = NULL; + nargs = 0; + exp = *expp; + + /* Pass one: resolve operands, saving their types and updating *pos. */ + switch (op) + { + case OP_VAR_VALUE: + /* case OP_UNRESOLVED_VALUE: */ + /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ + *pos += 4; + break; + + case OP_FUNCALL: + nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1; + /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ + /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE) + { + *pos += 7; + + argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1)); + for (i = 0; i < nargs-1; i += 1) + argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL); + argvec[i] = NULL; + } + else + { + *pos += 3; + ada_resolve_subexp (expp, pos, 0, NULL); + for (i = 1; i < nargs; i += 1) + ada_resolve_subexp (expp, pos, 1, NULL); + } + */ + exp = *expp; + break; + + /* FIXME: UNOP_QUAL should be defined in expression.h */ + /* case UNOP_QUAL: + nargs = 1; + *pos += 3; + ada_resolve_subexp (expp, pos, 1, exp->elts[pc + 1].type); + exp = *expp; + break; + */ + /* FIXME: OP_ATTRIBUTE should be defined in expression.h */ + /* case OP_ATTRIBUTE: + nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1; + *pos += 4; + for (i = 0; i < nargs; i += 1) + ada_resolve_subexp (expp, pos, 1, NULL); + exp = *expp; + break; + */ + case UNOP_ADDR: + nargs = 1; + *pos += 1; + ada_resolve_subexp (expp, pos, 0, NULL); + exp = *expp; + break; + + case BINOP_ASSIGN: + { + struct value *arg1; + nargs = 2; + *pos += 1; + arg1 = ada_resolve_subexp (expp, pos, 0, NULL); + if (arg1 == NULL) + ada_resolve_subexp (expp, pos, 1, NULL); + else + ada_resolve_subexp (expp, pos, 1, VALUE_TYPE (arg1)); + break; + } + + default: + switch (op) + { + default: + error ("Unexpected operator during name resolution"); + case UNOP_CAST: + /* case UNOP_MBR: + nargs = 1; + *pos += 3; + break; + */ + case BINOP_ADD: + case BINOP_SUB: + case BINOP_MUL: + case BINOP_DIV: + case BINOP_REM: + case BINOP_MOD: + case BINOP_EXP: + case BINOP_CONCAT: + case BINOP_LOGICAL_AND: + case BINOP_LOGICAL_OR: + case BINOP_BITWISE_AND: + case BINOP_BITWISE_IOR: + case BINOP_BITWISE_XOR: + + case BINOP_EQUAL: + case BINOP_NOTEQUAL: + case BINOP_LESS: + case BINOP_GTR: + case BINOP_LEQ: + case BINOP_GEQ: + + case BINOP_REPEAT: + case BINOP_SUBSCRIPT: + case BINOP_COMMA: + nargs = 2; + *pos += 1; + break; + + case UNOP_NEG: + case UNOP_PLUS: + case UNOP_LOGICAL_NOT: + case UNOP_ABS: + case UNOP_IND: + nargs = 1; + *pos += 1; + break; + + case OP_LONG: + case OP_DOUBLE: + case OP_VAR_VALUE: + *pos += 4; + break; + + case OP_TYPE: + case OP_BOOL: + case OP_LAST: + case OP_REGISTER: + case OP_INTERNALVAR: + *pos += 3; + break; + + case UNOP_MEMVAL: + *pos += 3; + nargs = 1; + break; + + case STRUCTOP_STRUCT: + case STRUCTOP_PTR: + nargs = 1; + *pos += 4 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1); + break; + + case OP_ARRAY: + *pos += 4; + nargs = longest_to_int (exp->elts[pc + 2].longconst) + 1; + nargs -= longest_to_int (exp->elts[pc + 1].longconst); + /* A null array contains one dummy element to give the type. */ + /* if (nargs == 0) + nargs = 1; + break; */ + + case TERNOP_SLICE: + /* FIXME: TERNOP_MBR should be defined in expression.h */ + /* case TERNOP_MBR: + *pos += 1; + nargs = 3; + break; + */ + /* FIXME: BINOP_MBR should be defined in expression.h */ + /* case BINOP_MBR: + *pos += 3; + nargs = 2; + break; */ + } + + argvec = + (struct value * *) alloca (sizeof (struct value *) * (nargs + 1)); + for (i = 0; i < nargs; i += 1) + argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL); + argvec[i] = NULL; + exp = *expp; + break; + } + + /* Pass two: perform any resolution on principal operator. */ + switch (op) + { + default: + break; + + /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ + /* case OP_UNRESOLVED_VALUE: + { + struct symbol** candidate_syms; + struct block** candidate_blocks; + int n_candidates; + + n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name, + exp->elts[pc + 1].block, + VAR_NAMESPACE, + &candidate_syms, + &candidate_blocks); + + if (n_candidates > 1) + { */ + /* Types tend to get re-introduced locally, so if there + are any local symbols that are not types, first filter + out all types. *//* + int j; + for (j = 0; j < n_candidates; j += 1) + switch (SYMBOL_CLASS (candidate_syms[j])) + { + case LOC_REGISTER: + case LOC_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_LOCAL: + case LOC_LOCAL_ARG: + case LOC_BASEREG: + case LOC_BASEREG_ARG: + goto FoundNonType; + default: + break; + } + FoundNonType: + if (j < n_candidates) + { + j = 0; + while (j < n_candidates) + { + if (SYMBOL_CLASS (candidate_syms[j]) == LOC_TYPEDEF) + { + candidate_syms[j] = candidate_syms[n_candidates-1]; + candidate_blocks[j] = candidate_blocks[n_candidates-1]; + n_candidates -= 1; + } + else + j += 1; + } + } + } + + if (n_candidates == 0) + error ("No definition found for %s", + ada_demangle (exp->elts[pc + 2].name)); + else if (n_candidates == 1) + i = 0; + else if (deprocedure_p + && ! is_nonfunction (candidate_syms, n_candidates)) + { + i = ada_resolve_function (candidate_syms, candidate_blocks, + n_candidates, NULL, 0, + exp->elts[pc + 2].name, context_type); + if (i < 0) + error ("Could not find a match for %s", + ada_demangle (exp->elts[pc + 2].name)); + } + else + { + printf_filtered ("Multiple matches for %s\n", + ada_demangle (exp->elts[pc+2].name)); + user_select_syms (candidate_syms, candidate_blocks, + n_candidates, 1); + i = 0; + } + + exp->elts[pc].opcode = exp->elts[pc + 3].opcode = OP_VAR_VALUE; + exp->elts[pc + 1].block = candidate_blocks[i]; + exp->elts[pc + 2].symbol = candidate_syms[i]; + if (innermost_block == NULL || + contained_in (candidate_blocks[i], innermost_block)) + innermost_block = candidate_blocks[i]; + } */ + /* FALL THROUGH */ + + case OP_VAR_VALUE: + if (deprocedure_p && + TYPE_CODE (SYMBOL_TYPE (exp->elts[pc + 2].symbol)) == + TYPE_CODE_FUNC) + { + replace_operator_with_call (expp, pc, 0, 0, + exp->elts[pc + 2].symbol, + exp->elts[pc + 1].block); + exp = *expp; + } + break; + + case OP_FUNCALL: + { + /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ + /* if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE) + { + struct symbol** candidate_syms; + struct block** candidate_blocks; + int n_candidates; + + n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name, + exp->elts[pc + 4].block, + VAR_NAMESPACE, + &candidate_syms, + &candidate_blocks); + if (n_candidates == 1) + i = 0; + else + { + i = ada_resolve_function (candidate_syms, candidate_blocks, + n_candidates, argvec, nargs-1, + exp->elts[pc + 5].name, context_type); + if (i < 0) + error ("Could not find a match for %s", + ada_demangle (exp->elts[pc + 5].name)); + } + + exp->elts[pc + 3].opcode = exp->elts[pc + 6].opcode = OP_VAR_VALUE; + exp->elts[pc + 4].block = candidate_blocks[i]; + exp->elts[pc + 5].symbol = candidate_syms[i]; + if (innermost_block == NULL || + contained_in (candidate_blocks[i], innermost_block)) + innermost_block = candidate_blocks[i]; + } */ + + } + break; + case BINOP_ADD: + case BINOP_SUB: + case BINOP_MUL: + case BINOP_DIV: + case BINOP_REM: + case BINOP_MOD: + case BINOP_CONCAT: + case BINOP_BITWISE_AND: + case BINOP_BITWISE_IOR: + case BINOP_BITWISE_XOR: + case BINOP_EQUAL: + case BINOP_NOTEQUAL: + case BINOP_LESS: + case BINOP_GTR: + case BINOP_LEQ: + case BINOP_GEQ: + case BINOP_EXP: + case UNOP_NEG: + case UNOP_PLUS: + case UNOP_LOGICAL_NOT: + case UNOP_ABS: + if (possible_user_operator_p (op, argvec)) + { + struct symbol **candidate_syms; + struct block **candidate_blocks; + int n_candidates; + + n_candidates = + ada_lookup_symbol_list (ada_mangle (ada_op_name (op)), + (struct block *) NULL, VAR_NAMESPACE, + &candidate_syms, &candidate_blocks); + i = + ada_resolve_function (candidate_syms, candidate_blocks, + n_candidates, argvec, nargs, + ada_op_name (op), NULL); + if (i < 0) + break; + + replace_operator_with_call (expp, pc, nargs, 1, + candidate_syms[i], candidate_blocks[i]); + exp = *expp; + } + break; + } + + *pos = pc; + return evaluate_subexp_type (exp, pos); +} + +/* Return non-zero if formal type FTYPE matches actual type ATYPE. If + MAY_DEREF is non-zero, the formal may be a pointer and the actual + a non-pointer. */ +/* The term "match" here is rather loose. The match is heuristic and + liberal. FIXME: TOO liberal, in fact. */ + +static int +ada_type_match (struct type *ftype, struct type *atype, int may_deref) +{ + CHECK_TYPEDEF (ftype); + CHECK_TYPEDEF (atype); + + if (TYPE_CODE (ftype) == TYPE_CODE_REF) + ftype = TYPE_TARGET_TYPE (ftype); + if (TYPE_CODE (atype) == TYPE_CODE_REF) + atype = TYPE_TARGET_TYPE (atype); + + if (TYPE_CODE (ftype) == TYPE_CODE_VOID + || TYPE_CODE (atype) == TYPE_CODE_VOID) + return 1; + + switch (TYPE_CODE (ftype)) + { + default: + return 1; + case TYPE_CODE_PTR: + if (TYPE_CODE (atype) == TYPE_CODE_PTR) + return ada_type_match (TYPE_TARGET_TYPE (ftype), + TYPE_TARGET_TYPE (atype), 0); + else + return (may_deref && + ada_type_match (TYPE_TARGET_TYPE (ftype), atype, 0)); + case TYPE_CODE_INT: + case TYPE_CODE_ENUM: + case TYPE_CODE_RANGE: + switch (TYPE_CODE (atype)) + { + case TYPE_CODE_INT: + case TYPE_CODE_ENUM: + case TYPE_CODE_RANGE: + return 1; + default: + return 0; + } + + case TYPE_CODE_ARRAY: + return (TYPE_CODE (atype) == TYPE_CODE_ARRAY + || ada_is_array_descriptor (atype)); + + case TYPE_CODE_STRUCT: + if (ada_is_array_descriptor (ftype)) + return (TYPE_CODE (atype) == TYPE_CODE_ARRAY + || ada_is_array_descriptor (atype)); + else + return (TYPE_CODE (atype) == TYPE_CODE_STRUCT + && !ada_is_array_descriptor (atype)); + + case TYPE_CODE_UNION: + case TYPE_CODE_FLT: + return (TYPE_CODE (atype) == TYPE_CODE (ftype)); + } +} + +/* Return non-zero if the formals of FUNC "sufficiently match" the + vector of actual argument types ACTUALS of size N_ACTUALS. FUNC + may also be an enumeral, in which case it is treated as a 0- + argument function. */ + +static int +ada_args_match (struct symbol *func, struct value **actuals, int n_actuals) +{ + int i; + struct type *func_type = SYMBOL_TYPE (func); + + if (SYMBOL_CLASS (func) == LOC_CONST && + TYPE_CODE (func_type) == TYPE_CODE_ENUM) + return (n_actuals == 0); + else if (func_type == NULL || TYPE_CODE (func_type) != TYPE_CODE_FUNC) + return 0; + + if (TYPE_NFIELDS (func_type) != n_actuals) + return 0; + + for (i = 0; i < n_actuals; i += 1) + { + struct type *ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i)); + struct type *atype = check_typedef (VALUE_TYPE (actuals[i])); + + if (!ada_type_match (TYPE_FIELD_TYPE (func_type, i), + VALUE_TYPE (actuals[i]), 1)) + return 0; + } + return 1; +} + +/* False iff function type FUNC_TYPE definitely does not produce a value + compatible with type CONTEXT_TYPE. Conservatively returns 1 if + FUNC_TYPE is not a valid function type with a non-null return type + or an enumerated type. A null CONTEXT_TYPE indicates any non-void type. */ + +static int +return_match (struct type *func_type, struct type *context_type) +{ + struct type *return_type; + + if (func_type == NULL) + return 1; + + /* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */ + /* if (TYPE_CODE (func_type) == TYPE_CODE_FUNC) + return_type = base_type (TYPE_TARGET_TYPE (func_type)); + else + return_type = base_type (func_type); */ + if (return_type == NULL) + return 1; + + /* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */ + /* context_type = base_type (context_type); */ + + if (TYPE_CODE (return_type) == TYPE_CODE_ENUM) + return context_type == NULL || return_type == context_type; + else if (context_type == NULL) + return TYPE_CODE (return_type) != TYPE_CODE_VOID; + else + return TYPE_CODE (return_type) == TYPE_CODE (context_type); +} + + +/* Return the index in SYMS[0..NSYMS-1] of symbol for the + function (if any) that matches the types of the NARGS arguments in + ARGS. If CONTEXT_TYPE is non-null, and there is at least one match + that returns type CONTEXT_TYPE, then eliminate other matches. If + CONTEXT_TYPE is null, prefer a non-void-returning function. + Asks the user if there is more than one match remaining. Returns -1 + if there is no such symbol or none is selected. NAME is used + solely for messages. May re-arrange and modify SYMS in + the process; the index returned is for the modified vector. BLOCKS + is modified in parallel to SYMS. */ + +int +ada_resolve_function (struct symbol *syms[], struct block *blocks[], + int nsyms, struct value **args, int nargs, + const char *name, struct type *context_type) +{ + int k; + int m; /* Number of hits */ + struct type *fallback; + struct type *return_type; + + return_type = context_type; + if (context_type == NULL) + fallback = builtin_type_void; + else + fallback = NULL; + + m = 0; + while (1) + { + for (k = 0; k < nsyms; k += 1) + { + struct type *type = check_typedef (SYMBOL_TYPE (syms[k])); + + if (ada_args_match (syms[k], args, nargs) + && return_match (SYMBOL_TYPE (syms[k]), return_type)) + { + syms[m] = syms[k]; + if (blocks != NULL) + blocks[m] = blocks[k]; + m += 1; + } + } + if (m > 0 || return_type == fallback) + break; + else + return_type = fallback; + } + + if (m == 0) + return -1; + else if (m > 1) + { + printf_filtered ("Multiple matches for %s\n", name); + user_select_syms (syms, blocks, m, 1); + return 0; + } + return 0; +} + +/* Returns true (non-zero) iff demangled name N0 should appear before N1 */ +/* in a listing of choices during disambiguation (see sort_choices, below). */ +/* The idea is that overloadings of a subprogram name from the */ +/* same package should sort in their source order. We settle for ordering */ +/* such symbols by their trailing number (__N or $N). */ +static int +mangled_ordered_before (char *N0, char *N1) +{ + if (N1 == NULL) + return 0; + else if (N0 == NULL) + return 1; + else + { + int k0, k1; + for (k0 = strlen (N0) - 1; k0 > 0 && isdigit (N0[k0]); k0 -= 1) + ; + for (k1 = strlen (N1) - 1; k1 > 0 && isdigit (N1[k1]); k1 -= 1) + ; + if ((N0[k0] == '_' || N0[k0] == '$') && N0[k0 + 1] != '\000' + && (N1[k1] == '_' || N1[k1] == '$') && N1[k1 + 1] != '\000') + { + int n0, n1; + n0 = k0; + while (N0[n0] == '_' && n0 > 0 && N0[n0 - 1] == '_') + n0 -= 1; + n1 = k1; + while (N1[n1] == '_' && n1 > 0 && N1[n1 - 1] == '_') + n1 -= 1; + if (n0 == n1 && STREQN (N0, N1, n0)) + return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1)); + } + return (strcmp (N0, N1) < 0); + } +} + +/* Sort SYMS[0..NSYMS-1] to put the choices in a canonical order by their */ +/* mangled names, rearranging BLOCKS[0..NSYMS-1] according to the same */ +/* permutation. */ +static void +sort_choices (struct symbol *syms[], struct block *blocks[], int nsyms) +{ + int i, j; + for (i = 1; i < nsyms; i += 1) + { + struct symbol *sym = syms[i]; + struct block *block = blocks[i]; + int j; + + for (j = i - 1; j >= 0; j -= 1) + { + if (mangled_ordered_before (SYMBOL_NAME (syms[j]), + SYMBOL_NAME (sym))) + break; + syms[j + 1] = syms[j]; + blocks[j + 1] = blocks[j]; + } + syms[j + 1] = sym; + blocks[j + 1] = block; + } +} + +/* Given a list of NSYMS symbols in SYMS and corresponding blocks in */ +/* BLOCKS, select up to MAX_RESULTS>0 by asking the user (if */ +/* necessary), returning the number selected, and setting the first */ +/* elements of SYMS and BLOCKS to the selected symbols and */ +/* corresponding blocks. Error if no symbols selected. BLOCKS may */ +/* be NULL, in which case it is ignored. */ + +/* NOTE: Adapted from decode_line_2 in symtab.c, with which it ought + to be re-integrated one of these days. */ + +int +user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms, + int max_results) +{ + int i; + int *chosen = (int *) alloca (sizeof (int) * nsyms); + int n_chosen; + int first_choice = (max_results == 1) ? 1 : 2; + + if (max_results < 1) + error ("Request to select 0 symbols!"); + if (nsyms <= 1) + return nsyms; + + printf_unfiltered ("[0] cancel\n"); + if (max_results > 1) + printf_unfiltered ("[1] all\n"); + + sort_choices (syms, blocks, nsyms); + + for (i = 0; i < nsyms; i += 1) + { + if (syms[i] == NULL) + continue; + + if (SYMBOL_CLASS (syms[i]) == LOC_BLOCK) + { + struct symtab_and_line sal = find_function_start_sal (syms[i], 1); + printf_unfiltered ("[%d] %s at %s:%d\n", + i + first_choice, + SYMBOL_SOURCE_NAME (syms[i]), + sal.symtab == NULL + ? "" + : sal.symtab->filename, sal.line); + continue; + } + else + { + int is_enumeral = + (SYMBOL_CLASS (syms[i]) == LOC_CONST + && SYMBOL_TYPE (syms[i]) != NULL + && TYPE_CODE (SYMBOL_TYPE (syms[i])) == TYPE_CODE_ENUM); + struct symtab *symtab = symtab_for_sym (syms[i]); + + if (SYMBOL_LINE (syms[i]) != 0 && symtab != NULL) + printf_unfiltered ("[%d] %s at %s:%d\n", + i + first_choice, + SYMBOL_SOURCE_NAME (syms[i]), + symtab->filename, SYMBOL_LINE (syms[i])); + else if (is_enumeral && TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL) + { + printf_unfiltered ("[%d] ", i + first_choice); + ada_print_type (SYMBOL_TYPE (syms[i]), NULL, gdb_stdout, -1, 0); + printf_unfiltered ("'(%s) (enumeral)\n", + SYMBOL_SOURCE_NAME (syms[i])); + } + else if (symtab != NULL) + printf_unfiltered (is_enumeral + ? "[%d] %s in %s (enumeral)\n" + : "[%d] %s at %s:?\n", + i + first_choice, + SYMBOL_SOURCE_NAME (syms[i]), + symtab->filename); + else + printf_unfiltered (is_enumeral + ? "[%d] %s (enumeral)\n" + : "[%d] %s at ?\n", + i + first_choice, + SYMBOL_SOURCE_NAME (syms[i])); + } + } + + n_chosen = get_selections (chosen, nsyms, max_results, max_results > 1, + "overload-choice"); + + for (i = 0; i < n_chosen; i += 1) + { + syms[i] = syms[chosen[i]]; + if (blocks != NULL) + blocks[i] = blocks[chosen[i]]; + } + + return n_chosen; +} + +/* Read and validate a set of numeric choices from the user in the + range 0 .. N_CHOICES-1. Place the results in increasing + order in CHOICES[0 .. N-1], and return N. + + The user types choices as a sequence of numbers on one line + separated by blanks, encoding them as follows: + + + A choice of 0 means to cancel the selection, throwing an error. + + If IS_ALL_CHOICE, a choice of 1 selects the entire set 0 .. N_CHOICES-1. + + The user chooses k by typing k+IS_ALL_CHOICE+1. + + The user is not allowed to choose more than MAX_RESULTS values. + + ANNOTATION_SUFFIX, if present, is used to annotate the input + prompts (for use with the -f switch). */ + +int +get_selections (int *choices, int n_choices, int max_results, + int is_all_choice, char *annotation_suffix) +{ + int i; + char *args; + const char *prompt; + int n_chosen; + int first_choice = is_all_choice ? 2 : 1; + + prompt = getenv ("PS2"); + if (prompt == NULL) + prompt = ">"; + + printf_unfiltered ("%s ", prompt); + gdb_flush (gdb_stdout); + + args = command_line_input ((char *) NULL, 0, annotation_suffix); + + if (args == NULL) + error_no_arg ("one or more choice numbers"); + + n_chosen = 0; + + /* Set choices[0 .. n_chosen-1] to the users' choices in ascending + order, as given in args. Choices are validated. */ + while (1) + { + char *args2; + int choice, j; + + while (isspace (*args)) + args += 1; + if (*args == '\0' && n_chosen == 0) + error_no_arg ("one or more choice numbers"); + else if (*args == '\0') + break; + + choice = strtol (args, &args2, 10); + if (args == args2 || choice < 0 + || choice > n_choices + first_choice - 1) + error ("Argument must be choice number"); + args = args2; + + if (choice == 0) + error ("cancelled"); + + if (choice < first_choice) + { + n_chosen = n_choices; + for (j = 0; j < n_choices; j += 1) + choices[j] = j; + break; + } + choice -= first_choice; + + for (j = n_chosen - 1; j >= 0 && choice < choices[j]; j -= 1) + { + } + + if (j < 0 || choice != choices[j]) + { + int k; + for (k = n_chosen - 1; k > j; k -= 1) + choices[k + 1] = choices[k]; + choices[j + 1] = choice; + n_chosen += 1; + } + } + + if (n_chosen > max_results) + error ("Select no more than %d of the above", max_results); + + return n_chosen; +} + +/* Replace the operator of length OPLEN at position PC in *EXPP with a call */ +/* on the function identified by SYM and BLOCK, and taking NARGS */ +/* arguments. Update *EXPP as needed to hold more space. */ + +static void +replace_operator_with_call (struct expression **expp, int pc, int nargs, + int oplen, struct symbol *sym, + struct block *block) +{ + /* A new expression, with 6 more elements (3 for funcall, 4 for function + symbol, -oplen for operator being replaced). */ + struct expression *newexp = (struct expression *) + xmalloc (sizeof (struct expression) + + EXP_ELEM_TO_BYTES ((*expp)->nelts + 7 - oplen)); + struct expression *exp = *expp; + + newexp->nelts = exp->nelts + 7 - oplen; + newexp->language_defn = exp->language_defn; + memcpy (newexp->elts, exp->elts, EXP_ELEM_TO_BYTES (pc)); + memcpy (newexp->elts + pc + 7, exp->elts + pc + oplen, + EXP_ELEM_TO_BYTES (exp->nelts - pc - oplen)); + + newexp->elts[pc].opcode = newexp->elts[pc + 2].opcode = OP_FUNCALL; + newexp->elts[pc + 1].longconst = (LONGEST) nargs; + + newexp->elts[pc + 3].opcode = newexp->elts[pc + 6].opcode = OP_VAR_VALUE; + newexp->elts[pc + 4].block = block; + newexp->elts[pc + 5].symbol = sym; + + *expp = newexp; + xfree (exp); +} + +/* Type-class predicates */ + +/* True iff TYPE is numeric (i.e., an INT, RANGE (of numeric type), or */ +/* FLOAT.) */ + +static int +numeric_type_p (struct type *type) +{ + if (type == NULL) + return 0; + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + case TYPE_CODE_FLT: + return 1; + case TYPE_CODE_RANGE: + return (type == TYPE_TARGET_TYPE (type) + || numeric_type_p (TYPE_TARGET_TYPE (type))); + default: + return 0; + } + } +} + +/* True iff TYPE is integral (an INT or RANGE of INTs). */ + +static int +integer_type_p (struct type *type) +{ + if (type == NULL) + return 0; + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + return 1; + case TYPE_CODE_RANGE: + return (type == TYPE_TARGET_TYPE (type) + || integer_type_p (TYPE_TARGET_TYPE (type))); + default: + return 0; + } + } +} + +/* True iff TYPE is scalar (INT, RANGE, FLOAT, ENUM). */ + +static int +scalar_type_p (struct type *type) +{ + if (type == NULL) + return 0; + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + case TYPE_CODE_RANGE: + case TYPE_CODE_ENUM: + case TYPE_CODE_FLT: + return 1; + default: + return 0; + } + } +} + +/* True iff TYPE is discrete (INT, RANGE, ENUM). */ + +static int +discrete_type_p (struct type *type) +{ + if (type == NULL) + return 0; + else + { + switch (TYPE_CODE (type)) + { + case TYPE_CODE_INT: + case TYPE_CODE_RANGE: + case TYPE_CODE_ENUM: + return 1; + default: + return 0; + } + } +} + +/* Returns non-zero if OP with operatands in the vector ARGS could be + a user-defined function. Errs on the side of pre-defined operators + (i.e., result 0). */ + +static int +possible_user_operator_p (enum exp_opcode op, struct value *args[]) +{ + struct type *type0 = check_typedef (VALUE_TYPE (args[0])); + struct type *type1 = + (args[1] == NULL) ? NULL : check_typedef (VALUE_TYPE (args[1])); + + switch (op) + { + default: + return 0; + + case BINOP_ADD: + case BINOP_SUB: + case BINOP_MUL: + case BINOP_DIV: + return (!(numeric_type_p (type0) && numeric_type_p (type1))); + + case BINOP_REM: + case BINOP_MOD: + case BINOP_BITWISE_AND: + case BINOP_BITWISE_IOR: + case BINOP_BITWISE_XOR: + return (!(integer_type_p (type0) && integer_type_p (type1))); + + case BINOP_EQUAL: + case BINOP_NOTEQUAL: + case BINOP_LESS: + case BINOP_GTR: + case BINOP_LEQ: + case BINOP_GEQ: + return (!(scalar_type_p (type0) && scalar_type_p (type1))); + + case BINOP_CONCAT: + return ((TYPE_CODE (type0) != TYPE_CODE_ARRAY && + (TYPE_CODE (type0) != TYPE_CODE_PTR || + TYPE_CODE (TYPE_TARGET_TYPE (type0)) + != TYPE_CODE_ARRAY)) + || (TYPE_CODE (type1) != TYPE_CODE_ARRAY && + (TYPE_CODE (type1) != TYPE_CODE_PTR || + TYPE_CODE (TYPE_TARGET_TYPE (type1)) != TYPE_CODE_ARRAY))); + + case BINOP_EXP: + return (!(numeric_type_p (type0) && integer_type_p (type1))); + + case UNOP_NEG: + case UNOP_PLUS: + case UNOP_LOGICAL_NOT: + case UNOP_ABS: + return (!numeric_type_p (type0)); + + } +} + + /* Renaming */ + +/** NOTE: In the following, we assume that a renaming type's name may + * have an ___XD suffix. It would be nice if this went away at some + * point. */ + +/* If TYPE encodes a renaming, returns the renaming suffix, which + * is XR for an object renaming, XRP for a procedure renaming, XRE for + * an exception renaming, and XRS for a subprogram renaming. Returns + * NULL if NAME encodes none of these. */ +const char * +ada_renaming_type (struct type *type) +{ + if (type != NULL && TYPE_CODE (type) == TYPE_CODE_ENUM) + { + const char *name = type_name_no_tag (type); + const char *suffix = (name == NULL) ? NULL : strstr (name, "___XR"); + if (suffix == NULL + || (suffix[5] != '\000' && strchr ("PES_", suffix[5]) == NULL)) + return NULL; + else + return suffix + 3; + } + else + return NULL; +} + +/* Return non-zero iff SYM encodes an object renaming. */ +int +ada_is_object_renaming (struct symbol *sym) +{ + const char *renaming_type = ada_renaming_type (SYMBOL_TYPE (sym)); + return renaming_type != NULL + && (renaming_type[2] == '\0' || renaming_type[2] == '_'); +} + +/* Assuming that SYM encodes a non-object renaming, returns the original + * name of the renamed entity. The name is good until the end of + * parsing. */ +const char * +ada_simple_renamed_entity (struct symbol *sym) +{ + struct type *type; + const char *raw_name; + int len; + char *result; + + type = SYMBOL_TYPE (sym); + if (type == NULL || TYPE_NFIELDS (type) < 1) + error ("Improperly encoded renaming."); + + raw_name = TYPE_FIELD_NAME (type, 0); + len = (raw_name == NULL ? 0 : strlen (raw_name)) - 5; + if (len <= 0) + error ("Improperly encoded renaming."); + + result = xmalloc (len + 1); + /* FIXME: add_name_string_cleanup should be defined in parse.c */ + /* add_name_string_cleanup (result); */ + strncpy (result, raw_name, len); + result[len] = '\000'; + return result; +} + + + /* Evaluation: Function Calls */ + +/* Copy VAL onto the stack, using and updating *SP as the stack + pointer. Return VAL as an lvalue. */ + +static struct value * +place_on_stack (struct value *val, CORE_ADDR *sp) +{ + CORE_ADDR old_sp = *sp; + +#ifdef STACK_ALIGN + *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val), + STACK_ALIGN (TYPE_LENGTH + (check_typedef (VALUE_TYPE (val))))); +#else + *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val), + TYPE_LENGTH (check_typedef (VALUE_TYPE (val)))); +#endif + + VALUE_LVAL (val) = lval_memory; + if (INNER_THAN (1, 2)) + VALUE_ADDRESS (val) = *sp; + else + VALUE_ADDRESS (val) = old_sp; + + return val; +} + +/* Return the value ACTUAL, converted to be an appropriate value for a + formal of type FORMAL_TYPE. Use *SP as a stack pointer for + allocating any necessary descriptors (fat pointers), or copies of + values not residing in memory, updating it as needed. */ + +static struct value * +convert_actual (struct value *actual, struct type *formal_type0, + CORE_ADDR *sp) +{ + struct type *actual_type = check_typedef (VALUE_TYPE (actual)); + struct type *formal_type = check_typedef (formal_type0); + struct type *formal_target = + TYPE_CODE (formal_type) == TYPE_CODE_PTR + ? check_typedef (TYPE_TARGET_TYPE (formal_type)) : formal_type; + struct type *actual_target = + TYPE_CODE (actual_type) == TYPE_CODE_PTR + ? check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type; + + if (ada_is_array_descriptor (formal_target) + && TYPE_CODE (actual_target) == TYPE_CODE_ARRAY) + return make_array_descriptor (formal_type, actual, sp); + else if (TYPE_CODE (formal_type) == TYPE_CODE_PTR) + { + if (TYPE_CODE (formal_target) == TYPE_CODE_ARRAY + && ada_is_array_descriptor (actual_target)) + return desc_data (actual); + else if (TYPE_CODE (actual_type) != TYPE_CODE_PTR) + { + if (VALUE_LVAL (actual) != lval_memory) + { + struct value *val; + actual_type = check_typedef (VALUE_TYPE (actual)); + val = allocate_value (actual_type); + memcpy ((char *) VALUE_CONTENTS_RAW (val), + (char *) VALUE_CONTENTS (actual), + TYPE_LENGTH (actual_type)); + actual = place_on_stack (val, sp); + } + return value_addr (actual); + } + } + else if (TYPE_CODE (actual_type) == TYPE_CODE_PTR) + return ada_value_ind (actual); + + return actual; +} + + +/* Push a descriptor of type TYPE for array value ARR on the stack at + *SP, updating *SP to reflect the new descriptor. Return either + an lvalue representing the new descriptor, or (if TYPE is a pointer- + to-descriptor type rather than a descriptor type), a struct value* + representing a pointer to this descriptor. */ + +static struct value * +make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp) +{ + struct type *bounds_type = desc_bounds_type (type); + struct type *desc_type = desc_base_type (type); + struct value *descriptor = allocate_value (desc_type); + struct value *bounds = allocate_value (bounds_type); + CORE_ADDR bounds_addr; + int i; + + for (i = ada_array_arity (check_typedef (VALUE_TYPE (arr))); i > 0; i -= 1) + { + modify_general_field (VALUE_CONTENTS (bounds), + value_as_long (ada_array_bound (arr, i, 0)), + desc_bound_bitpos (bounds_type, i, 0), + desc_bound_bitsize (bounds_type, i, 0)); + modify_general_field (VALUE_CONTENTS (bounds), + value_as_long (ada_array_bound (arr, i, 1)), + desc_bound_bitpos (bounds_type, i, 1), + desc_bound_bitsize (bounds_type, i, 1)); + } + + bounds = place_on_stack (bounds, sp); + + modify_general_field (VALUE_CONTENTS (descriptor), + arr, + fat_pntr_data_bitpos (desc_type), + fat_pntr_data_bitsize (desc_type)); + modify_general_field (VALUE_CONTENTS (descriptor), + VALUE_ADDRESS (bounds), + fat_pntr_bounds_bitpos (desc_type), + fat_pntr_bounds_bitsize (desc_type)); + + descriptor = place_on_stack (descriptor, sp); + + if (TYPE_CODE (type) == TYPE_CODE_PTR) + return value_addr (descriptor); + else + return descriptor; +} + + +/* Assuming a dummy frame has been established on the target, perform any + conversions needed for calling function FUNC on the NARGS actual + parameters in ARGS, other than standard C conversions. Does + nothing if FUNC does not have Ada-style prototype data, or if NARGS + does not match the number of arguments expected. Use *SP as a + stack pointer for additional data that must be pushed, updating its + value as needed. */ + +void +ada_convert_actuals (struct value *func, int nargs, struct value *args[], + CORE_ADDR *sp) +{ + int i; + + if (TYPE_NFIELDS (VALUE_TYPE (func)) == 0 + || nargs != TYPE_NFIELDS (VALUE_TYPE (func))) + return; + + for (i = 0; i < nargs; i += 1) + args[i] = + convert_actual (args[i], TYPE_FIELD_TYPE (VALUE_TYPE (func), i), sp); +} + + + /* Symbol Lookup */ + + +/* The vectors of symbols and blocks ultimately returned from */ +/* ada_lookup_symbol_list. */ + +/* Current size of defn_symbols and defn_blocks */ +static size_t defn_vector_size = 0; + +/* Current number of symbols found. */ +static int ndefns = 0; + +static struct symbol **defn_symbols = NULL; +static struct block **defn_blocks = NULL; + +/* Return the result of a standard (literal, C-like) lookup of NAME in + * given NAMESPACE. */ + +static struct symbol * +standard_lookup (const char *name, namespace_enum namespace) +{ + struct symbol *sym; + struct symtab *symtab; + sym = lookup_symbol (name, (struct block *) NULL, namespace, 0, &symtab); + return sym; +} + + +/* Non-zero iff there is at least one non-function/non-enumeral symbol */ +/* in SYMS[0..N-1]. We treat enumerals as functions, since they */ +/* contend in overloading in the same way. */ +static int +is_nonfunction (struct symbol *syms[], int n) +{ + int i; + + for (i = 0; i < n; i += 1) + if (TYPE_CODE (SYMBOL_TYPE (syms[i])) != TYPE_CODE_FUNC + && TYPE_CODE (SYMBOL_TYPE (syms[i])) != TYPE_CODE_ENUM) + return 1; + + return 0; +} + +/* If true (non-zero), then TYPE0 and TYPE1 represent equivalent + struct types. Otherwise, they may not. */ + +static int +equiv_types (struct type *type0, struct type *type1) +{ + if (type0 == type1) + return 1; + if (type0 == NULL || type1 == NULL + || TYPE_CODE (type0) != TYPE_CODE (type1)) + return 0; + if ((TYPE_CODE (type0) == TYPE_CODE_STRUCT + || TYPE_CODE (type0) == TYPE_CODE_ENUM) + && ada_type_name (type0) != NULL && ada_type_name (type1) != NULL + && STREQ (ada_type_name (type0), ada_type_name (type1))) + return 1; + + return 0; +} + +/* True iff SYM0 represents the same entity as SYM1, or one that is + no more defined than that of SYM1. */ + +static int +lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) +{ + if (sym0 == sym1) + return 1; + if (SYMBOL_NAMESPACE (sym0) != SYMBOL_NAMESPACE (sym1) + || SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1)) + return 0; + + switch (SYMBOL_CLASS (sym0)) + { + case LOC_UNDEF: + return 1; + case LOC_TYPEDEF: + { + struct type *type0 = SYMBOL_TYPE (sym0); + struct type *type1 = SYMBOL_TYPE (sym1); + char *name0 = SYMBOL_NAME (sym0); + char *name1 = SYMBOL_NAME (sym1); + int len0 = strlen (name0); + return + TYPE_CODE (type0) == TYPE_CODE (type1) + && (equiv_types (type0, type1) + || (len0 < strlen (name1) && STREQN (name0, name1, len0) + && STREQN (name1 + len0, "___XV", 5))); + } + case LOC_CONST: + return SYMBOL_VALUE (sym0) == SYMBOL_VALUE (sym1) + && equiv_types (SYMBOL_TYPE (sym0), SYMBOL_TYPE (sym1)); + default: + return 0; + } +} + +/* Append SYM to the end of defn_symbols, and BLOCK to the end of + defn_blocks, updating ndefns, and expanding defn_symbols and + defn_blocks as needed. Do not include SYM if it is a duplicate. */ + +static void +add_defn_to_vec (struct symbol *sym, struct block *block) +{ + int i; + size_t tmp; + + if (SYMBOL_TYPE (sym) != NULL) + CHECK_TYPEDEF (SYMBOL_TYPE (sym)); + for (i = 0; i < ndefns; i += 1) + { + if (lesseq_defined_than (sym, defn_symbols[i])) + return; + else if (lesseq_defined_than (defn_symbols[i], sym)) + { + defn_symbols[i] = sym; + defn_blocks[i] = block; + return; + } + } + + tmp = defn_vector_size; + GROW_VECT (defn_symbols, tmp, ndefns + 2); + GROW_VECT (defn_blocks, defn_vector_size, ndefns + 2); + + defn_symbols[ndefns] = sym; + defn_blocks[ndefns] = block; + ndefns += 1; +} + +/* Look, in partial_symtab PST, for symbol NAME in given namespace. + Check the global symbols if GLOBAL, the static symbols if not. Do + wild-card match if WILD. */ + +static struct partial_symbol * +ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, + int global, namespace_enum namespace, int wild) +{ + struct partial_symbol **start; + int name_len = strlen (name); + int length = (global ? pst->n_global_syms : pst->n_static_syms); + int i; + + if (length == 0) + { + return (NULL); + } + + start = (global ? + pst->objfile->global_psymbols.list + pst->globals_offset : + pst->objfile->static_psymbols.list + pst->statics_offset); + + if (wild) + { + for (i = 0; i < length; i += 1) + { + struct partial_symbol *psym = start[i]; + + if (SYMBOL_NAMESPACE (psym) == namespace && + wild_match (name, name_len, SYMBOL_NAME (psym))) + return psym; + } + return NULL; + } + else + { + if (global) + { + int U; + i = 0; + U = length - 1; + while (U - i > 4) + { + int M = (U + i) >> 1; + struct partial_symbol *psym = start[M]; + if (SYMBOL_NAME (psym)[0] < name[0]) + i = M + 1; + else if (SYMBOL_NAME (psym)[0] > name[0]) + U = M - 1; + else if (strcmp (SYMBOL_NAME (psym), name) < 0) + i = M + 1; + else + U = M; + } + } + else + i = 0; + + while (i < length) + { + struct partial_symbol *psym = start[i]; + + if (SYMBOL_NAMESPACE (psym) == namespace) + { + int cmp = strncmp (name, SYMBOL_NAME (psym), name_len); + + if (cmp < 0) + { + if (global) + break; + } + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (psym) + name_len)) + return psym; + } + i += 1; + } + + if (global) + { + int U; + i = 0; + U = length - 1; + while (U - i > 4) + { + int M = (U + i) >> 1; + struct partial_symbol *psym = start[M]; + if (SYMBOL_NAME (psym)[0] < '_') + i = M + 1; + else if (SYMBOL_NAME (psym)[0] > '_') + U = M - 1; + else if (strcmp (SYMBOL_NAME (psym), "_ada_") < 0) + i = M + 1; + else + U = M; + } + } + else + i = 0; + + while (i < length) + { + struct partial_symbol *psym = start[i]; + + if (SYMBOL_NAMESPACE (psym) == namespace) + { + int cmp; + + cmp = (int) '_' - (int) SYMBOL_NAME (psym)[0]; + if (cmp == 0) + { + cmp = strncmp ("_ada_", SYMBOL_NAME (psym), 5); + if (cmp == 0) + cmp = strncmp (name, SYMBOL_NAME (psym) + 5, name_len); + } + + if (cmp < 0) + { + if (global) + break; + } + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (psym) + name_len + 5)) + return psym; + } + i += 1; + } + + } + return NULL; +} + + +/* Find a symbol table containing symbol SYM or NULL if none. */ +static struct symtab * +symtab_for_sym (struct symbol *sym) +{ + struct symtab *s; + struct objfile *objfile; + struct block *b; + struct symbol *tmp_sym; + int i, j; + + ALL_SYMTABS (objfile, s) + { + switch (SYMBOL_CLASS (sym)) + { + case LOC_CONST: + case LOC_STATIC: + case LOC_TYPEDEF: + case LOC_REGISTER: + case LOC_LABEL: + case LOC_BLOCK: + case LOC_CONST_BYTES: + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); + ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym) + return s; + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); + ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym) + return s; + break; + default: + break; + } + switch (SYMBOL_CLASS (sym)) + { + case LOC_REGISTER: + case LOC_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_LOCAL: + case LOC_TYPEDEF: + case LOC_LOCAL_ARG: + case LOC_BASEREG: + case LOC_BASEREG_ARG: + for (j = FIRST_LOCAL_BLOCK; + j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1) + { + b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j); + ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym) + return s; + } + break; + default: + break; + } + } + return NULL; +} + +/* Return a minimal symbol matching NAME according to Ada demangling + rules. Returns NULL if there is no such minimal symbol. */ + +struct minimal_symbol * +ada_lookup_minimal_symbol (const char *name) +{ + struct objfile *objfile; + struct minimal_symbol *msymbol; + int wild_match = (strstr (name, "__") == NULL); + + ALL_MSYMBOLS (objfile, msymbol) + { + if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match) + && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline) + return msymbol; + } + + return NULL; +} + +/* For all subprograms that statically enclose the subprogram of the + * selected frame, add symbols matching identifier NAME in NAMESPACE + * and their blocks to vectors *defn_symbols and *defn_blocks, as for + * ada_add_block_symbols (q.v.). If WILD, treat as NAME with a + * wildcard prefix. At the moment, this function uses a heuristic to + * find the frames of enclosing subprograms: it treats the + * pointer-sized value at location 0 from the local-variable base of a + * frame as a static link, and then searches up the call stack for a + * frame with that same local-variable base. */ +static void +add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, + int wild_match) +{ +#ifdef i386 + static struct symbol static_link_sym; + static struct symbol *static_link; + + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + struct frame_info *frame; + struct frame_info *target_frame; + + if (static_link == NULL) + { + /* Initialize the local variable symbol that stands for the + * static link (when it exists). */ + static_link = &static_link_sym; + SYMBOL_NAME (static_link) = ""; + SYMBOL_LANGUAGE (static_link) = language_unknown; + SYMBOL_CLASS (static_link) = LOC_LOCAL; + SYMBOL_NAMESPACE (static_link) = VAR_NAMESPACE; + SYMBOL_TYPE (static_link) = lookup_pointer_type (builtin_type_void); + SYMBOL_VALUE (static_link) = + -(long) TYPE_LENGTH (SYMBOL_TYPE (static_link)); + } + + frame = selected_frame; + while (frame != NULL && ndefns == 0) + { + struct block *block; + struct value *target_link_val = read_var_value (static_link, frame); + CORE_ADDR target_link; + + if (target_link_val == NULL) + break; + QUIT; + + target_link = target_link_val; + do + { + QUIT; + frame = get_prev_frame (frame); + } + while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link); + + if (frame == NULL) + break; + + block = get_frame_block (frame, 0); + while (block != NULL && block_function (block) != NULL && ndefns == 0) + { + ada_add_block_symbols (block, name, namespace, NULL, wild_match); + + block = BLOCK_SUPERBLOCK (block); + } + } + + do_cleanups (old_chain); +#endif +} + +/* True if TYPE is definitely an artificial type supplied to a symbol + * for which no debugging information was given in the symbol file. */ +static int +is_nondebugging_type (struct type *type) +{ + char *name = ada_type_name (type); + return (name != NULL && STREQ (name, "")); +} + +/* Remove any non-debugging symbols in SYMS[0 .. NSYMS-1] that definitely + * duplicate other symbols in the list. (The only case I know of where + * this happens is when object files containing stabs-in-ecoff are + * linked with files containing ordinary ecoff debugging symbols (or no + * debugging symbols)). Modifies SYMS to squeeze out deleted symbols, + * and applies the same modification to BLOCKS to maintain the + * correspondence between SYMS[i] and BLOCKS[i]. Returns the number + * of symbols in the modified list. */ +static int +remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms) +{ + int i, j; + + i = 0; + while (i < nsyms) + { + if (SYMBOL_NAME (syms[i]) != NULL + && SYMBOL_CLASS (syms[i]) == LOC_STATIC + && is_nondebugging_type (SYMBOL_TYPE (syms[i]))) + { + for (j = 0; j < nsyms; j += 1) + { + if (i != j + && SYMBOL_NAME (syms[j]) != NULL + && STREQ (SYMBOL_NAME (syms[i]), SYMBOL_NAME (syms[j])) + && SYMBOL_CLASS (syms[i]) == SYMBOL_CLASS (syms[j]) + && SYMBOL_VALUE_ADDRESS (syms[i]) + == SYMBOL_VALUE_ADDRESS (syms[j])) + { + int k; + for (k = i + 1; k < nsyms; k += 1) + { + syms[k - 1] = syms[k]; + blocks[k - 1] = blocks[k]; + } + nsyms -= 1; + goto NextSymbol; + } + } + } + i += 1; + NextSymbol: + ; + } + return nsyms; +} + +/* Find symbols in NAMESPACE matching NAME, in BLOCK0 and enclosing + scope and in global scopes, returning the number of matches. Sets + *SYMS to point to a vector of matching symbols, with *BLOCKS + pointing to the vector of corresponding blocks in which those + symbols reside. These two vectors are transient---good only to the + next call of ada_lookup_symbol_list. Any non-function/non-enumeral symbol + match within the nest of blocks whose innermost member is BLOCK0, + is the outermost match returned (no other matches in that or + enclosing blocks is returned). If there are any matches in or + surrounding BLOCK0, then these alone are returned. */ + +int +ada_lookup_symbol_list (const char *name, struct block *block0, + namespace_enum namespace, struct symbol ***syms, + struct block ***blocks) +{ + struct symbol *sym; + struct symtab *s; + struct partial_symtab *ps; + struct blockvector *bv; + struct objfile *objfile; + struct block *b; + struct block *block; + struct minimal_symbol *msymbol; + int wild_match = (strstr (name, "__") == NULL); + int cacheIfUnique; + +#ifdef TIMING + markTimeStart (0); +#endif + + ndefns = 0; + cacheIfUnique = 0; + + /* Search specified block and its superiors. */ + + block = block0; + while (block != NULL) + { + ada_add_block_symbols (block, name, namespace, NULL, wild_match); + + /* If we found a non-function match, assume that's the one. */ + if (is_nonfunction (defn_symbols, ndefns)) + goto done; + + block = BLOCK_SUPERBLOCK (block); + } + + /* If we found ANY matches in the specified BLOCK, we're done. */ + + if (ndefns > 0) + goto done; + + cacheIfUnique = 1; + + /* Now add symbols from all global blocks: symbol tables, minimal symbol + tables, and psymtab's */ + + ALL_SYMTABS (objfile, s) + { + QUIT; + if (!s->primary) + continue; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + ada_add_block_symbols (block, name, namespace, objfile, wild_match); + } + + if (namespace == VAR_NAMESPACE) + { + ALL_MSYMBOLS (objfile, msymbol) + { + if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match)) + { + switch (MSYMBOL_TYPE (msymbol)) + { + case mst_solib_trampoline: + break; + default: + s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)); + if (s != NULL) + { + int old_ndefns = ndefns; + QUIT; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + ada_add_block_symbols (block, + SYMBOL_NAME (msymbol), + namespace, objfile, wild_match); + if (ndefns == old_ndefns) + { + block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + ada_add_block_symbols (block, + SYMBOL_NAME (msymbol), + namespace, objfile, + wild_match); + } + } + } + } + } + } + + ALL_PSYMTABS (objfile, ps) + { + QUIT; + if (!ps->readin + && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match)) + { + s = PSYMTAB_TO_SYMTAB (ps); + if (!s->primary) + continue; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + ada_add_block_symbols (block, name, namespace, objfile, wild_match); + } + } + + /* Now add symbols from all per-file blocks if we've gotten no hits. + (Not strictly correct, but perhaps better than an error). + Do the symtabs first, then check the psymtabs */ + + if (ndefns == 0) + { + + ALL_SYMTABS (objfile, s) + { + QUIT; + if (!s->primary) + continue; + bv = BLOCKVECTOR (s); + block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + ada_add_block_symbols (block, name, namespace, objfile, wild_match); + } + + ALL_PSYMTABS (objfile, ps) + { + QUIT; + if (!ps->readin + && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match)) + { + s = PSYMTAB_TO_SYMTAB (ps); + bv = BLOCKVECTOR (s); + if (!s->primary) + continue; + block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + ada_add_block_symbols (block, name, namespace, + objfile, wild_match); + } + } + } + + /* Finally, we try to find NAME as a local symbol in some lexically + enclosing block. We do this last, expecting this case to be + rare. */ + if (ndefns == 0) + { + add_symbols_from_enclosing_procs (name, namespace, wild_match); + if (ndefns > 0) + goto done; + } + +done: + ndefns = remove_extra_symbols (defn_symbols, defn_blocks, ndefns); + + + *syms = defn_symbols; + *blocks = defn_blocks; +#ifdef TIMING + markTimeStop (0); +#endif + return ndefns; +} + +/* Return a symbol in NAMESPACE matching NAME, in BLOCK0 and enclosing + * scope and in global scopes, or NULL if none. NAME is folded to + * lower case first, unless it is surrounded in single quotes. + * Otherwise, the result is as for ada_lookup_symbol_list, but is + * disambiguated by user query if needed. */ + +struct symbol * +ada_lookup_symbol (const char *name, struct block *block0, + namespace_enum namespace) +{ + struct symbol **candidate_syms; + struct block **candidate_blocks; + int n_candidates; + + n_candidates = ada_lookup_symbol_list (name, + block0, namespace, + &candidate_syms, &candidate_blocks); + + if (n_candidates == 0) + return NULL; + else if (n_candidates != 1) + user_select_syms (candidate_syms, candidate_blocks, n_candidates, 1); + + return candidate_syms[0]; +} + + +/* True iff STR is a possible encoded suffix of a normal Ada name + * that is to be ignored for matching purposes. Suffixes of parallel + * names (e.g., XVE) are not included here. Currently, the possible suffixes + * are given by the regular expression: + * (X[nb]*)?(__[0-9]+|\$[0-9]+|___(LJM|X([FDBUP].*|R[^T]?)))?$ + * + */ +static int +is_name_suffix (const char *str) +{ + int k; + if (str[0] == 'X') + { + str += 1; + while (str[0] != '_' && str[0] != '\0') + { + if (str[0] != 'n' && str[0] != 'b') + return 0; + str += 1; + } + } + if (str[0] == '\000') + return 1; + if (str[0] == '_') + { + if (str[1] != '_' || str[2] == '\000') + return 0; + if (str[2] == '_') + { + if (STREQ (str + 3, "LJM")) + return 1; + if (str[3] != 'X') + return 0; + if (str[4] == 'F' || str[4] == 'D' || str[4] == 'B' || + str[4] == 'U' || str[4] == 'P') + return 1; + if (str[4] == 'R' && str[5] != 'T') + return 1; + return 0; + } + for (k = 2; str[k] != '\0'; k += 1) + if (!isdigit (str[k])) + return 0; + return 1; + } + if (str[0] == '$' && str[1] != '\000') + { + for (k = 1; str[k] != '\0'; k += 1) + if (!isdigit (str[k])) + return 0; + return 1; + } + return 0; +} + +/* True if NAME represents a name of the form A1.A2....An, n>=1 and + * PATN[0..PATN_LEN-1] = Ak.Ak+1.....An for some k >= 1. Ignores + * informational suffixes of NAME (i.e., for which is_name_suffix is + * true). */ +static int +wild_match (const char *patn, int patn_len, const char *name) +{ + int name_len; + int s, e; + + name_len = strlen (name); + if (name_len >= patn_len + 5 && STREQN (name, "_ada_", 5) + && STREQN (patn, name + 5, patn_len) + && is_name_suffix (name + patn_len + 5)) + return 1; + + while (name_len >= patn_len) + { + if (STREQN (patn, name, patn_len) && is_name_suffix (name + patn_len)) + return 1; + do + { + name += 1; + name_len -= 1; + } + while (name_len > 0 + && name[0] != '.' && (name[0] != '_' || name[1] != '_')); + if (name_len <= 0) + return 0; + if (name[0] == '_') + { + if (!islower (name[2])) + return 0; + name += 2; + name_len -= 2; + } + else + { + if (!islower (name[1])) + return 0; + name += 1; + name_len -= 1; + } + } + + return 0; +} + + +/* Add symbols from BLOCK matching identifier NAME in NAMESPACE to + vector *defn_symbols, updating *defn_symbols (if necessary), *SZ (the size of + the vector *defn_symbols), and *ndefns (the number of symbols + currently stored in *defn_symbols). If WILD, treat as NAME with a + wildcard prefix. OBJFILE is the section containing BLOCK. */ + +static void +ada_add_block_symbols (struct block *block, const char *name, + namespace_enum namespace, struct objfile *objfile, + int wild) +{ + int i; + int name_len = strlen (name); + /* A matching argument symbol, if any. */ + struct symbol *arg_sym; + /* Set true when we find a matching non-argument symbol */ + int found_sym; + int is_sorted = BLOCK_SHOULD_SORT (block); + struct symbol *sym; + + arg_sym = NULL; + found_sym = 0; + if (wild) + { + struct symbol *sym; + ALL_BLOCK_SYMBOLS (block, i, sym) + { + if (SYMBOL_NAMESPACE (sym) == namespace && + wild_match (name, name_len, SYMBOL_NAME (sym))) + { + switch (SYMBOL_CLASS (sym)) + { + case LOC_ARG: + case LOC_LOCAL_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_BASEREG_ARG: + arg_sym = sym; + break; + case LOC_UNRESOLVED: + continue; + default: + found_sym = 1; + fill_in_ada_prototype (sym); + add_defn_to_vec (fixup_symbol_section (sym, objfile), block); + break; + } + } + } + } + else + { + if (is_sorted) + { + int U; + i = 0; + U = BLOCK_NSYMS (block) - 1; + while (U - i > 4) + { + int M = (U + i) >> 1; + struct symbol *sym = BLOCK_SYM (block, M); + if (SYMBOL_NAME (sym)[0] < name[0]) + i = M + 1; + else if (SYMBOL_NAME (sym)[0] > name[0]) + U = M - 1; + else if (strcmp (SYMBOL_NAME (sym), name) < 0) + i = M + 1; + else + U = M; + } + } + else + i = 0; + + for (; i < BLOCK_BUCKETS (block); i += 1) + for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next) + { + if (SYMBOL_NAMESPACE (sym) == namespace) + { + int cmp = strncmp (name, SYMBOL_NAME (sym), name_len); + + if (cmp < 0) + { + if (is_sorted) + { + i = BLOCK_BUCKETS (block); + break; + } + } + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (sym) + name_len)) + { + switch (SYMBOL_CLASS (sym)) + { + case LOC_ARG: + case LOC_LOCAL_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_BASEREG_ARG: + arg_sym = sym; + break; + case LOC_UNRESOLVED: + break; + default: + found_sym = 1; + fill_in_ada_prototype (sym); + add_defn_to_vec (fixup_symbol_section (sym, objfile), + block); + break; + } + } + } + } + } + + if (!found_sym && arg_sym != NULL) + { + fill_in_ada_prototype (arg_sym); + add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block); + } + + if (!wild) + { + arg_sym = NULL; + found_sym = 0; + if (is_sorted) + { + int U; + i = 0; + U = BLOCK_NSYMS (block) - 1; + while (U - i > 4) + { + int M = (U + i) >> 1; + struct symbol *sym = BLOCK_SYM (block, M); + if (SYMBOL_NAME (sym)[0] < '_') + i = M + 1; + else if (SYMBOL_NAME (sym)[0] > '_') + U = M - 1; + else if (strcmp (SYMBOL_NAME (sym), "_ada_") < 0) + i = M + 1; + else + U = M; + } + } + else + i = 0; + + for (; i < BLOCK_BUCKETS (block); i += 1) + for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next) + { + struct symbol *sym = BLOCK_SYM (block, i); + + if (SYMBOL_NAMESPACE (sym) == namespace) + { + int cmp; + + cmp = (int) '_' - (int) SYMBOL_NAME (sym)[0]; + if (cmp == 0) + { + cmp = strncmp ("_ada_", SYMBOL_NAME (sym), 5); + if (cmp == 0) + cmp = strncmp (name, SYMBOL_NAME (sym) + 5, name_len); + } + + if (cmp < 0) + { + if (is_sorted) + { + i = BLOCK_BUCKETS (block); + break; + } + } + else if (cmp == 0 + && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5)) + { + switch (SYMBOL_CLASS (sym)) + { + case LOC_ARG: + case LOC_LOCAL_ARG: + case LOC_REF_ARG: + case LOC_REGPARM: + case LOC_REGPARM_ADDR: + case LOC_BASEREG_ARG: + arg_sym = sym; + break; + case LOC_UNRESOLVED: + break; + default: + found_sym = 1; + fill_in_ada_prototype (sym); + add_defn_to_vec (fixup_symbol_section (sym, objfile), + block); + break; + } + } + } + } + + /* NOTE: This really shouldn't be needed for _ada_ symbols. + They aren't parameters, right? */ + if (!found_sym && arg_sym != NULL) + { + fill_in_ada_prototype (arg_sym); + add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block); + } + } +} + + + /* Function Types */ + +/* Assuming that SYM is the symbol for a function, fill in its type + with prototype information, if it is not already there. */ + +static void +fill_in_ada_prototype (struct symbol *func) +{ + struct block *b; + int nargs, nsyms; + int i; + struct type *ftype; + struct type *rtype; + size_t max_fields; + struct symbol *sym; + + if (func == NULL + || TYPE_CODE (SYMBOL_TYPE (func)) != TYPE_CODE_FUNC + || TYPE_FIELDS (SYMBOL_TYPE (func)) != NULL) + return; + + /* We make each function type unique, so that each may have its own */ + /* parameter types. This particular way of doing so wastes space: */ + /* it would be nicer to build the argument types while the original */ + /* function type is being built (FIXME). */ + rtype = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (func))); + ftype = alloc_type (TYPE_OBJFILE (SYMBOL_TYPE (func))); + make_function_type (rtype, &ftype); + SYMBOL_TYPE (func) = ftype; + + b = SYMBOL_BLOCK_VALUE (func); + + nargs = 0; + max_fields = 8; + TYPE_FIELDS (ftype) = + (struct field *) xmalloc (sizeof (struct field) * max_fields); + ALL_BLOCK_SYMBOLS (b, i, sym) + { + GROW_VECT (TYPE_FIELDS (ftype), max_fields, nargs + 1); + + switch (SYMBOL_CLASS (sym)) + { + case LOC_REF_ARG: + case LOC_REGPARM_ADDR: + TYPE_FIELD_BITPOS (ftype, nargs) = nargs; + TYPE_FIELD_BITSIZE (ftype, nargs) = 0; + TYPE_FIELD_TYPE (ftype, nargs) = + lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym))); + TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + nargs += 1; + + break; + + case LOC_ARG: + case LOC_REGPARM: + case LOC_LOCAL_ARG: + case LOC_BASEREG_ARG: + TYPE_FIELD_BITPOS (ftype, nargs) = nargs; + TYPE_FIELD_BITSIZE (ftype, nargs) = 0; + TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym)); + TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + nargs += 1; + + break; + + default: + break; + } + } + + /* Re-allocate fields vector; if there are no fields, make the */ + /* fields pointer non-null anyway, to mark that this function type */ + /* has been filled in. */ + + TYPE_NFIELDS (ftype) = nargs; + if (nargs == 0) + { + static struct field dummy_field = { 0, 0, 0, 0 }; + xfree (TYPE_FIELDS (ftype)); + TYPE_FIELDS (ftype) = &dummy_field; + } + else + { + struct field *fields = + (struct field *) TYPE_ALLOC (ftype, nargs * sizeof (struct field)); + memcpy ((char *) fields, + (char *) TYPE_FIELDS (ftype), nargs * sizeof (struct field)); + xfree (TYPE_FIELDS (ftype)); + TYPE_FIELDS (ftype) = fields; + } +} + + + /* Breakpoint-related */ + +char no_symtab_msg[] = + "No symbol table is loaded. Use the \"file\" command."; + +/* Assuming that LINE is pointing at the beginning of an argument to + 'break', return a pointer to the delimiter for the initial segment + of that name. This is the first ':', ' ', or end of LINE. +*/ +char * +ada_start_decode_line_1 (char *line) +{ + /* [NOTE: strpbrk would be more elegant, but I am reluctant to be + the first to use such a library function in GDB code.] */ + char *p; + for (p = line; *p != '\000' && *p != ' ' && *p != ':'; p += 1) + ; + return p; +} + +/* *SPEC points to a function and line number spec (as in a break + command), following any initial file name specification. + + Return all symbol table/line specfications (sals) consistent with the + information in *SPEC and FILE_TABLE in the + following sense: + + FILE_TABLE is null, or the sal refers to a line in the file + named by FILE_TABLE. + + If *SPEC points to an argument with a trailing ':LINENUM', + then the sal refers to that line (or one following it as closely as + possible). + + If *SPEC does not start with '*', the sal is in a function with + that name. + + Returns with 0 elements if no matching non-minimal symbols found. + + If *SPEC begins with a function name of the form , then NAME + is taken as a literal name; otherwise the function name is subject + to the usual mangling. + + *SPEC is updated to point after the function/line number specification. + + FUNFIRSTLINE is non-zero if we desire the first line of real code + in each function (this is ignored in the presence of a LINENUM spec.). + + If CANONICAL is non-NULL, and if any of the sals require a + 'canonical line spec', then *CANONICAL is set to point to an array + of strings, corresponding to and equal in length to the returned + list of sals, such that (*CANONICAL)[i] is non-null and contains a + canonical line spec for the ith returned sal, if needed. If no + canonical line specs are required and CANONICAL is non-null, + *CANONICAL is set to NULL. + + A 'canonical line spec' is simply a name (in the format of the + breakpoint command) that uniquely identifies a breakpoint position, + with no further contextual information or user selection. It is + needed whenever the file name, function name, and line number + information supplied is insufficient for this unique + identification. Currently overloaded functions, the name '*', + or static functions without a filename yield a canonical line spec. + The array and the line spec strings are allocated on the heap; it + is the caller's responsibility to free them. */ + +struct symtabs_and_lines +ada_finish_decode_line_1 (char **spec, struct symtab *file_table, + int funfirstline, char ***canonical) +{ + struct symbol **symbols; + struct block **blocks; + struct block *block; + int n_matches, i, line_num; + struct symtabs_and_lines selected; + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + char *name; + + int len; + char *lower_name; + char *unquoted_name; + + if (file_table == NULL) + block = get_selected_block (NULL); + else + block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_table), STATIC_BLOCK); + + if (canonical != NULL) + *canonical = (char **) NULL; + + name = *spec; + if (**spec == '*') + *spec += 1; + else + { + while (**spec != '\000' && + !strchr (ada_completer_word_break_characters, **spec)) + *spec += 1; + } + len = *spec - name; + + line_num = -1; + if (file_table != NULL && (*spec)[0] == ':' && isdigit ((*spec)[1])) + { + line_num = strtol (*spec + 1, spec, 10); + while (**spec == ' ' || **spec == '\t') + *spec += 1; + } + + if (name[0] == '*') + { + if (line_num == -1) + error ("Wild-card function with no line number or file name."); + + return all_sals_for_line (file_table->filename, line_num, canonical); + } + + if (name[0] == '\'') + { + name += 1; + len -= 2; + } + + if (name[0] == '<') + { + unquoted_name = (char *) alloca (len - 1); + memcpy (unquoted_name, name + 1, len - 2); + unquoted_name[len - 2] = '\000'; + lower_name = NULL; + } + else + { + unquoted_name = (char *) alloca (len + 1); + memcpy (unquoted_name, name, len); + unquoted_name[len] = '\000'; + lower_name = (char *) alloca (len + 1); + for (i = 0; i < len; i += 1) + lower_name[i] = tolower (name[i]); + lower_name[len] = '\000'; + } + + n_matches = 0; + if (lower_name != NULL) + n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block, + VAR_NAMESPACE, &symbols, &blocks); + if (n_matches == 0) + n_matches = ada_lookup_symbol_list (unquoted_name, block, + VAR_NAMESPACE, &symbols, &blocks); + if (n_matches == 0 && line_num >= 0) + error ("No line number information found for %s.", unquoted_name); + else if (n_matches == 0) + { +#ifdef HPPA_COMPILER_BUG + /* FIXME: See comment in symtab.c::decode_line_1 */ +#undef volatile + volatile struct symtab_and_line val; +#define volatile /*nothing */ +#else + struct symtab_and_line val; +#endif + struct minimal_symbol *msymbol; + + INIT_SAL (&val); + + msymbol = NULL; + if (lower_name != NULL) + msymbol = ada_lookup_minimal_symbol (ada_mangle (lower_name)); + if (msymbol == NULL) + msymbol = ada_lookup_minimal_symbol (unquoted_name); + if (msymbol != NULL) + { + val.pc = SYMBOL_VALUE_ADDRESS (msymbol); + val.section = SYMBOL_BFD_SECTION (msymbol); + if (funfirstline) + { + val.pc += FUNCTION_START_OFFSET; + SKIP_PROLOGUE (val.pc); + } + selected.sals = (struct symtab_and_line *) + xmalloc (sizeof (struct symtab_and_line)); + selected.sals[0] = val; + selected.nelts = 1; + return selected; + } + + if (!have_full_symbols () && + !have_partial_symbols () && !have_minimal_symbols ()) + error (no_symtab_msg); + + error ("Function \"%s\" not defined.", unquoted_name); + return selected; /* for lint */ + } + + if (line_num >= 0) + { + return + find_sal_from_funcs_and_line (file_table->filename, line_num, + symbols, n_matches); + } + else + { + selected.nelts = + user_select_syms (symbols, blocks, n_matches, n_matches); + } + + selected.sals = (struct symtab_and_line *) + xmalloc (sizeof (struct symtab_and_line) * selected.nelts); + memset (selected.sals, 0, selected.nelts * sizeof (selected.sals[i])); + make_cleanup (xfree, selected.sals); + + i = 0; + while (i < selected.nelts) + { + if (SYMBOL_CLASS (symbols[i]) == LOC_BLOCK) + selected.sals[i] = find_function_start_sal (symbols[i], funfirstline); + else if (SYMBOL_LINE (symbols[i]) != 0) + { + selected.sals[i].symtab = symtab_for_sym (symbols[i]); + selected.sals[i].line = SYMBOL_LINE (symbols[i]); + } + else if (line_num >= 0) + { + /* Ignore this choice */ + symbols[i] = symbols[selected.nelts - 1]; + blocks[i] = blocks[selected.nelts - 1]; + selected.nelts -= 1; + continue; + } + else + error ("Line number not known for symbol \"%s\"", unquoted_name); + i += 1; + } + + if (canonical != NULL && (line_num >= 0 || n_matches > 1)) + { + *canonical = (char **) xmalloc (sizeof (char *) * selected.nelts); + for (i = 0; i < selected.nelts; i += 1) + (*canonical)[i] = + extended_canonical_line_spec (selected.sals[i], + SYMBOL_SOURCE_NAME (symbols[i])); + } + + discard_cleanups (old_chain); + return selected; +} + +/* The (single) sal corresponding to line LINE_NUM in a symbol table + with file name FILENAME that occurs in one of the functions listed + in SYMBOLS[0 .. NSYMS-1]. */ +static struct symtabs_and_lines +find_sal_from_funcs_and_line (const char *filename, int line_num, + struct symbol **symbols, int nsyms) +{ + struct symtabs_and_lines sals; + int best_index, best; + struct linetable *best_linetable; + struct objfile *objfile; + struct symtab *s; + struct symtab *best_symtab; + + read_all_symtabs (filename); + + best_index = 0; + best_linetable = NULL; + best_symtab = NULL; + best = 0; + ALL_SYMTABS (objfile, s) + { + struct linetable *l; + int ind, exact; + + QUIT; + + if (!STREQ (filename, s->filename)) + continue; + l = LINETABLE (s); + ind = find_line_in_linetable (l, line_num, symbols, nsyms, &exact); + if (ind >= 0) + { + if (exact) + { + best_index = ind; + best_linetable = l; + best_symtab = s; + goto done; + } + if (best == 0 || l->item[ind].line < best) + { + best = l->item[ind].line; + best_index = ind; + best_linetable = l; + best_symtab = s; + } + } + } + + if (best == 0) + error ("Line number not found in designated function."); + +done: + + sals.nelts = 1; + sals.sals = (struct symtab_and_line *) xmalloc (sizeof (sals.sals[0])); + + INIT_SAL (&sals.sals[0]); + + sals.sals[0].line = best_linetable->item[best_index].line; + sals.sals[0].pc = best_linetable->item[best_index].pc; + sals.sals[0].symtab = best_symtab; + + return sals; +} + +/* Return the index in LINETABLE of the best match for LINE_NUM whose + pc falls within one of the functions denoted by SYMBOLS[0..NSYMS-1]. + Set *EXACTP to the 1 if the match is exact, and 0 otherwise. */ +static int +find_line_in_linetable (struct linetable *linetable, int line_num, + struct symbol **symbols, int nsyms, int *exactp) +{ + int i, len, best_index, best; + + if (line_num <= 0 || linetable == NULL) + return -1; + + len = linetable->nitems; + for (i = 0, best_index = -1, best = 0; i < len; i += 1) + { + int k; + struct linetable_entry *item = &(linetable->item[i]); + + for (k = 0; k < nsyms; k += 1) + { + if (symbols[k] != NULL && SYMBOL_CLASS (symbols[k]) == LOC_BLOCK + && item->pc >= BLOCK_START (SYMBOL_BLOCK_VALUE (symbols[k])) + && item->pc < BLOCK_END (SYMBOL_BLOCK_VALUE (symbols[k]))) + goto candidate; + } + continue; + + candidate: + + if (item->line == line_num) + { + *exactp = 1; + return i; + } + + if (item->line > line_num && (best == 0 || item->line < best)) + { + best = item->line; + best_index = i; + } + } + + *exactp = 0; + return best_index; +} + +/* Find the smallest k >= LINE_NUM such that k is a line number in + LINETABLE, and k falls strictly within a named function that begins at + or before LINE_NUM. Return -1 if there is no such k. */ +static int +nearest_line_number_in_linetable (struct linetable *linetable, int line_num) +{ + int i, len, best; + + if (line_num <= 0 || linetable == NULL || linetable->nitems == 0) + return -1; + len = linetable->nitems; + + i = 0; + best = INT_MAX; + while (i < len) + { + int k; + struct linetable_entry *item = &(linetable->item[i]); + + if (item->line >= line_num && item->line < best) + { + char *func_name; + CORE_ADDR start, end; + + func_name = NULL; + find_pc_partial_function (item->pc, &func_name, &start, &end); + + if (func_name != NULL && item->pc < end) + { + if (item->line == line_num) + return line_num; + else + { + struct symbol *sym = + standard_lookup (func_name, VAR_NAMESPACE); + if (is_plausible_func_for_line (sym, line_num)) + best = item->line; + else + { + do + i += 1; + while (i < len && linetable->item[i].pc < end); + continue; + } + } + } + } + + i += 1; + } + + return (best == INT_MAX) ? -1 : best; +} + + +/* Return the next higher index, k, into LINETABLE such that k > IND, + entry k in LINETABLE has a line number equal to LINE_NUM, k + corresponds to a PC that is in a function different from that + corresponding to IND, and falls strictly within a named function + that begins at a line at or preceding STARTING_LINE. + Return -1 if there is no such k. + IND == -1 corresponds to no function. */ + +static int +find_next_line_in_linetable (struct linetable *linetable, int line_num, + int starting_line, int ind) +{ + int i, len; + + if (line_num <= 0 || linetable == NULL || ind >= linetable->nitems) + return -1; + len = linetable->nitems; + + if (ind >= 0) + { + CORE_ADDR start, end; + + if (find_pc_partial_function (linetable->item[ind].pc, + (char **) NULL, &start, &end)) + { + while (ind < len && linetable->item[ind].pc < end) + ind += 1; + } + else + ind += 1; + } + else + ind = 0; + + i = ind; + while (i < len) + { + int k; + struct linetable_entry *item = &(linetable->item[i]); + + if (item->line >= line_num) + { + char *func_name; + CORE_ADDR start, end; + + func_name = NULL; + find_pc_partial_function (item->pc, &func_name, &start, &end); + + if (func_name != NULL && item->pc < end) + { + if (item->line == line_num) + { + struct symbol *sym = + standard_lookup (func_name, VAR_NAMESPACE); + if (is_plausible_func_for_line (sym, starting_line)) + return i; + else + { + while ((i + 1) < len && linetable->item[i + 1].pc < end) + i += 1; + } + } + } + } + i += 1; + } + + return -1; +} + +/* True iff function symbol SYM starts somewhere at or before line # + LINE_NUM. */ +static int +is_plausible_func_for_line (struct symbol *sym, int line_num) +{ + struct symtab_and_line start_sal; + + if (sym == NULL) + return 0; + + start_sal = find_function_start_sal (sym, 0); + + return (start_sal.line != 0 && line_num >= start_sal.line); +} + +static void +debug_print_lines (struct linetable *lt) +{ + int i; + + if (lt == NULL) + return; + + fprintf (stderr, "\t"); + for (i = 0; i < lt->nitems; i += 1) + fprintf (stderr, "(%d->%p) ", lt->item[i].line, (void *) lt->item[i].pc); + fprintf (stderr, "\n"); +} + +static void +debug_print_block (struct block *b) +{ + int i; + struct symbol *i; + + fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]", + b, BLOCK_START (b), BLOCK_END (b)); + if (BLOCK_FUNCTION (b) != NULL) + fprintf (stderr, " Function: %s", SYMBOL_NAME (BLOCK_FUNCTION (b))); + fprintf (stderr, "\n"); + fprintf (stderr, "\t Superblock: %p\n", BLOCK_SUPERBLOCK (b)); + fprintf (stderr, "\t Symbols:"); + ALL_BLOCK_SYMBOLS (b, i, sym) + { + if (i > 0 && i % 4 == 0) + fprintf (stderr, "\n\t\t "); + fprintf (stderr, " %s", SYMBOL_NAME (sym)); + } + fprintf (stderr, "\n"); +} + +static void +debug_print_blocks (struct blockvector *bv) +{ + int i; + + if (bv == NULL) + return; + for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i += 1) + { + fprintf (stderr, "%6d. ", i); + debug_print_block (BLOCKVECTOR_BLOCK (bv, i)); + } +} + +static void +debug_print_symtab (struct symtab *s) +{ + fprintf (stderr, "Symtab %p\n File: %s; Dir: %s\n", s, + s->filename, s->dirname); + fprintf (stderr, " Blockvector: %p, Primary: %d\n", + BLOCKVECTOR (s), s->primary); + debug_print_blocks (BLOCKVECTOR (s)); + fprintf (stderr, " Line table: %p\n", LINETABLE (s)); + debug_print_lines (LINETABLE (s)); +} + +/* Read in all symbol tables corresponding to partial symbol tables + with file name FILENAME. */ +static void +read_all_symtabs (const char *filename) +{ + struct partial_symtab *ps; + struct objfile *objfile; + + ALL_PSYMTABS (objfile, ps) + { + QUIT; + + if (STREQ (filename, ps->filename)) + PSYMTAB_TO_SYMTAB (ps); + } +} + +/* All sals corresponding to line LINE_NUM in a symbol table from file + FILENAME, as filtered by the user. If CANONICAL is not null, set + it to a corresponding array of canonical line specs. */ +static struct symtabs_and_lines +all_sals_for_line (const char *filename, int line_num, char ***canonical) +{ + struct symtabs_and_lines result; + struct objfile *objfile; + struct symtab *s; + struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); + size_t len; + + read_all_symtabs (filename); + + result.sals = + (struct symtab_and_line *) xmalloc (4 * sizeof (result.sals[0])); + result.nelts = 0; + len = 4; + make_cleanup (free_current_contents, &result.sals); + + ALL_SYMTABS (objfile, s) + { + int ind, target_line_num; + + QUIT; + + if (!STREQ (s->filename, filename)) + continue; + + target_line_num = + nearest_line_number_in_linetable (LINETABLE (s), line_num); + if (target_line_num == -1) + continue; + + ind = -1; + while (1) + { + ind = + find_next_line_in_linetable (LINETABLE (s), + target_line_num, line_num, ind); + + if (ind < 0) + break; + + GROW_VECT (result.sals, len, result.nelts + 1); + INIT_SAL (&result.sals[result.nelts]); + result.sals[result.nelts].line = LINETABLE (s)->item[ind].line; + result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc; + result.sals[result.nelts].symtab = s; + result.nelts += 1; + } + } + + if (canonical != NULL || result.nelts > 1) + { + int k; + char **func_names = (char **) alloca (result.nelts * sizeof (char *)); + int first_choice = (result.nelts > 1) ? 2 : 1; + int n; + int *choices = (int *) alloca (result.nelts * sizeof (int)); + + for (k = 0; k < result.nelts; k += 1) + { + find_pc_partial_function (result.sals[k].pc, &func_names[k], + (CORE_ADDR *) NULL, (CORE_ADDR *) NULL); + if (func_names[k] == NULL) + error ("Could not find function for one or more breakpoints."); + } + + if (result.nelts > 1) + { + printf_unfiltered ("[0] cancel\n"); + if (result.nelts > 1) + printf_unfiltered ("[1] all\n"); + for (k = 0; k < result.nelts; k += 1) + printf_unfiltered ("[%d] %s\n", k + first_choice, + ada_demangle (func_names[k])); + + n = get_selections (choices, result.nelts, result.nelts, + result.nelts > 1, "instance-choice"); + + for (k = 0; k < n; k += 1) + { + result.sals[k] = result.sals[choices[k]]; + func_names[k] = func_names[choices[k]]; + } + result.nelts = n; + } + + if (canonical != NULL) + { + *canonical = (char **) xmalloc (result.nelts * sizeof (char **)); + make_cleanup (xfree, *canonical); + for (k = 0; k < result.nelts; k += 1) + { + (*canonical)[k] = + extended_canonical_line_spec (result.sals[k], func_names[k]); + if ((*canonical)[k] == NULL) + error ("Could not locate one or more breakpoints."); + make_cleanup (xfree, (*canonical)[k]); + } + } + } + + discard_cleanups (old_chain); + return result; +} + + +/* A canonical line specification of the form FILE:NAME:LINENUM for + symbol table and line data SAL. NULL if insufficient + information. The caller is responsible for releasing any space + allocated. */ + +static char * +extended_canonical_line_spec (struct symtab_and_line sal, const char *name) +{ + char *r; + + if (sal.symtab == NULL || sal.symtab->filename == NULL || sal.line <= 0) + return NULL; + + r = (char *) xmalloc (strlen (name) + strlen (sal.symtab->filename) + + sizeof (sal.line) * 3 + 3); + sprintf (r, "%s:'%s':%d", sal.symtab->filename, name, sal.line); + return r; +} + +#if 0 +int begin_bnum = -1; +#endif +int begin_annotate_level = 0; + +static void +begin_cleanup (void *dummy) +{ + begin_annotate_level = 0; +} + +static void +begin_command (char *args, int from_tty) +{ + struct minimal_symbol *msym; + CORE_ADDR main_program_name_addr; + char main_program_name[1024]; + struct cleanup *old_chain = make_cleanup (begin_cleanup, NULL); + begin_annotate_level = 2; + + /* Check that there is a program to debug */ + if (!have_full_symbols () && !have_partial_symbols ()) + error ("No symbol table is loaded. Use the \"file\" command."); + + /* Check that we are debugging an Ada program */ + /* if (ada_update_initial_language (language_unknown, NULL) != language_ada) + error ("Cannot find the Ada initialization procedure. Is this an Ada main program?"); + */ + /* FIXME: language_ada should be defined in defs.h */ + + /* Get the address of the name of the main procedure */ + msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL); + + if (msym != NULL) + { + main_program_name_addr = SYMBOL_VALUE_ADDRESS (msym); + if (main_program_name_addr == 0) + error ("Invalid address for Ada main program name."); + + /* Read the name of the main procedure */ + extract_string (main_program_name_addr, main_program_name); + + /* Put a temporary breakpoint in the Ada main program and run */ + do_command ("tbreak ", main_program_name, 0); + do_command ("run ", args, 0); + } + else + { + /* If we could not find the symbol containing the name of the + main program, that means that the compiler that was used to build + was not recent enough. In that case, we fallback to the previous + mechanism, which is a little bit less reliable, but has proved to work + in most cases. The only cases where it will fail is when the user + has set some breakpoints which will be hit before the end of the + begin command processing (eg in the initialization code). + + The begining of the main Ada subprogram is located by breaking + on the adainit procedure. Since we know that the binder generates + the call to this procedure exactly 2 calls before the call to the + Ada main subprogram, it is then easy to put a breakpoint on this + Ada main subprogram once we hit adainit. + */ + do_command ("tbreak adainit", 0); + do_command ("run ", args, 0); + do_command ("up", 0); + do_command ("tbreak +2", 0); + do_command ("continue", 0); + do_command ("step", 0); + } + + do_cleanups (old_chain); +} + +int +is_ada_runtime_file (char *filename) +{ + return (STREQN (filename, "s-", 2) || + STREQN (filename, "a-", 2) || + STREQN (filename, "g-", 2) || STREQN (filename, "i-", 2)); +} + +/* find the first frame that contains debugging information and that is not + part of the Ada run-time, starting from fi and moving upward. */ + +int +find_printable_frame (struct frame_info *fi, int level) +{ + struct symtab_and_line sal; + + for (; fi != NULL; level += 1, fi = get_prev_frame (fi)) + { + /* If fi is not the innermost frame, that normally means that fi->pc + points to *after* the call instruction, and we want to get the line + containing the call, never the next line. But if the next frame is + a signal_handler_caller or a dummy frame, then the next frame was + not entered as the result of a call, and we want to get the line + containing fi->pc. */ + sal = + find_pc_line (fi->pc, + fi->next != NULL + && !fi->next->signal_handler_caller + && !frame_in_dummy (fi->next)); + if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename)) + { +#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) + /* libpthread.so contains some debugging information that prevents us + from finding the right frame */ + + if (sal.symtab->objfile && + STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so")) + continue; +#endif + selected_frame = fi; + break; + } + } + + return level; +} + +void +ada_report_exception_break (struct breakpoint *b) +{ +#ifdef UI_OUT + /* FIXME: break_on_exception should be defined in breakpoint.h */ + /* if (b->break_on_exception == 1) + { + /* Assume that cond has 16 elements, the 15th + being the exception *//* + if (b->cond && b->cond->nelts == 16) + { + ui_out_text (uiout, "on "); + ui_out_field_string (uiout, "exception", + SYMBOL_NAME (b->cond->elts[14].symbol)); + } + else + ui_out_text (uiout, "on all exceptions"); + } + else if (b->break_on_exception == 2) + ui_out_text (uiout, "on unhandled exception"); + else if (b->break_on_exception == 3) + ui_out_text (uiout, "on assert failure"); + #else + if (b->break_on_exception == 1) + { */ + /* Assume that cond has 16 elements, the 15th + being the exception *//* + if (b->cond && b->cond->nelts == 16) + { + fputs_filtered ("on ", gdb_stdout); + fputs_filtered (SYMBOL_NAME + (b->cond->elts[14].symbol), gdb_stdout); + } + else + fputs_filtered ("on all exceptions", gdb_stdout); + } + else if (b->break_on_exception == 2) + fputs_filtered ("on unhandled exception", gdb_stdout); + else if (b->break_on_exception == 3) + fputs_filtered ("on assert failure", gdb_stdout); + */ +#endif +} + +int +ada_is_exception_sym (struct symbol *sym) +{ + char *type_name = type_name_no_tag (SYMBOL_TYPE (sym)); + + return (SYMBOL_CLASS (sym) != LOC_TYPEDEF + && SYMBOL_CLASS (sym) != LOC_BLOCK + && SYMBOL_CLASS (sym) != LOC_CONST + && type_name != NULL && STREQ (type_name, "exception")); +} + +int +ada_maybe_exception_partial_symbol (struct partial_symbol *sym) +{ + return (SYMBOL_CLASS (sym) != LOC_TYPEDEF + && SYMBOL_CLASS (sym) != LOC_BLOCK + && SYMBOL_CLASS (sym) != LOC_CONST); +} + +/* If ARG points to an Ada exception or assert breakpoint, rewrite + into equivalent form. Return resulting argument string. Set + *BREAK_ON_EXCEPTIONP to 1 for ordinary break on exception, 2 for + break on unhandled, 3 for assert, 0 otherwise. */ +char * +ada_breakpoint_rewrite (char *arg, int *break_on_exceptionp) +{ + if (arg == NULL) + return arg; + *break_on_exceptionp = 0; + /* FIXME: language_ada should be defined in defs.h */ + /* if (current_language->la_language == language_ada + && STREQN (arg, "exception", 9) && + (arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0')) + { + char *tok, *end_tok; + int toklen; + + *break_on_exceptionp = 1; + + tok = arg+9; + while (*tok == ' ' || *tok == '\t') + tok += 1; + + end_tok = tok; + + while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000') + end_tok += 1; + + toklen = end_tok - tok; + + arg = (char*) xmalloc (sizeof ("__gnat_raise_nodefer_with_msg if " + "long_integer(e) = long_integer(&)") + + toklen + 1); + make_cleanup (xfree, arg); + if (toklen == 0) + strcpy (arg, "__gnat_raise_nodefer_with_msg"); + else if (STREQN (tok, "unhandled", toklen)) + { + *break_on_exceptionp = 2; + strcpy (arg, "__gnat_unhandled_exception"); + } + else + { + sprintf (arg, "__gnat_raise_nodefer_with_msg if " + "long_integer(e) = long_integer(&%.*s)", + toklen, tok); + } + } + else if (current_language->la_language == language_ada + && STREQN (arg, "assert", 6) && + (arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0')) + { + char *tok = arg + 6; + + *break_on_exceptionp = 3; + + arg = (char*) + xmalloc (sizeof ("system__assertions__raise_assert_failure") + + strlen (tok) + 1); + make_cleanup (xfree, arg); + sprintf (arg, "system__assertions__raise_assert_failure%s", tok); + } + */ + return arg; +} + + + /* Field Access */ + +/* True if field number FIELD_NUM in struct or union type TYPE is supposed + to be invisible to users. */ + +int +ada_is_ignored_field (struct type *type, int field_num) +{ + if (field_num < 0 || field_num > TYPE_NFIELDS (type)) + return 1; + else + { + const char *name = TYPE_FIELD_NAME (type, field_num); + return (name == NULL + || (name[0] == '_' && !STREQN (name, "_parent", 7))); + } +} + +/* True iff structure type TYPE has a tag field. */ + +int +ada_is_tagged_type (struct type *type) +{ + if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT) + return 0; + + return (ada_lookup_struct_elt_type (type, "_tag", 1, NULL) != NULL); +} + +/* The type of the tag on VAL. */ + +struct type * +ada_tag_type (struct value *val) +{ + return ada_lookup_struct_elt_type (VALUE_TYPE (val), "_tag", 0, NULL); +} + +/* The value of the tag on VAL. */ + +struct value * +ada_value_tag (struct value *val) +{ + return ada_value_struct_elt (val, "_tag", "record"); +} + +/* The parent type of TYPE, or NULL if none. */ + +struct type * +ada_parent_type (struct type *type) +{ + int i; + + CHECK_TYPEDEF (type); + + if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT) + return NULL; + + for (i = 0; i < TYPE_NFIELDS (type); i += 1) + if (ada_is_parent_field (type, i)) + return check_typedef (TYPE_FIELD_TYPE (type, i)); + + return NULL; +} + +/* True iff field number FIELD_NUM of structure type TYPE contains the + parent-type (inherited) fields of a derived type. Assumes TYPE is + a structure type with at least FIELD_NUM+1 fields. */ + +int +ada_is_parent_field (struct type *type, int field_num) +{ + const char *name = TYPE_FIELD_NAME (check_typedef (type), field_num); + return (name != NULL && + (STREQN (name, "PARENT", 6) || STREQN (name, "_parent", 7))); +} + +/* True iff field number FIELD_NUM of structure type TYPE is a + transparent wrapper field (which should be silently traversed when doing + field selection and flattened when printing). Assumes TYPE is a + structure type with at least FIELD_NUM+1 fields. Such fields are always + structures. */ + +int +ada_is_wrapper_field (struct type *type, int field_num) +{ + const char *name = TYPE_FIELD_NAME (type, field_num); + return (name != NULL + && (STREQN (name, "PARENT", 6) || STREQ (name, "REP") + || STREQN (name, "_parent", 7) + || name[0] == 'S' || name[0] == 'R' || name[0] == 'O')); +} + +/* True iff field number FIELD_NUM of structure or union type TYPE + is a variant wrapper. Assumes TYPE is a structure type with at least + FIELD_NUM+1 fields. */ + +int +ada_is_variant_part (struct type *type, int field_num) +{ + struct type *field_type = TYPE_FIELD_TYPE (type, field_num); + return (TYPE_CODE (field_type) == TYPE_CODE_UNION + || (is_dynamic_field (type, field_num) + && TYPE_CODE (TYPE_TARGET_TYPE (field_type)) == + TYPE_CODE_UNION)); +} + +/* Assuming that VAR_TYPE is a variant wrapper (type of the variant part) + whose discriminants are contained in the record type OUTER_TYPE, + returns the type of the controlling discriminant for the variant. */ + +struct type * +ada_variant_discrim_type (struct type *var_type, struct type *outer_type) +{ + char *name = ada_variant_discrim_name (var_type); + struct type *type = ada_lookup_struct_elt_type (outer_type, name, 1, NULL); + if (type == NULL) + return builtin_type_int; + else + return type; +} + +/* Assuming that TYPE is the type of a variant wrapper, and FIELD_NUM is a + valid field number within it, returns 1 iff field FIELD_NUM of TYPE + represents a 'when others' clause; otherwise 0. */ + +int +ada_is_others_clause (struct type *type, int field_num) +{ + const char *name = TYPE_FIELD_NAME (type, field_num); + return (name != NULL && name[0] == 'O'); +} + +/* Assuming that TYPE0 is the type of the variant part of a record, + returns the name of the discriminant controlling the variant. The + value is valid until the next call to ada_variant_discrim_name. */ + +char * +ada_variant_discrim_name (struct type *type0) +{ + static char *result = NULL; + static size_t result_len = 0; + struct type *type; + const char *name; + const char *discrim_end; + const char *discrim_start; + + if (TYPE_CODE (type0) == TYPE_CODE_PTR) + type = TYPE_TARGET_TYPE (type0); + else + type = type0; + + name = ada_type_name (type); + + if (name == NULL || name[0] == '\000') + return ""; + + for (discrim_end = name + strlen (name) - 6; discrim_end != name; + discrim_end -= 1) + { + if (STREQN (discrim_end, "___XVN", 6)) + break; + } + if (discrim_end == name) + return ""; + + for (discrim_start = discrim_end; discrim_start != name + 3; + discrim_start -= 1) + { + if (discrim_start == name + 1) + return ""; + if ((discrim_start > name + 3 && STREQN (discrim_start - 3, "___", 3)) + || discrim_start[-1] == '.') + break; + } + + GROW_VECT (result, result_len, discrim_end - discrim_start + 1); + strncpy (result, discrim_start, discrim_end - discrim_start); + result[discrim_end - discrim_start] = '\0'; + return result; +} + +/* Scan STR for a subtype-encoded number, beginning at position K. Put the + position of the character just past the number scanned in *NEW_K, + if NEW_K!=NULL. Put the scanned number in *R, if R!=NULL. Return 1 + if there was a valid number at the given position, and 0 otherwise. A + "subtype-encoded" number consists of the absolute value in decimal, + followed by the letter 'm' to indicate a negative number. Assumes 0m + does not occur. */ + +int +ada_scan_number (const char str[], int k, LONGEST * R, int *new_k) +{ + ULONGEST RU; + + if (!isdigit (str[k])) + return 0; + + /* Do it the hard way so as not to make any assumption about + the relationship of unsigned long (%lu scan format code) and + LONGEST. */ + RU = 0; + while (isdigit (str[k])) + { + RU = RU * 10 + (str[k] - '0'); + k += 1; + } + + if (str[k] == 'm') + { + if (R != NULL) + *R = (-(LONGEST) (RU - 1)) - 1; + k += 1; + } + else if (R != NULL) + *R = (LONGEST) RU; + + /* NOTE on the above: Technically, C does not say what the results of + - (LONGEST) RU or (LONGEST) -RU are for RU == largest positive + number representable as a LONGEST (although either would probably work + in most implementations). When RU>0, the locution in the then branch + above is always equivalent to the negative of RU. */ + + if (new_k != NULL) + *new_k = k; + return 1; +} + +/* Assuming that TYPE is a variant part wrapper type (a VARIANTS field), + and FIELD_NUM is a valid field number within it, returns 1 iff VAL is + in the range encoded by field FIELD_NUM of TYPE; otherwise 0. */ + +int +ada_in_variant (LONGEST val, struct type *type, int field_num) +{ + const char *name = TYPE_FIELD_NAME (type, field_num); + int p; + + p = 0; + while (1) + { + switch (name[p]) + { + case '\0': + return 0; + case 'S': + { + LONGEST W; + if (!ada_scan_number (name, p + 1, &W, &p)) + return 0; + if (val == W) + return 1; + break; + } + case 'R': + { + LONGEST L, U; + if (!ada_scan_number (name, p + 1, &L, &p) + || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p)) + return 0; + if (val >= L && val <= U) + return 1; + break; + } + case 'O': + return 1; + default: + return 0; + } + } +} + +/* Given a value ARG1 (offset by OFFSET bytes) + of a struct or union type ARG_TYPE, + extract and return the value of one of its (non-static) fields. + FIELDNO says which field. Differs from value_primitive_field only + in that it can handle packed values of arbitrary type. */ + +struct value * +ada_value_primitive_field (struct value *arg1, int offset, int fieldno, + struct type *arg_type) +{ + struct value *v; + struct type *type; + + CHECK_TYPEDEF (arg_type); + type = TYPE_FIELD_TYPE (arg_type, fieldno); + + /* Handle packed fields */ + + if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) + { + int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); + int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); + + return ada_value_primitive_packed_val (arg1, VALUE_CONTENTS (arg1), + offset + bit_pos / 8, + bit_pos % 8, bit_size, type); + } + else + return value_primitive_field (arg1, offset, fieldno, arg_type); +} + + +/* Look for a field NAME in ARG. Adjust the address of ARG by OFFSET bytes, + and search in it assuming it has (class) type TYPE. + If found, return value, else return NULL. + + Searches recursively through wrapper fields (e.g., '_parent'). */ + +struct value * +ada_search_struct_field (char *name, struct value *arg, int offset, + struct type *type) +{ + int i; + CHECK_TYPEDEF (type); + + for (i = TYPE_NFIELDS (type) - 1; i >= 0; i -= 1) + { + char *t_field_name = TYPE_FIELD_NAME (type, i); + + if (t_field_name == NULL) + continue; + + else if (field_name_match (t_field_name, name)) + return ada_value_primitive_field (arg, offset, i, type); + + else if (ada_is_wrapper_field (type, i)) + { + struct value *v = ada_search_struct_field (name, arg, + offset + + TYPE_FIELD_BITPOS (type, + i) / + 8, + TYPE_FIELD_TYPE (type, + i)); + if (v != NULL) + return v; + } + + else if (ada_is_variant_part (type, i)) + { + int j; + struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); + int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; + + for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1) + { + struct value *v = ada_search_struct_field (name, arg, + var_offset + + + TYPE_FIELD_BITPOS + (field_type, j) / 8, + TYPE_FIELD_TYPE + (field_type, j)); + if (v != NULL) + return v; + } + } + } + return NULL; +} + +/* Given ARG, a value of type (pointer to a)* structure/union, + extract the component named NAME from the ultimate target structure/union + and return it as a value with its appropriate type. + + The routine searches for NAME among all members of the structure itself + and (recursively) among all members of any wrapper members + (e.g., '_parent'). + + ERR is a name (for use in error messages) that identifies the class + of entity that ARG is supposed to be. */ + +struct value * +ada_value_struct_elt (struct value *arg, char *name, char *err) +{ + struct type *t; + struct value *v; + + arg = ada_coerce_ref (arg); + t = check_typedef (VALUE_TYPE (arg)); + + /* Follow pointers until we get to a non-pointer. */ + + while (TYPE_CODE (t) == TYPE_CODE_PTR || TYPE_CODE (t) == TYPE_CODE_REF) + { + arg = ada_value_ind (arg); + t = check_typedef (VALUE_TYPE (arg)); + } + + if (TYPE_CODE (t) != TYPE_CODE_STRUCT && TYPE_CODE (t) != TYPE_CODE_UNION) + error ("Attempt to extract a component of a value that is not a %s.", + err); + + v = ada_search_struct_field (name, arg, 0, t); + if (v == NULL) + error ("There is no member named %s.", name); + + return v; +} + +/* Given a type TYPE, look up the type of the component of type named NAME. + If DISPP is non-null, add its byte displacement from the beginning of a + structure (pointed to by a value) of type TYPE to *DISPP (does not + work for packed fields). + + Matches any field whose name has NAME as a prefix, possibly + followed by "___". + + TYPE can be either a struct or union, or a pointer or reference to + a struct or union. If it is a pointer or reference, its target + type is automatically used. + + Looks recursively into variant clauses and parent types. + + If NOERR is nonzero, return NULL if NAME is not suitably defined. */ + +struct type * +ada_lookup_struct_elt_type (struct type *type, char *name, int noerr, + int *dispp) +{ + int i; + + if (name == NULL) + goto BadName; + + while (1) + { + CHECK_TYPEDEF (type); + if (TYPE_CODE (type) != TYPE_CODE_PTR + && TYPE_CODE (type) != TYPE_CODE_REF) + break; + type = TYPE_TARGET_TYPE (type); + } + + if (TYPE_CODE (type) != TYPE_CODE_STRUCT && + TYPE_CODE (type) != TYPE_CODE_UNION) + { + target_terminal_ours (); + gdb_flush (gdb_stdout); + fprintf_unfiltered (gdb_stderr, "Type "); + type_print (type, "", gdb_stderr, -1); + error (" is not a structure or union type"); + } + + type = to_static_fixed_type (type); + + for (i = 0; i < TYPE_NFIELDS (type); i += 1) + { + char *t_field_name = TYPE_FIELD_NAME (type, i); + struct type *t; + int disp; + + if (t_field_name == NULL) + continue; + + else if (field_name_match (t_field_name, name)) + { + if (dispp != NULL) + *dispp += TYPE_FIELD_BITPOS (type, i) / 8; + return check_typedef (TYPE_FIELD_TYPE (type, i)); + } + + else if (ada_is_wrapper_field (type, i)) + { + disp = 0; + t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (type, i), name, + 1, &disp); + if (t != NULL) + { + if (dispp != NULL) + *dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8; + return t; + } + } + + else if (ada_is_variant_part (type, i)) + { + int j; + struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); + + for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1) + { + disp = 0; + t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (field_type, j), + name, 1, &disp); + if (t != NULL) + { + if (dispp != NULL) + *dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8; + return t; + } + } + } + + } + +BadName: + if (!noerr) + { + target_terminal_ours (); + gdb_flush (gdb_stdout); + fprintf_unfiltered (gdb_stderr, "Type "); + type_print (type, "", gdb_stderr, -1); + fprintf_unfiltered (gdb_stderr, " has no component named "); + error ("%s", name == NULL ? "" : name); + } + + return NULL; +} + +/* Assuming that VAR_TYPE is the type of a variant part of a record (a union), + within a value of type OUTER_TYPE that is stored in GDB at + OUTER_VALADDR, determine which variant clause (field number in VAR_TYPE, + numbering from 0) is applicable. Returns -1 if none are. */ + +int +ada_which_variant_applies (struct type *var_type, struct type *outer_type, + char *outer_valaddr) +{ + int others_clause; + int i; + int disp; + struct type *discrim_type; + char *discrim_name = ada_variant_discrim_name (var_type); + LONGEST discrim_val; + + disp = 0; + discrim_type = + ada_lookup_struct_elt_type (outer_type, discrim_name, 1, &disp); + if (discrim_type == NULL) + return -1; + discrim_val = unpack_long (discrim_type, outer_valaddr + disp); + + others_clause = -1; + for (i = 0; i < TYPE_NFIELDS (var_type); i += 1) + { + if (ada_is_others_clause (var_type, i)) + others_clause = i; + else if (ada_in_variant (discrim_val, var_type, i)) + return i; + } + + return others_clause; +} + + + + /* Dynamic-Sized Records */ + +/* Strategy: The type ostensibly attached to a value with dynamic size + (i.e., a size that is not statically recorded in the debugging + data) does not accurately reflect the size or layout of the value. + Our strategy is to convert these values to values with accurate, + conventional types that are constructed on the fly. */ + +/* There is a subtle and tricky problem here. In general, we cannot + determine the size of dynamic records without its data. However, + the 'struct value' data structure, which GDB uses to represent + quantities in the inferior process (the target), requires the size + of the type at the time of its allocation in order to reserve space + for GDB's internal copy of the data. That's why the + 'to_fixed_xxx_type' routines take (target) addresses as parameters, + rather than struct value*s. + + However, GDB's internal history variables ($1, $2, etc.) are + struct value*s containing internal copies of the data that are not, in + general, the same as the data at their corresponding addresses in + the target. Fortunately, the types we give to these values are all + conventional, fixed-size types (as per the strategy described + above), so that we don't usually have to perform the + 'to_fixed_xxx_type' conversions to look at their values. + Unfortunately, there is one exception: if one of the internal + history variables is an array whose elements are unconstrained + records, then we will need to create distinct fixed types for each + element selected. */ + +/* The upshot of all of this is that many routines take a (type, host + address, target address) triple as arguments to represent a value. + The host address, if non-null, is supposed to contain an internal + copy of the relevant data; otherwise, the program is to consult the + target at the target address. */ + +/* Assuming that VAL0 represents a pointer value, the result of + dereferencing it. Differs from value_ind in its treatment of + dynamic-sized types. */ + +struct value * +ada_value_ind (struct value *val0) +{ + struct value *val = unwrap_value (value_ind (val0)); + return ada_to_fixed_value (VALUE_TYPE (val), 0, + VALUE_ADDRESS (val) + VALUE_OFFSET (val), val); +} + +/* The value resulting from dereferencing any "reference to" + * qualifiers on VAL0. */ +static struct value * +ada_coerce_ref (struct value *val0) +{ + if (TYPE_CODE (VALUE_TYPE (val0)) == TYPE_CODE_REF) + { + struct value *val = val0; + COERCE_REF (val); + val = unwrap_value (val); + return ada_to_fixed_value (VALUE_TYPE (val), 0, + VALUE_ADDRESS (val) + VALUE_OFFSET (val), + val); + } + else + return val0; +} + +/* Return OFF rounded upward if necessary to a multiple of + ALIGNMENT (a power of 2). */ + +static unsigned int +align_value (unsigned int off, unsigned int alignment) +{ + return (off + alignment - 1) & ~(alignment - 1); +} + +/* Return the additional bit offset required by field F of template + type TYPE. */ + +static unsigned int +field_offset (struct type *type, int f) +{ + int n = TYPE_FIELD_BITPOS (type, f); + /* Kludge (temporary?) to fix problem with dwarf output. */ + if (n < 0) + return (unsigned int) n & 0xffff; + else + return n; +} + + +/* Return the bit alignment required for field #F of template type TYPE. */ + +static unsigned int +field_alignment (struct type *type, int f) +{ + const char *name = TYPE_FIELD_NAME (type, f); + int len = (name == NULL) ? 0 : strlen (name); + int align_offset; + + if (len < 8 || !isdigit (name[len - 1])) + return TARGET_CHAR_BIT; + + if (isdigit (name[len - 2])) + align_offset = len - 2; + else + align_offset = len - 1; + + if (align_offset < 7 || !STREQN ("___XV", name + align_offset - 6, 5)) + return TARGET_CHAR_BIT; + + return atoi (name + align_offset) * TARGET_CHAR_BIT; +} + +/* Find a type named NAME. Ignores ambiguity. */ +struct type * +ada_find_any_type (const char *name) +{ + struct symbol *sym; + + sym = standard_lookup (name, VAR_NAMESPACE); + if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF) + return SYMBOL_TYPE (sym); + + sym = standard_lookup (name, STRUCT_NAMESPACE); + if (sym != NULL) + return SYMBOL_TYPE (sym); + + return NULL; +} + +/* Because of GNAT encoding conventions, several GDB symbols may match a + given type name. If the type denoted by TYPE0 is to be preferred to + that of TYPE1 for purposes of type printing, return non-zero; + otherwise return 0. */ +int +ada_prefer_type (struct type *type0, struct type *type1) +{ + if (type1 == NULL) + return 1; + else if (type0 == NULL) + return 0; + else if (TYPE_CODE (type1) == TYPE_CODE_VOID) + return 1; + else if (TYPE_CODE (type0) == TYPE_CODE_VOID) + return 0; + else if (ada_is_packed_array_type (type0)) + return 1; + else if (ada_is_array_descriptor (type0) + && !ada_is_array_descriptor (type1)) + return 1; + else if (ada_renaming_type (type0) != NULL + && ada_renaming_type (type1) == NULL) + return 1; + return 0; +} + +/* The name of TYPE, which is either its TYPE_NAME, or, if that is + null, its TYPE_TAG_NAME. Null if TYPE is null. */ +char * +ada_type_name (struct type *type) +{ + if (type == NULL) + return NULL; + else if (TYPE_NAME (type) != NULL) + return TYPE_NAME (type); + else + return TYPE_TAG_NAME (type); +} + +/* Find a parallel type to TYPE whose name is formed by appending + SUFFIX to the name of TYPE. */ + +struct type * +ada_find_parallel_type (struct type *type, const char *suffix) +{ + static char *name; + static size_t name_len = 0; + struct symbol **syms; + struct block **blocks; + int nsyms; + int len; + char *typename = ada_type_name (type); + + if (typename == NULL) + return NULL; + + len = strlen (typename); + + GROW_VECT (name, name_len, len + strlen (suffix) + 1); + + strcpy (name, typename); + strcpy (name + len, suffix); + + return ada_find_any_type (name); +} + + +/* If TYPE is a variable-size record type, return the corresponding template + type describing its fields. Otherwise, return NULL. */ + +static struct type * +dynamic_template_type (struct type *type) +{ + CHECK_TYPEDEF (type); + + if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT + || ada_type_name (type) == NULL) + return NULL; + else + { + int len = strlen (ada_type_name (type)); + if (len > 6 && STREQ (ada_type_name (type) + len - 6, "___XVE")) + return type; + else + return ada_find_parallel_type (type, "___XVE"); + } +} + +/* Assuming that TEMPL_TYPE is a union or struct type, returns + non-zero iff field FIELD_NUM of TEMPL_TYPE has dynamic size. */ + +static int +is_dynamic_field (struct type *templ_type, int field_num) +{ + const char *name = TYPE_FIELD_NAME (templ_type, field_num); + return name != NULL + && TYPE_CODE (TYPE_FIELD_TYPE (templ_type, field_num)) == TYPE_CODE_PTR + && strstr (name, "___XVL") != NULL; +} + +/* Assuming that TYPE is a struct type, returns non-zero iff TYPE + contains a variant part. */ + +static int +contains_variant_part (struct type *type) +{ + int f; + + if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT + || TYPE_NFIELDS (type) <= 0) + return 0; + return ada_is_variant_part (type, TYPE_NFIELDS (type) - 1); +} + +/* A record type with no fields, . */ +static struct type * +empty_record (struct objfile *objfile) +{ + struct type *type = alloc_type (objfile); + TYPE_CODE (type) = TYPE_CODE_STRUCT; + TYPE_NFIELDS (type) = 0; + TYPE_FIELDS (type) = NULL; + TYPE_NAME (type) = ""; + TYPE_TAG_NAME (type) = NULL; + TYPE_FLAGS (type) = 0; + TYPE_LENGTH (type) = 0; + return type; +} + +/* An ordinary record type (with fixed-length fields) that describes + the value of type TYPE at VALADDR or ADDRESS (see comments at + the beginning of this section) VAL according to GNAT conventions. + DVAL0 should describe the (portion of a) record that contains any + necessary discriminants. It should be NULL if VALUE_TYPE (VAL) is + an outer-level type (i.e., as opposed to a branch of a variant.) A + variant field (unless unchecked) is replaced by a particular branch + of the variant. */ +/* NOTE: Limitations: For now, we assume that dynamic fields and + * variants occupy whole numbers of bytes. However, they need not be + * byte-aligned. */ + +static struct type * +template_to_fixed_record_type (struct type *type, char *valaddr, + CORE_ADDR address, struct value *dval0) +{ + struct value *mark = value_mark (); + struct value *dval; + struct type *rtype; + int nfields, bit_len; + long off; + int f; + + nfields = TYPE_NFIELDS (type); + rtype = alloc_type (TYPE_OBJFILE (type)); + TYPE_CODE (rtype) = TYPE_CODE_STRUCT; + INIT_CPLUS_SPECIFIC (rtype); + TYPE_NFIELDS (rtype) = nfields; + TYPE_FIELDS (rtype) = (struct field *) + TYPE_ALLOC (rtype, nfields * sizeof (struct field)); + memset (TYPE_FIELDS (rtype), 0, sizeof (struct field) * nfields); + TYPE_NAME (rtype) = ada_type_name (type); + TYPE_TAG_NAME (rtype) = NULL; + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in + gdbtypes.h */ + /* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */ + + off = 0; + bit_len = 0; + for (f = 0; f < nfields; f += 1) + { + int fld_bit_len, bit_incr; + off = + align_value (off, + field_alignment (type, f)) + TYPE_FIELD_BITPOS (type, f); + /* NOTE: used to use field_offset above, but that causes + * problems with really negative bit positions. So, let's + * rediscover why we needed field_offset and fix it properly. */ + TYPE_FIELD_BITPOS (rtype, f) = off; + TYPE_FIELD_BITSIZE (rtype, f) = 0; + + if (ada_is_variant_part (type, f)) + { + struct type *branch_type; + + if (dval0 == NULL) + dval = value_from_contents_and_address (rtype, valaddr, address); + else + dval = dval0; + + branch_type = + to_fixed_variant_branch_type + (TYPE_FIELD_TYPE (type, f), + cond_offset_host (valaddr, off / TARGET_CHAR_BIT), + cond_offset_target (address, off / TARGET_CHAR_BIT), dval); + if (branch_type == NULL) + TYPE_NFIELDS (rtype) -= 1; + else + { + TYPE_FIELD_TYPE (rtype, f) = branch_type; + TYPE_FIELD_NAME (rtype, f) = "S"; + } + bit_incr = 0; + fld_bit_len = + TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, f)) * TARGET_CHAR_BIT; + } + else if (is_dynamic_field (type, f)) + { + if (dval0 == NULL) + dval = value_from_contents_and_address (rtype, valaddr, address); + else + dval = dval0; + + TYPE_FIELD_TYPE (rtype, f) = + ada_to_fixed_type + (ada_get_base_type + (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, f))), + cond_offset_host (valaddr, off / TARGET_CHAR_BIT), + cond_offset_target (address, off / TARGET_CHAR_BIT), dval); + TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f); + bit_incr = fld_bit_len = + TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, f)) * TARGET_CHAR_BIT; + } + else + { + TYPE_FIELD_TYPE (rtype, f) = TYPE_FIELD_TYPE (type, f); + TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f); + if (TYPE_FIELD_BITSIZE (type, f) > 0) + bit_incr = fld_bit_len = + TYPE_FIELD_BITSIZE (rtype, f) = TYPE_FIELD_BITSIZE (type, f); + else + bit_incr = fld_bit_len = + TYPE_LENGTH (TYPE_FIELD_TYPE (type, f)) * TARGET_CHAR_BIT; + } + if (off + fld_bit_len > bit_len) + bit_len = off + fld_bit_len; + off += bit_incr; + TYPE_LENGTH (rtype) = bit_len / TARGET_CHAR_BIT; + } + TYPE_LENGTH (rtype) = align_value (TYPE_LENGTH (rtype), TYPE_LENGTH (type)); + + value_free_to_mark (mark); + if (TYPE_LENGTH (rtype) > varsize_limit) + error ("record type with dynamic size is larger than varsize-limit"); + return rtype; +} + +/* As for template_to_fixed_record_type, but uses no run-time values. + As a result, this type can only be approximate, but that's OK, + since it is used only for type determinations. Works on both + structs and unions. + Representation note: to save space, we memoize the result of this + function in the TYPE_TARGET_TYPE of the template type. */ + +static struct type * +template_to_static_fixed_type (struct type *templ_type) +{ + struct type *type; + int nfields; + int f; + + if (TYPE_TARGET_TYPE (templ_type) != NULL) + return TYPE_TARGET_TYPE (templ_type); + + nfields = TYPE_NFIELDS (templ_type); + TYPE_TARGET_TYPE (templ_type) = type = + alloc_type (TYPE_OBJFILE (templ_type)); + TYPE_CODE (type) = TYPE_CODE (templ_type); + INIT_CPLUS_SPECIFIC (type); + TYPE_NFIELDS (type) = nfields; + TYPE_FIELDS (type) = (struct field *) + TYPE_ALLOC (type, nfields * sizeof (struct field)); + memset (TYPE_FIELDS (type), 0, sizeof (struct field) * nfields); + TYPE_NAME (type) = ada_type_name (templ_type); + TYPE_TAG_NAME (type) = NULL; + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* TYPE_FLAGS (type) |= TYPE_FLAG_FIXED_INSTANCE; */ + TYPE_LENGTH (type) = 0; + + for (f = 0; f < nfields; f += 1) + { + TYPE_FIELD_BITPOS (type, f) = 0; + TYPE_FIELD_BITSIZE (type, f) = 0; + + if (is_dynamic_field (templ_type, f)) + { + TYPE_FIELD_TYPE (type, f) = + to_static_fixed_type (TYPE_TARGET_TYPE + (TYPE_FIELD_TYPE (templ_type, f))); + TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f); + } + else + { + TYPE_FIELD_TYPE (type, f) = + check_typedef (TYPE_FIELD_TYPE (templ_type, f)); + TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f); + } + } + + return type; +} + +/* A revision of TYPE0 -- a non-dynamic-sized record with a variant + part -- in which the variant part is replaced with the appropriate + branch. */ +static struct type * +to_record_with_fixed_variant_part (struct type *type, char *valaddr, + CORE_ADDR address, struct value *dval) +{ + struct value *mark = value_mark (); + struct type *rtype; + struct type *branch_type; + int nfields = TYPE_NFIELDS (type); + + if (dval == NULL) + return type; + + rtype = alloc_type (TYPE_OBJFILE (type)); + TYPE_CODE (rtype) = TYPE_CODE_STRUCT; + INIT_CPLUS_SPECIFIC (type); + TYPE_NFIELDS (rtype) = TYPE_NFIELDS (type); + TYPE_FIELDS (rtype) = + (struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field)); + memcpy (TYPE_FIELDS (rtype), TYPE_FIELDS (type), + sizeof (struct field) * nfields); + TYPE_NAME (rtype) = ada_type_name (type); + TYPE_TAG_NAME (rtype) = NULL; + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */ + TYPE_LENGTH (rtype) = TYPE_LENGTH (type); + + branch_type = + to_fixed_variant_branch_type + (TYPE_FIELD_TYPE (type, nfields - 1), + cond_offset_host (valaddr, + TYPE_FIELD_BITPOS (type, + nfields - 1) / TARGET_CHAR_BIT), + cond_offset_target (address, + TYPE_FIELD_BITPOS (type, + nfields - 1) / TARGET_CHAR_BIT), + dval); + if (branch_type == NULL) + { + TYPE_NFIELDS (rtype) -= 1; + TYPE_LENGTH (rtype) -= + TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1)); + } + else + { + TYPE_FIELD_TYPE (rtype, nfields - 1) = branch_type; + TYPE_FIELD_NAME (rtype, nfields - 1) = "S"; + TYPE_FIELD_BITSIZE (rtype, nfields - 1) = 0; + TYPE_LENGTH (rtype) += TYPE_LENGTH (branch_type); + -TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1)); + } + + return rtype; +} + +/* An ordinary record type (with fixed-length fields) that describes + the value at (TYPE0, VALADDR, ADDRESS) [see explanation at + beginning of this section]. Any necessary discriminants' values + should be in DVAL, a record value; it should be NULL if the object + at ADDR itself contains any necessary discriminant values. A + variant field (unless unchecked) is replaced by a particular branch + of the variant. */ + +static struct type * +to_fixed_record_type (struct type *type0, char *valaddr, CORE_ADDR address, + struct value *dval) +{ + struct type *templ_type; + + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE) + return type0; + */ + templ_type = dynamic_template_type (type0); + + if (templ_type != NULL) + return template_to_fixed_record_type (templ_type, valaddr, address, dval); + else if (contains_variant_part (type0)) + return to_record_with_fixed_variant_part (type0, valaddr, address, dval); + else + { + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* TYPE_FLAGS (type0) |= TYPE_FLAG_FIXED_INSTANCE; */ + return type0; + } + +} + +/* An ordinary record type (with fixed-length fields) that describes + the value at (VAR_TYPE0, VALADDR, ADDRESS), where VAR_TYPE0 is a + union type. Any necessary discriminants' values should be in DVAL, + a record value. That is, this routine selects the appropriate + branch of the union at ADDR according to the discriminant value + indicated in the union's type name. */ + +static struct type * +to_fixed_variant_branch_type (struct type *var_type0, char *valaddr, + CORE_ADDR address, struct value *dval) +{ + int which; + struct type *templ_type; + struct type *var_type; + + if (TYPE_CODE (var_type0) == TYPE_CODE_PTR) + var_type = TYPE_TARGET_TYPE (var_type0); + else + var_type = var_type0; + + templ_type = ada_find_parallel_type (var_type, "___XVU"); + + if (templ_type != NULL) + var_type = templ_type; + + which = + ada_which_variant_applies (var_type, + VALUE_TYPE (dval), VALUE_CONTENTS (dval)); + + if (which < 0) + return empty_record (TYPE_OBJFILE (var_type)); + else if (is_dynamic_field (var_type, which)) + return + to_fixed_record_type + (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (var_type, which)), + valaddr, address, dval); + else if (contains_variant_part (TYPE_FIELD_TYPE (var_type, which))) + return + to_fixed_record_type + (TYPE_FIELD_TYPE (var_type, which), valaddr, address, dval); + else + return TYPE_FIELD_TYPE (var_type, which); +} + +/* Assuming that TYPE0 is an array type describing the type of a value + at ADDR, and that DVAL describes a record containing any + discriminants used in TYPE0, returns a type for the value that + contains no dynamic components (that is, no components whose sizes + are determined by run-time quantities). Unless IGNORE_TOO_BIG is + true, gives an error message if the resulting type's size is over + varsize_limit. +*/ + +static struct type * +to_fixed_array_type (struct type *type0, struct value *dval, + int ignore_too_big) +{ + struct type *index_type_desc; + struct type *result; + + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ +/* if (ada_is_packed_array_type (type0) /* revisit? *//* + || (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)) + return type0; */ + + index_type_desc = ada_find_parallel_type (type0, "___XA"); + if (index_type_desc == NULL) + { + struct type *elt_type0 = check_typedef (TYPE_TARGET_TYPE (type0)); + /* NOTE: elt_type---the fixed version of elt_type0---should never + * depend on the contents of the array in properly constructed + * debugging data. */ + struct type *elt_type = ada_to_fixed_type (elt_type0, 0, 0, dval); + + if (elt_type0 == elt_type) + result = type0; + else + result = create_array_type (alloc_type (TYPE_OBJFILE (type0)), + elt_type, TYPE_INDEX_TYPE (type0)); + } + else + { + int i; + struct type *elt_type0; + + elt_type0 = type0; + for (i = TYPE_NFIELDS (index_type_desc); i > 0; i -= 1) + elt_type0 = TYPE_TARGET_TYPE (elt_type0); + + /* NOTE: result---the fixed version of elt_type0---should never + * depend on the contents of the array in properly constructed + * debugging data. */ + result = ada_to_fixed_type (check_typedef (elt_type0), 0, 0, dval); + for (i = TYPE_NFIELDS (index_type_desc) - 1; i >= 0; i -= 1) + { + struct type *range_type = + to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i), + dval, TYPE_OBJFILE (type0)); + result = create_array_type (alloc_type (TYPE_OBJFILE (type0)), + result, range_type); + } + if (!ignore_too_big && TYPE_LENGTH (result) > varsize_limit) + error ("array type with dynamic size is larger than varsize-limit"); + } + +/* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ +/* TYPE_FLAGS (result) |= TYPE_FLAG_FIXED_INSTANCE; */ + return result; +} + + +/* A standard type (containing no dynamically sized components) + corresponding to TYPE for the value (TYPE, VALADDR, ADDRESS) + DVAL describes a record containing any discriminants used in TYPE0, + and may be NULL if there are none. */ + +struct type * +ada_to_fixed_type (struct type *type, char *valaddr, CORE_ADDR address, + struct value *dval) +{ + CHECK_TYPEDEF (type); + switch (TYPE_CODE (type)) + { + default: + return type; + case TYPE_CODE_STRUCT: + return to_fixed_record_type (type, valaddr, address, NULL); + case TYPE_CODE_ARRAY: + return to_fixed_array_type (type, dval, 0); + case TYPE_CODE_UNION: + if (dval == NULL) + return type; + else + return to_fixed_variant_branch_type (type, valaddr, address, dval); + } +} + +/* A standard (static-sized) type corresponding as well as possible to + TYPE0, but based on no runtime data. */ + +static struct type * +to_static_fixed_type (struct type *type0) +{ + struct type *type; + + if (type0 == NULL) + return NULL; + + /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */ + /* if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE) + return type0; + */ + CHECK_TYPEDEF (type0); + + switch (TYPE_CODE (type0)) + { + default: + return type0; + case TYPE_CODE_STRUCT: + type = dynamic_template_type (type0); + if (type != NULL) + return template_to_static_fixed_type (type); + return type0; + case TYPE_CODE_UNION: + type = ada_find_parallel_type (type0, "___XVU"); + if (type != NULL) + return template_to_static_fixed_type (type); + return type0; + } +} + +/* A static approximation of TYPE with all type wrappers removed. */ +static struct type * +static_unwrap_type (struct type *type) +{ + if (ada_is_aligner_type (type)) + { + struct type *type1 = TYPE_FIELD_TYPE (check_typedef (type), 0); + if (ada_type_name (type1) == NULL) + TYPE_NAME (type1) = ada_type_name (type); + + return static_unwrap_type (type1); + } + else + { + struct type *raw_real_type = ada_get_base_type (type); + if (raw_real_type == type) + return type; + else + return to_static_fixed_type (raw_real_type); + } +} + +/* In some cases, incomplete and private types require + cross-references that are not resolved as records (for example, + type Foo; + type FooP is access Foo; + V: FooP; + type Foo is array ...; + ). In these cases, since there is no mechanism for producing + cross-references to such types, we instead substitute for FooP a + stub enumeration type that is nowhere resolved, and whose tag is + the name of the actual type. Call these types "non-record stubs". */ + +/* A type equivalent to TYPE that is not a non-record stub, if one + exists, otherwise TYPE. */ +struct type * +ada_completed_type (struct type *type) +{ + CHECK_TYPEDEF (type); + if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM + || (TYPE_FLAGS (type) & TYPE_FLAG_STUB) == 0 + || TYPE_TAG_NAME (type) == NULL) + return type; + else + { + char *name = TYPE_TAG_NAME (type); + struct type *type1 = ada_find_any_type (name); + return (type1 == NULL) ? type : type1; + } +} + +/* A value representing the data at VALADDR/ADDRESS as described by + type TYPE0, but with a standard (static-sized) type that correctly + describes it. If VAL0 is not NULL and TYPE0 already is a standard + type, then return VAL0 [this feature is simply to avoid redundant + creation of struct values]. */ + +struct value * +ada_to_fixed_value (struct type *type0, char *valaddr, CORE_ADDR address, + struct value *val0) +{ + struct type *type = ada_to_fixed_type (type0, valaddr, address, NULL); + if (type == type0 && val0 != NULL) + return val0; + else + return value_from_contents_and_address (type, valaddr, address); +} + +/* A value representing VAL, but with a standard (static-sized) type + chosen to approximate the real type of VAL as well as possible, but + without consulting any runtime values. For Ada dynamic-sized + types, therefore, the type of the result is likely to be inaccurate. */ + +struct value * +ada_to_static_fixed_value (struct value *val) +{ + struct type *type = + to_static_fixed_type (static_unwrap_type (VALUE_TYPE (val))); + if (type == VALUE_TYPE (val)) + return val; + else + return coerce_unspec_val_to_type (val, 0, type); +} + + + + + +/* Attributes */ + +/* Table mapping attribute numbers to names */ +/* NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h */ + +static const char *attribute_names[] = { + "", + + "first", + "last", + "length", + "image", + "img", + "max", + "min", + "pos" "tag", + "val", + + 0 +}; + +const char * +ada_attribute_name (int n) +{ + if (n > 0 && n < (int) ATR_END) + return attribute_names[n]; + else + return attribute_names[0]; +} + +/* Evaluate the 'POS attribute applied to ARG. */ + +static struct value * +value_pos_atr (struct value *arg) +{ + struct type *type = VALUE_TYPE (arg); + + if (!discrete_type_p (type)) + error ("'POS only defined on discrete types"); + + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + { + int i; + LONGEST v = value_as_long (arg); + + for (i = 0; i < TYPE_NFIELDS (type); i += 1) + { + if (v == TYPE_FIELD_BITPOS (type, i)) + return value_from_longest (builtin_type_ada_int, i); + } + error ("enumeration value is invalid: can't find 'POS"); + } + else + return value_from_longest (builtin_type_ada_int, value_as_long (arg)); +} + +/* Evaluate the TYPE'VAL attribute applied to ARG. */ + +static struct value * +value_val_atr (struct type *type, struct value *arg) +{ + if (!discrete_type_p (type)) + error ("'VAL only defined on discrete types"); + if (!integer_type_p (VALUE_TYPE (arg))) + error ("'VAL requires integral argument"); + + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + { + long pos = value_as_long (arg); + if (pos < 0 || pos >= TYPE_NFIELDS (type)) + error ("argument to 'VAL out of range"); + return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos)); + } + else + return value_from_longest (type, value_as_long (arg)); +} + + + /* Evaluation */ + +/* True if TYPE appears to be an Ada character type. + * [At the moment, this is true only for Character and Wide_Character; + * It is a heuristic test that could stand improvement]. */ + +int +ada_is_character_type (struct type *type) +{ + const char *name = ada_type_name (type); + return + name != NULL + && (TYPE_CODE (type) == TYPE_CODE_CHAR + || TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_RANGE) + && (STREQ (name, "character") || STREQ (name, "wide_character") + || STREQ (name, "unsigned char")); +} + +/* True if TYPE appears to be an Ada string type. */ + +int +ada_is_string_type (struct type *type) +{ + CHECK_TYPEDEF (type); + if (type != NULL + && TYPE_CODE (type) != TYPE_CODE_PTR + && (ada_is_simple_array (type) || ada_is_array_descriptor (type)) + && ada_array_arity (type) == 1) + { + struct type *elttype = ada_array_element_type (type, 1); + + return ada_is_character_type (elttype); + } + else + return 0; +} + + +/* True if TYPE is a struct type introduced by the compiler to force the + alignment of a value. Such types have a single field with a + distinctive name. */ + +int +ada_is_aligner_type (struct type *type) +{ + CHECK_TYPEDEF (type); + return (TYPE_CODE (type) == TYPE_CODE_STRUCT + && TYPE_NFIELDS (type) == 1 + && STREQ (TYPE_FIELD_NAME (type, 0), "F")); +} + +/* If there is an ___XVS-convention type parallel to SUBTYPE, return + the parallel type. */ + +struct type * +ada_get_base_type (struct type *raw_type) +{ + struct type *real_type_namer; + struct type *raw_real_type; + struct type *real_type; + + if (raw_type == NULL || TYPE_CODE (raw_type) != TYPE_CODE_STRUCT) + return raw_type; + + real_type_namer = ada_find_parallel_type (raw_type, "___XVS"); + if (real_type_namer == NULL + || TYPE_CODE (real_type_namer) != TYPE_CODE_STRUCT + || TYPE_NFIELDS (real_type_namer) != 1) + return raw_type; + + raw_real_type = ada_find_any_type (TYPE_FIELD_NAME (real_type_namer, 0)); + if (raw_real_type == NULL) + return raw_type; + else + return raw_real_type; +} + +/* The type of value designated by TYPE, with all aligners removed. */ + +struct type * +ada_aligned_type (struct type *type) +{ + if (ada_is_aligner_type (type)) + return ada_aligned_type (TYPE_FIELD_TYPE (type, 0)); + else + return ada_get_base_type (type); +} + + +/* The address of the aligned value in an object at address VALADDR + having type TYPE. Assumes ada_is_aligner_type (TYPE). */ + +char * +ada_aligned_value_addr (struct type *type, char *valaddr) +{ + if (ada_is_aligner_type (type)) + return ada_aligned_value_addr (TYPE_FIELD_TYPE (type, 0), + valaddr + + TYPE_FIELD_BITPOS (type, + 0) / TARGET_CHAR_BIT); + else + return valaddr; +} + +/* The printed representation of an enumeration literal with encoded + name NAME. The value is good to the next call of ada_enum_name. */ +const char * +ada_enum_name (const char *name) +{ + char *tmp; + + while (1) + { + if ((tmp = strstr (name, "__")) != NULL) + name = tmp + 2; + else if ((tmp = strchr (name, '.')) != NULL) + name = tmp + 1; + else + break; + } + + if (name[0] == 'Q') + { + static char result[16]; + int v; + if (name[1] == 'U' || name[1] == 'W') + { + if (sscanf (name + 2, "%x", &v) != 1) + return name; + } + else + return name; + + if (isascii (v) && isprint (v)) + sprintf (result, "'%c'", v); + else if (name[1] == 'U') + sprintf (result, "[\"%02x\"]", v); + else + sprintf (result, "[\"%04x\"]", v); + + return result; + } + else + return name; +} + +static struct value * +evaluate_subexp (struct type *expect_type, struct expression *exp, int *pos, + enum noside noside) +{ + return (*exp->language_defn->evaluate_exp) (expect_type, exp, pos, noside); +} + +/* Evaluate the subexpression of EXP starting at *POS as for + evaluate_type, updating *POS to point just past the evaluated + expression. */ + +static struct value * +evaluate_subexp_type (struct expression *exp, int *pos) +{ + return (*exp->language_defn->evaluate_exp) + (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); +} + +/* If VAL is wrapped in an aligner or subtype wrapper, return the + value it wraps. */ + +static struct value * +unwrap_value (struct value *val) +{ + struct type *type = check_typedef (VALUE_TYPE (val)); + if (ada_is_aligner_type (type)) + { + struct value *v = value_struct_elt (&val, NULL, "F", + NULL, "internal structure"); + struct type *val_type = check_typedef (VALUE_TYPE (v)); + if (ada_type_name (val_type) == NULL) + TYPE_NAME (val_type) = ada_type_name (type); + + return unwrap_value (v); + } + else + { + struct type *raw_real_type = + ada_completed_type (ada_get_base_type (type)); + + if (type == raw_real_type) + return val; + + return + coerce_unspec_val_to_type + (val, 0, ada_to_fixed_type (raw_real_type, 0, + VALUE_ADDRESS (val) + VALUE_OFFSET (val), + NULL)); + } +} + +static struct value * +cast_to_fixed (struct type *type, struct value *arg) +{ + LONGEST val; + + if (type == VALUE_TYPE (arg)) + return arg; + else if (ada_is_fixed_point_type (VALUE_TYPE (arg))) + val = ada_float_to_fixed (type, + ada_fixed_to_float (VALUE_TYPE (arg), + value_as_long (arg))); + else + { + DOUBLEST argd = + value_as_double (value_cast (builtin_type_double, value_copy (arg))); + val = ada_float_to_fixed (type, argd); + } + + return value_from_longest (type, val); +} + +static struct value * +cast_from_fixed_to_double (struct value *arg) +{ + DOUBLEST val = ada_fixed_to_float (VALUE_TYPE (arg), + value_as_long (arg)); + return value_from_double (builtin_type_double, val); +} + +/* Coerce VAL as necessary for assignment to an lval of type TYPE, and + * return the converted value. */ +static struct value * +coerce_for_assign (struct type *type, struct value *val) +{ + struct type *type2 = VALUE_TYPE (val); + if (type == type2) + return val; + + CHECK_TYPEDEF (type2); + CHECK_TYPEDEF (type); + + if (TYPE_CODE (type2) == TYPE_CODE_PTR + && TYPE_CODE (type) == TYPE_CODE_ARRAY) + { + val = ada_value_ind (val); + type2 = VALUE_TYPE (val); + } + + if (TYPE_CODE (type2) == TYPE_CODE_ARRAY + && TYPE_CODE (type) == TYPE_CODE_ARRAY) + { + if (TYPE_LENGTH (type2) != TYPE_LENGTH (type) + || TYPE_LENGTH (TYPE_TARGET_TYPE (type2)) + != TYPE_LENGTH (TYPE_TARGET_TYPE (type2))) + error ("Incompatible types in assignment"); + VALUE_TYPE (val) = type; + } + return val; +} + +struct value * +ada_evaluate_subexp (struct type *expect_type, struct expression *exp, + int *pos, enum noside noside) +{ + enum exp_opcode op; + enum ada_attribute atr; + int tem, tem2, tem3; + int pc; + struct value *arg1 = NULL, *arg2 = NULL, *arg3; + struct type *type; + int nargs; + struct value **argvec; + + pc = *pos; + *pos += 1; + op = exp->elts[pc].opcode; + + switch (op) + { + default: + *pos -= 1; + return + unwrap_value (evaluate_subexp_standard + (expect_type, exp, pos, noside)); + + case UNOP_CAST: + (*pos) += 2; + type = exp->elts[pc + 1].type; + arg1 = evaluate_subexp (type, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (type != check_typedef (VALUE_TYPE (arg1))) + { + if (ada_is_fixed_point_type (type)) + arg1 = cast_to_fixed (type, arg1); + else if (ada_is_fixed_point_type (VALUE_TYPE (arg1))) + arg1 = value_cast (type, cast_from_fixed_to_double (arg1)); + else if (VALUE_LVAL (arg1) == lval_memory) + { + /* This is in case of the really obscure (and undocumented, + but apparently expected) case of (Foo) Bar.all, where Bar + is an integer constant and Foo is a dynamic-sized type. + If we don't do this, ARG1 will simply be relabeled with + TYPE. */ + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (to_static_fixed_type (type), not_lval); + arg1 = + ada_to_fixed_value + (type, 0, VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1), 0); + } + else + arg1 = value_cast (type, arg1); + } + return arg1; + + /* FIXME: UNOP_QUAL should be defined in expression.h */ + /* case UNOP_QUAL: + (*pos) += 2; + type = exp->elts[pc + 1].type; + return ada_evaluate_subexp (type, exp, pos, noside); + */ + case BINOP_ASSIGN: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside); + if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS) + return arg1; + if (binop_user_defined_p (op, arg1, arg2)) + return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL); + else + { + if (ada_is_fixed_point_type (VALUE_TYPE (arg1))) + arg2 = cast_to_fixed (VALUE_TYPE (arg1), arg2); + else if (ada_is_fixed_point_type (VALUE_TYPE (arg2))) + error + ("Fixed-point values must be assigned to fixed-point variables"); + else + arg2 = coerce_for_assign (VALUE_TYPE (arg1), arg2); + return ada_value_assign (arg1, arg2); + } + + case BINOP_ADD: + arg1 = evaluate_subexp_with_coercion (exp, pos, noside); + arg2 = evaluate_subexp_with_coercion (exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (binop_user_defined_p (op, arg1, arg2)) + return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL); + else + { + if ((ada_is_fixed_point_type (VALUE_TYPE (arg1)) + || ada_is_fixed_point_type (VALUE_TYPE (arg2))) + && VALUE_TYPE (arg1) != VALUE_TYPE (arg2)) + error + ("Operands of fixed-point addition must have the same type"); + return value_cast (VALUE_TYPE (arg1), value_add (arg1, arg2)); + } + + case BINOP_SUB: + arg1 = evaluate_subexp_with_coercion (exp, pos, noside); + arg2 = evaluate_subexp_with_coercion (exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (binop_user_defined_p (op, arg1, arg2)) + return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL); + else + { + if ((ada_is_fixed_point_type (VALUE_TYPE (arg1)) + || ada_is_fixed_point_type (VALUE_TYPE (arg2))) + && VALUE_TYPE (arg1) != VALUE_TYPE (arg2)) + error + ("Operands of fixed-point subtraction must have the same type"); + return value_cast (VALUE_TYPE (arg1), value_sub (arg1, arg2)); + } + + case BINOP_MUL: + case BINOP_DIV: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (binop_user_defined_p (op, arg1, arg2)) + return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL); + else + if (noside == EVAL_AVOID_SIDE_EFFECTS + && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD)) + return value_zero (VALUE_TYPE (arg1), not_lval); + else + { + if (ada_is_fixed_point_type (VALUE_TYPE (arg1))) + arg1 = cast_from_fixed_to_double (arg1); + if (ada_is_fixed_point_type (VALUE_TYPE (arg2))) + arg2 = cast_from_fixed_to_double (arg2); + return value_binop (arg1, arg2, op); + } + + case UNOP_NEG: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (unop_user_defined_p (op, arg1)) + return value_x_unop (arg1, op, EVAL_NORMAL); + else if (ada_is_fixed_point_type (VALUE_TYPE (arg1))) + return value_cast (VALUE_TYPE (arg1), value_neg (arg1)); + else + return value_neg (arg1); + + /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ + /* case OP_UNRESOLVED_VALUE: + /* Only encountered when an unresolved symbol occurs in a + context other than a function call, in which case, it is + illegal. *//* + (*pos) += 3; + if (noside == EVAL_SKIP) + goto nosideret; + else + error ("Unexpected unresolved symbol, %s, during evaluation", + ada_demangle (exp->elts[pc + 2].name)); + */ + case OP_VAR_VALUE: + *pos -= 1; + if (noside == EVAL_SKIP) + { + *pos += 4; + goto nosideret; + } + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + *pos += 4; + return value_zero + (to_static_fixed_type + (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))), + not_lval); + } + else + { + arg1 = + unwrap_value (evaluate_subexp_standard + (expect_type, exp, pos, noside)); + return ada_to_fixed_value (VALUE_TYPE (arg1), 0, + VALUE_ADDRESS (arg1) + + VALUE_OFFSET (arg1), arg1); + } + + case OP_ARRAY: + (*pos) += 3; + tem2 = longest_to_int (exp->elts[pc + 1].longconst); + tem3 = longest_to_int (exp->elts[pc + 2].longconst); + nargs = tem3 - tem2 + 1; + type = expect_type ? check_typedef (expect_type) : NULL_TYPE; + + argvec = + (struct value * *) alloca (sizeof (struct value *) * (nargs + 1)); + for (tem = 0; tem == 0 || tem < nargs; tem += 1) + /* At least one element gets inserted for the type */ + { + /* Ensure that array expressions are coerced into pointer objects. */ + argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside); + } + if (noside == EVAL_SKIP) + goto nosideret; + return value_array (tem2, tem3, argvec); + + case OP_FUNCALL: + (*pos) += 2; + + /* Allocate arg vector, including space for the function to be + called in argvec[0] and a terminating NULL */ + nargs = longest_to_int (exp->elts[pc + 1].longconst); + argvec = + (struct value * *) alloca (sizeof (struct value *) * (nargs + 2)); + + /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */ + /* FIXME: name should be defined in expresion.h */ + /* if (exp->elts[*pos].opcode == OP_UNRESOLVED_VALUE) + error ("Unexpected unresolved symbol, %s, during evaluation", + ada_demangle (exp->elts[pc + 5].name)); + */ + if (0) + { + error ("unexpected code path, FIXME"); + } + else + { + for (tem = 0; tem <= nargs; tem += 1) + argvec[tem] = evaluate_subexp (NULL_TYPE, exp, pos, noside); + argvec[tem] = 0; + + if (noside == EVAL_SKIP) + goto nosideret; + } + + if (TYPE_CODE (VALUE_TYPE (argvec[0])) == TYPE_CODE_REF) + argvec[0] = value_addr (argvec[0]); + + if (ada_is_packed_array_type (VALUE_TYPE (argvec[0]))) + argvec[0] = ada_coerce_to_simple_array (argvec[0]); + + type = check_typedef (VALUE_TYPE (argvec[0])); + if (TYPE_CODE (type) == TYPE_CODE_PTR) + { + switch (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (type)))) + { + case TYPE_CODE_FUNC: + type = check_typedef (TYPE_TARGET_TYPE (type)); + break; + case TYPE_CODE_ARRAY: + break; + case TYPE_CODE_STRUCT: + if (noside != EVAL_AVOID_SIDE_EFFECTS) + argvec[0] = ada_value_ind (argvec[0]); + type = check_typedef (TYPE_TARGET_TYPE (type)); + break; + default: + error ("cannot subscript or call something of type `%s'", + ada_type_name (VALUE_TYPE (argvec[0]))); + break; + } + } + + switch (TYPE_CODE (type)) + { + case TYPE_CODE_FUNC: + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return allocate_value (TYPE_TARGET_TYPE (type)); + return call_function_by_hand (argvec[0], nargs, argvec + 1); + case TYPE_CODE_STRUCT: + { + int arity = ada_array_arity (type); + type = ada_array_element_type (type, nargs); + if (type == NULL) + error ("cannot subscript or call a record"); + if (arity != nargs) + error ("wrong number of subscripts; expecting %d", arity); + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return allocate_value (ada_aligned_type (type)); + return + unwrap_value (ada_value_subscript + (argvec[0], nargs, argvec + 1)); + } + case TYPE_CODE_ARRAY: + if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + type = ada_array_element_type (type, nargs); + if (type == NULL) + error ("element type of array unknown"); + else + return allocate_value (ada_aligned_type (type)); + } + return + unwrap_value (ada_value_subscript + (ada_coerce_to_simple_array (argvec[0]), + nargs, argvec + 1)); + case TYPE_CODE_PTR: /* Pointer to array */ + type = to_fixed_array_type (TYPE_TARGET_TYPE (type), NULL, 1); + if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + type = ada_array_element_type (type, nargs); + if (type == NULL) + error ("element type of array unknown"); + else + return allocate_value (ada_aligned_type (type)); + } + return + unwrap_value (ada_value_ptr_subscript (argvec[0], type, + nargs, argvec + 1)); + + default: + error ("Internal error in evaluate_subexp"); + } + + case TERNOP_SLICE: + { + struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside); + int lowbound + = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); + int upper + = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); + if (noside == EVAL_SKIP) + goto nosideret; + + /* If this is a reference to an array, then dereference it */ + if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF + && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL + && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) == + TYPE_CODE_ARRAY + && !ada_is_array_descriptor (check_typedef (VALUE_TYPE (array)))) + { + array = ada_coerce_ref (array); + } + + if (noside == EVAL_AVOID_SIDE_EFFECTS && + ada_is_array_descriptor (check_typedef (VALUE_TYPE (array)))) + { + /* Try to dereference the array, in case it is an access to array */ + struct type *arrType = ada_type_of_array (array, 0); + if (arrType != NULL) + array = value_at_lazy (arrType, 0, NULL); + } + if (ada_is_array_descriptor (VALUE_TYPE (array))) + array = ada_coerce_to_simple_array (array); + + /* If at this point we have a pointer to an array, it means that + it is a pointer to a simple (non-ada) array. We just then + dereference it */ + if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR + && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL + && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) == + TYPE_CODE_ARRAY) + { + array = ada_value_ind (array); + } + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + /* The following will get the bounds wrong, but only in contexts + where the value is not being requested (FIXME?). */ + return array; + else + return value_slice (array, lowbound, upper - lowbound + 1); + } + + /* FIXME: UNOP_MBR should be defined in expression.h */ + /* case UNOP_MBR: + (*pos) += 2; + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + type = exp->elts[pc + 1].type; + + if (noside == EVAL_SKIP) + goto nosideret; + + switch (TYPE_CODE (type)) + { + default: + warning ("Membership test incompletely implemented; always returns true"); + return value_from_longest (builtin_type_int, (LONGEST) 1); + + case TYPE_CODE_RANGE: + arg2 = value_from_longest (builtin_type_int, + (LONGEST) TYPE_LOW_BOUND (type)); + arg3 = value_from_longest (builtin_type_int, + (LONGEST) TYPE_HIGH_BOUND (type)); + return + value_from_longest (builtin_type_int, + (value_less (arg1,arg3) + || value_equal (arg1,arg3)) + && (value_less (arg2,arg1) + || value_equal (arg2,arg1))); + } + */ + /* FIXME: BINOP_MBR should be defined in expression.h */ + /* case BINOP_MBR: + (*pos) += 2; + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + + if (noside == EVAL_SKIP) + goto nosideret; + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (builtin_type_int, not_lval); + + tem = longest_to_int (exp->elts[pc + 1].longconst); + + if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg2))) + error ("invalid dimension number to '%s", "range"); + + arg3 = ada_array_bound (arg2, tem, 1); + arg2 = ada_array_bound (arg2, tem, 0); + + return + value_from_longest (builtin_type_int, + (value_less (arg1,arg3) + || value_equal (arg1,arg3)) + && (value_less (arg2,arg1) + || value_equal (arg2,arg1))); + */ + /* FIXME: TERNOP_MBR should be defined in expression.h */ + /* case TERNOP_MBR: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + + if (noside == EVAL_SKIP) + goto nosideret; + + return + value_from_longest (builtin_type_int, + (value_less (arg1,arg3) + || value_equal (arg1,arg3)) + && (value_less (arg2,arg1) + || value_equal (arg2,arg1))); + */ + /* FIXME: OP_ATTRIBUTE should be defined in expression.h */ + /* case OP_ATTRIBUTE: + *pos += 3; + atr = (enum ada_attribute) longest_to_int (exp->elts[pc + 2].longconst); + switch (atr) + { + default: + error ("unexpected attribute encountered"); + + case ATR_FIRST: + case ATR_LAST: + case ATR_LENGTH: + { + struct type* type_arg; + if (exp->elts[*pos].opcode == OP_TYPE) + { + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = NULL; + type_arg = exp->elts[pc + 5].type; + } + else + { + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + type_arg = NULL; + } + + if (exp->elts[*pos].opcode != OP_LONG) + error ("illegal operand to '%s", ada_attribute_name (atr)); + tem = longest_to_int (exp->elts[*pos+2].longconst); + *pos += 4; + + if (noside == EVAL_SKIP) + goto nosideret; + + if (type_arg == NULL) + { + arg1 = ada_coerce_ref (arg1); + + if (ada_is_packed_array_type (VALUE_TYPE (arg1))) + arg1 = ada_coerce_to_simple_array (arg1); + + if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg1))) + error ("invalid dimension number to '%s", + ada_attribute_name (atr)); + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + type = ada_index_type (VALUE_TYPE (arg1), tem); + if (type == NULL) + error ("attempt to take bound of something that is not an array"); + return allocate_value (type); + } + + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + return ada_array_bound (arg1, tem, 0); + case ATR_LAST: + return ada_array_bound (arg1, tem, 1); + case ATR_LENGTH: + return ada_array_length (arg1, tem); + } + } + else if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE + || TYPE_CODE (type_arg) == TYPE_CODE_INT) + { + struct type* range_type; + char* name = ada_type_name (type_arg); + if (name == NULL) + { + if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE) + range_type = type_arg; + else + error ("unimplemented type attribute"); + } + else + range_type = + to_fixed_range_type (name, NULL, TYPE_OBJFILE (type_arg)); + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + return value_from_longest (TYPE_TARGET_TYPE (range_type), + TYPE_LOW_BOUND (range_type)); + case ATR_LAST: + return value_from_longest (TYPE_TARGET_TYPE (range_type), + TYPE_HIGH_BOUND (range_type)); + } + } + else if (TYPE_CODE (type_arg) == TYPE_CODE_ENUM) + { + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + return value_from_longest + (type_arg, TYPE_FIELD_BITPOS (type_arg, 0)); + case ATR_LAST: + return value_from_longest + (type_arg, + TYPE_FIELD_BITPOS (type_arg, + TYPE_NFIELDS (type_arg) - 1)); + } + } + else if (TYPE_CODE (type_arg) == TYPE_CODE_FLT) + error ("unimplemented type attribute"); + else + { + LONGEST low, high; + + if (ada_is_packed_array_type (type_arg)) + type_arg = decode_packed_array_type (type_arg); + + if (tem < 1 || tem > ada_array_arity (type_arg)) + error ("invalid dimension number to '%s", + ada_attribute_name (atr)); + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + type = ada_index_type (type_arg, tem); + if (type == NULL) + error ("attempt to take bound of something that is not an array"); + return allocate_value (type); + } + + switch (atr) + { + default: + error ("unexpected attribute encountered"); + case ATR_FIRST: + low = ada_array_bound_from_type (type_arg, tem, 0, &type); + return value_from_longest (type, low); + case ATR_LAST: + high = ada_array_bound_from_type (type_arg, tem, 1, &type); + return value_from_longest (type, high); + case ATR_LENGTH: + low = ada_array_bound_from_type (type_arg, tem, 0, &type); + high = ada_array_bound_from_type (type_arg, tem, 1, NULL); + return value_from_longest (type, high-low+1); + } + } + } + + case ATR_TAG: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return + value_zero (ada_tag_type (arg1), not_lval); + + return ada_value_tag (arg1); + + case ATR_MIN: + case ATR_MAX: + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (VALUE_TYPE (arg1), not_lval); + else + return value_binop (arg1, arg2, + atr == ATR_MIN ? BINOP_MIN : BINOP_MAX); + + case ATR_MODULUS: + { + struct type* type_arg = exp->elts[pc + 5].type; + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + *pos += 4; + + if (noside == EVAL_SKIP) + goto nosideret; + + if (! ada_is_modular_type (type_arg)) + error ("'modulus must be applied to modular type"); + + return value_from_longest (TYPE_TARGET_TYPE (type_arg), + ada_modulus (type_arg)); + } + + + case ATR_POS: + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (builtin_type_ada_int, not_lval); + else + return value_pos_atr (arg1); + + case ATR_SIZE: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (builtin_type_ada_int, not_lval); + else + return value_from_longest (builtin_type_ada_int, + TARGET_CHAR_BIT + * TYPE_LENGTH (VALUE_TYPE (arg1))); + + case ATR_VAL: + evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + type = exp->elts[pc + 5].type; + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (type, not_lval); + else + return value_val_atr (type, arg1); + } */ + case BINOP_EXP: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (binop_user_defined_p (op, arg1, arg2)) + return unwrap_value (value_x_binop (arg1, arg2, op, OP_NULL, + EVAL_NORMAL)); + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (VALUE_TYPE (arg1), not_lval); + else + return value_binop (arg1, arg2, op); + + case UNOP_PLUS: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (unop_user_defined_p (op, arg1)) + return unwrap_value (value_x_unop (arg1, op, EVAL_NORMAL)); + else + return arg1; + + case UNOP_ABS: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (value_less (arg1, value_zero (VALUE_TYPE (arg1), not_lval))) + return value_neg (arg1); + else + return arg1; + + case UNOP_IND: + if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR) + expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type)); + arg1 = evaluate_subexp (expect_type, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + type = check_typedef (VALUE_TYPE (arg1)); + if (noside == EVAL_AVOID_SIDE_EFFECTS) + { + if (ada_is_array_descriptor (type)) + /* GDB allows dereferencing GNAT array descriptors. */ + { + struct type *arrType = ada_type_of_array (arg1, 0); + if (arrType == NULL) + error ("Attempt to dereference null array pointer."); + return value_at_lazy (arrType, 0, NULL); + } + else if (TYPE_CODE (type) == TYPE_CODE_PTR + || TYPE_CODE (type) == TYPE_CODE_REF + /* In C you can dereference an array to get the 1st elt. */ + || TYPE_CODE (type) == TYPE_CODE_ARRAY) + return + value_zero + (to_static_fixed_type + (ada_aligned_type (check_typedef (TYPE_TARGET_TYPE (type)))), + lval_memory); + else if (TYPE_CODE (type) == TYPE_CODE_INT) + /* GDB allows dereferencing an int. */ + return value_zero (builtin_type_int, lval_memory); + else + error ("Attempt to take contents of a non-pointer value."); + } + arg1 = ada_coerce_ref (arg1); + type = check_typedef (VALUE_TYPE (arg1)); + + if (ada_is_array_descriptor (type)) + /* GDB allows dereferencing GNAT array descriptors. */ + return ada_coerce_to_simple_array (arg1); + else + return ada_value_ind (arg1); + + case STRUCTOP_STRUCT: + tem = longest_to_int (exp->elts[pc + 1].longconst); + (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (ada_aligned_type + (ada_lookup_struct_elt_type (VALUE_TYPE (arg1), + &exp->elts[pc + + 2].string, + 0, NULL)), + lval_memory); + else + return unwrap_value (ada_value_struct_elt (arg1, + &exp->elts[pc + 2].string, + "record")); + case OP_TYPE: + /* The value is not supposed to be used. This is here to make it + easier to accommodate expressions that contain types. */ + (*pos) += 2; + if (noside == EVAL_SKIP) + goto nosideret; + else if (noside == EVAL_AVOID_SIDE_EFFECTS) + return allocate_value (builtin_type_void); + else + error ("Attempt to use a type name as an expression"); + + case STRUCTOP_PTR: + tem = longest_to_int (exp->elts[pc + 1].longconst); + (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) + goto nosideret; + if (noside == EVAL_AVOID_SIDE_EFFECTS) + return value_zero (ada_aligned_type + (ada_lookup_struct_elt_type (VALUE_TYPE (arg1), + &exp->elts[pc + + 2].string, + 0, NULL)), + lval_memory); + else + return unwrap_value (ada_value_struct_elt (arg1, + &exp->elts[pc + 2].string, + "record access")); + } + +nosideret: + return value_from_longest (builtin_type_long, (LONGEST) 1); +} + + + /* Fixed point */ + +/* If TYPE encodes an Ada fixed-point type, return the suffix of the + type name that encodes the 'small and 'delta information. + Otherwise, return NULL. */ + +static const char * +fixed_type_info (struct type *type) +{ + const char *name = ada_type_name (type); + enum type_code code = (type == NULL) ? TYPE_CODE_UNDEF : TYPE_CODE (type); + + if ((code == TYPE_CODE_INT || code == TYPE_CODE_RANGE) && name != NULL) + { + const char *tail = strstr (name, "___XF_"); + if (tail == NULL) + return NULL; + else + return tail + 5; + } + else if (code == TYPE_CODE_RANGE && TYPE_TARGET_TYPE (type) != type) + return fixed_type_info (TYPE_TARGET_TYPE (type)); + else + return NULL; +} + +/* Returns non-zero iff TYPE represents an Ada fixed-point type. */ + +int +ada_is_fixed_point_type (struct type *type) +{ + return fixed_type_info (type) != NULL; +} + +/* Assuming that TYPE is the representation of an Ada fixed-point + type, return its delta, or -1 if the type is malformed and the + delta cannot be determined. */ + +DOUBLEST +ada_delta (struct type *type) +{ + const char *encoding = fixed_type_info (type); + long num, den; + + if (sscanf (encoding, "_%ld_%ld", &num, &den) < 2) + return -1.0; + else + return (DOUBLEST) num / (DOUBLEST) den; +} + +/* Assuming that ada_is_fixed_point_type (TYPE), return the scaling + factor ('SMALL value) associated with the type. */ + +static DOUBLEST +scaling_factor (struct type *type) +{ + const char *encoding = fixed_type_info (type); + unsigned long num0, den0, num1, den1; + int n; + + n = sscanf (encoding, "_%lu_%lu_%lu_%lu", &num0, &den0, &num1, &den1); + + if (n < 2) + return 1.0; + else if (n == 4) + return (DOUBLEST) num1 / (DOUBLEST) den1; + else + return (DOUBLEST) num0 / (DOUBLEST) den0; +} + + +/* Assuming that X is the representation of a value of fixed-point + type TYPE, return its floating-point equivalent. */ + +DOUBLEST +ada_fixed_to_float (struct type *type, LONGEST x) +{ + return (DOUBLEST) x *scaling_factor (type); +} + +/* The representation of a fixed-point value of type TYPE + corresponding to the value X. */ + +LONGEST +ada_float_to_fixed (struct type *type, DOUBLEST x) +{ + return (LONGEST) (x / scaling_factor (type) + 0.5); +} + + + /* VAX floating formats */ + +/* Non-zero iff TYPE represents one of the special VAX floating-point + types. */ +int +ada_is_vax_floating_type (struct type *type) +{ + int name_len = + (ada_type_name (type) == NULL) ? 0 : strlen (ada_type_name (type)); + return + name_len > 6 + && (TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_RANGE) + && STREQN (ada_type_name (type) + name_len - 6, "___XF", 5); +} + +/* The type of special VAX floating-point type this is, assuming + ada_is_vax_floating_point */ +int +ada_vax_float_type_suffix (struct type *type) +{ + return ada_type_name (type)[strlen (ada_type_name (type)) - 1]; +} + +/* A value representing the special debugging function that outputs + VAX floating-point values of the type represented by TYPE. Assumes + ada_is_vax_floating_type (TYPE). */ +struct value * +ada_vax_float_print_function (struct type *type) +{ + switch (ada_vax_float_type_suffix (type)) + { + case 'F': + return get_var_value ("DEBUG_STRING_F", 0); + case 'D': + return get_var_value ("DEBUG_STRING_D", 0); + case 'G': + return get_var_value ("DEBUG_STRING_G", 0); + default: + error ("invalid VAX floating-point type"); + } +} + + + /* Range types */ + +/* Scan STR beginning at position K for a discriminant name, and + return the value of that discriminant field of DVAL in *PX. If + PNEW_K is not null, put the position of the character beyond the + name scanned in *PNEW_K. Return 1 if successful; return 0 and do + not alter *PX and *PNEW_K if unsuccessful. */ + +static int +scan_discrim_bound (char *, int k, struct value *dval, LONGEST * px, + int *pnew_k) +{ + static char *bound_buffer = NULL; + static size_t bound_buffer_len = 0; + char *bound; + char *pend; + struct value *bound_val; + + if (dval == NULL || str == NULL || str[k] == '\0') + return 0; + + pend = strstr (str + k, "__"); + if (pend == NULL) + { + bound = str + k; + k += strlen (bound); + } + else + { + GROW_VECT (bound_buffer, bound_buffer_len, pend - (str + k) + 1); + bound = bound_buffer; + strncpy (bound_buffer, str + k, pend - (str + k)); + bound[pend - (str + k)] = '\0'; + k = pend - str; + } + + bound_val = ada_search_struct_field (bound, dval, 0, VALUE_TYPE (dval)); + if (bound_val == NULL) + return 0; + + *px = value_as_long (bound_val); + if (pnew_k != NULL) + *pnew_k = k; + return 1; +} + +/* Value of variable named NAME in the current environment. If + no such variable found, then if ERR_MSG is null, returns 0, and + otherwise causes an error with message ERR_MSG. */ +static struct value * +get_var_value (char *name, char *err_msg) +{ + struct symbol **syms; + struct block **blocks; + int nsyms; + + nsyms = + ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE, + &syms, &blocks); + + if (nsyms != 1) + { + if (err_msg == NULL) + return 0; + else + error ("%s", err_msg); + } + + return value_of_variable (syms[0], blocks[0]); +} + +/* Value of integer variable named NAME in the current environment. If + no such variable found, then if ERR_MSG is null, returns 0, and sets + *FLAG to 0. If successful, sets *FLAG to 1. */ +LONGEST +get_int_var_value (char *name, char *err_msg, int *flag) +{ + struct value *var_val = get_var_value (name, err_msg); + + if (var_val == 0) + { + if (flag != NULL) + *flag = 0; + return 0; + } + else + { + if (flag != NULL) + *flag = 1; + return value_as_long (var_val); + } +} + + +/* Return a range type whose base type is that of the range type named + NAME in the current environment, and whose bounds are calculated + from NAME according to the GNAT range encoding conventions. + Extract discriminant values, if needed, from DVAL. If a new type + must be created, allocate in OBJFILE's space. The bounds + information, in general, is encoded in NAME, the base type given in + the named range type. */ + +static struct type * +to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile) +{ + struct type *raw_type = ada_find_any_type (name); + struct type *base_type; + LONGEST low, high; + char *subtype_info; + + if (raw_type == NULL) + base_type = builtin_type_int; + else if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE) + base_type = TYPE_TARGET_TYPE (raw_type); + else + base_type = raw_type; + + subtype_info = strstr (name, "___XD"); + if (subtype_info == NULL) + return raw_type; + else + { + static char *name_buf = NULL; + static size_t name_len = 0; + int prefix_len = subtype_info - name; + LONGEST L, U; + struct type *type; + char *bounds_str; + int n; + + GROW_VECT (name_buf, name_len, prefix_len + 5); + strncpy (name_buf, name, prefix_len); + name_buf[prefix_len] = '\0'; + + subtype_info += 5; + bounds_str = strchr (subtype_info, '_'); + n = 1; + + if (*subtype_info == 'L') + { + if (!ada_scan_number (bounds_str, n, &L, &n) + && !scan_discrim_bound (bounds_str, n, dval, &L, &n)) + return raw_type; + if (bounds_str[n] == '_') + n += 2; + else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */ + n += 1; + subtype_info += 1; + } + else + { + strcpy (name_buf + prefix_len, "___L"); + L = get_int_var_value (name_buf, "Index bound unknown.", NULL); + } + + if (*subtype_info == 'U') + { + if (!ada_scan_number (bounds_str, n, &U, &n) + && !scan_discrim_bound (bounds_str, n, dval, &U, &n)) + return raw_type; + } + else + { + strcpy (name_buf + prefix_len, "___U"); + U = get_int_var_value (name_buf, "Index bound unknown.", NULL); + } + + if (objfile == NULL) + objfile = TYPE_OBJFILE (base_type); + type = create_range_type (alloc_type (objfile), base_type, L, U); + TYPE_NAME (type) = name; + return type; + } +} + +/* True iff NAME is the name of a range type. */ +int +ada_is_range_type_name (const char *name) +{ + return (name != NULL && strstr (name, "___XD")); +} + + + /* Modular types */ + +/* True iff TYPE is an Ada modular type. */ +int +ada_is_modular_type (struct type *type) +{ + /* FIXME: base_type should be declared in gdbtypes.h, implemented in + valarith.c */ + struct type *subranged_type; /* = base_type (type); */ + + return (subranged_type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE + && TYPE_CODE (subranged_type) != TYPE_CODE_ENUM + && TYPE_UNSIGNED (subranged_type)); +} + +/* Assuming ada_is_modular_type (TYPE), the modulus of TYPE. */ +LONGEST +ada_modulus (struct type * type) +{ + return TYPE_HIGH_BOUND (type) + 1; +} + + + + /* Operators */ + +/* Table mapping opcodes into strings for printing operators + and precedences of the operators. */ + +static const struct op_print ada_op_print_tab[] = { + {":=", BINOP_ASSIGN, PREC_ASSIGN, 1}, + {"or else", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0}, + {"and then", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0}, + {"or", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0}, + {"xor", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0}, + {"and", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0}, + {"=", BINOP_EQUAL, PREC_EQUAL, 0}, + {"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0}, + {"<=", BINOP_LEQ, PREC_ORDER, 0}, + {">=", BINOP_GEQ, PREC_ORDER, 0}, + {">", BINOP_GTR, PREC_ORDER, 0}, + {"<", BINOP_LESS, PREC_ORDER, 0}, + {">>", BINOP_RSH, PREC_SHIFT, 0}, + {"<<", BINOP_LSH, PREC_SHIFT, 0}, + {"+", BINOP_ADD, PREC_ADD, 0}, + {"-", BINOP_SUB, PREC_ADD, 0}, + {"&", BINOP_CONCAT, PREC_ADD, 0}, + {"*", BINOP_MUL, PREC_MUL, 0}, + {"/", BINOP_DIV, PREC_MUL, 0}, + {"rem", BINOP_REM, PREC_MUL, 0}, + {"mod", BINOP_MOD, PREC_MUL, 0}, + {"**", BINOP_EXP, PREC_REPEAT, 0}, + {"@", BINOP_REPEAT, PREC_REPEAT, 0}, + {"-", UNOP_NEG, PREC_PREFIX, 0}, + {"+", UNOP_PLUS, PREC_PREFIX, 0}, + {"not ", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, + {"not ", UNOP_COMPLEMENT, PREC_PREFIX, 0}, + {"abs ", UNOP_ABS, PREC_PREFIX, 0}, + {".all", UNOP_IND, PREC_SUFFIX, 1}, /* FIXME: postfix .ALL */ + {"'access", UNOP_ADDR, PREC_SUFFIX, 1}, /* FIXME: postfix 'ACCESS */ + {NULL, 0, 0, 0} +}; + + /* Assorted Types and Interfaces */ + +struct type *builtin_type_ada_int; +struct type *builtin_type_ada_short; +struct type *builtin_type_ada_long; +struct type *builtin_type_ada_long_long; +struct type *builtin_type_ada_char; +struct type *builtin_type_ada_float; +struct type *builtin_type_ada_double; +struct type *builtin_type_ada_long_double; +struct type *builtin_type_ada_natural; +struct type *builtin_type_ada_positive; +struct type *builtin_type_ada_system_address; + +struct type **const (ada_builtin_types[]) = +{ + + &builtin_type_ada_int, + &builtin_type_ada_long, + &builtin_type_ada_short, + &builtin_type_ada_char, + &builtin_type_ada_float, + &builtin_type_ada_double, + &builtin_type_ada_long_long, + &builtin_type_ada_long_double, + &builtin_type_ada_natural, &builtin_type_ada_positive, + /* The following types are carried over from C for convenience. */ +&builtin_type_int, + &builtin_type_long, + &builtin_type_short, + &builtin_type_char, + &builtin_type_float, + &builtin_type_double, + &builtin_type_long_long, + &builtin_type_void, + &builtin_type_signed_char, + &builtin_type_unsigned_char, + &builtin_type_unsigned_short, + &builtin_type_unsigned_int, + &builtin_type_unsigned_long, + &builtin_type_unsigned_long_long, + &builtin_type_long_double, + &builtin_type_complex, &builtin_type_double_complex, 0}; + +/* Not really used, but needed in the ada_language_defn. */ +static void +emit_char (int c, struct ui_file *stream, int quoter) +{ + ada_emit_char (c, stream, quoter, 1); +} + +const struct language_defn ada_language_defn = { + "ada", /* Language name */ + /* language_ada, */ + language_unknown, + /* FIXME: language_ada should be defined in defs.h */ + ada_builtin_types, + range_check_off, + type_check_off, + case_sensitive_on, /* Yes, Ada is case-insensitive, but + * that's not quite what this means. */ + ada_parse, + ada_error, + ada_evaluate_subexp, + ada_printchar, /* Print a character constant */ + ada_printstr, /* Function to print string constant */ + emit_char, /* Function to print single char (not used) */ + ada_create_fundamental_type, /* Create fundamental type in this language */ + ada_print_type, /* Print a type using appropriate syntax */ + ada_val_print, /* Print a value using appropriate syntax */ + ada_value_print, /* Print a top-level value */ + {"", "", "", ""}, /* Binary format info */ +#if 0 + {"8#%lo#", "8#", "o", "#"}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"16#%lx#", "16#", "x", "#"}, /* Hex format info */ +#else + /* Copied from c-lang.c. */ + {"0%lo", "0", "o", ""}, /* Octal format info */ + {"%ld", "", "d", ""}, /* Decimal format info */ + {"0x%lx", "0x", "x", ""}, /* Hex format info */ +#endif + ada_op_print_tab, /* expression operators for printing */ + 1, /* c-style arrays (FIXME?) */ + 0, /* String lower bound (FIXME?) */ + &builtin_type_ada_char, + LANG_MAGIC +}; + +void +_initialize_ada_language (void) +{ + builtin_type_ada_int = + init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "integer", (struct objfile *) NULL); + builtin_type_ada_long = + init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_integer", (struct objfile *) NULL); + builtin_type_ada_short = + init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, "short_integer", (struct objfile *) NULL); + builtin_type_ada_char = + init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "character", (struct objfile *) NULL); + builtin_type_ada_float = + init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 0, "float", (struct objfile *) NULL); + builtin_type_ada_double = + init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long_float", (struct objfile *) NULL); + builtin_type_ada_long_long = + init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_long_integer", (struct objfile *) NULL); + builtin_type_ada_long_double = + init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long_long_float", (struct objfile *) NULL); + builtin_type_ada_natural = + init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "natural", (struct objfile *) NULL); + builtin_type_ada_positive = + init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "positive", (struct objfile *) NULL); + + + builtin_type_ada_system_address = + lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void", + (struct objfile *) NULL)); + TYPE_NAME (builtin_type_ada_system_address) = "system__address"; + + add_language (&ada_language_defn); + + add_show_from_set + (add_set_cmd ("varsize-limit", class_support, var_uinteger, + (char *) &varsize_limit, + "Set maximum bytes in dynamic-sized object.", + &setlist), &showlist); + varsize_limit = 65536; + + add_com ("begin", class_breakpoint, begin_command, + "Start the debugged program, stopping at the beginning of the\n\ +main program. You may specify command-line arguments to give it, as for\n\ +the \"run\" command (q.v.)."); +} + + +/* Create a fundamental Ada type using default reasonable for the current + target machine. + + Some object/debugging file formats (DWARF version 1, COFF, etc) do not + define fundamental types such as "int" or "double". Others (stabs or + DWARF version 2, etc) do define fundamental types. For the formats which + don't provide fundamental types, gdb can create such types using this + function. + + FIXME: Some compilers distinguish explicitly signed integral types + (signed short, signed int, signed long) from "regular" integral types + (short, int, long) in the debugging information. There is some dis- + agreement as to how useful this feature is. In particular, gcc does + not support this. Also, only some debugging formats allow the + distinction to be passed on to a debugger. For now, we always just + use "short", "int", or "long" as the type name, for both the implicit + and explicitly signed types. This also makes life easier for the + gdb test suite since we don't have to account for the differences + in output depending upon what the compiler and debugging format + support. We will probably have to re-examine the issue when gdb + starts taking it's fundamental type information directly from the + debugging information supplied by the compiler. fnf@cygnus.com */ + +static struct type * +ada_create_fundamental_type (struct objfile *objfile, int typeid) +{ + struct type *type = NULL; + + switch (typeid) + { + default: + /* FIXME: For now, if we are asked to produce a type not in this + language, create the equivalent of a C integer type with the + name "". When all the dust settles from the type + reconstruction work, this should probably become an error. */ + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "", objfile); + warning ("internal error: no Ada fundamental type %d", typeid); + break; + case FT_VOID: + type = init_type (TYPE_CODE_VOID, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "void", objfile); + break; + case FT_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "character", objfile); + break; + case FT_SIGNED_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "signed char", objfile); + break; + case FT_UNSIGNED_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned char", objfile); + break; + case FT_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, "short_integer", objfile); + break; + case FT_SIGNED_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, "short_integer", objfile); + break; + case FT_UNSIGNED_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned short", objfile); + break; + case FT_INTEGER: + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "integer", objfile); + break; + case FT_SIGNED_INTEGER: + type = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, 0, "integer", objfile); /* FIXME -fnf */ + break; + case FT_UNSIGNED_INTEGER: + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned int", objfile); + break; + case FT_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_integer", objfile); + break; + case FT_SIGNED_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_integer", objfile); + break; + case FT_UNSIGNED_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long", objfile); + break; + case FT_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_long_integer", objfile); + break; + case FT_SIGNED_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, "long_long_integer", objfile); + break; + case FT_UNSIGNED_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long long", objfile); + break; + case FT_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 0, "float", objfile); + break; + case FT_DBL_PREC_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long_float", objfile); + break; + case FT_EXT_PREC_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long_long_float", objfile); + break; + } + return (type); +} + +void +ada_dump_symtab (struct symtab *s) +{ + int i; + fprintf (stderr, "New symtab: [\n"); + fprintf (stderr, " Name: %s/%s;\n", + s->dirname ? s->dirname : "?", s->filename ? s->filename : "?"); + fprintf (stderr, " Format: %s;\n", s->debugformat); + if (s->linetable != NULL) + { + fprintf (stderr, " Line table (section %d):\n", s->block_line_section); + for (i = 0; i < s->linetable->nitems; i += 1) + { + struct linetable_entry *e = s->linetable->item + i; + fprintf (stderr, " %4ld: %8lx\n", (long) e->line, (long) e->pc); + } + } + fprintf (stderr, "]\n"); +} diff --git a/gdb/c-lang.c b/gdb/c-lang.c new file mode 100644 index 0000000..6bbd6d9 --- /dev/null +++ b/gdb/c-lang.c @@ -0,0 +1,652 @@ +/* C language support routines for GDB, the GNU debugger. + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "defs.h" +#include "symtab.h" +#include "gdbtypes.h" +#include "expression.h" +#include "parser-defs.h" +#include "language.h" +#include "c-lang.h" +#include "valprint.h" +#include "macroscope.h" +#include "gdb_assert.h" +#include "charset.h" + +extern void _initialize_c_language (void); +static void c_emit_char (int c, struct ui_file * stream, int quoter); + +/* Print the character C on STREAM as part of the contents of a literal + string whose delimiter is QUOTER. Note that that format for printing + characters and strings is language specific. */ + +static void +c_emit_char (register int c, struct ui_file *stream, int quoter) +{ + const char *escape; + int host_char; + + c &= 0xFF; /* Avoid sign bit follies */ + + escape = c_target_char_has_backslash_escape (c); + if (escape) + { + if (quoter == '"' && strcmp (escape, "0") == 0) + /* Print nulls embedded in double quoted strings as \000 to + prevent ambiguity. */ + fprintf_filtered (stream, "\\000"); + else + fprintf_filtered (stream, "\\%s", escape); + } + else if (target_char_to_host (c, &host_char) + && host_char_print_literally (host_char)) + { + if (host_char == '\\' || host_char == quoter) + fputs_filtered ("\\", stream); + fprintf_filtered (stream, "%c", host_char); + } + else + fprintf_filtered (stream, "\\%.3o", (unsigned int) c); +} + +void +c_printchar (int c, struct ui_file *stream) +{ + fputc_filtered ('\'', stream); + LA_EMIT_CHAR (c, stream, '\''); + fputc_filtered ('\'', stream); +} + +/* Print the character string STRING, printing at most LENGTH characters. + LENGTH is -1 if the string is nul terminated. Each character is WIDTH bytes + long. Printing stops early if the number hits print_max; repeat counts are + printed as appropriate. Print ellipses at the end if we had to stop before + printing LENGTH characters, or if FORCE_ELLIPSES. */ + +void +c_printstr (struct ui_file *stream, char *string, unsigned int length, + int width, int force_ellipses) +{ + register unsigned int i; + unsigned int things_printed = 0; + int in_quotes = 0; + int need_comma = 0; + extern int inspect_it; + + /* If the string was not truncated due to `set print elements', and + the last byte of it is a null, we don't print that, in traditional C + style. */ + if (!force_ellipses + && length > 0 + && (extract_unsigned_integer (string + (length - 1) * width, width) + == '\0')) + length--; + + if (length == 0) + { + fputs_filtered ("\"\"", stream); + return; + } + + for (i = 0; i < length && things_printed < print_max; ++i) + { + /* Position of the character we are examining + to see whether it is repeated. */ + unsigned int rep1; + /* Number of repetitions we have detected so far. */ + unsigned int reps; + unsigned long current_char; + + QUIT; + + if (need_comma) + { + fputs_filtered (", ", stream); + need_comma = 0; + } + + current_char = extract_unsigned_integer (string + i * width, width); + + rep1 = i + 1; + reps = 1; + while (rep1 < length + && extract_unsigned_integer (string + rep1 * width, width) + == current_char) + { + ++rep1; + ++reps; + } + + if (reps > repeat_count_threshold) + { + if (in_quotes) + { + if (inspect_it) + fputs_filtered ("\\\", ", stream); + else + fputs_filtered ("\", ", stream); + in_quotes = 0; + } + LA_PRINT_CHAR (current_char, stream); + fprintf_filtered (stream, " ", reps); + i = rep1 - 1; + things_printed += repeat_count_threshold; + need_comma = 1; + } + else + { + if (!in_quotes) + { + if (inspect_it) + fputs_filtered ("\\\"", stream); + else + fputs_filtered ("\"", stream); + in_quotes = 1; + } + LA_EMIT_CHAR (current_char, stream, '"'); + ++things_printed; + } + } + + /* Terminate the quotes if necessary. */ + if (in_quotes) + { + if (inspect_it) + fputs_filtered ("\\\"", stream); + else + fputs_filtered ("\"", stream); + } + + if (force_ellipses || i < length) + fputs_filtered ("...", stream); +} + +/* Create a fundamental C type using default reasonable for the current + target machine. + + Some object/debugging file formats (DWARF version 1, COFF, etc) do not + define fundamental types such as "int" or "double". Others (stabs or + DWARF version 2, etc) do define fundamental types. For the formats which + don't provide fundamental types, gdb can create such types using this + function. + + FIXME: Some compilers distinguish explicitly signed integral types + (signed short, signed int, signed long) from "regular" integral types + (short, int, long) in the debugging information. There is some dis- + agreement as to how useful this feature is. In particular, gcc does + not support this. Also, only some debugging formats allow the + distinction to be passed on to a debugger. For now, we always just + use "short", "int", or "long" as the type name, for both the implicit + and explicitly signed types. This also makes life easier for the + gdb test suite since we don't have to account for the differences + in output depending upon what the compiler and debugging format + support. We will probably have to re-examine the issue when gdb + starts taking it's fundamental type information directly from the + debugging information supplied by the compiler. fnf@cygnus.com */ + +struct type * +c_create_fundamental_type (struct objfile *objfile, int typeid) +{ + register struct type *type = NULL; + + switch (typeid) + { + default: + /* FIXME: For now, if we are asked to produce a type not in this + language, create the equivalent of a C integer type with the + name "". When all the dust settles from the type + reconstruction work, this should probably become an error. */ + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "", objfile); + warning ("internal error: no C/C++ fundamental type %d", typeid); + break; + case FT_VOID: + type = init_type (TYPE_CODE_VOID, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "void", objfile); + break; + case FT_BOOLEAN: + type = init_type (TYPE_CODE_BOOL, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "bool", objfile); + break; + case FT_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_NOSIGN, "char", objfile); + break; + case FT_SIGNED_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, "signed char", objfile); + break; + case FT_UNSIGNED_CHAR: + type = init_type (TYPE_CODE_INT, + TARGET_CHAR_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned char", objfile); + break; + case FT_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, "short", objfile); + break; + case FT_SIGNED_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, "short", objfile); /* FIXME-fnf */ + break; + case FT_UNSIGNED_SHORT: + type = init_type (TYPE_CODE_INT, + TARGET_SHORT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned short", objfile); + break; + case FT_INTEGER: + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "int", objfile); + break; + case FT_SIGNED_INTEGER: + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, "int", objfile); /* FIXME -fnf */ + break; + case FT_UNSIGNED_INTEGER: + type = init_type (TYPE_CODE_INT, + TARGET_INT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned int", objfile); + break; + case FT_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, "long", objfile); + break; + case FT_SIGNED_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, "long", objfile); /* FIXME -fnf */ + break; + case FT_UNSIGNED_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long", objfile); + break; + case FT_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, "long long", objfile); + break; + case FT_SIGNED_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, "signed long long", objfile); + break; + case FT_UNSIGNED_LONG_LONG: + type = init_type (TYPE_CODE_INT, + TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long long", objfile); + break; + case FT_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 0, "float", objfile); + break; + case FT_DBL_PREC_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "double", objfile); + break; + case FT_EXT_PREC_FLOAT: + type = init_type (TYPE_CODE_FLT, + TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long double", objfile); + break; + case FT_COMPLEX: + type = init_type (TYPE_CODE_FLT, + 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 0, "complex float", objfile); + TYPE_TARGET_TYPE (type) + = init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT, + 0, "float", objfile); + break; + case FT_DBL_PREC_COMPLEX: + type = init_type (TYPE_CODE_FLT, + 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "complex double", objfile); + TYPE_TARGET_TYPE (type) + = init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "double", objfile); + break; + case FT_EXT_PREC_COMPLEX: + type = init_type (TYPE_CODE_FLT, + 2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "complex long double", objfile); + TYPE_TARGET_TYPE (type) + = init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT, + 0, "long double", objfile); + break; + case FT_TEMPLATE_ARG: + type = init_type (TYPE_CODE_TEMPLATE_ARG, + 0, + 0, "