diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2004-12-27 14:01:02 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2004-12-27 14:01:02 +0000 |
commit | 7cb023cfb07d13fb208030e4352f159f1e2b229d (patch) | |
tree | 961c03598dd9430c22e1c634d533db0a08de8999 | |
parent | 5b0cde74db4ad7c994ffdca423951b72310dd8cb (diff) |
Resolve conflicts for GDB 6.3. Add local patches.
ok deraadt@
511 files changed, 29624 insertions, 27090 deletions
diff --git a/gnu/usr.bin/binutils/gdb/ChangeLog b/gnu/usr.bin/binutils/gdb/ChangeLog index b1a85513d40..b95334c371e 100644 --- a/gnu/usr.bin/binutils/gdb/ChangeLog +++ b/gnu/usr.bin/binutils/gdb/ChangeLog @@ -1,33 +1,8532 @@ -2004-04-03 GDB Administrator <gdbadmin@sourceware.org> +2004-11-08 Andrew Cagney <cagney@gnu.org> - GDB 6.1 released. - * version.in: Bump to version 6.1. + GDB 6.3 released. + * version.in: Bump to version 6.3. + +2004-11-08 Andrew Cagney <cagney@gnu.org> + + * README: Refer to 6.3, not 6.2, update directory listing droppng + references to intl/ and mmalloc/. + * PROBLEMS: Refer to 6.3 not 6.2. + + * PROBLEMS: Delete no-longer applicable problems. + +2004-11-05 Andrew Cagney <cagney@gnu.org> + + Backport 2004-10-27 Jim Blandy <jimb@redhat.com> + * remote.c (fetch_register_using_p): Construct 'p' packet in a + manner independent of the host byte order. + +2004-11-04 Kei Sakamoto <sakamoto.kei@denesas.com> + + * Makefile.in (m32r-tdep.o): Update dependencies. + * m32r-tdep.c (m32r_gdbarch_init): Call gdbarch_init_osabi for + ABI-specific overrides. + +2004-11-04 Kei Sakamoto <sakamoto.kei@denesas.com> + + * m32r-tdep.c (m32r_memory_insert_breakpoint): Remove + unnecessary parallel execution bit. + (m32r_memory_remove_breakpoint): Ditto. + (m32r_breakpoint_from_pc): Update. + +2004-11-03 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_frame_cache): Use frame_pc_unwind instead of + frame_func_unwind to locate the unwind entry. + (hppa_frame_this_id): Likewise. + +2004-11-03 Andrew Cagney <cagney@gnu.org> + + * gdb/NEWS: Mention internationalization, m32r-*-linux-gnu, 'p' + packet, obsolete configurations, end-of-life deprecated_registers. + +2004-11-02 Mark Kettenis <kettenis@gnu.org> + + * dwarf2-frame.c (read_encoded_value): Set proper size for signed + encodings as well as unsigned encodings. + +2004-11-02 Paul Hilfinger <hilfingr@nile.gnat.com> + + * NEWS: GDB understands GNAT Ada. + +2004-10-23 Ulrich Weigand <uweigand@de.ibm.com> + + * s390-tdep.c (enum pv_boolean): Remove. + (pv_is_array_ref): Remove. + (s390_on_stack): Remove. + (S390_NUM_SPILL_SLOTS): Remove. + (struct s390_prologue_data): Remove members 'spill' and 'back_chain', + add members 'gpr_slot', 'fpr_slot', and 'back_chain_saved_p'. + (s390_store): Track all stores of orginal incoming registers to the + stack constant offsets relative to the CFA, instead of only tracking + stores into specific spill slots. + (s390_load): Likewise. + (s390_analyze_prologue): Adapt to struct s390_prologue_data changes. + (s390_prologue_frame_unwind_cache): Likewise. Only track registers + defined as call-saved by the ABI. + (s390_push_dummy_call): Use bottom of dummy call argument save area + as return value, not the top. Do not store to the called function's + register save area. + (s390_unwind_dummy_id): Adapt accordingly. + +2004-10-19 Michael Chastain <mec.gnu@mindspring.com> + + * NEWS: GDB works with GCC -feliminate-dwarf2-dups. + +2004-10-19 Andrew Cagney <cagney@gnu.org> + + GDB 6.3 branch created. + * version.in: Bump to version 6.2.90. + +2004-10-15 Joel Brobecker <brobecker@gnat.com> + + * dwarf2read.c (set_cu_language): Set language to Ada for + DW_LANG_Ada83 and DW_LANG_Ada95. + +2004-10-15 Michael Chastain <mec.gnu@mindspring.com> + + From Andreas Schwab <schwab@suse.de>: + * Makefile.in (.y.c, .l.c.): Fix the substitutions for + for xmalloc and xrealloc. + +2004-10-15 Andrew Cagney <cagney@gnu.org> + + * ada-exp.y, ada-lex.l: Use xmalloc and xrealloc through out. + * inf-ptrace.c: Include "gdb_wait.h" instead of <wait.h>. + * Makefile.in (.y.c, .l.c): Don't replace xmalloc with xxmalloc. + Update dependencies. + +2004-10-15 Paul Hilfinger <Hilfinger@gnat.com> + + * ada-lang.c (ada_lookup_symbol): Correct comment. + (ada_evaluate_subexp): Change error message for + OP_FUNCALL case so as not to indicate an internal error. + +2004-10-15 Joel Brobecker <brobecker@gnat.com> + + Committed by Paul Hilfinger. + * ada-lang.c (ada_template_to_fixed_record_type_1): Detect bogus + type sizes in XVE/XVU types, and emit a warning when that happens, + instead of rounding up the size of the resulting type. + Some minor reformatting. + (ada_is_aligner_type): Do not consider a type as an aligner type + if there is a corresponding XVS type as well. + (ada_evaluate_subexp): For TERNOP_SLICE, handle cases where we + have several levels of pointer indirection to the array. + +2004-10-15 Jerome Guitton <guitton@gnat.com> + + Committed by Paul Hilfinger. + * ada-lang.c (check_size): New function. + (coerce_unspec_val_to_type): call check_size to make sure + that the object size is reasonable. + (ada_evaluate_subexp): in UNOP_IND: Ditto. In TERNOP_SLICE: + Implements the case when we get a reference when we evaluate + the expression of one of the bounds of the slice. + (ada_value_struct_elt): when a packed array field is + a reference, use ada_coerce_ref to dereference it; use + ada_value_ind only if it is a pointer. + +2004-10-15 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips32_scan_prologue): Move the implementation up + a bit to avoid the necessity of an advance declaration. Remove + declaration. + (set_reg_offset): Move implemenation up. + (mips16_get_imm): Likewise. + (mips16_scan_prologue): Likewise. + (reset_saved_regs): Likewise. + (mips32_scan_prologue): Likewise. + +2004-10-14 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips32_scan_prologue): Add advance declaration. + Remove sp as a parameter, compute it internally instead. Move + prologue scanning limit from heuristic_proc_desc to here. + (mips16_scan_prologue): Likewise. + (mips_insn16_frame_cache): Replace call to heuristic_proc_desc + by call to mips16_scan_prologue. + (mips_insn32_frame_cache): Replace call to heuristic_proc_desc + by call to mips32_scan_prologue. + (heuristic_proc_desc): Remove code that's no longer necessary. + Update calls to mips16_scan_prologue and mips32_scan_prologue. + (mips_skip_prologue): Update calls to mips16_scan_prologue + and mips32_scan_prologue. + +2004-10-14 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips16_scan_prologue): Merge code from + mips16_skip_prologue. Now return the address of the first + instruction past the function prologue. + (mips16_skip_prologue): Remove, no longer necessary. + (mips_skip_prologue): Replace call to mips16_skip_prologue + by call to mips16_scan_prologue. + +2004-10-14 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips32_scan_prologue): Merge code from + mips32_skip_prologue. Now return the address of the first + instruction past the function prologue. + (mips32_skip_prologue): Remove. No longer necessary. + (mips16_skip_prologue): Add parameter end_pc instead of + computing it. + (mips_skip_prologue): Compute the upper limit for the + prologue scanning. Update call to mips16_skip_prologue. + Replace call to mips32_skip_prologue by call to + mips32_scan_prologue. + +2004-10-14 Mark Kettenis <kettenis@gnu.org> + + * hppa-tdep.c (hppa_frame_cache): Add support for OpenBSD and + NetBSD system call stubs that store %rp in the ERP slot of the + stack frame. + + * source.c: Always define O_BINARY to 0 if not defined already. + (openp): Unconditionally use O_BINARY. + + * top.c (gdb_readline): Always accept "\r\n" as a line-ending. + * event-top.c (gdb_readline2): Likewise. + +2004-10-14 Orjan Friberg <orjanf@axis.com> + + * cris-tdep.c (_initialize_cris_tdep): Re-add call to + deprecated_add_core_fns which was removed by mistake. + +2004-10-13 Kevin Buettner <kevinb@redhat.com> + + * ia64-linux-nat.c (fill_gregset, fill_fpregset): Replace + references to deprecated_registers[] with equivalent code. + +2004-10-13 Kevin Buettner <kevinb@redhat.com> + + * rs6000-tdep.c (rs6000_push_dummy_call): Replace references to + ``deprecated_registers'' with equivalent code. Use gdb_assert() + instead of explicit test and print statement. + +2004-10-12 Mark Kettenis <kettenis@gnu.org> + + * sparc-nat.c: Include "inf-ptrace.h". + (sparc_target): New function. + * sparc-nat.h: Update copyright year. + (sparc_target): New prototype. + * sparcnbsd-nat.c: Don't include "gdbcore.h", include "target.h". + (_initialize_sparcnbsd_nat): Construct and add target vector. + * sparc64nbsd-nat.c: Include "target.h". + (_initialize_sparc64nbsd_nat): Construct and add target vector. + * Makefile.in (sparc-nat.o, sparcnbsd-nat.o, sparc64nbsd-nat.o): + Update dependencies. + * config/sparc/nbsd64.mh (NATDEPFILES): Remove infptrace.o and + inftarg.o, add inf-ptrace.o. + * config/sparc/nbsdaout.mh (NATDEPFILES): Remove infptrace.o and + inftarg.o, add inf-ptrace.o and bsd-kvm.o. + (NAT_FILE): Set to nm-bsd.h. + (LOADLIBES): New variable. + * config/sparc/nbsdelf.mh (NATDEPFILES): Remove infptrace.o and + infarg.o, add inf-ptrace.o. + * config/sparc/nm-nbsdaout.h: Remove file. + * config/sparc/fbsd.mh (NATDEPFILES): Add inf-ptrace.o. + * config/sparc/linux.mh (NATDEPFILES): Add inf-ptrace.o. + * config/sparc/linux64.mh (NATDEPFILES): Add inf-ptrace.o. + + * defs.h [!FOPEN_RB]: Include "fopen-bin.h" instead of + "fopen-same.h". Update comment. + +2004-10-11 Mark Kettenis <kettenis@gnu.org> + + * i386gnu-nat.c: Include "gdb_string.h". + (fetch_fpregs): Use i387_supply_fxsave to fill the floating-point + registers when the floating-point state isn't initialized. + * Makefile.in (i386gnu-nat.o): Update dependencies. + +2004-10-11 David Anderson <davea@sgi.com> + + * regcache.c (regcache_raw_read): Comment was missing "to". + Extraneous ' removed. + * gdb_thread_db.h (struct td_thrinfo): ti_lid field + comment now describes use. + +2004-10-11 Orjan Friberg <orjanf@axis.com> + + * cris-tdep.c (cris_sigtramp_start, cris_rt_sigtramp_start) + (cris_sigcontext_addr, cris_sigtramp_frame_unwind_cache) + (cris_sigtramp_frame_this_id, cris_sigtramp_frame_prev_register) + (cris_sigtramp_frame_sniffer): New functions. + (cris_gdbarch_init): Hook in signal trampoline unwinder. + (cris_dwarf2_reg_to_regnum, cris_dwarf2_frame_init_reg): New functions. + (cris_gdbarch_init): Hook in Dwarf-2 unwinder. + (struct gdbarch_tdep, set_cris_dwarf2_cfi, cris_dump_tdep) + (cris_gdbarch_init, _initialize_cris_tdep): Add CRIS Dwarf-2 CFI usage + command. + (cris_version_update): Remove, replace with ... + (set_cris_version): New function. + (struct gdbarch_tdep, cris_mode, cris_mode_update) + (cris_cannot_store_register, cris_dump_tdep, cris_gdbarch_init) + (_initialize_cris_tdep): Remove CRIS mode command. + (cris_fpless_backtrace, _initialize_cris_tdep): Remove + cris-fpless-backtrace command. + (cris_scan_prologue): Fix prologue scanning limit. + (cris_register_type): Update to reflect actual registers. + (cris_register_bytes_ok) Remove. + (cris_gdbarch_init): Remove support for CRIS v8 and v9. + Remove set_gdbarch_deprecated_register_size, + set_gdbarch_deprecated_register_byte, set_gdbarch_register_bytes_ok. + +2004-10-10 Andrew Cagney <cagney@gnu.org> + + * ada-lang.c (lim_warning): Add ATTR_FORMAT prototype and FIXME + comment. + +2004-10-10 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips16_scan_prologue): Remove redundant code. + +2004-10-10 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips16_scan_prologue): Renames + mips16_heuristic_proc_desc. Update comment. + (mips32_scan_prologue): Renames mips32_heuristic_proc_desc. + (heuristic_proc_desc): Update calls to the 2 functions above. + +2004-10-10 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips_insn16_frame_cache): Remove unused variables. + Update comments. Also immediately return empty cache when the start + address of our function could not be found. + (mips_insn32_frame_cache): Likewise. + +2004-10-10 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips16_decode_reg_save): Delete, no longer used. + (mips_insn16_frame_cache): Pass frame cache in call to + heuristic_proc_desc. Move some code to mips16_heuristic_proc_desc. + Remove code that became redundant as a consequence. + (mips32_heuristic_proc_desc): No longer compute a fake + procedure descriptor. Compute the full frame cache instead. + Some minor comment reformatting. + +2004-10-10 Jim Blandy <jimb@redhat.com> + + * MAINTAINERS (generic symtabs, dwarf readers, elf reader, stabs + reader, tracing bytecode stuff): Remove self. + +2004-10-10 Mark Kettenis <kettenis@gnu.org> + + * sparc64-linux-tdep.c: Update copyright year. Don't include + "solib-svr4.h". + (sparc64_linux_svr4_fetch_link_map_offsets): Remove function. + (sparc64_linux_init_abi): Don't set solib_svr4_link_map_offsets. + * Makefile.in (sparc64-linux-tdep.o): Update dependencies. + + * sparc-linux-tdep.c: Update copyright year. + (sparc_linux_sigtramp_start): Change first argument from CORE_ADDR + to struct frame_info *. Use safe_frame_unwind_memory instead of + deprecated_read_memory_nobpt. + (sparc32_linux_sigtramp_start, sparc32_linux_rt_sigtramp_start): + Change argumen from CORE_ADDR to struct frame_info *. Adjust for + changed signature of sparc_linux_sigtramp_start. + (sparc32_linux_pc_in_sigtramp): Remove function. + (sparc32_linux_sigtramp_p): New function. + (sparc32_linux_sigtramp_frame_sniffer): Use + sparc32_linux_sigtramp_p instead of sparc32_linux_pc_in_sigtramp. + + * sparc-linux-tdep.c (sparc32_linux_svr4_fetch_link_map_offsets): + Remove function. + (sparc32_linux_init_abi): Don't set solib_svr4_link_map_offsets. + + * ada-lang.c (lim_warning): Re-implement as a varargs function. + (decode_packed_array_type, value_subscript_packed) + (ada_evaluate_subexp, to_fixed_range_type): Remove redundant + argument in call to lim_warning. + + * configure.in: Really disable the TUI if an enhanced curses + library isn't found. + * configure: Regenerate. + +2004-10-09 Mark Kettenis <kettenis@gnu.org> + + * config/i386/nbsdaout.mh (NAT_FILE): Set to solib.h. + * config/i386/nbsdelf.mh (NAT_FILE): Set to solib.h. + * config/i386/nm-nbsdaout.h: Remove file. + * config/i386/nm-fbsd.h (link_object, lo_name, lo_library) + (lo_unused, lo_major, lo_minor, lo_next, link_map, lm_addr) + (lm_name, lm_next, lm_lop, lm_lob, lm_rwt, lm_ld, lm_lpd) + (link_dynamic_2, ld_loaded, ld_need, ld_rules, ld_got, ld_plt) + (ld_rel, ld_hash, ld_stab, ld_stab_hash, ld_buckets, ld_symbols) + (ld_symb_size, ld_text, ld_plt_sz, rtc_symb, rtc_sp, rtc_next) + (ld_debug, ldd_version, ldd_in_debugger, ldd_sym_loaded) + (ldd_bp_addr, ldd_bp_inst, ldd_cp, link_dynamic, ld_version) + (ldd, ld_un, ld_2): Remove defines. + * config/i386/nm-obsd.h: Likewise. + +2004-10-09 Paul Hilfinger <hilfingr@nile.gnat.com> + + * ada-lex.l: Remove useless rule whose right-context clause + causes unreferenced static function warning for yyrealloc. + (ada_flex_use): Remove the artificial reference to yyrealloc. + +2004-10-08 Andrew Cagney <cagney@gnu.org> + + * target.h (struct target_ops): Rename to_xfer_memory to + deprecated_xfer_memory. + * target.c: Update. + (deprecated_debug_xfer_memory): Rename debug_to_xfer_memory. + * wince.c: Update. + * win32-nat.c: Update. + * v850ice.c: Update. + * uw-thread.c: Update. + * thread-db.c: Update. + * sol-thread.c: Update. + * remote.c: Update. + * remote-vx.c: Update. + * remote-st.c: Update. + * remote-sim.c: Update. + * remote-sds.c: Update. + * remote-rdp.c: Update. + * remote-rdi.c: Update. + * remote-mips.c: Update. + * remote-m32r-sdi.c: Update. + * remote-e7000.c: Update. + * procfs.c: Update. + * ppc-bdm.c: Update. + * nto-procfs.c: Update. + * monitor.c: Update. + * linux-nat.c: Update. + * inftarg.c: Update. + * hpux-thread.c: Update. + * go32-nat.c: Update. + * gnu-nat.c: Update. + * exec.c: Update. + * corelow.c: Update. + * bsd-kvm.c: Update. + * aix-thread.c: Update. + +2004-10-08 Andrew Cagney <cagney@gnu.org> + + * target.c (debug_target): Move to near start of file. + (target_stopped_data_address_p): Re-org logic, add casts. + +2004-10-02 Mark Kettenis <kettenis@gnu.org> + + * solib-sunos.c [HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS] (link_map) + (lm_addr, lm_name, lm_next, link_dynamic_2, ld_loaded, rtc_symb) + (rtc_sp, rtc_next, ld_debug, ldd_in_debugger, ldd_bp_addr) + (ldd_bp_inst, ldd_cp, link_dynamic, ld_version, ldd, ld_un, ld_2): + New defines. + +2004-10-08 Jeff Johnston <jjohnstn@redhat.com> + + * target.h (to_stopped_data_address): Change prototype to + take a CORE_ADDR pointer and return an int. + * target.c (update_current_target): Change to_stopped_data_address + to match new prototype. + (debug_to_stopped_data_address): Change appropriately. + * breakpoint.c (bpstat_stop_status): Change call to + target_stopped_data_address to use new prototype. + * frv-tdep.c (frv_have_stopped_data_address): New function. + (frv_stopped_data_address): Change to new prototype and + functionality. + * ia64-linux-nat.c (ia64_stopped_data_address): Change to new + prototype and functionality. + (ia64_stopped_by_watchpoint): New function. + * i386-nat.c (i386_stopped_data_address): Change to new + prototype and functionality. + (i386_stopped_by_watchpoint): New function. + * remote.c (remote_stopped_data_address): Change to new prototype + and functionality. + * remote-m32r-sdi.c (m32r_stopped_data_address): Ditto. + * config/frv/tm-frv.h (frv_stopped_data_address): Change prototype. + (STOPPED_BY_WATCHPOINT): Change to use frv_have_stopped_data_address. + * config/i386/nm-i386.h (STOPPED_BY_WATCHPOINT): Change to use + new i386_stopped_by_watchpoint function. + (i386_stopped_by_watchpoint): New prototype. + (i386_stoppped_data_address): Change to new prototype. + * config/ia64/nm-linux.h (STOPPED_BY_WATCHPOINT): Change to use + new ia64_stopped_by_watchpoint function. + (ia64_stopped_by_watchpoint): New prototype. + (ia64_stopped_data_address): Ditto. + +2004-10-08 Paul Hilfinger <Hilfinger@gnat.com> + + * ada-typeprint.c (ada_print_type): Use int_string for printing + modulus of modular type. + * ada-lang.h (ada_modulus): Change return type to unsigned. + * ada-lang.c (ada_language_arch_info): Correct type of + string_char_type. + (ada_modulus): Return unsigned result. + (ada_lookup_symbol): Remove user disambiguation and modify comment + accordingly. + +2004-10-08 Eric Botcazou <ebotcazou@act-europe.fr> + + Committed by Paul Hilfinger. + * ada-lang.c (decode_packed_array): On big-endian targets, + left-justify the value if it comes with a modular type. + +2004-10-08 Joel Brobecker <brobecker@gnat.com> + + Committed by Paul Hilfinger. + * ada-lang.c (template_to_static_fixed_type): Fix a small typo. + (is_name_suffix): Add support for "___JM" suffixes. + (ada_check_typedef): Renames ada_completed_type. + Update all users of CHECK_TYPEDEF, check_typedef, and + ada_complete_type to call ada_check_typedef. + * ada-typeprint.c: Likewise. + * ada-valprint.c: Likewise. + +2004-10-08 Corinna Vinschen <vinschen@redhat.com> + + * infcall.c (call_function_by_hand): Use correct VALUE_TYPE macro. + +2004-10-08 Nick Roberts <nickrob@snap.net.nz> + + * MAINTAINERS: Update e-mail address. + +2004-10-07 Daniel Jacobowitz <dan@debian.org> + + From Maciej W. Rozycki <macro@mips.com>: + * mips-tdep.c (mips32_next_pc): Check the register's contents, + not its number for BLEZ/BLEZL and BGTZ/BGTZL. + +2004-10-07 Kei Sakamoto <sakamoto.kei@renesas.com> + + * m32r-tdep.c (decode_prologue): Support functions written + in assembler language. Recognize trap instructions as the + end of prologue. + (m32r_frame_unwind_cache): Ditto. + (m32r_skip_prologue): Extend search limit. Quit analyzing + prologue if pc's location is not readable. + +2004-10-06 Paul N. Hilfinger <Hilfinger@gnat.com> + + * Makefile.in (.l.c): Do conversions of names of alloc and free + functions that are done for .y.c files, plus special one + for yy_flex_realloc. Also, correct missing-file tests here. + * ada-lex.l (malloc, free): Remove macros. + (resize_tempbuf): Use "realloc"; rely on sed changes to convert to + xrealloc. + (ada_flex_use): Dummy definition to remove warnings about unused + functions. + * ada-exp.y (dummy_string_to_ada_operator): Temporary definition + to suppress warning. + +2004-10-06 Corinna Vinschen <vinschen@redhat.com> + + * sh-tdep.c (sh_return_value_nofpu): New function, implementing + RETURN_VALUE. + (sh_return_value_fpu): Ditto for CPUs with FPU. + (sh_gdbarch_init): Remove STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE, + RETURN_VALUE_ON_STACK and USE_STRUCT_CONVENTION throughout. + Install sh_return_value_nofpu resp. sh_return_value_fpu as + RETURN_VALUE functions. + +2004-10-06 Corinna Vinschen <vinschen@redhat.com> + + * sh-tdep.c (sh_pseudo_register_read): Add PSEUDO_BANK_REGNUM handling. + (sh_pseudo_register_write): Ditto. + +2004-10-06 Corinna Vinschen <vinschen@redhat.com> + + * sh-tdep.c (IS_MACL_STS): New define. + (IS_MOVI20): Ditto. + (IS_MACL_LDS): Ditto. + (sh_analyze_prologue): Recognize STS.L MACL,@-r15 and MOVI20 + instructions in prologue. + (sh_in_function_epilogue_p): Recognize LDS.L @r15+,MACL and MOVI20 + instructions in epilogue. + +2004-10-06 Corinna Vinschen <vinschen@redhat.com> + + * sh-tdep.c (SH_NUM_REGS): Define as 67. + (sh_sh_register_name): Add eight empty register names. + (sh_sh3_register_name): Ditto. + (sh_sh3e_register_name): Ditto. + (sh_sh2e_register_name): Ditto. + (sh_sh2a_register_name): New function, defining SH2A register set. + (sh_sh2a_nofpu_register_name): New function, defining SH2A register set + in nofpu case. + (sh_sh_dsp_register_name): Add eight empty register names. + (sh_sh3_dsp_register_name): Ditto. + (sh_sh4_register_name): Ditto. + (sh_sh4_nofpu_register_name): Ditto. + (sh_sh4al_dsp_register_name): Ditto. + (sh2a_show_regs): New function. + (sh2a_nofpu_show_regs): New function. + (sh_sh2a_register_type): New function. + (do_bank_register_info): New function. + (sh_print_pseudo_register): Call do_bank_register_info. + Call sh_print_pseudo_register for valid "bank" register. + (sh_sh2a_register_sim_regno): New function. + (sh_gdbarch_init): Add bfd_mach_sh2a and bfd_mach_sh2a_nofpu handling. + Increment pseudo register count by one for all sh variants with + pseudo registers to accomodate pseudo bank register. + * sh-tdep.h: Add register numbers for R0_BANK0_REGNUM, MACHB_REGNUM, + IVNB_REGNUM, PRB_REGNUM, GBRB_REGNUM, MACLB_REGNUM, BANK_REGNUM, + IBCR_REGNUM, IBNR_REGNUM, TBR_REGNUM and PSEUDO_BANK_REGNUM. + Increment pseudo register numbers. + +2004-10-06 Corinna Vinschen <vinschen@redhat.com> + + * dwarf2read.c (read_subroutine_type): Call make_function_type + instead of lookup_function_type. + +2004-10-05 Jim Blandy <jimb@redhat.com> + + * linux-nat.c (_initialize_linux_nat): Rename child_ops. + (Previous change missed some uses.) + +2004-10-05 Andrew Cagney <cagney@gnu.org> + + * target.h (deprecated_child_ops): Rename child_ops. + * wince.c: Update copyright. Rename child_ops. + * win32-nat.c: Rename child_ops. + * target.c: Rename child_ops. + * rs6000-nat.c: Rename child_ops. + * linux-nat.c: Rename child_ops. + * infttrace.c: Rename child_ops. + * inftarg.c: Rename child_ops. + * infptrace.c: Rename child_ops. + * hppah-nat.c: Update copyright. Rename child_ops. + * hpux-thread.c: Update copyright. Rename child_ops. + +2004-10-05 Daniel Jacobowitz <dan@debian.org> + + * remote.c (remote_xfer_partial): Handle TARGET_OBJECT_MEMORY. + +2004-10-05 Andrew Cagney <cagney@gnu.org> + + * version.in: Bump to version 6.2.50_YYYY-MM-DD-cvs. + +2004-10-05 Daniel Jacobowitz <dan@debian.org> + + * dwarf2read.c (REF_HASH_SIZE): Move earlier. + (die_ref_table): Remove. + (struct dwarf2_cu): Add DIES, DEPENDENCIES, and DIE_REF_TABLE. + (struct dwarf2_per_cu_data): Add PSYMTAB. Add a comment describing + the usage of this type. + (struct dwarf2_per_objfile): Update comment for ALL_COMP_UNITS. + (struct dwarf2_pinfo, PST_PRIVATE, DWARF_INFO_OFFSET): Remove. + (struct dwarf2_queue_item, dwarf2_queue, dwarf2_queue_tail): New. + (dwarf2_create_include_psymtab): Update comment. + (find_partial_die): Remove third argument. Remove unreachable call + to error (). + (dwarf2_find_containing_comp_unit): Update comments. Change one + assertion to an error. Remove an unreachable error. + (dwarf2_find_comp_unit): Update comments. + (type_at_offset): Remove dead code. + (make_cleanup_free_die_list, dwarf2_empty_hash_tables): Remove. + (store_in_ref_table): Add CU argument. + (follow_die_ref): Take DIE, attribute, and CU arguments. Handle + inter-compilation-unit references. + (load_full_comp_unit, process_full_comp_unit): New functions, based + on psymtab_to_symtab_1. + (psymtab_to_symtab_1): Use them. + (dwarf2_add_dependence): New function. + (dwarf2_build_psymtabs_hard): Set the psymtab in per_cu. Always create + a per_cu structure, and save it in READ_PSYMTAB_PRIVATE. + (partial_die_parent_scope, guess_structure_name): Update for changes + to find_partial_die. + (dwarf2_psymtab_to_symtab): Initialize dwarf2_per_objfile here. + (queue_comp_unit, process_queue, dwarf2_release_queue): New. + (read_comp_unit): Don't call dwarf2_empty_hash_tables. + (read_die_and_children): Update call to store_in_ref_table. + (do_free_die_list_cleanup): Remove. + (fixup_partial_die): Update for changes to find_partial_die. + (read_full_die): Handle queueing absolute references. + (read_attribute_value): Use DW_ADDR for all DW_FORM_ref* forms. + (dwarf2_attr, die_specification, die_type) + (die_containing_type, dwarf2_extension): Update calls to + follow_die_ref. + (dump_die): Update DW_FORM_ref* handling. + (dwarf2_get_ref_die_offset): Likewise. + (free_one_comp_unit): Release the dies list. + (dwarf2_mark_helper): New function. + (dwarf2_mark): Use it. + +2004-10-05 Mark Kettenis <kettenis@jive.nl> + + * procfs.c (procfs_xfer_partial): Use WRITEBUF instead of READBUF + when writing to memory. + +2004-10-05 Kei Sakamoto <sakamoto.kei@renesas.com> + + * m32r-tdep.c (m32r_use_struct_convention): Delete function. + (m32r_extract_struct_value_address): Delete function. + (m32r_return_value): New function. + (m32r_gdbarch_init): Instead of store_return_value, + extract_return_value, deprecated_extract_struct_value_address + and deprecated_use_struct_convention, set return_value. + +2004-10-03 Daniel Jacobowitz <dan@debian.org> + + * dwarf2read.c (read_subrange_type): Add comment for variable + sized arrays. + +2004-10-03 Paul Hilfinger <hilfingr@nile.gnat.com> + + * Makefile.in (.l.c): Modify rule for compatibility with recent + versions of flex, and remove most command-line options. + * ada-lex.l: Add %options line in place of -I -i and -s command-line + options. + +2004-10-02 Paul N. Hilfinger <Hilfinger@gnat.com> + + Turn on initial Ada support (mainly expression evaluation). + + * Makefile.in (SFILES): Remove ada-tasks.c. + (HFILES_NO_SRCDIR): Add ada-lang.h. + (COMMON_OBS): Add ada-lang.o, ada-typeprint.o, ada-valprint.o. + (YYOBJ): Add ada-exp.o. + (rule .l.c): Generalize to not mention ada. + * symtab.c: Include ada-lang.h. + (symbol_natural_name, symbol_demangled_name) + (symbol_search_name): Add Ada case. + +2004-10-01 Andrew Cagney <cagney@gnu.org> + + * Makefile.in (COMMON_OBS): Add inf-child.o. + * config/vax/obsd.mh (NATDEPFILES): Remove inf-child.o. + * config/vax/nbsdelf.mh (NATDEPFILES): Remove inf-child.o. + * config/vax/nbsdaout.mh (NATDEPFILES): Remove inf-child.o. + * config/powerpc/nbsd.mh (NATDEPFILES): Remove inf-child.o. + * config/m88k/obsd.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/obsdaout.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/obsd64.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/obsd.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/nbsdaout.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/nbsd64.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/fbsd64.mh (NATDEPFILES): Remove inf-child.o. + * config/i386/fbsd.mh (NATDEPFILES): Remove inf-child.o. + + * target.c (xfer_using_stratum): Change return type to LONGEST. + On each iteration offset, readbuf and writebuf. + * inf-ptrace.c (inf_ptrace_xfer_partial): Simplify computation of + partial_length, and read/modify/write predicate, update comments. + Pass buffer.word to ptrace write. + +2004-10-01 Paul N. Hilfinger <Hilfinger@gnat.com> + + * symfile.c (init_filename_language_table): Add extensions for + Ada. + * defs.h (enum language): Add language_ada. + * gdbtypes.h (TYPE_FLAG_FIXED_INSTANCE): Define. + * ada-lang.c: Strip code that is conditionalized out by GNAT_GDB. + (add_symbols_from_enclosing_procs): Make a no-op for now. + (ada_unqualified_name,add_angle_brackets,function_name_from_pc) + (extended_canonical_line_spec, find_sal_from_funcs_and_line) + (find_line_in_linetable, find_next_line_in_linetable) + (read_all_symtabs, is_plausible_func_for_line) + (adjust_pc_past_prologue, error_breakpoint_runtime_sym_not_found) + (is_runtime_sym_defined, check_size): Remove declaration. + (function_name_from_pc, ada_translate_error_message) + (ada_lookup_minimal_symbol): Remove definition. + (ada_add_block_symbols): Remove useless label. + * ada-lang.h (ada_maybe_exception_partial_symbol): Remove + useless declaration. + (ada_is_exception_sym): Likewise. + +2004-09-30 Kei Sakamoto <sakamoto.kei@renesas.com> + + Add m32r-linux support. + * configure.tgt: Add m32r*-*-linux*. + * Makefile.in (ALLDEPFILES): Add m32r-tdep.c, m32r-linux-nat.c + and m32r-linux-tdep.c. + (m32r-linux-nat.o, m32r-linux-tdep.o): New dependencies. + * m32r-tdep.c: Move some definitions to m32r-tdep.h. + * config/djgpp/fnchange.lst: Add m32r-linux-nat.c and + m32r-linux-tdep.c. + * m32r-tdep.h, m32r-linux-nat.c, m32r-linux-tdep.c, + config/m32r/linux.mh, config/m32r/linux.mt, + config/m32r/nm-linux.h: New files. + +2004-09-30 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips32_decode_reg_save): Remove, unused. + (mips32_fetch_instruction): Remove, unused. + +2004-09-30 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips_insn16_frame_cache): Remove dead code or + conditions that will always be true. + +2004-09-30 Mark Kettenis <kettenis@gnu.org> + + * vaxbsd-nat.c: Include "target,h" and "inf-ptrace.h". + (vaxbsd_fetch_inferior_registers): Rename from + fetch_inferior_registers. Make static. + (vaxbsd_store_inferior_registers): Rename from + store_inferior_registers. Make static. + (_initialize_vaxbsd_nat): Construct and add target vector. + * config/vax/nbsdaout.mh (NATDEPFILES): Remove infptrace.o and + inftarg.o. Add inf-child.o and inf-ptrace.o. + * config/vax/nbsdelf.mh (NATDEPFILES): Remove infptrace.o and + inftarg.o. Add inf-child.o and inf-ptrace.o. + (NAT_FILE): Remove. + * config/vax/obsd.mh (NATDEPFILES): Remove infptrace.o and + inftarg.o. Add inf-child.o and inf-ptrace.o. + (NAT_FILE): Remove. + * Makefile.in (vaxbsd-nat.o): Update dependencies. + + * m88kbsd-nat.c: Include "target.h" and "inf-ptrace.h". + (m88kbsd_fetch_inferior_registers): Rename from + fetch_inferior_registers. Make static. + (m88kbsd_store_inferior_registers): Rename from + store_inferior_registers. Make static. + (_initialize_m88kbsd_nat): New prototype and function. + * config/m88k/obsd.mh (NATDEPFILES): Remove infptrace.o and + inftarg.o. Add inf-child.o and inf-ptrace.o. + (NAT_FILE): Remove. + * Makefile.in (m88kbsd-nat.o): Update dependencies. + +2004-09-30 Andrew Cagney <cagney@gnu.org> + + * target.c (target_xfer_partial): New function. + (target_read_memory_partial, target_write_memory_partial) + (default_xfer_partial, target_read_partial, target_write_partial) + (xfer_using_stratum): Use. + (debug_to_xfer_partial): Delete function. + (setup_target_debug): Do not override to_xfer_partial. + +2004-09-30 Mark Kettenis <kettenis@chello.nl> + + * fork-child.c: Update copyright year. Fix coding style. + +2004-09-29 Mark Kettenis <kettenis@gnu.org> + + * defs.h (msavestring, mstrsave): Remove prototypes. + * utils.c (msavestring, mstrsave): Remove functions. + * objfiles.c (allocate_objfile): Use xstrdup instead of mstrsave. + * solib-sunos.c (allocate_rt_common_objfile): Use xstrdup instead + of mstrsave. + * source.c (find_and_open_source): Use xstrdup instead of + mstrsave. + +2004-09-30 Andrew Cagney <cagney@gnu.org> + + * inf-ptrace.c (inf_ptrace_target): Do not set to_xfer_memory. + (inf_ptrace_xfer_memory): Delete. + * target.c (target_xfer_partial_p, xfer_using_stratum): New. + (target_read_memory, target_write_memory): Use xfer_using_stratum + when target_xfer_partial_p. + (debug_target): Move to start of file. + (target_read_memory_partial, target_write_memory_partial): Use + to_xfer_partial when target_xfer_partial_p. + + * inf-ptrace.c (inf_ptrace_xfer_partial): Replace call to + inf_ptrace_xfer_memory with equivalent code. + * inftarg.c (child_xfer_partial): When performing a write, pass + writebuf to child_xfer_memory. + + * target.c (target_read_string): Use target_read_memory instead of + target_xfer_memory. + +2004-09-29 Andrew Cagney <cagney@gnu.org> + + * infptrace.c (kill_inferior): Fix typo, in previous inline. Pass + the address of status. + + * infptrace.c (ptrace_wait): Mention problem with HPUX. + (kill_inferior): Inline ptrace_wait call. + * linux-nat.c (kill_inferior): Inline ptrace_wait call. + * inftarg.c (child_wait): Inline ptrace_wait call. + + * target.h (struct target_ops): Delete field to_post_wait. + (target_post_wait): Delete macro. + (child_post_wait): Delete declaration. + * target.c (update_current_target, update_current_target) + (debug_to_post_wait, setup_target_debug): Delete functions and + references. + * infttrace.c (ptrace_wait): Delete call to target_post_wait. + * inftarg.c (child_post_wait): Delete. + (init_child_ops): Do not set to_post_wait. + * infptrace.c (ptrace_wait): Delete call to target_post_wait. + * inf-ptrace.c (inf_ptrace_wait): Delete call to target_post_wait. + * inf-child.c (inf_child_post_wait): Delete. + (inf_child_target): Do not set to_post_wait. + * inf-ptrace.c (inf_ptrace_post_wait): Delete. + (inf_ptrace_target): Do not set to_post_wait. + + * wince.c (child_ops): Delete. + * win32-nat.c (child_ops): Delete. + + * inftarg.c (inftarg_set_find_memory_regions) + (inftarg_set_make_corefile_notes): Delete functions. + (_initialize_linux_nat): Inline calls. + + * target.h (child_ops): Declare. + * inftarg.c (child_ops): Move from here ... + * target.c (child_ops): ... to here. + * wince.c (child_ops): Delete extern declaration. + * win32-nat.c (child_ops): Delete extern declaration. + * linux-nat.c (child_ops): Delete extern declaration. + * hpux-thread.c (child_ops): Delete extern declaration. + +2004-09-28 Mark Kettenis <kettenis@gnu.org> + + * configure.tgt: Set default OS/ABI for OpenBSD ELF targets. + +2004-09-28 Mark Kettenis <kettenis@gnu.org> + + * configure.in: Only set host_makefile_frag when building a native + debugger. + * configure: Regenerate. + + * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Register OS/ABI + for OpenBSD ELF. + +2004-09-28 Andrew Cagney <cagney@gnu.org> + + Problem identified by Paul Hilfinger. + * Makefile.in (ada_lex_c): Define. + (ada-lex.o): Delete rule. + + * linux-proc.c: Delete file. + * Makefile.in: Update. + * config/sparc/linux64.mh (NATDEPFILES): + * config/sparc/linux.mh (NATDEPFILES): Update. + * config/s390/s390.mh (NATDEPFILES): Update. + * config/powerpc/ppc64-linux.mh (NATDEPFILES): Update. + * config/powerpc/linux.mh (NATDEPFILES): Update. + * config/pa/linux.mh (NATDEPFILES): Update. + * config/mips/linux.mh (NATDEPFILES): Update. + * config/m68k/linux.mh (NATDEPFILES): Update. + * config/ia64/linux.mh (NATDEPFILES): Update. + * config/i386/linux64.mh (NATDEPFILES): Update. + * config/i386/linux.mh (NATDEPFILES): Update. + * config/arm/linux.mh (NATDEPFILES): Update. + * config/alpha/alpha-linux.mh (NATDEPFILES): Update. + * linux-nat.c: Update copyright. Include <sys/param.h>, + <sys/procfs.h>, "elf-bfd.h", "gregset.h", <ctype.h>, + "gdbthread.h", "gdb_stat.h", <fcntl.h>. + (O_LARGEFILE): Possibly define. + (_initialize_linux_nat, linux_proc_pending_signals) + (add_line_to_sigset, linux_proc_xfer_memory) + (linux_nat_info_proc_cmd, linux_nat_make_corefile_notes) + (linux_nat_do_registers, linux_nat_corefile_thread_callback) + (struct linux_corefile_thread_data) + (linux_nat_do_thread_registers, linux_nat_find_memory_regions) + (child_pid_to_exec_file): Insert code previously in linux-proc.c. + +2004-09-16 Andrew Cagney <cagney@gnu.org> + + * lin-lwp.c: Delete file. + * linux-nat.c: Include "gdb_assert.h", "gdb_string.h", <unistd.h>, + <sys/syscall.h>, "gdbthread.h", "gdbcmd.h", "regcache.h". + (status_to_str, init_lwp_list, add_lwp, delete_lwp) + (find_lwp_pid, iterate_over_lwps, lin_lwp_attach_lwp) + (linux_nat_attach, detach_callback, linux_nat_detach) + (resume_callback, resume_clear_callback, linux_nat_resume) + (kill_lwp, linux_nat_handle_extended, wait_lwp, stop_callback) + (stop_wait_callback, linux_nat_has_pending, flush_callback) + (status_callback, running_callback, count_events_callback) + (select_singlestep_lwp_callback, select_event_lwp_callback) + (cancel_breakpoints_callback, select_event_lwp, resumed_callback) + (child_wait, stop_and_resume_callback, linux_nat_wait) + (kill_callback, kill_wait_callback, linux_nat_kill) + (linux_nat_create_inferior, linux_nat_mourn_inferior) + (linux_nat_xfer_memory, linux_nat_thread_alive) + (linux_nat_pid_to_str, init_linux_nat_ops, sigchld_handler) + (_initialize_linux_nat): New functions. + * Makefile.in: Update all dependencies. + * config/sparc/linux64.mh (NATDEPFILES): Remove lin-lwp.o. + * config/sparc/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/s390/s390.mh (NATDEPFILES): Remove lin-lwp.o. + * config/powerpc/ppc64-linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/powerpc/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/pa/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/mips/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/m68k/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/ia64/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/i386/linux64.mh (NATDEPFILES): Remove lin-lwp.o. + * config/i386/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/arm/linux.mh (NATDEPFILES): Remove lin-lwp.o. + * config/alpha/alpha-linux.mh (NATDEPFILES): Remove lin-lwp.o. + +2004-09-27 Mark Kettenis <kettenis@gnu.org> + + * config/i386/fbsd64.mh, config/i386/nbsd64.mh, + config/i386/obsd64.mh (NAT_FILE): Remove variable. + + * configure.in: Don't comment out NATDEPFILES in the generated + Makefile if NAT_FILE is unset. + * configure: Regenerate. + +2004-09-27 Andrew Cagney <cagney@gnu.org> + + * infrun.c (check_for_old_step_resume_breakpoint): Delete. + (insert_step_resume_breakpoint): Delete. + (insert_step_resume_breakpoint_at_frame): New function. + (insert_step_resume_breakpoint_at_sal): New function. + (handle_inferior_event, step_into_function) + (insert_step_resume_breakpoint): Simplify by using same. + + * gdb_indent.sh (types): Add caddr_t to list of predefined types. + +2004-09-26 Mark Kettenis <kettenis@gnu.org> + + * fbsd-proc.c: Remove file. + * Makefile.in (fbsd-proc.o): Remove dependency. + + * i386fbsd-nat.c (_initialize_i386fbsd_nat): Group target related + code together. + + * config/i386/nm-fbsd64.h: Remove file. + * config/i386/fbsd64.mh (NAT_FILE): Set to config/nm-nbsd.h. + +2004-09-26 Mark Kettenis <kettenis@gnu.org> + + * amd64-nat.h: Update copyright year. + (amd64bsd_target): New prototype. + * amd64bsd-nat.c: Include "target.h" and "inf-ptrace.h". + (amd64bsd_target): New function. + (amd64bsd_fetch_inferior_registers): Rename from + fetch_inferior_registers. Make static. + (amd64bsd_store_inferior_registers): Rename from + store_inferior_registers. Make static. + * amd64fbsd-nat.c: Include "target.h" and "fbsd-nat.h". + (_initialize_amd64fbsd_nat): Construct and add target vector. + * amd64nbsd-nat.o: Include "target.h". + (_initialize_amd64nbsd_nat): Construct and add target vector. + * amd64obsd-nat.c: Include "target.h". + (_initialize_amd64obsd_nat): Construct and add target vector. + * config/i386/nm-fbsd64.h (CHILD_PID_TO_EXEC_FILE): Remove define. + * config/i386/fbsd64.mh (NATDEPFILES): Remove infptrace.o, + inftarg.o and fbsd-proc.o. Add inf-child.o, inf-ptrace.o and + fbsd-nat.o. + * config/i386/nbsd64.mh, config/i386/obsd64.mh (NATDEPFILES): + Remove infptrace.o and inftarg.o. Add inf-child.o and + inf-ptrace.o. + * Makefile.in (amd64bsd-nat.o, amd64fbsd-nat.o, amd64nbsd-nat.o) + (amd64obsd-nat.o): Update dependencies. + +2004-09-25 Mark Kettenis <kettenis@gnu.org> + + * config/i386/fbsd.mh (NATDEPFILES): Remove infptrace.o. + * config/i386/nbsdaout.mh (NATDEPFILES): Remove infptrace.o. + * config/i386/nbsdelf.mh (NATDEPFILES): Remove infptrace.o. + * config/i386/obsd.mh (NATDEPFILES): Remove infptrace.o. + * config/i386/obsdaout.mh (NATDEPFILES): Remove infptrace.o. + + * inf-ptrace.c (inf_ptrace_attach): Remove redundant parenthesis. + Inline attach call. + (inf_ptrace_detach): Inline detach call. + + * configure.in: Check for waddstr instead of mvwaddstr when + searching for curses library. Check for wborder. + * configure, config.in: Regenerate. + * tui/tui-wingeneral.c (box_win): Use box if wborder isn't + available. + + * inf-ptrace.c (inf_ptrace_xfer_memory): Fix gdb_indent.sh wart. + +2004-09-24 Robert Picco <Robert.Picco@hp.com> + + Committed by Andrew Cagney. + * remote.c (set_remote_protocol_p_packet_cmd, remote_protocol_p) + (show_remote_protocol_p_packet_cmd): New. Implement 'p' packet. + configuration. + (fetch_register_using_p): Implement 'p' packet. Based on code by + Fernando Nasser. + (remote_fetch_registers): Call fetch_register_using_p. + (init_all_packet_configs, show_remote_cmd) + (_initialize_remote): Add p-packet. + +2004-09-24 Mark Kettenis <kettenis@gnu.org> + + * inf-ptrace.c (inf_ptrace_kill_inferior): Call ptrace directly + instead of call_ptrace. Call wait directly instead of + ptrace_wait. + (inf_ptrace_me): Call ptrace directly instead of call_ptrace. + (inf_ptrace_wait): Inline ptrace_wait call. + +2004-09-24 Paul Hilfinger <hilfingr@nile.gnat.com> + + * Makefile.in (.y.c): Revert previous change. ../ylwrap was + rolled back instead. + +2004-09-24 Paul Hilfinger <hilfingr@nile.gnat.com> + + * Makefile.in (.y.c): Modify $(YLWRAP) invocation to use + the new argument order. + +2004-09-23 Corinna Vinschen <vinschen@redhat.com> + + * MAINTAINERS: Remove "broken" from XStormy16 entry. + * xstormy16-tdep.c: Convert XStormy16 target to latest GDB methods. + (struct gdbarch_tdep): Remove. + (struct xstormy16_frame_cache): New frame cache structure. + (xstormy16_register_byte, xstormy16_register_raw_size) + (xstormy16_reg_virtual_type, xstormy16_register_type) + (xstormy16_push_arguments, xstormy16_push_return_address) + (xstormy16_pop_frame, xstormy16_store_struct_return) + (xstormy16_store_return_value, xstormy16_extract_struct_value_address) + (xstormy16_frame_saved_register, xstormy16_get_saved_register) + (xstormy16_scan_prologue, xstormy16_frame_init_saved_regs) + (xstormy16_frame_saved_pc, xstormy16_init_extra_frame_info) + (xstormy16_frame_chain, xstormy16_frame_chain_valid, + (xstormy16_saved_pc_after_call, xstormy16_save_dummy_frame_to): Remove. + (xstormy16_use_struct_convention): Drop gcc_p parameter. + (xstormy16_extract_return_value, xstormy16_store_return_value): + Regcachify. Drop useless struct convention handling. + (xstormy16_register_type, xstormy16_return_value) + (xstormy16_push_dummy_call, xstormy16_analyze_prologue) + (xstormy16_alloc_frame_cache, xstormy16_frame_cache) + (xstormy16_frame_prev_register, xstormy16_frame_this_id) + (xstormy16_frame_base_address, xstormy16_frame_sniffer) + (xstormy16_unwind_sp, xstormy16_unwind_pc) + (xstormy16_unwind_dummy_id) : New functions. + (xstormy16_skip_prologue): Call xstormy16_analyze_prologue instead + of xstormy16_scan_prologue. + (xstormy16_frame_unwind): New frame_unwind structure. + (xstormy16_frame_base): New frame_base structure. + (xstormy16_gdbarch_init): Accomodate all of the above changes. + Reshuffle for better readability. Also add dwarf2_frame_sniffer. + +2004-09-22 Mark Kettenis <kettenis@gnu.org> + + * language.c (language_gdbarch_post_init): Fix off-by one error. + +2004-09-21 Daniel Jacobowitz <dan@debian.org> + + * dwarf2read.c (struct dwarf2_per_cu_data): New field type_hash. + (struct dwarf2_offset_and_type): New. + (set_die_type, reset_die_and_siblings_types, get_die_type) + (offset_and_type_hash, offset_and_type_eq): New functions. + (read_structure_type, read_enumeration_type, read_array_type) + (read_namespace, read_tag_pointer_type, read_tag_ptr_to_member_type) + (read_tag_reference_type, read_tag_const_type) + (read_tag_volatile_type, read_tag_string_type, read_subroutine_type) + (read_typedef, read_base_type, read_subrange_type): Use + set_die_type. + +2004-09-20 Daniel Jacobowitz <dan@debian.org> + + * Makefile.in (dwarf2read.o): Update dependencies. + * dwarf2read.c: Include "command.h" and "gdbcmd.h". + (struct dwarf2_per_objfile): Add all_comp_units, n_comp_units, + and read_in_chain. + (struct dwarf2_cu): Add read_in_chain, per_cu, last_used, + mark, and has_form_ref_addr. + (struct dwarf2_per_cu_data): New. + (dwarf2_max_cache_age): New. + (dwarf2_build_psymtabs_hard): Free cached compilation units + after loading. Create and manage the list of compilation units. + Remove unnecessary NULL initialization. Fix indentation. + (psymtab_to_symtab_1): Initialize all of CU. + (dwarf2_read_abbrevs): Set has_form_ref_addr. + (find_partial_die): Use dwarf2_find_containing_comp_unit + and load_comp_unit. + (free_stack_comp_unit): Update comments. Clear the per-cu + pointer. Handle aging. + (dwarf2_find_containing_comp_unit, free_cached_comp_units) + (age_cached_comp_units, free_one_cached_comp_unit) + (dwarf2_mark, dwarf2_clear_marks, create_all_comp_units) + (load_comp_unit, dwarf2_find_comp_unit, free_one_comp_unit) + (set_dwarf2_cmdlist, show_dwarf2_cmdlist, set_dwarf2_cmd) + (show_dwarf2_cmd): New. + (_initialize_dwarf2_read): Provide "maint set dwarf2 max-cache-age" + and "maint show dwarf2 max-cache-age". + * gdbcmd.h (maintenance_set_cmdlist, maintenance_show_cmdlist): New + externs. + * maint.c (maintenance_set_cmdlist, maintenance_show_cmdlist): Make + global. + +2004-09-20 Jeff Johnston <jjohnstn@redhat.com> + + * dwarf2read.c (typename_concat): Change prototype to accept obstack + and dwarf2_cu struct pointer as arguments. Change function to use + obstack if provided and use dwarf2_cu to determine language-specific + separator. + (partial_die_parent_scope): Change comment to include java. Use + new version of typename_concat instead of obconcat. + (partial_die_full_name): Use typename_concat. + (read_namespace): Ditto. + (read_enumeration_type): Use typename_concat instead of obconcat. + (new_symbol): Ditto. + (add_partial_symbol): Enhance tests for C++ to also test for Java. + (guess_structure_name): Ditto. + (read_subroutine_type): Ditto. + (read_structure_type): Ditto. + (is_vtable_name): Add Java support. + (determine_class_name): Switch to new typename_concat call. + (determine_prefix): Switch to new typename_concat call. + * jv-exp.y (FuncStart): New pattern. + (MethodInvocation): Add support for simple function calls. Change + warning message for other forms of inferior call currently not + supported. + * valarith.c (value_subscript): Treat an array with upper-bound + of -1 as unknown size. + +2004-09-20 Daniel Jacobowitz <dan@debian.org> + + * symtab.c (lookup_partial_symtab): Use psymtab_to_fullname. + (lookup_partial_symtab): Use symtab_to_fullname. + +2004-09-19 Jim Blandy <jimb@redhat.com> + + * minsyms.c (lookup_minimal_symbol): Doc fix. + +2004-09-20 Andrew Cagney <cagney@gnu.org> + + * config/nm-lynx.h (DEPRECATED_CHILD_RESUME): Deprecate + CHILD_RESUME. + * config/i386/nm-linux.h (DEPRECATED_CHILD_RESUME): Ditto. + * config/nm-linux.h (DEPRECATED_KILL_INFERIOR): Deprecate + KILL_INFERIOR. + * infptrace.c: Update. + +2004-09-19 Daniel Jacobowitz <dan@debian.org> + + * symtab.c (output_source_filename): Mark first argument as const. + (sources_info): Use symtab_to_fullname and psymtab_to_fullname + for "info sources" output. + +2004-09-20 Mark Kettenis <kettenis@gnu.org> + + * config/i386/nm-fbsd.h, config/i386/nm-obsd.h: Don't include + <machine/vmparam.h>. + (KERNEL_U_ADDR, REGISTER_U_ADDR): Remove defines. + (register_u_addr): Remove prototype. + +2004-09-19 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-nat.c: Include "i386bsd-nat.h" and "inf-ptrace.h". + (i386bsd_fetch_inferior_registers): Rename from + fetch_inferior_registers. Make static. + (i386bsd_store_inferior_registers): Rename from + store_inferior_registers. Make static. + (i386bsd_target): New function. + * i386bsd-nat.h: New file. + * i386fbsd-nat.c: Include "target.h", "fbsd-nat.h" and + "i386bsd-nat.h". + (i386fbsd_resume): Rename from child_resume. Make static. + (_initialize_i386fbsd_nat): Construct and add target vector. + * i386nbsd-nat.c: Include "target.h" and "i386bsd-nat.h". + (_initialize_i386nbsd_nat): Construct and add target vector. + * config/i386/nm-fbsd.h: (CHILD_RESUME, CHILD_PID_TO_EXEC_FILE): + Remove defines. + * config/i386/fbsd.mh (NATDEPFILES): Add inf-child.o, inf-ptrace.o + and fbsd-nat.o. Remove inftarg.o and fbsd-proc.o. + * config/i386/nbsdaout.mh (NATDEPFILES): Add inf-child.o, + inf-ptrace.o, i386bsd-nat.o and bsd-kvm.o. Remove inftarg.o. + (LOADLIBES): New variable. + * config/i386/nbsdelf.mh (NATDEPFILES): Add inf-child.o and + inf-ptrace.o. Remove inftarg.o. + * config/i386/obsd.mh (NATDEPFILES): Add inf-child.o and + inf-ptrace.o. Remove inftarg.o. + * config/i386/obsdaout.mh (NATDEPFILES): Add inf-child.o, + inf-ptrace.o, i386nbsd-nat.o and bsd-kvm.o. Remove inftarg.o. + (LOADLIBES): New variable. + * Makefile.in (i386bsd_nat_h): New variable. + (i386bsd-nat.o, i386fbsd-nat.o, i386nbsd-nat.o): Update + dependencies. + + * sparc64nbsd-tdep.c: Include "objfiles.h". + (sparc64nbsd_init_abi): Set in_solib_call_trampoline and + skip_trampoline_code. Set solib_svr4_fetch_link_map_offsets to + svr4_lp64_fetch_link_map_offsets. + * sparc64obsd-tdep.c: Include "objfiles.h". Don't include + "nbsd-tdep.h". + (sparc64obsd_init_abi): Set in_solib_call_trampoline and + skip_trampoline_code. Set solib_svr4_fetch_link_map_offsets to + svr4_lp64_fetch_link_map_offsets. + * Makefile.in (sparc64nbsd-tdep.o, sparc64obsd-tdep.o): Update + dependencies. + + * fbsd-nat.c: New files with cleaned up contents of fbsd-proc.c. + * fbsd-nat.h: New file. + * Makefile.in (ALLDEPFILES): Add fbsd-nat.c. + (fbsd_nat_h): New variable. + (fbsd-nat.o): New dependency. + + * config/sparc/nbsd64.mt, config/sparc/obsd.mt, + config/sparc/obsd64.mt (DEPRECATED_TM_FILE): Set to solib.h. + + * inf-child.c (inf_child_post_wait): Remove stray whitespace in + comment. + +2004-09-18 Paul N. Hilfinger <hilfinger@gnat.com> + + * ada-exp.y (type_int): New function to add layer of abstraction + around references to expression types. + (type_long): Ditto. + (type_long_long): Ditto. + (type_float): Ditto. + (type_double): Ditto. + (type_long_double): Ditto. + (type_char): Ditto. + (type_system_address): Ditto. + (simple_exp): Use type_* functions in place of builtin_* + variables. + (exp): Ditto. + (write_var_from_name): Ditto. + (write_object_renaming): Ditto. + * ada-lang.c (ada_create_fundamental_type): Remove redundant + declaration. + (build_ada_types): Remove, replacing with... + (ada_language_arch_info): New function to initialize primitive + type vector in language_arch_info. + (ada_array_length): Remove use of builtin_type_ada_int. + (value_pos_atr): Ditto. + (ada_evaluate_subexp): Ditto. + (builtin_type_ada_int, builtin_type_ada_short, builtin_type_ada_long, + builtin_type_ada_long_long, builtin_type_ada_char, + builtin_type_ada_float, builtin_type_ada_double, + builtin_type_ada_long_double, builtin_type_ada_natural, + builtin_type_ada_positive, builtin_type_ada_system_address): Remove. + (ada_builtin_types): Remove. + (ada_language_defn): Remove entries for la_builtin_type_vector and + string_char_type and use ada_language_arch_info. + (_initialize_ada_language): Do type-vector initialization along + the lines of c-lang.c. + (ada_create_fundamental_type): Break up line. + (ada_dump_symtab): Remove unused function. + (enum ada_primitive_types): Define. + * ada-lang.h (builtin_type_ada_int, builtin_type_ada_short, + builtin_type_ada_long,builtin_type_ada_long_long,builtin_type_ada_char, + builtin_type_ada_float, builtin_type_ada_double, + builtin_type_ada_long_double, builtin_type_ada_natural, + builtin_type_ada_positive, builtin_type_ada_system_address): Remove. + * ada-lex.l: Use type_* functions in place of builtin_* variables. + (processInt): Ditto. + (processReal): Ditto. + (name_lookup): Ditto. + * ada-typeprint.c (print_range): Use builtin_type_int, not + builtin_type_ada_int. + +2004-09-18 Mark Kettenis <kettenis@gnu.org> + + * i386-tdep.c (i386_register_name): Rename regno to regnum. + + * config/pa/hpux1020.mh (MH_CFLAGS): Remove -D__HP_CURSES. + * config/pa/hpux11.mh (MH_CFLAGS): Likewise. + * config/pa/hpux11w.mh (MH_CFLAGS): Likewise. + * configure.in: Improve checks for curses library by checking for + mvwaddstr instead of initscr. Drop HP curses in favour of + standard curses on HP-UX. + * configure: Regenerated. + +2004-09-18 Paul N. Hilfinger <hilfinger@gnat.com> + + * ada-lang.c: (ada_main_name, ada_value_slice_ptr, ada_value_slice, + ada_breakpoint_rewrite, ada_template_to_fixed_record_type_1): + Minor formatting changes. + (empty_array): Slight rewrite for formatting. + (emit_char,parse,ada_language_defn,build_ada_types, + ada_is_exception_sym, _initialize_ada_language): Move + definitions around. + (ada_dump_symtab): Remove unused definition. + (ada_maybe_exception_partial_symbol): Remove unused definition. + +2004-09-16 Andrew Cagney <cagney@gnu.org> + + * inf-child.c: Include "gdb_string.h". + (inf_child_core_file_to_sym_file): Delete. + (inf_child_target): Set to_fetch_registers and to_store_registers. + * inf-ptrace.c: Include "gdb_string.h". + * Makefile.in: Update all dependencies. + + * Makefile.in (gnu-v3-abi.o): Add explict rule to avoid -Werror + problem. + +2004-09-14 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips_insn32_frame_cache): Pass frame cache in + call to heuristic_proc_desc. Remove code that became redundant + as a consequence. + (read_next_frame_reg): Remove special case for SP_REGNUM. + (set_reg_offset): Fix small typo. + (reset_saved_regs): New procedure. + (mips32_heuristic_proc_desc): No longer compute a fake + procedure descriptor. Compute the full frame cache instead. + Some minor comment reformatting. + +2004-09-14 Andrew Cagney <cagney@gnu.org> + + * MAINTAINERS: Add Michael Chastain as the backup gdb.threads + maintainer. + + * thread-db.c (thread_db_new_objfile): Assume that there is a + child process. + +2004-09-13 Jim Blandy <jimb@redhat.com> + + * valops.c (value_assign): Move 'buffer' to the enclosing block, + so that its storage isn't referenced after its lifetime ends. + + * valops.c (value_assign): 'use_buffer' is initialized to zero, + and never assigned to. Delete it, and the 'if (use_buffer)' + clauses. Delete 'raw_buffer', since it is now unused. + +2004-09-13 Andrew Cagney <cagney@gnu.org> + + * configure.in (frags): Replace TM_FILE with DEPRECATED_TM_FILE. + * configure: Re-generate. + * nlm/Makefile.in (TAGS): Update. + * Makefile.in (TAGS): Update. + * config/vax/nbsd.mt (TM_FILE): Update. + * config/sparc/vxworks.mt (TM_FILE): Update. + * config/sparc/sol2.mt (TM_FILE): Update. + * config/sparc/sol2-64.mt (TM_FILE): Update. + * config/sparc/obsd64.mt (TM_FILE): Update. + * config/sparc/obsd.mt (TM_FILE): Update. + * config/sparc/nbsd64.mt (TM_FILE): Update. + * config/sparc/nbsd.mt (TM_FILE): Update. + * config/sparc/linux64.mt (TM_FILE): Update. + * config/sparc/linux.mt (TM_FILE): Update. + * config/sparc/fbsd.mt (TM_FILE): Update. + * config/sh/wince.mt (TM_FILE): Update. + * config/sh/nbsd.mt (TM_FILE): Update. + * config/sh/linux.mt (TM_FILE): Update. + * config/sh/embed.mt (TM_FILE): Update. + * config/s390/s390.mt (TM_FILE): Update. + * config/rs6000/rs6000lynx.mt (TM_FILE): Update. + * config/rs6000/rs6000.mt (TM_FILE): Update. + * config/rs6000/aix4.mt (TM_FILE): Update. + * config/powerpc/vxworks.mt (TM_FILE): Update. + * config/powerpc/ppc-sim.mt (TM_FILE): Update. + * config/powerpc/ppc-eabi.mt (TM_FILE): Update. + * config/powerpc/obsd.mt (TM_FILE): Update. + * config/powerpc/nbsd.mt (TM_FILE): Update. + * config/powerpc/linux.mt (TM_FILE): Update. + * config/powerpc/aix.mt (TM_FILE): Update. + * config/pa/obsd.mt (TM_FILE): Update. + * config/pa/linux.mt (TM_FILE): Update. + * config/pa/hppahpux.mt (TM_FILE): Update. + * config/pa/hppa64.mt (TM_FILE): Update. + * config/pa/hppa.mt (TM_FILE): Update. + * config/ns32k/nbsdaout.mt (TM_FILE): Update. + * config/mips/wince.mt (TM_FILE): Update. + * config/mips/vxmips.mt (TM_FILE): Update. + * config/mips/nbsd.mt (TM_FILE): Update. + * config/mips/linux.mt (TM_FILE): Update. + * config/mips/irix6.mt (TM_FILE): Update. + * config/mips/irix5.mt (TM_FILE): Update. + * config/mips/embed.mt (TM_FILE): Update. + * config/m68k/vxworks68.mt (TM_FILE): Update. + * config/m68k/st2000.mt (TM_FILE): Update. + * config/m68k/os68k.mt (TM_FILE): Update. + * config/m68k/obsd.mt (TM_FILE): Update. + * config/m68k/nbsd.mt (TM_FILE): Update. + * config/m68k/monitor.mt (TM_FILE): Update. + * config/m68k/linux.mt (TM_FILE): Update. + * config/m68k/cisco.mt (TM_FILE): Update. + * config/ia64/linux.mt (TM_FILE): Update. + * config/ia64/aix.mt (TM_FILE): Update. + * config/ia64/ia64.mt (TM_FILE): Update. + * config/i386/vxworks.mt (TM_FILE): Update. + * config/i386/obsd64.mt (TM_FILE): Update. + * config/i386/obsd.mt (TM_FILE): Update. + * config/i386/nto.mt (TM_FILE): Update. + * config/i386/nbsd64.mt (TM_FILE): Update. + * config/i386/nbsd.mt (TM_FILE): Update. + * config/i386/linux64.mt (TM_FILE): Update. + * config/i386/linux.mt (TM_FILE): Update. + * config/i386/i386sol2.mt (TM_FILE): Update. + * config/i386/i386lynx.mt (TM_FILE): Update. + * config/i386/fbsd64.mt (TM_FILE): Update. + * config/i386/fbsd.mt (TM_FILE): Update. + * config/i386/cygwin.mt (TM_FILE): Update. + * config/h8300/h8300.mt (TM_FILE): Update. + * config/frv/frv.mt (TM_FILE): Update. + * config/cris/cris.mt (TM_FILE): Update. + * config/arm/wince.mt (TM_FILE): Update. + * config/arm/nbsd.mt (TM_FILE): Update. + * config/arm/linux.mt (TM_FILE): Update. + * config/arm/embed.mt (TM_FILE): Update. + * config/alpha/nbsd.mt (TM_FILE): Update. + * config/alpha/fbsd.mt (TM_FILE): Update. + * config/alpha/alpha.mt (TM_FILE): Update. + * config/alpha/alpha-osf1.mt (TM_FILE): Update. + * config/alpha/alpha-linux.mt (TM_FILE): Update. + + Eliminate event_loop_p, always has the value 1. + * defs.h (event_loop_p): Delete macro. + * breakpoint.c (until_break_command): Simplify. + * utils.c (prompt_for_continue): Simplify. + * tracepoint.c (read_actions): Simplify. + * top.c (throw_exception, execute_command, gdb_readline_wrapper) + (gdb_rl_operate_and_get_next, command_line_input, get_prompt) + (set_prompt, init_main): Simplify. + (init_signals, disconnect): Delete, unused. + * remote.c (remote_async_resume) + (extended_remote_async_create_inferior): Simplify. + * mi/mi-interp.c (mi_input): Delete, unused. + (mi_interpreter_resume, mi_command_loop): Simplify. + * interps.c (current_interp_command_loop): Simplify. + * infrun.c (proceed): Simplify. + * infcmd.c (run_command, continue_command, step_1, jump_command) + (until_command, advance_command, finish_command) + (interrupt_target_command): Simplify. + * event-top.c (gdb_setup_readline, gdb_disable_readline): Simplify. + + * config/i386/nm-i386.h (TARGET_HAS_HARDWARE_WATCHPOINTS): Delete. + * config/s390/nm-linux.h (TARGET_HAS_HARDWARE_WATCHPOINTS): Delete. + * config/pa/nm-hppah.h (TARGET_HAS_HARDWARE_WATCHPOINTS): Delete. + * config/ia64/nm-linux.h (TARGET_HAS_HARDWARE_WATCHPOINTS): Delete. + * config/frv/tm-frv.h (TARGET_HAS_HARDWARE_WATCHPOINTS): Delete. + * mips-tdep.c (mips_dump_tdep): Do not print same. + +2004-09-12 Andrew Cagney <cagney@gnu.org> + + * valprint.c (print_longest): Use fputs_filtered. Make "val" + const. + * Makefile.in (valprint.o): Delete explict rule. + + * config/m68k/nbsdelf.mh: Add missing trailing newline. Problem + reported by Dave Anderson. + + * target.c (target_info): Delete #ifdef call to FILES_INFO_HOOK. + + * inferior.h (STORE_STRUCT_RETURN): Delete macro. + +2004-09-12 Salvador E. Tropea <set@users.sf.net> + Andrew Cagney <cagney@gnu.org> + + * mi/mi-main.c (mi_cmd_data_list_changed_registers) + (mi_cmd_data_list_register_values) + (mi_cmd_data_write_register_values): Include the PSEUDO_REGS in + the register number computation. + +2004-09-12 Andrew Cagney <cagney@gnu.org> + + * ppcnbsd-nat.c: Include "inf-ptrace.h". + (ppcnbsd_fetch_inferior_registers): Rename fetch_inferior_registers. + (ppcnbsd_store_inferior_registers): Rename store_inferior_registers. + (_initialize_ppcnbsd_nat): Create and add a NetBSD/PPC ptrace + target. + * config/powerpc/nbsd.mh (NATDEPFILES): Replace and inftarg.o with + inf-ptrace.o and inf-child.o. + * inf-ptrace.h, inf-ptrace.c, inf-child.h, inf-child.c: New files. + * Makefile.in: Update dependencies. + +2004-09-11 Andrew Cagney <cagney@gnu.org> + + * language.c (hex_string, hex_string_custom): Move from here ... + * utils.c (hex_string, hex_string_custom): ... to here, rewrite. + (CELLSIZE): Increase to 50. + * language.h (hex_string, hex_string_custom): Move from here ... + * defs.h: ... to here. + * Makefile.in: Update all dependencies. + +2004-09-11 Paul N. Hilfinger <hilfinger@gnat.com> + + * language.c (local_hex_format_custom): Remove. + (local_hex_string): Rename to hex_string, use C format, and move to + utils.c + (local_hex_string_custom): Rename to hex_string_custom and change + interface. Now uses C format. Move to utils.c + (local_octal_format_custom): Remove. + (local_decimal_format_custom): Remove. + (unknown_language_defn): Remove language-specific number + formatting entries. + (auto_language_defn): Ditto. + (local_language_defn): Ditto. + * language.h (struct language_format_info): Delete declaration. + (struct language_defn): Remove language_format_info fields + la_binary_format, la_octal_format, la_decimal_format, la_hex_format. + (local_binary_format): Remove macro. + (local_binary_format_prefix): Remove macro. + (local_binary_format_specifier): Remove macro. + (local_binary_format_suffix): Remove macro. + (local_octal_format): Remove macro. + (local_octal_format_prefix): Remove macro. + (local_octal_format_specifier): Remove macro. + (local_octal_format_suffix): Remove macro. + (local_decimal_format): Remove macro. + (local_decimal_format_prefix): Remove macro. + (local_decimal_format_specifier): Remove macro. + (local_decimal_format_suffix): Remove macro. + (local_hex_format): Remove macro. + (local_hex_format_prefix): Remove macro. + (local_hex_format_specifier): Remove macro. + (local_hex_format_suffix): Remove macro. + (local_decimal_format_custom): Remove. + (local_octal_format_custom): Remove. + (local_hex_format_custom): Remove. + (local_hex_string): Rename to hex_string and move to defs.h. + (local_hex_string_custom): Rename to hex_string_custom, change + interface, and move to defs.h. + * utils.c: (int_string): New function. + (hex_string): New function (from language.c). + (hex_string_custom): New function (from language.c). + (octal2str): New function. + (decimal2str): Add width parameter. + (paddr_u): Use new decimal2str interface. + (paddr_d): Ditto. + * defs.h (hex_string): Declare. + (hex_string_custom): Declare. + (int_string): Declare. + * printcmd.c (print_scalar_formatted): Remove localized binary + formatting. + * valprint.c (print_longest): Use int_string. + (print_floating): Use C hex format. + (print_hex_chars): Ditto. + (print_binary_chars): Remove language-specific formatting. + (print_octal_chars): Use C octal format. + (print_decimal_chars): Delocalize format. + (print_decimal): Remove. + * ada-lang.c (ada_language_defn): Remove language-specific number + formatting entries. + * p-lang.c (pascal_language_defn): Ditto. + * c-lang.c (c_language_defn): Ditto. + (cplus_language_defn): Ditto. + (asm_language_defn): Ditto. + (minimal_language_defn): Ditto. + * f-lang.c (f_language_defn): Ditto. + * jv-lang.c (java_language_defn): Ditto. + * m2-lang.c (m2_language_defn): Ditto. + * scm-lang.c (scm_language_defn): Ditto. + * objc-lang.c (objc_language_defn): Ditto. + * memattr.c (mem_info_command): Use renamed hex_string_custom with + new interface. + * pa64solib.c (pa64_sharedlibrary_info_command): Ditto. + * ui-out.c (ui_out_field_core_addr): Ditto. + * breakpoint.c (breakpoint_adjustment_warning): Ditto. + * exec.c (print_section_info): Ditto. + * i387-tdep.c (print_i387_status_word): Ditto. + (print_i387_control_word): Ditto. + (i387_print_float_info): Ditto. + * maint.c (maint_print_section_info): Ditto. + * solib.c (info_sharedlibrary_command): Ditto. + * somsolib.c (som_sharedlibrary_info_command): Ditto. + * symtab.c (print_msymbol_info): Ditto. + * tracepoint.c (tracepoints_info): Ditto. + * solib-frv.c (lm_base): Ditto. + (frv_current_sos): Ditto. + (enable_break2): Ditto. + (enable_break): Ditto. + * dbxread.c (read_dbx_symtab): Use renamed hex_string. + (process_one_symbol): Ditto. + * infcmd.c (program_info): Ditto. + * mdebugread.c (parse_partial_symbols): Ditto. + * symfile.c (add_symbol_file_command): Ditto. + * cli/cli-cmds.c (edit_command): Ditto. + (list_command): Ditto. + * infcall.c (call_function_by_hand): Ditto. + * remote-vx.c (vx_run_files_info): Ditto. + (vx_wait): Ditto. + (vx_attach): Ditto. + (vx_detach): Ditto. + (vx_kill): Ditto. + * aix-thread.c (pdc_symbol_addrs): Ditto. + (pdc_read_regs): Ditto. + (pdc_write_regs): Ditto. + (pdc_read_data): Ditto. + (pdc_write_data): Ditto. + * d10v-tdep.c (display_trace): Ditto. + * rs6000-nat.c (find_toc_address): Ditto. + * aix-thread.c: Don't include language.h. + * buildsym.c: Ditto. + * dbxread.c: Ditto. + * mdebugread.c: Ditto. + * rs6000-nat.c: Ditto. + * buildsym.c (make_blockvector): Use renamed hex_string. + +2004-09-10 Jason Molenda (jmolenda@apple.com) + + * cli/cli-script.c (read_next_line): Accept zero or more whitespace + chars after 'if' or 'while' commands in user-defined commands. + +2004-09-08 Jim Blandy <jimb@redhat.com> + + Fix bug reported and analyzed by Olivier Crete: + * symfile.c (copy_section_addr_info): New function. + (symbol_file_add_with_addrs_or_offsets): Use it to save the + original set of address arguments, instead of handwritten code + that uses one length to allocate and a different length to + initialize. Use make_cleanup_free_section_addr_info. + * symfile.h (copy_section_addr_info): New declaration. + * utils.c: #include "symfile.h". + (do_free_section_addr_info, make_cleanup_free_section_addr_info): + New functions. + * defs.h (make_cleanup_free_section_addr_info): New declaration. + * Makefile.in (utils.o): Update dependencies. + +2004-09-08 Andrew Cagney <cagney@gnu.org> + + * thread-db.c (keep_thread_db): Delete. + (thread_db_new_objfile, thread_db_create_inferior) + (thread_db_mourn_inferior): Simplify assuming !keep_thread_db. + +2004-09-08 Mark Kettenis <kettenis@gnu.org> + + * i386-tdep.h (FPC_REGNUM, FCTRL_REGNUM, FSTAT_REGNUM, FTAG_REGNUM) + (FISEG_REGNUM, FIOFF_REGNUM, FOSEG_REGNUM, FOOFF_REGNUM) + (FOP_REGNUM, XMM0_REGNUM, MXCSR_REGNUM): Remove macros. + (i386_frameless_signal_p): Remove prototype. + * i386-linux-nat.c (GETFPREGS_SUPPLIES): Remove macro. + (GETFPXREGS_SUPPLIES): Define using I386_ST0_REGNUM and + I386_SSE_NUM_REGS. + * i386-nto-tdep.c (i386nto_supply_gregset): Use I386_NUM_GREGS + instead of FP0_REGNUM. + (i386nto_regset_id): Use I386_NUM_GREGS and I386_NUM_FREGS instead + of FP0_REGNUM and FPC_REGNUM. + + * solib-sunos.c (sunos_relocate_main_executable): Remove function. + (sunos_solib_create_inferior_hook): Don't call + sunos_relocate_main_executable. + + * sparcnbsd-tdep.c (sparc32nbsd_elf_init_abi): Set + solib_svr4_fetch_link_map_offsets to + svr4_ilp32_fetch_link_map_offsets. + * sparcobsd-tdep.c: Don't include "nbsd-tdep.h". + (sparc32obsd_init_abi): Set solib_svr4_fetch_link_map_offsets to + svr4_ilp32_fetch_link_map_offsets. + * Makefile.in (sparcobsd-tdep.o): Update dependencies. + +2004-09-07 Jim Blandy <jimb@redhat.com> + + * frame.h (frame_register): Doc fix. + +2004-09-07 Andrew Cagney <cagney@gnu.org> + + * vx-share/wait.h: Delete #ifdef USG. + * utils.c (request_quit): Ditto. + * tui/tui.c (tui_reset): Ditto. + * remote.c: Ditto. + * remote-sds.c: Ditto. + * remote-rdi.c: Ditto. + * mdebugread.c: Ditto. + * m68klinux-nat.c: Ditto. + * infttrace.c: Ditto. + * infptrace.c: Ditto. + * i386v-nat.c: Ditto. + * exec.c: Ditto. + * dbxread.c: Ditto. + * core-aout.c: Ditto. + +2004-09-05 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips_insn16_frame_cache): Fix parameter in call to + heuristic_proc_desc. + (mips_insn32_frame_cache): Likewise. + +2004-09-04 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips32_heuristic_proc_desc): Remove code that was + left behind by error. + +2004-09-04 Joel Brobecker <brobecker@gnat.com> + + * config/alpha/nm-osf.h (PTRACE_ARG3_TYPE): Remove define. + * config/powerpc/nm-aix.h (PTRACE_ARG3_TYPE): Likewise. + +2004-09-04 Joel Brobecker <brobecker@gnat.com> + + * config/rs6000/xm-aix4.h: Remove this file. + * config/rs6000/aix4.mh (XM_FILE): Delete. + +2004-09-04 Joel Brobecker <brobecker@gnat.com> + + * config/rs6000/xm-rs6000.h: Remove this file. + * config/rs6000/rs6000.mh (XM_FILE): Remove. + +2004-09-03 Andrew Cagney <cagney@gnu.org> + + * mips-tdep.c (PROC_DESC_IS_DUMMY, SET_PROC_DESC_IS_DUMMY) + (_PROC_MAGIC_, after_prologue, mips_dump_tdep): Delete macros and + only use. + + * mips-tdep.c (temp_saved_regs): Delete. + (set_reg_offset): Replace saved_regs parameter with this_cache. + (heuristic_proc_desc, mips16_heuristic_proc_desc) + (mips32_heuristic_proc_desc): Add this_cache parameter. + (mips_insn32_frame_cache, mips_insn16_frame_cache) + (after_prologue): Pass a NULL this_cache. + + * mips-tdep.c (mips_mdebug_frame_cache): Delete code handling + non-kernel trap prologues. + + * mips-tdep.c (find_proc_desc): Delete function. + (mips_mdebug_frame_cache): Inline call to find_proc_desc, + simplify. + (mips_insn16_frame_cache): Replace find_proc_desc with code from + mips_insn32_frame_cache. + + * mips-tdep.c (after_prologue): Inline call to find_proc_desc. + Simplify as NEXT_FRAME is NULL. + (find_proc_desc): Simplify as NEXT_FRAME is non-NULL. + + * mips-tdep.c (after_prologue): Replace proc_desc parameter with + local variable. + (mips_skip_prologue): Update. + + * mips-tdep.c (find_proc_desc, heuristic_proc_desc): Delete + "cur_frame" parameter. + (after_prologue, mips_mdebug_frame_cache, mips_insn16_frame_cache): + (mips_insn32_frame_cache, find_proc_desc): Update + + * config/vax/nm-obsd.h: Delete file. + * config/vax/obsd.mh (NAT_FILE): Set to config/nm-bsd.h. + * config/vax/nm-nbsd.h: Delete file. + * config/vax/nm-nbsdaout.h: Include config/nm-nbsd.h. + * config/vax/nbsdelf.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/sh/nm-nbsd.h: Delete file. + * config/sh/nbsd.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/rs6000/nm-rs6000ly.h: Delete file. + * config/djgpp/fnchange.lst: Do not rename nm-rs6000ly.h. + * config/rs6000/rs6000lynx.mh (NAT_FILE): Set to config/nm-lynx.h. + * config/powerpc/nm-obsd.h: Delete file. + * config/powerpc/obsd.mh (NAT_FILE): Set to config/nm-bsd.h. + * config/powerpc/nm-nbsd.h: Delete file. + * config/powerpc/nbsd.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/pa/nm-obsd.h: Delete file. + * config/pa/obsd.mh (NAT_FILE): Set to config/nm-bsd.h. + * config/mips/nm-nbsd.h: Delete file. + * config/mips/nbsd.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/m88k/nm-obsd.h: Delete file. + * config/m88k/obsd.mh (NAT_FILE): Set to config/nm-bsd.h. + * config/m68k/nm-nbsd.h: Delete file. + * config/m68k/nm-nbsdaout.h: Include config/nm-nbsd.h. + * config/m68k/nbsdelf.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/i386/nm-nbsd.h: Delete file. + * config/i386/nm-nbsdaout.h: Include config/nm-nbsd.h. + * config/i386/obsd64.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/i386/nbsd64.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/i386/nbsdelf.mh (NAT_FILE): Set to config/nm-nbsd.h. + * config/i386/nm-i386lynx.h: Delete file. + * config/i386/i386lynx.mh (NAT_FILE): Set to config/nm-lynx.h. + * config/arm/nm-nbsd.h: Delete file. + * config/arm/nm-nbsdaout.h: Include config/nm-nbsd.h. + * config/arm/nbsdelf.mh (NAT_FILE): Set to config/nm-nbsd.h. + + * config/i386/tm-fbsd.h: Delete file. + * config/i386/fbsd64.mt (TM_FILE): Set to solib.h. + * config/i386/fbsd.mt (TM_FILE): Set to solib.h. + + * config/rs6000/tm-rs6000-aix4.h: Delete file. + * config/djgpp/fnchange.lst: Do not rename tm-rs6000-aix4.h. + * config/rs6000/aix4.mt (TM_FILE): Set to + config/rs6000/tm-rs6000.h. + * config/powerpc/tm-ppc-aix.h: Delete file. + * config/powerpc/aix.mt (TM_FILE): Set to + config/rs6000/tm-rs6000.h. + * config/m68k/tm-linux.h: Delete file. + * config/m68k/linux.mt (TM_FILE): Set to solib.h + * config/i386/tm-linux64.h: Delete file. + * config/i386/linux64.mt (TM_FILE): Set to solib.h. + * config/djgpp/fnchange.lst: Do not rename tm-linux.h. + + * config/m68k/tm-linux.h (SVR4_SHARED_LIBS): Delete. + * config/i386/tm-linux64.h (SVR4_SHARED_LIBS): Delete. + * config/i386/nm-i386sco5.h (SVR4_SHARED_LIBS): Delete. + * config/tm-linux.h (SVR4_SHARED_LIBS): Delete. + * config/nm-sysv4.h (SVR4_SHARED_LIBS): Delete. + * config/nm-linux.h (SVR4_SHARED_LIBS): Delete. + * config/nm-gnu.h (SVR4_SHARED_LIBS): Delete. + * sh64-tdep.c [SVR4_SHARED_LIBS]: Delete #ifdef wrapper. + * sh-tdep.c [SVR4_SHARED_LIBS]: Delete #ifdef wrapper. + + * configure.in (GDB_TM_FILE): Fix typo, use gdb_target_cpu and not + gdb_host_cpu. + +2004-09-02 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips_insn32_frame_cache): Remove some dead code. + Minor reformatting. Some code factoring. + +2004-09-02 Andrew Cagney <cagney@gnu.org> + + * config/vax/nbsd.mt (TM_FILE): Set to solib.h. + * config/vax/tm-nbsd.h: Delete file. + * config/sparc/vxworks.mt (TM_FILE): Set to config/tm-vxworks.h. + * config/sparc/tm-vxworks.h: Delete file. + * config/sparc/nbsd.mt (TM_FILE): Set to solib.h. + * config/sparc/tm-nbsd.h: Delete file. + * config/sparc/linux64.mt (TM_FILE): Set to solib.h. + * config/sparc/linux.mt (TM_FILE): Set to solib.h. + * config/sparc/tm-linux.h: Delete file. + * config/s390/s390.mt (TM_FILE): Set to config/tm-linux.h + * config/s390/tm-linux.h: Delete file. + * config/pa/obsd.mt (TM_FILE): Set to solib.h. + * config/pa/tm-bsd.h: Delete file. + * config/m68k/obsd.mt (TM_FILE): Set to solib.h. + * config/m68k/tm-obsd.h: Delete file. + * config/m68k/nbsd.mt (TM_FILE): Set to solib.h. + * config/m68k/tm-nbsd.h: Delete file. + * config/i386/vxworks.mt (TM_FILE): Set to config/tm-vxworks.h. + * config/i386/tm-vxworks.h: Delete file. + * config/i386/obsd64.mt (TM_FILE): Set to solib.h. + * config/i386/obsd.mt (TM_FILE): Set to solib.h. + * config/i386/nbsd64.mt (TM_FILE): Set to solib.h. + * config/i386/nbsd.mt (TM_FILE): Set to solib.h. + * config/i386/tm-nbsd.h: Delete file. + * config/i386/i386lynx.mt (TM_FILE): Set to config/tm-lynx.h. + * config/i386/tm-i386lynx.h: Delete file. + * config/cris/cris.mt (TM_FILE): Set to solib.h. + * config/cris/tm-cris.h: Delete file. + + * configure.in: Let TM_FILE, XM_FILE and NAT_FILE specify a path. + * configure: Re-generate. + * config/arm/nbsd.mt (TM_FILE): Set to "solib.h". + * config/arm/tm-nbsd.h: Delete file. + + * config/powerpc/tm-ppcle-sim.h: Delete. + * config/powerpc/tm-ppcle-eabi.h: Delete. + * config/powerpc/tm-nbsd.h: Delete. + * config/powerpc/nbsd.mt (TM_FILE): Set to tm-ppc-eabi.h. + * config/djgpp/fnchange.lst: Do not rename tm-ppcle-sim.h or + tm-ppcle-eabi.h. + + * config/i386/nto.mh (NAT_FILE): Delete. + * config/i386/nm-nto.h: Delete. + + * config/m68k/tm-vx68.h: Do not include "tm-m68k.h". + * config/m68k/tm-os68k.h: Ditto. + * config/m68k/tm-monitor.h: Ditto. + * config/m68k/tm-cisco.h: Ditto. + * config/m68k/st2000.mt (TM_FILE): Delete. + * config/m68k/tm-vx68.h (GET_LONGJMP_TARGET): Delete. + * config/m68k/tm-cisco.h (GET_LONGJMP_TARGET): Delete. + * config/m68k/tm-m68k.h (m68k_get_longjmp_target): Delete file. + * m68k-tdep.c (m68k_get_longjmp_target): Make static. + + * config/m68k/tm-st2000.h: Delete. + * config/m68k/st2000.mt (TM_FILE): Set to tm-m68k.h. + * config/sparc/fbsd.mt (TM_FILE): Delete. + * config/sparc/tm-fbsd.h: Delete. + + * acconfig.h (GDB_MULTI_ARCH): Delete undef. + * defs.h (GDB_MULTI_ARCH_PARTIAL, GDB_MULTI_ARCH_TM) + (GDB_MULTI_ARCH_PURE, GDB_MULTI_ARCH): Delete macros. + + * gdbarch.sh: Instead of GDB_MULTI_ARCH print GDB_NM_FILE, + GDB_TM_FILE and GDB_XM_FILE. + * gdbarch.c: Re-generate. + * configure.in (GDB_XM_FILE, GDB_NM_FILE, GDB_TM_FILE): Include + quotes in macro definition. + * configure.in: Re-generate. + + * gdbarch.sh: Delete check for GDB_MULTI_ARCH_PARTIAL when + validating architecture methods. + * gdbarch.c: Re-generate. + + * gdbarch.sh: Delete check for consistency between GDB_MULTI_ARCH + and GDB_TM_FILE. Check for GDB_TM_FILE instead of + GDB_MULTI_ARCH_PARTIAL. + * gdbarch.h: Re-generate. + + * config/sparc/tm-vxworks.h (GDB_MULTI_ARCH): Delete. + * config/sparc/tm-sol2.h (GDB_MULTI_ARCH): Delete. + * config/sparc/tm-nbsd.h (GDB_MULTI_ARCH): Delete. + * config/sparc/tm-linux.h (GDB_MULTI_ARCH): Delete. + * config/sparc/tm-fbsd.h (GDB_MULTI_ARCH): Delete. + * config/sh/tm-sh.h (GDB_MULTI_ARCH): Delete. + * config/rs6000/tm-rs6000.h (GDB_MULTI_ARCH): Delete. + * config/pa/tm-hppa.h (GDB_MULTI_ARCH): Delete. + * config/mips/tm-mips.h (GDB_MULTI_ARCH): Delete. + * config/ia64/tm-ia64.h (GDB_MULTI_ARCH): Delete. + * config/cris/tm-cris.h (GDB_MULTI_ARCH): Delete. + * config/arm/tm-arm.h (GDB_MULTI_ARCH): Delete. + +2004-09-01 Andrew Cagney <cagney@gnu.org> + + * objfiles.h (struct entry_info): Delete fields main_func_lowpc + and main_func_highpc. + (INVALID_ENTRY_LOWPC, INVALID_ENTRY_HIGHPC): Delete macros. + * objfiles.c (init_entry_point_info, objfile_relocate): Update + * nlmread.c (nlm_symfile_read): Update. + +2004-09-01 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (linked_proc_desc_table): Delete, not used. + (mips_insn32_frame_cache): Inline call to find_proc_desc. + (find_proc_desc): Remove dead code. + +2004-09-01 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c (mips_mdebug_frame_cache): Minor reformatting. + +2004-09-01 Jeff Johnston <jjohnstn@redhat.com> + + * observer.sh: Add struct so_list declaration. + * Makefile.in: Add dependencies on observer.h for solib.c and + breakpoint.c. + * breakpoint.c (disable_breakpoints_in_unloaded_shlib): New + function. + (_initialize_breakpoint): Register + disable_breakpoints_in_unloaded_shlib as an observer of the + "solib unloaded" observation event. + (re_enable_breakpoints_in_shlibs): For bp_shlib_disabled breakpoints, + call decode_line_1 so unfound breakpoint errors are silent. + * solib.c (update_solib_list): When a solib is discovered to have + been unloaded by the program, notify all observers of the + "solib unloaded" observation event. + +2004-09-01 Andrew Cagney <cagney@gnu.org> + + * frame.c: Include "objfiles.h". + (inside_main_func): New function. + (get_prev_frame): Use new inside_main_func. + * Makefile.in (frame.o): Update dependencies. + * defs.h (inside_main_func): Delete declaration. + * blockframe.c (inside_main_func): Delete function. + +2004-08-31 Jim Blandy <jimb@redhat.com> + + * dwarf2read.c (is_vtable_name): New function, based on logic from + read_structure_type, but passing the correct length to strncmp, + and using 'sizeof' instead of 'strlen'. + (read_structure_type): Call it. + +2004-08-31 Joel Brobecker <brobecker@gnat.com> + + * config/powerpc/aix.mh: Add comment. + +2004-08-31 Paul GIlliam <pgilliam@us.ibm.com> + + * MAINTAINERS: Add self to Write-After-Approval. + +2004-08-30 Manoj Iyer <manjo@austin.ibm.com> + + * MAINTAINERS: Add self to Write-After-Approval. + +2004-08-30 Andrew Cagney <cagney@gnu.org> + + Fix PR breakpoints/1757. + * infrun.c (struct execution_control_state): Replace + remove_breakpoints_on_following_step with + step_after_step_resume_breakpoint. + (init_execution_control_state): Update. + (handle_inferior_event): For signals, when stepping off a + breakpoint, set step_after_step_resume_breakpoint. When + BPSTAT_WHAT_STEP_RESUME, do a single-step off the breakpoint. + (keep_going): Delete code handling + remove_breakpoints_on_following_step. + +2004-08-29 David Lecomber <david@streamline-computing.com> + + Fix PR gdb/648 + * language.h (enum array_ordering): New enum. + * language.h (struct language_defn): New la_array_ordering + attribute. + * language.c (unknown_language_defn, auto_language_defn) + (local_language_defn): Ditto. + * ada-lang.c (ada_language_defn): Ditto. + * c-lang.c (c_language_defn, cplus_language_defn) + (asm_language_defn, minimal_language_defn): Ditto. + * f-lang.c (f_language_defn): Ditto. + * jv-lang.c (java_language_defn): Ditto. + * m2-lang.c (f_language_defn): Ditto. + * objc-lang.c (objc_language_defn): Ditto. + * p-lang.c (pascal_language_defn): Ditto. + * scm-lang.c (scm_language_defn): Ditto. + * eval.c (evaluate_subexp_standard): Assume Fortran arrays are + oriented large to small in type structure. + * dwarf2read.c (read_array_order): New function. + (read_array_type): Use read_array_order to check row/column + major ordering. + +2004-08-27 Nathan J. Williams <nathanw@wasabisystems.com> + + * target.c (target_resize_to_sections): Check + current_target.to_sections for an old value when updating. + +2004-08-27 Joel Brobecker <brobecker@gnat.com> + + * procfs.c (dbx_link_bpt_addr): New static global variable. + (dbx_link_shadow_contents): New static global variable. + (procfs_wait, case <PR_SYSEXIT>): Handle syssgi events. + (procfs_wait, case <FLTBPT>): Remove the __dbx_link brekapoint + if we just hit it. + (procfs_init_inferior): Enable syssgi() syscall trace if appropriate. + Reset dbx_link_bpt_addr as the address of __dbx_link() may change + from run to run. + (procfs_create_inferior): Remove syssgi syscall-exit notifications + after the inferior has been forked. + (remove_dbx_link_breakpoint): New function. + (dbx_link_addr): New function. + (insert_dbx_link_bpt_in_file): New function. + (insert_dbx_link_bpt_in_region): New function. + (insert_dbx_link_breakpoint): New function. + (proc_trace_syscalls_1): New function, extracted from + proc_trace_syscalls. + (proc_trace_syscalls): Replace extract code by call to + proc_trace_syscalls_1. + * solib-irix.c (disable_break): Remove stop_pc assertion, as it + is no longer valid. + +2004-08-25 Jim Blandy <jimb@redhat.com> + + * gdbtypes.h (TYPE_CODE_ARRAY): Doc fix. + +2004-08-25 Andrew Cagney <cagney@gnu.org> + + * infrun.c (struct execution_control_state): Delete field + "stepping_through_sigtramp". + (init_execution_control_state): Do not set same. + (context_switch): Do not pass same to save_infrun_state and + load_infrun_state. + * gdbthread.h (struct thread_info): Delete field + stepping_through_sigtramp. + (save_infrun_state, load_infrun_state): Delete parameter + stepping_through_sigtramp. + * thread.c (load_infrun_state, save_infrun_state): Update. + + * infrun.c: Re-indent. Move expression operators to the beginning + of the line. Remove long disabled #if 0 code. + +2004-08-24 Andrew Cagney <cagney@gnu.org> + + * doublest.h (floatformat_ieee_quad): Rename + floatformat_ia64_quad. + * doublest.c (floatformat_ieee_quad): Rename + floatformat_ia64_quad. + (_initialize_doublest): Update. + +2004-08-24 Jim Blandy <jimb@redhat.com> + + * dwarf2expr.h (struct dwarf_expr_context): New members + 'num_pieces' and 'pieces', for returning the result of an + expression that uses DW_OP_piece. + (struct dwarf_expr_piece): New struct type. + * dwarf2expr.c (new_dwarf_expr_context): Initialize num_pieces and + pieces. + (free_dwarf_expr_context): Free pieces, if any. + (add_piece): New function. + (execute_stack_op): Implement DW_OP_piece. + * dwarf2loc.c (dwarf2_evaluate_loc_desc): If the result of the + expression is a list of pieces, print an error message. + (dwarf2_loc_desc_needs_frame): If the expression yields + pieces, and any piece is in a register, then we need a frame. + + * dwarf2loc.c (dwarf2_evaluate_loc_desc): Wait to fetch the top of + the stack until we've decided what sort of result the evaluation + has produced. Use separate variables, with more specific names. + +2004-08-23 Richard Earnshaw <rearnsha@arm.com> + + * armnbsd-tdep.c (arm_nbsd_arm_be_breakpoint): Define. + (arm_nbsd_thumb_[lb]e_breakpoint): Define. + (arm_netbsd_init_abi_common): Register them. + +2004-08-22 Mark Kettenis <kettenis@gnu.org> + + * config/vax/vax.mh (NATDEPFILES): Add vax-nat.c. + + * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Use + safe_frame_unwind_memory instead of target_read_memory. + + * infptrace.c: Remove #ifdef'ed out inclusion of gdb_stat.h. + Reorder includes. + (fetch_register, store_register): Remove prototypes. + (child_resume): Reorganize code and comments such that it is + grouped a bit more logically. + (attach): Explicitly compare errno against 0. + (detach): Likewise. Use perror_with_name instead of + print_sys_errmsg. + * Makefile.in (infptrace.o): Update dependencies. + + * ia64-linux-nat.c: Update copyright year. + (fetch_debug_register, store_debug_register) + (ia64_linux_stopped_by_watchpoint): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * config/ia64/nm-linux.h: Update copyright year. + (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): Remove defines. + + * amd64-linux-tdep.c (amd64_linux_sigtramp_start): Change argument + from CORE_ADDR to struct frame_info *. Use + safe_frame_unwind_memory instead of deprecated_read_memory_nobpt. + (amd64_linux_sigtramp_p): Adjust for changed signature of + and64_linux_sigtramp_start + + * gdb_ptrace.h: GNU/Linux. + + * config/alpha/nm-linux.h (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): + Remove defines. + + * infptrace.c: Include "gdb_assert.h". + (PTRACE_XFER_TYPE): Remove define. + (offsetof): Only define if U_REGS_OFFSET isn't defined. + (fetch_register, store_register): Rewrite to use PTRACE_TYPE_RET. + Tweak comment. + (fetch_inferior_registers, store_inferior_registers): Remove + redundant culry braces. Tweak comment. s/regno/regnum. + * Makefile.in (infptrace.o): Update dependencies. + + * configure.in: Change test for return type of ptrace to default + to `long' instead of `int'. + * configure: Regenerate. + +2004-08-21 Mark Kettenis <kettenis@gnu.org> + + * config/alpha/alpha-linux.mh (LOADLIBES): New variable. + + * configure.in: Check for ttrace function. + * configure, config.in: Regenerate. + + * gdb_ptrace.h: New file. + * infptrace.c: Include "gdb_ptrace.h" instead of <ptrace.h> or + <sys/ptrace.h>. + (PT_READ_I, PT_READ_D, PT_READ_U, PT_WRITE_I, PT_WRITE_D) + (PT_WRITE_U, PT_CONTINUE, PT_STEP, PT_KILL): Remove defines. + (attach): Don't define PT_ATTACH. + (detach): Don't define PT_DETACH. + * Makefile.in (gdb_ptrace_h): New variable. + (infptrace.o): Update dependencies. + +2004-08-16 Mark Kettenis <kettenis@gnu.org> + + * inferior.h (PTRACE_ARG3_TYPE): Define as PTRACE_TYPE_ARG3 + instead of `int' if not already defined. + (call_ptrace): Revert change that replaced PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * infptrace.c (call_ptrace): Revert change that replaced + PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + +2004-08-15 Mark Kettenis <kettenis@gnu.org> + + * config/i386/nm-linux64.h (PTRACE_ARG3_TYPE, PTRACE_XFER_TYPE): + Remove defines. + + * linux-nat.c (kill_inferior): Add missing third and fourth + arguments to ptrace call. Don't use PTRACE_ARG3_TYPE. + + * infptrace.c (child_xfer_memory): Replace PTRACE_XFER_TYPE with + PTRACE_TYPE_RET. + + * proc-why.c (proc_prettyfprint_why): Fix format string. + + * solib-osf.c (osf_current_sos): Remove unsused label. + + * configure.in: Add <ncurses/ncurses.h> to the list of possible + curses headers. + * configure, config.in: Regenerate. + * gdb_curses.h [HAVE_NCURSES_NCURSES_H]: Include + <ncurses/ncurses.h>. + + * config/nm-bsd.h (PTRACE_ARG3_TYPE): Remove define. + * config/nm-nbsd.h: Update copyright year. + (PTRACE_ARG3_TYPE): Remove define. + + * sparc-nat.c (fetch_inferior_registers) + (store_inferior_registers, sparc_xfer_wcookie): + Replace PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + + * alphabsd-nat.c (fetch_inferior_registers): + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * amd64bsd-nat.c (fetch_inferior_registers) + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * armnbsd-nat.c: Update copyright year. + (fetch_register, fetch_regs, fetch_fp_register, fetch_fp_regs) + (store_register, store_regs, store_fp_register, store_fp_regs): + Replace PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + * hppabsd-nat.c (fetch_inferior_registers) + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * i386bsd-nat.c (fetch_inferior_registers) + (store_inferior_registers, i386bsd_dr_set, i386bsd_dr_get_status): + Replace PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + * m68kbsd-nat.c (fetch_inferior_registers) + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * m88kbsd-nat.c (fetch_inferior_registers) + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * mipsnbsd-nat.c: Update copyright year. + (fetch_inferior_registers, store_inferior_registers): + Replace PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + * ns32knbsd-nat.c: Update copyright year. + (fetch_inferior_registers, store_inferior_registers): + Replace PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + * ppcnbsd-nat.c (fetch_inferior_registers): + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * ppcobsd-nat.c (fetch_inferior_registers): + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * shnbsd-nat.c: Update copyright year. + (fetch_inferior_registers, store_inferior_registers): + Replace PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + * vaxbsd-nat.c (fetch_inferior_registers) + (store_inferior_registers): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + + * inferior.h (call_ptrace): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + * infptrace.c (call_ptrace, child_resume, attach, detach) + (U_REGS_OFFSET, fetch_register, store_register, child_xfer_memory) + (udot_info): Replace PTRACE_ARG3_TYPE with PTRACE_TYPE_ARG3. + * inftarg.c (ptrace_me): Replace PTRACE_ARG3_TYPE with + PTRACE_TYPE_ARG3. + +2004-08-14 Mark Kettenis <kettenis@gnu.org> + + * defs.h: Remove out-of-date comment. + [!FCLOSE_PROVIDED] (fclose): Remove prototype. + [!GETENV_PROVIDED] (getenv): Remove prototype. + + * standalone.c: Remove file. + * Makefile.in (standalone.o): Remove dependency. + + * i386-linux-nat.c (dummy_sse_values): Remove function and + prototype. + (i386_linux_dr_get): Fix typo in comment. + (LINUX_SYSCALL_REGNUM): Define as I386_EAX_REGNUM. + + * config/i386/obsd64.mt (TDEPFILES): Add i386obsd-tdep.o. + + * defs.h (deprecated_error_hook): Remove RETURN and ATTR_NORETURN + from declaration. + * top.c (deprecated_error_hook): Remove RETURN and ATTR_NORETURN + from definition. + +2004-08-13 Mark Kettenis <kettenis@gnu.org> + + * configure.in (PTRACE_TYPE_ARG3, PTRACE_TYPE_ARG5): Don't use + parenthesis in definition. + * configure: Regenerated. + +2004-08-12 Michael Chastain <mec.gnu@mindspring.com> + + * PROBLEMS: Mention build/1411. + +2004-08-09 Robert Millan <robertmh@gnu.org> + + Committed by Nathanael Nerode. + * configure.host: Match kfreebsd*-gnu and knetbsd*-gnu. + * configure.tgt: Match kfreebsd*-gnu and knetbsd*-gnu. + +2004-08-12 Andrew Cagney <cagney@gnu.org> + + * NEWS: Mention fixes in GDB 6.2.1. + * PROBLEMS: Remove mention of mips-irix. + +2004-08-11 Joel Brobecker <brobecker@gnat.com> + + * config/powerpc/xm-aix.h: Delete. + * config/powerpc/aix.mh (MH_FILE): Remove. + * config/powerpc/aix432.mh (MH_FILE): Remove. + +2004-08-11 Joel Brobecker <brobecker@gnat.com> + + * config/powerpc/aix.mh: Remove obsolete comment. + * config/powerpc/aix432.mh: Likewise. + +2004-08-11 Joel Brobecker <brobecker@gnat.com> + + * config/powerpc/xm-aix.h (UINT_MAX): Remove undef. + +2004-08-11 Joel Brobecker <brobecker@gnat.com> + + * config/rs6000/xm-aix4.h: Remove "config/xm-aix4.h" include, + this file is now empty. + * config/xm-aix4.h: Remove, this file is no longer included + anywhere. + +2004-08-11 Joel Brobecker <brobecker@gnat.com> + + * config/powerpc/xm-aix.h: Remove "config/xm-aix4.h" include, + that file is now empty. + (termdef): Remove prototype, function no longer used. + +2004-08-11 Joel Brobecker <brobecker@gnat.com> + + * doc/gdbint.texinfo (Host Definition): Remove documentation + for USE_O_NOCTTY, no longer used. + * config/xm-aix4.h (USE_O_NOCTTY): Remove, no longer used. + * config/rs6000/xm-rs6000.h (USE_O_NOCTTY): Likewise. + +2004-08-11 Joel Brobecker <brobecker@gnat.com> + + * config/xm-aix4.h (FIVE_ARG_PTRACE): Remove, no longer used. + * config/pa/nm-hppah.h (FIVE_ARG_PTRACE): Likewise. + * config/rs6000/xm-rs6000.h (FIVE_ARG_PTRACE): Likewise. + +2004-08-11 Mark Kettenis <kettenis@gnu.org> + + * infptrace.c (call_ptrace): Select code based on PTRACE_TYPE_ARG5 + instead of FIVE_ARG_PTRACE. + + * inflow.c (O_NOCTTY): Define to zero if not already defined. + (new_tty): Use O_NOCTTY unconditionally. + +2004-08-10 Mark Kettenis <kettenis@gnu.org> + + * procfs.c (procfs_detach): Cleanup. Print process ID, not LWP + ID. Use comma in output. Use gdb_flush on gdb_stdout instead of + fflush on stdout. + +2004-08-10 Joel Brobecker <brobecker@gnat.com> + + * xcoff_symfile_finish: Replace last call to xmfree by call + to xfree. + +2004-08-10 Andrew Cagney <cagney@gnu.org> + + * main.c (captured_main): Delete call to init_malloc. + * defs.h (init_malloc): Delete declaration. + * utils.c (mmalloc, mrealloc, mcalloc, mfree) + (init_malloc): Delete functions. + + * defs.h (xmfree): Delete. + * utils.c (xmfree): Delete function. + (xfree): Inline calls to xmfree and mfree. + * symmisc.c (free_symtab_block, free_symtab): Use xfree. + * symfile.c (reread_symbols, init_psymbol_list): Ditto. + * source.c (forget_cached_source_info, find_and_open_source): Ditto. + * somread.c (som_symfile_finish): Ditto. + * objfiles.c (allocate_objfile, free_objfile): + * nlmread.c (nlm_symfile_finish): Ditto. + * hpread.c (hpread_symfile_finish): Ditto. + * elfread.c (free_elfinfo, elf_symfile_finish): Ditto. + * dbxread.c (dbx_symfile_finish, free_bincl_list): Ditto. + * coffread.c (coff_symfile_finish): Ditto. + + * defs.h (xmcalloc): Delete declaration. + * utils.c (xmcalloc): Delete. + (xcalloc): Inline calls to xmcalloc and mcalloc. + * ada-lang.c (_initialize_ada_language): Use htab_create_alloc, + xcalloc and xfree. + * symtab.c (create_demangled_names_hash): Ditto. + + * defs.h (xmrealloc): Delete. + * utils.c (xmrealloc): Delete. + (xrealloc): Inline calls to xmrealloc, mmalloc and mrealloc. + * symmisc.c (extend_psymbol_list): Use xrealloc. + * source.c (find_source_lines): Ditto. + * hpread.c (hpread_lookup_type): Ditto. + * dbxread.c (add_bincl_to_list): Ditto. + + * utils.c (xmmalloc): Delete. + (xmalloc): Inline xmmalloc and mmalloc calls. + (msavestring): Use xmalloc. + * defs.h (xmmalloc): Delete declaration. + * xcoffread.c (xcoff_symfile_init): Use xmalloc instead of + xmmalloc. + * symmisc.c (extend_psymbol_list): Ditto. + * symfile.c (init_psymbol_list): Ditto. + * source.c (find_source_lines): Ditto. + * hpread.c (hpread_symfile_init, hpread_lookup_type): Ditto. + * elfread.c (elf_symtab_read): Ditto. + * dbxread.c (dbx_symfile_init, init_bincl_list): Ditto. + * coffread.c (coff_symfile_init): Ditto. + +2004-08-10 David Carlton <carlton@bactrian.org> + + * MAINTAINERS: Remove David Carlton from c++ testsuite + maintainers. + +2004-08-10 Jerome Guitton <guitton@gnat.com> + + * symfile.c (symbol_file_add_with_addrs_or_offsets): Make sure to + print a line feed before the prompt. + +2004-08-10 Mark Kettenis <kettenis@gnu.org> + + * procfs.c (procfs_pid_to_str): Use "%ld" to print LWP. + +2004-08-09 Joel Brobecker <brobecker@gnat.com> + + General cleanup of the AIX xm include file: + * config/xm-aix4.h (fd_set): Remove undefine. + Remove include of <sys/select.h>. + (HAVE_TERMIO): Remove define. + (USG): Likewise. + (NULL): Remove redefine. + (alloca): Remove #pragma. + (vfork): Remove define. + (termdef): Remove. + (SIGWINCH_HANDLER): Remove. + (SIGWINCH_HANDLER_BODY): Remove. + +2004-08-09 Mark Kettenis <kettenis@gnu.org> + + * configure.tgt (x86_64-*-openbsd*): Set gdb_osabi to + GDB_OSABI_OPENBSD_ELF. + +2004-08-07 Robert Millan <robertmh@gnu.org> + + * bsd-kvm.c: Check for nlist.h before including it. + +2004-08-09 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-nat.c (_initialize_i386bsd_nat): Remove `struct + sigcontext' offset consistency checks for ancient BSD. + + * gdb_curses.h [HAVE_CURSESX_H]: Include <cursesX.h> + + * configure.in: Check for <sys/types.h>. Check return and + argument types of ptrace. + * configure, config.in: Regenerate. + +2004-08-09 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (set_sim_regno, init_sim_regno_table, + rs6000_register_sim_regno): Doc fixes. + +2004-08-08 Joel Brobecker <brobecker@gnat.com> + + * mips-tdep.c: Include "floatformat.h". + (n32n64_floatformat_always_valid): New function. + (floatformat_n32n64_long_double_big): New constant. + (mips_gdbarch_init): Set size and format of long double + for N32 and N64 ABIs. + * Makefile.in (mips-tdep.o): Update dependencies. + +2004-08-08 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh: Delete "fmt" and "attrib" fields. Always use %s to + print. Improve script's error messages. + * gdbarch.h: Re-generate. + + * gdbarch.sh (pformat): New function. + (float_format, double_format, long_double_format): List with bit + members. Use pformat when printing. + * gdbarch.c, gdbarch.h: Re-generate. + +2004-08-08 Nathan J. Williams <nathanw@wasabisystems.com> + + * ppcnbsd-nat.c: Include <machine/frame.h>, <machine/pcb.h>, + "gdbcore.h", "regcache.h", and "bsd-kvm.h". + (ppcnbsd_supply_pcb): New function. + (_initialize_ppcnbsd_nat): New prototype and function. + * config/powerpc/nbsd.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + * Makefile.in (ppcnbsd-nat.o): Update dependencies. + +2004-08-08 Andrew Cagney <cagney@gnu.org> + + * gdbtypes.c (builtin_type_arm_ext, builtin_type_ieee_single) + (builtin_type_ieee_double, builtin_type_ia64_quad) + (builtin_type_ia64_spill, _initialize_gdbtypes): Add tables of + BE/LE floating-point types. + * gdbtypes.h (builtin_type_arm_ext, builtin_type_ieee_single) + (builtin_type_ieee_double, builtin_type_ia64_quad) + (builtin_type_ia64_spill): Declare. + * doublest.c (_initialize_doublest, floatformat_ieee_single) + (floatformat_ieee_double, floatformat_arm_ext) + (floatformat_ia64_spill, floatformat_ia64_quad): Add tables + of LE/BE floatformats. + * doublest.h: (struct floatformat, floatformat_ieee_single) + (floatformat_ieee_double, floatformat_arm_ext) + (floatformat_ia64_spill, floatformat_ia64_quad): Declare. + +2004-08-08 Mark Kettenis <kettenis@gnu.org> + + * i386gnu-nat.c (gnu_store_registers): Fix typo. + + * i386gnu-nat.c (gnu_store_registers): Use regcache_raw_collect + instead of regcache_raw_supply when storing the registers. + + * i386gnu-nat.c: Update copyright year. + (gnu_store_registers): Don't use deprecated_registers and + deprecated_registers_valid. Use regcache_valid_p and + regcache_raw_supply instead. + + * vax-tdep.c (vax_frame_this_id): Use frame_func_unwind instead of + frame_pc_unwind. + + * procfs.c (procfs_pid_to_str): Remove redundant and unused + variables. Incapitalized "process". + + * configure.in: Add cursesX to the list of possible curses libs. + Add cursesX.h to the list of possible curses headers. + * configure, config.in: Regenerate. + +2004-08-07 Nathan J. Williams <nathanw@wasabisystems.com> + + * configure.in: Test for struct lwp in <sys/lwp.h>. + * bsd-kvm.c (bsd_kvm_proc_cmd): If HAVE_STRUCT_LWP is defined, use + the offset of l_addr in struct lwp. + +2004-08-07 Nathan J. Williams <nathanw@wasabisystems.com> + + * bsd-kvm.c: Include "gdbcore.h" + (bsd_kvm_open): Use get_exec_file() to set 'execfile'. + +2004-08-07 Andrew Cagney <cagney@gnu.org> + + * gdbtypes.c (build_flt, build_complex): New functions. + (gdbtypes_post_init): Use. + + * doublest.c (floatformat_from_length): Fix tipo, "*" not "&". + + * gdbtypes.c (_initialize_gdbtypes): Do not swap builtin_type_int8 + through to builtin_type_uint128. + + * c-exp.y: Use builtin_type function to obtain builtin types. + + * gdbtypes.h (struct builtin_type): Delete builtin_int0 through to + builtin_uint128. + * gdbtypes.c (gdbtypes_post_init): Update. + (build_gdbtypes): Move initialization of builtin_type_int0 + through to builtin_type_uint128 from here ... + (_initialize_gdbtypes): ... to here. + * d10v-tdep.c (d10v_register_type): Update. + + * doublest.c: Update copyright. + (floatformat_from_length): Call error when floatformat is NULL. + (extract_floating_by_length): Remove NULL fmt check. + (store_floating_by_length): Ditto. + +2004-08-07 Andrew Cagney <cagney@gnu.org> + + * regcache.c (regcache_raw_read): For the moment, #ifdef assert + that the register is valid. + +2004-08-05 Mark Kettenis <kettenis@chello.nl> + + * i386-linux-tdep.c (i386_linux_sigtramp_start) + (i386_linux_rt_sigtramp_start): Change argument from CORE_ADDR to + struct frame_info *. Use safe_frame_unwind_memory instead of + deprecated_read_memory_nobpt. + (i386_linux_sigtramp_p, i386_linux_sigcontext_addr): Adjust for + changed signature of i386_linux_sigtramp_start and + i386_linux_rt_sigtramp_start. + + * i386nbsd-tdep.c (i386nbsd_sigtramp_offset): Change argument from + CORE_ADDR to struct frame_info *. Use safe_frame_unwind_memory + instead of deprecated_read_memory_nobpt. + (i386nbsd_sigtramp_p): Adjust for changed signature of + i386nbsd_sigtramp_offset. + + * i386obsd-tdep.c (i386obsd_sigtramp_p): Use + safe_frame_unwind_memory instead of target_read_memory. + + * infptrace.c: Include <sys/file.h> if HAVE_SYS_FILE_H instead of + !NO_SYS_FILE. + [KERNEL_U_ADDR_BSD]: Don't include <a.out.h>. + [KERNEL_U_ADDR_BSD] (kernel_u_addr): Remove variable. + (_initialize_kernel_u_addr): Remove prototype and function. + * infttrace.c: Include <sys/file.h> if HAVE_SYS_FILE_H instead of + !NO_SYS_FILE. + * xcoffread.c: Likewise. + +2004-08-06 Mark Kettenis <kettenis@gnu.org> + + * vax-nat.c: New file. + * vaxbsd-nat.c: Tweak comment. + * Makefile.in (ALLDEPFILES): Add vax-nat.c, vaxbsd-nat.c and + vaxnbsd-tdep.c. + (vax-nat.o): New dependency. + * configure.host (vax-*-bsd*, vax-*-ultrix*): Set gdb_host to vax. + (vax-*-ultrix2*): Remove. + * config/vax/vax.mh: New file. + * config/vax/nm-vax.h (vax_kernel_u_addr): New extern declaration. + (KERNEL_U_ADDR): Define as vax_kernel_u_addr. + (vax_register_u_addr): New prototype. + (REGISTER_U_ADDR): Define using vax_register_u_addr. + * config/vax/vaxult2.mh: Remove file. + * config/vax/vaxult.mh: Remove file. + * config/vax/vaxbsd.mh: Remove file. + * config/vax/vax.mt (TM_FILE): Remove. + * config/vax/tm-vaxbsd.h: Remove file. + +2004-08-06 Joel Brobecker <brobecker@gnat.com> + + * aix-thread.c (get_signaled_thread): New function. + (iter_trap): Delete, no longer used. + (iter_tid): New function. + (pd_update): Find the thread that received the SIGTRAP signal + by first locating the kernel thread, and then finding its + associated thread. + +2004-08-06 Ulrich Weigand <uweigand@de.ibm.com> + + * lin-lwp.c (child_wait): Continue inferior after processing + PTRACE_EVENT_CLONE event. + +2004-08-05 Nathanael Nerode <neroden@gcc.gnu.org> + + * MAINTAINERS: Add self to Write-After-Approval. + +2004-08-05 Jeff Johnston <jjohnstn@redhat.com> + + * libunwind-frame.c (LIBUNWIND_SO): Change to be of form: + libunwind-xxxx.so" where xxxx is UNW_TARGET. + +2004-08-05 Andrew Cagney <cagney@gnu.org> + + * config/xm-sysv4.h: Delete file. + * config/mips/xm-irix5.h: Delete file. + * config/mips/irix6.mh (XM_FILE, XM_CLIBS): Delete. + * config/mips/irix5.mh (XM_FILE, XM_CLIBS): Delete. + * config/ia64/xm-aix.h: Delete file. + * config/ia64/aix.mh (XM_FILE): Delete. + * config/pa/xm-hppah.h: Delete file. + * config/pa/hpux11w.mh (XM_FILE): Delete. + * config/pa/hpux11.mh (XM_FILE): Delete. + * config/pa/hpux1020.mh (XM_FILE): Delete. + * config/pa/hppahpux.mh (XM_FILE): Delete. + + * config/alpha/xm-alphalinux.h: Delete file. + * config/djgpp/fnchange.lst: Do not fix xm-alphalinux.h. + * config/alpha/alpha-linux.mh (XM_FILE, LOADLIBES): Delete. + * config/alpha/xm-alphaosf.h: Delete file. + * config/djgpp/fnchange.lst: Do not fix xm-alphaosf.h. + * config/alpha/alpha-osf3.mh (XM_FILE): Delete. + * config/alpha/alpha-osf2.mh (XM_FILE): Delete. + * config/alpha/alpha-osf1.mh (XM_FILE): Delete. + + * config/i386/xm-i386v.h: Delete file. + * config/i386/i386v.mh (XM_FILE, XM_CLIBS): Delete. + * config/i386/i386sco5.mh (XM_FILE, XM_CLIBS): Delete. + * config/i386/xm-i386sco.h: Delete file. + * config/i386/i386sco4.mh (XM_FILE, XM_CLIBS, MH_CFLAGS): Delete. + * config/i386/i386sco.mh (XM_FILE, XM_CLIBS, CC): Delete. + * config/i386/xm-i386v4.h: Delete file. + * config/djgpp/fnchange.lst: Do not fix xm-i386v4.h. + * config/i386/ncr3000.mh (CC, CFLAGS, XM_FILE): Delete. + * config/i386/i386v42mp.mh (XM_FILE, XM_CLIBS): Delete. + * config/i386/i386v4.mh (XM_FILE, XM_CLIBS): Delete. + + * config/vax/xm-vax.h: Delete file. + * Makefile.in (xm-vaxult.h, xm-vaxbsd.h): Delete. + * config/vax/xm-vaxult2.h: Delete file. + * config/djgpp/fnchange.lst: Do not fix xm-vaxult2.h. + * config/vax/vaxult2.mh (XM_FILE): Delete. + * config/vax/xm-vaxult.h: Delete file. + * config/vax/vaxult.mh (XM_FILE): Delete. + * config/vax/xm-vaxbsd.h: Delete file. + * config/vax/vaxbsd.mh (XM_FILE): Delete. + + * gdbarch.sh (deprecated_frame_saved_pc): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * regcache.c (deprecated_read_fp, deprecated_write_sp): Delete. + * inferior.h (deprecated_read_fp, deprecated_write_sp): Delete. + * frame.h: Delete deprecated_read_fp from comments. + * arch-utils.c (deprecated_init_frame_pc_default): Delete. + * arch-utils.h (deprecated_init_frame_pc_default): Delete. + +2004-08-04 Mark Kettenis <kettenis@gnu.org> + + * i386obsd-tdep.c (i386obsd_sigtramp_p): Adjust for changed signal + trampoline in OpenBSD 3.5-current. + + * i387-tdep.c (i387_supply_fsave): Provide summy values for the + SSE registers. + + * Makefile.in: Remove embedded page breaks. + +2004-08-04 Jim Blandy <jimb@redhat.com> + + * regcache.c (regcache_raw_read): Assert that, after calling + target_fetch_registers, the register we're reading is cached. + + * ppc-linux-nat.c (fetch_register): Replace 'gdb_assert (0)' with + a call to 'internal_error', with a more helpful error message. + * rs6000-tdep.c (e500_pseudo_register_read, + e500_pseudo_register_write, rs6000_store_return_value): Same. + +2004-08-04 Andrew Cagney <cagney@gnu.org> + + * Makefile.in: Update dependencies. + +2004-08-04 Jim Blandy <jimb@redhat.com> + + Change the layout of the PowerPC E500 raw register cache to allow + the lower 32-bit halves of the GPRS to be their own raw registers, + not pseudoregisters. + * ppc-tdep.h (struct gdbarch_tdep): Remove ppc_gprs_pseudo_p flag; + add ppc_ev0_upper_regnum flag. + * rs6000-tdep.c: #include "reggroups.h". + (spe_register_p): Recognize the ev upper half registers as SPE + registers. + (init_sim_regno_table): Build gdb->sim mappings for the upper-half + registers. + (e500_move_ev_register): New function. + (e500_pseudo_register_read, e500_pseudo_register_write): The 'ev' + vector registers are the pseudo-registers now, formed by splicing + together the gprs and the upper-half registers. + (e500_register_reggroup_p): New function. + (P): Macro deleted. + (P8, A4): New macro. + (PPC_EV_REGS, PPC_GPRS_PSEUDO_REGS): Macros deleted. + (PPC_SPE_GP_REGS, PPC_SPE_UPPER_GP_REGS, PPC_EV_PSEUDO_REGS): New + macros. + (registers_e500): Rearrange register set so that the raw register + set contains 32-bit GPRs and upper-half registers, and the SPE + vector registers become pseudo-registers. + (rs6000_gdbarch_init): Don't initialize tdep->ppc_gprs_pseudo_p; + it has been deleted. Initialize ppc_ev0_upper_regnum. Many other + register numbers are now the same for the E500 as they are for + other PowerPC variants. Register e500_register_reggroup_p as the + register group function for the E500. + * Makefile.in (rs6000-tdep.o): Update dependencies. + + Adapt PPC E500 native support to the new raw regcache layout. + * ppc-linux-nat.c (struct gdb_evrregset_t): Doc fixes. + (read_spliced_spe_reg, write_spliced_spe_reg): Deleted. + (fetch_spe_register, store_spe_register): Handle fetching/storing + all the SPE registers at once, if regno == -1. These now take + over the job of fetch_spe_registers and store_spe_registers. + (fetch_spe_registers, store_spe_registers): Deleted. + (fetch_ppc_registers, store_ppc_registers): Fetch/store gprs + unconditionally; they're always raw. Fetch/store SPE upper half + registers, if present, instead of ev registers. + (fetch_register, store_register): Remove sanity checks: gprs are + never pseudo-registers now, so we never need to even mention any + registers that are ever pseudoregisters. + + Use a fixed register numbering when communicating with the PowerPC + simulator. + * ppc-tdep.h (struct gdbarch_tdep): New member: 'sim_regno'. + * rs6000-tdep.c: #include "sim-regno.h" and "gdb/sim-ppc.h". + (set_sim_regno, init_sim_regno_table, rs6000_register_sim_regno): + New functions. + (rs6000_gdbarch_init): Register rs6000_register_sim_regno. Call + init_sim_regno_table. + * Makefile.in (gdb_sim_ppc_h): New variable. + (rs6000-tdep.o): Update dependencies. + +2004-08-02 Andrew Cagney <cagney@gnu.org> + + * cris-tdep.c (cris_register_size): Restore function, still used + locally. + + * gdbarch.sh (deprecated_target_read_fp) + (deprecated_frame_locals_address, deprecated_frame_args_address) + (deprecated_frame_chain_valid, deprecated_frame_chain) + (deprecated_init_extra_frame_info, deprecated_pop_frame) + (deprecated_frame_init_saved_regs, deprecated_get_saved_register) + (deprecated_do_registers_info, deprecated_init_frame_pc): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * regcache.c (deprecated_read_fp): Do not call + DEPRECATED_TARGET_READ_FP_P. + * infcmd.c (default_print_registers_info): Do not call + DEPRECATED_DO_REGISTERS_INFO. + * frame-base.c (default_frame_locals_address): Do not call + DEPRECATED_FRAME_LOCALS_ADDRESS. + (default_frame_args_address): Do not call + DEPRECATED_FRAME_ARGS_ADDRESS. + + * gdbarch.sh (deprecated_register_raw_size) + (deprecated_register_virtual_size:int): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * cris-tdep.c (cris_register_size): Delete. + (cris_gdbarch_init): Update. + * alpha-tdep.c (alpha_register_raw_size) + (alpha_register_virtual_size): Delete. + (alpha_gdbarch_init): Update. + + * gdbarch.sh (deprecated_register_virtual_type) + (deprecated_save_dummy_frame_tos, deprecated_push_return_address) + (deprecated_dummy_write_sp): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + + * gdbarch.sh (deprecated_register_bytes): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * regcache.c (deprecated_register_bytes): New function. + * regcache.h (deprecated_register_bytes): Declare. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sh64-tdep.c (sh64_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init_32082): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * remote.c (init_remote_state): Update. + * remote-vx.c (vx_prepare_to_store): Update. + * remote-sds.c (sds_fetch_registers, sds_prepare_to_store): Update. + * irix5-nat.c (fetch_core_registers): Update. + * cris-tdep.c (cris_register_bytes_ok): Update. + * config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update. + + * mips-tdep.c (mips_gdbarch_init, mips_insn16_frame_cache) + (mips_insn16_frame_this_id, mips_insn16_frame_prev_register) + (mips_insn16_frame_unwind, mips_insn16_frame_sniffer) + (mips_insn16_frame_base_address, mips_insn16_frame_base) + (mips_insn16_frame_base_sniffer, mips_insn32_frame_cache) + (mips_insn32_frame_this_id, mips_insn32_frame_prev_register) + (mips_insn32_frame_unwind, mips_insn32_frame_sniffer) + (mips_insn32_frame_base_address, mips_insn32_frame_base) + (mips_insn32_frame_base_sniffer): Replace mips16 / mips32 prefix + with mips_insn16 and mips_insn32. + + Replace DEPRECATED_REGISTER_RAW_SIZE with register_size. + * rs6000-tdep.c (rs6000_push_dummy_call) + (rs6000_extract_return_value): Use register_size. + * xstormy16-tdep.c (xstormy16_get_saved_register) + (xstormy16_extract_return_value): Ditto. + * valops.c (value_assign): Ditto. + * v850ice.c (v850ice_fetch_registers, v850ice_store_registers): + * v850-tdep.c (v850_extract_return_value): Ditto. + * tracepoint.c (collect_symbol): Ditto. + * target.c (debug_print_register): Ditto. + * stack.c (frame_info): Ditto. + * rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto. + * rom68k-rom.c (rom68k_supply_one_register): Ditto. + * remote.c (struct packet_reg, remote_wait, remote_async_wait) + (store_register_using_P): Ditto. + * remote-vxmips.c (vx_read_register, vx_write_register): Ditto. + * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto. + * remote-mips.c (mips_wait, mips_fetch_registers): Ditto. + * remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto. + * regcache.c (deprecated_read_register_bytes) + (deprecated_write_register_bytes, read_register) + (write_register): Ditto. + * ppc-linux-nat.c (fetch_altivec_register, fetch_register) + (supply_vrregset, store_altivec_register, fill_vrregset): Ditto. + * monitor.c (monitor_supply_register, monitor_fetch_register) + (monitor_store_register): Ditto. + * mn10300-tdep.c (mn10300_pop_frame_regular) + (mn10300_print_register): Ditto. + * mipsv4-nat.c (fill_fpregset): Ditto. + * mips-linux-tdep.c (supply_32bit_reg, fill_fpregset) + (mips64_fill_fpregset): Ditto. + * mi/mi-main.c (register_changed_p, get_register) + (mi_cmd_data_write_register_values): Ditto. + * lynx-nat.c (fetch_inferior_registers, store_inferior_registers): + * irix5-nat.c (fill_gregset, fetch_core_registers): + * infrun.c (write_inferior_status_register): Ditto. + * infptrace.c (fetch_register, store_register): Ditto. + * infcmd.c (default_print_registers_info): Ditto. + * ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto. + * ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto. + * i386gnu-nat.c (gnu_store_registers, fill): Ditto. + * hpux-thread.c (hpux_thread_fetch_registers) + (hpux_thread_store_registers): Ditto. + * hppah-nat.c (store_inferior_registers, fetch_register): + * findvar.c (value_from_register): Ditto. + * dve3900-rom.c (fetch_bitmapped_register): + * cris-tdep.c (cris_gdbarch_init): Ditto. + * alpha-tdep.h: Ditto. + * aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto. + + * regcache.h: Delete DEPRECATED_REGISTER_VIRTUAL_SIZE and + DEPRECATED_REGISTER_RAW_SIZE from comments. + * regcache.c (init_regcache_descr, regcache_dump): Do not check or + use DEPRECATED_REGISTER_VIRTUAL_SIZE and + DEPRECATED_REGISTER_RAW_SIZE. + * findvar.c (value_of_register): Simplify by assuming that the + registers raw and virtual sizes are identical. + * regcache.h: Delete DEPRECATED_REGISTER_VIRTUAL_TYPE in + comment. + * arch-utils.c (generic_register_size): Simplify by assuming + register_type. + + * regcache.c (legacy_read_register_gen, real_register) + (legacy_write_register_gen): Delete, not used. + + * regcache.c (struct regcache_descr): Delete legacy_p. + (init_legacy_regcache_descr): Delete function. + (init_regcache_descr): Delete call to init_legacy_regcache_descr. + Do not use deprecated register functions. + (regcache_raw_read, deprecated_write_register_gen): + (deprecated_read_register_gen, regcache_raw_write): Delete code + predicated on legacy_p. + (register_size): Delete check against register raw size. + + * cris-tdep.c (cris_register_type): Replace + cris_register_virtual_type. + (cris_gdbarch_init): Update, set register_type. + + * gdbarch.sh (deprecated_frameless_function_invocation): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * arm-tdep.c (arm_frameless_function_invocation): Delete. + (arm_gdbarch_init) Do not set frameless function invocation. + * frame.h (legacy_frameless_look_for_prologue): Delete declaration. + * blockframe.c (legacy_frameless_look_for_prologue): Delete function. + * frv-tdep.c (frv_frameless_function_invocation): Delete. + (frv_gdbarch_init): Do not set frameless function invocation. + * sh64-tdep.c (sh64_gdbarch_init): Ditto. + * sh-tdep.c (sh_gdbarch_init): Ditto. + * m32r-tdep.c (m32r_gdbarch_init): Ditto. + * h8300-tdep.c (h8300_gdbarch_init): Ditto. + * avr-tdep.c (avr_gdbarch_init): Ditto. + + * blockframe.c (legacy_frame_chain_valid): Delete function. + + * dummy-frame.c (struct dummy_frame): Delete call_lo, call_hi, top + and pc. Update comments. + (pc_in_dummy_frame): Delete function. + (deprecated_pc_in_call_dummy): Inline old pc_in_dummy_frame code, + use the "id". + (dummy_frame_push, dummy_frame_sniffer): Instead of call_lo, + call_hi, top and pc, use the id. + (fprint_dummy_frames): Do not print call_lo, call_hi, top and pc. + + * dummy-frame.c: Include "gdb_string.h". + (generic_save_call_dummy_addr, generic_push_dummy_frame) + (generic_save_dummy_frame_tos): Delete. + (dummy_frame_push): New function, replaces above. + * dummy-frame.h: Update copyright. + (dummy_frame_push): Declare. + * frame.h (generic_save_dummy_frame_tos, generic_push_dummy_frame) + (generic_save_call_dummy_addr): Delete declarations. + * infcall.c: Include "dummy-frame.h". + (call_function_by_hand): Add locals caller_regcache, + caller_regcache_cleanup and dummy_id. Replace push_dummy_frame + with call to frame_save_as_regcache plus cleanup. Delete calls to + generic_save_call_dummy_addr and generic_save_dummy_frame_tos. + Move clear_proceed_status to just before the resume, add call to + dummy_frame_push (discard cleanup). + * Makefile.in (infcall.o): Add $(dummy_frame_h). + (dummy-frame.o): Add $(gdb_string_h). + +2004-08-01 Andrew Cagney <cagney@gnu.org> + + * dummy-frame.h (dummy_frame_unwind): Replace dummy_frame_sniffer. + * frame-unwind.c (frame_unwind_init): Use dummy_frame_unwind. + * dummy-frame.c (find_dummy_frame): Delete. + (struct dummy_frame_cache, dummy_frame_sniffer) + (dummy_frame_prev_register, dummy_frame_this_id) + (dummy_frame_unwinder, dummy_frame_unwind): Re-implement dummy + frame unwinder using a dummy_frame_cache. + +2004-08-01 Andrew Cagney <cagney@gnu.org> + + * frame.h (frame_save_as_regcache): Declare. + * frame.c (frame_save_as_regcache): New function. + (do_frame_read_register): Replace do_frame_unwind_register. + (frame_pop): Use frame_save_as_regcache. + * dummy-frame.c (generic_push_dummy_frame): Use + frame_save_as_regcache. + +2004-08-01 Joel Brobecker <brobecker@gnat.com> + + * dwarf2read.c (dwarf_decode_lines): Do not consider the current + file as included until we record the first line in the linetable. + +2004-08-01 Andrew Cagney <cagney@gnu.org> + + * frame.h (deprecated_pop_dummy_frame) + (deprecated_read_register_dummy) + (deprecated_generic_find_dummy_frame): Delete. + * dummy-frame.c (deprecated_generic_find_dummy_frame) + (deprecated_read_register_dummy) + (deprecated_find_dummy_frame_regcache) + (discard_innermost_dummy) + (deprecated_pop_dummy_frame): Delete. + (dummy_frame_this_id): Simplify. + (struct dummy_frame): Delete "fp" and "sp". + (find_dummy_frame): Simplify. + (generic_push_dummy_frame): Do not set "fp" or "sp". + (fprint_dummy_frames): Do not print "fp" and "sp" + +2004-08-01 Mark Kettenis <kettenis@gnu.org> + + * i386-tdep.c (I386_MAX_INSN_LEN): New define. + (struct i386_insn): New structure. + (i386_match_insn): New function. + (i386_frame_setup_skip_insns): New variable. + (i386_analyze_frame_setup): Change to use i386_match_insn and the + array i386_frame_setup_insns of instructions that should be + skipped inside the frame setup sequence. + +2004-08-01 Andrew Cagney <cagney@gnu.org> + + * frame.h (deprecated_frame_xmalloc_with_cleanup) + (frame_saved_regs_zalloc, frame_extra_info_zalloc) + (get_frame_extra_info, deprecated_get_frame_saved_regs): Delete. + * stack.c (frame_info): Delete references to + DEPRECATED_FRAME_INIT_SAVED_REGS and + deprecated_get_frame_saved_regs. + * frame.c (struct frame_info): Delete saved_regs and extra_info. + (frame_pc_unwind): Do not use DEPRECATED_FRAME_SAVED_PC. + (frame_register): Do not use DEPRECATED_GET_SAVED_REGISTER. + (frame_unwind_register_signed) + (frame_unwind_register_unsigned) + (frame_unwind_unsigned_register): Use register_size. + (create_new_frame): Do not use DEPRECATED_INIT_EXTRA_FRAME_INFO. + (deprecated_frame_xmalloc_with_cleanup) + (frame_saved_regs_zalloc, frame_extra_info_zalloc) + (get_frame_extra_info, deprecated_get_frame_saved_regs): Delete. + + * sh-tdep.c (sh_gdbarch_init): Disable call to sh64_gdbarch_init. + * config/sh/nbsd.mt (TDEPFILES): Remove sh64-tdep.o. + * config/sh/linux.mt (TDEPFILES): Remove sh64-tdep.o. + * config/sh/embed.mt (TDEPFILES): Remove sh64-tdep.o. + + * infcall.c (call_function_by_hand): Do not use + DEPRECATED_PUSH_RETURN_ADDRESS, DEPRECATED_DUMMY_WRITE_SP, + DEPRECATED_SAVE_DUMMY_FRAME_TOS, DEPRECATED_TARGET_READ_FP, + DEPRECATED_FP_REGNUM, DEPRECATED_STORE_STRUCT_RETURN, and + DEPRECATED_STACK_ALIGN. + +2004-07-30 Ramana Radhakrishnan <ramana.radhakrishnan@codito.com> + + Committed by Andrew Cagney. + * arm-tdep.c: Remove references to add_setshow_cmd_full for apcs32 . + +2004-08-01 Andrew Cagney <cagney@gnu.org> + + * mips-tdep.c (mips16_frame_cache) + (mips16_frame_this_id, mips16_frame_prev_register) + (mips16_frame_unwind, mips16_frame_sniffer) + (mips16_frame_base_address, mips16_frame_base) + (mips16_frame_base_sniffer, mips32_frame_cache) + (mips32_frame_this_id, mips32_frame_prev_register) + (mips32_frame_unwind, mips32_frame_sniffer) + (mips32_frame_base_address, mips32_frame_base) + (mips32_frame_base_sniffer): Clone the mdebug unwinder into + separate heuristic mips16 and mips32 unwinders. + (mips_stub_frame_cache, mips_stub_frame_this_id) + (mips_stub_frame_prev_register) + (mips_stub_frame_unwind, mips_stub_frame_sniffer) + (mips_stub_frame_base_address, mips_stub_frame_base) + (mips_stub_frame_base_sniffer): Add a simple stub unwinder. + (mips_mdebug_frame_base_sniffer, mips_mdebug_frame_sniffer): Only + match true mdebug frames. + (non_heuristic_proc_desc): Add forward declaration. + +2004-08-01 Andrew Cagney <cagney@gnu.org> + + * config/mips/tm-irix6.h: Delete file. + * config/mips/tm-irix5.h: Delete file. + * config/mips/irix5.mt (TM_FILE): Set to tm-mips.h + * config/mips/irix6.mt (TM_FILE): Set to tm-mips.h + + * config/ia64/tm-linux.h (IA64_GNULINUX_TARGET): Delete. + * config/alpha/nm-osf2.h (PROCFS_SIGPEND_OFFSET): Delete. + * config/nm-gnu.h (NO_CORE_OPS): Delete. + * config/pa/nm-hppah.h (MAY_SWITCH_FROM_INFERIOR_PID): Delete. + * config/i386/nm-i386v4.h (LOSING_POLL): Delete. + * config/alpha/nm-osf2.h (LOSING_POLL): Delete. + * config/tm-nto.h (RAW_SIGNAL_LO, RAW_SIGNAL_HI): Delete. + * config/m68k/tm-vx68.h (VX_SIZE_FPREGS): Delete. + * config/nm-linux.h (USE_THREAD_STEP_NEEDED): Delete. + * config/pa/nm-hppah.h (USE_THREAD_STEP_NEEDED): Delete. + * config/tm-nto.h (TARGET_SIGNAL_RAW_TABLE) Delete. + (TARGET_SIGNAL_RAW_VALUES): Delete. + * config/pa/nm-hppah.h (TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT): + Delete. + * config/frv/tm-frv.h (TARGET_HW_BREAK_LIMIT) + (TARGET_HW_WATCH_LIMIT): Delete. + * Makefile.in (minimon_h, HFILES_NO_SRCDIR): Remove minimon.h. + * minimon.h: Delete file. + + * trad-frame.c (trad_frame_get_this_base) + (trad_frame_set_this_base, trad_frame_set_reg_realreg): New + functions. + * trad-frame.h (trad_frame_set_this_base) + (trad_frame_get_this_base, trad_frame_set_reg_realreg): Declare. + +2004-07-31 Andrew Cagney <cagney@gnu.org> + + * trad-frame.c (trad_frame_get_prev_register): Rename + trad_frame_get_prev_register. + * vax-tdep.c (vax_frame_prev_register): Update. + * trad-frame.h: Update. + * trad-frame.c (trad_frame_get_register): Update. + * sparcobsd-tdep.c (sparc32obsd_frame_prev_register): Update. + * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_prev_register): + Update. + * sparc64obsd-tdep.c (sparc64obsd_frame_prev_register): Update. + * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_prev_register): + Update. + * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_prev_register): + Update. + * sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_prev_register): + Update. + * sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_prev_register): + Update. + * sparc-linux-tdep.c (sparc32_linux_sigtramp_frame_prev_register): + Update. + * s390-tdep.c (s390_frame_prev_register) + (s390_stub_frame_prev_register) + (s390_sigtramp_frame_prev_register): Update. + * rs6000-tdep.c (rs6000_frame_prev_register): Update. + * ppc-linux-tdep.c (ppc_linux_sigtramp_prev_register): Update. + * mips-tdep.c (mips_mdebug_frame_prev_register): Update. + * m88k-tdep.c (m88k_frame_prev_register) + * m68hc11-tdep.c (m68hc11_frame_prev_register) + * m32r-tdep.c (m32r_frame_prev_register): Update. + * hppa-tdep.c (hppa_frame_prev_register_helper) + * frv-tdep.c (frv_frame_prev_register): Update. + * d10v-tdep.c (d10v_frame_prev_register): Update. + * cris-tdep.c (cris_frame_prev_register): Update. + * avr-tdep.c (avr_frame_prev_register): Update. + * arm-tdep.c (arm_prologue_prev_register) + (arm_sigtramp_prev_register): Update. + +2004-07-31 Andrew Cagney <cagney@gnu.org> + + * frame.h (legacy_saved_regs_unwind) + (legacy_frame_chain_valid, legacy_frame_p) + (enum frame_type): Delete UNKNOWN_FRAME. + * dummy-frame.c (dummy_frame_this_id): Simplify. + * frame-unwind.c (frame_unwind_find_by_frame): Simplify. + * frame.c (struct frame_info): Delete the field "type". + (legacy_saved_regs_prev_register, legacy_get_prev_frame) + (legacy_saved_regs_this_id, legacy_saved_regs_unwinder) + (legacy_saved_regs_unwind, legacy_frame_p) + (frame_type_from_pc): Delete. + (get_frame_id, frame_pop, frame_register_unwind, get_prev_frame_1) + (fprint_frame, create_new_frame, fprint_frame_type): Simplify. + +2004-07-31 Mark Kettenis <kettenis@gnu.org> + + * sparc64obsd-tdep.c (sparc64obsd_pc_in_sigtramp): Fix + indentation. + + * mips-nat.c: Remove file. + * Makefile.in (ALLDEPFILES): Remove mips-nat.c + (mips-nat.o): Remove dependency. + + * infptrace.c: Update copyright year. + (fetch_register): Pass NULL in regcache_raw_supply call instead of + explicitly setting the buffer to all zeroes. + + * sparc64obsd-tdep.c (sparc64obsd_sigreturn_offset): New variable. + (sparc64obsd_pc_in_sigtramp): Reorganize to avoid goto. + +2004-07-30 Andrew Cagney <cagney@gnu.org> + + * GDB 6.2 released from gdb_6_2-branch. + +2004-07-30 Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> + + * defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH): New macros. + + * exec.c (exec_file_attach): + * nto-tdep.c (nto_find_and_open_solib): + * pa64solib.c (pa64_solib_sizeof_symbol_table): + * solib.c (solib_open): + * somsolib.c (som_solib_sizeof_symbol_table): + * source.c (is_regular_file, openp, open_source_file): + * symfile.c (symfile_bfd_open): + * wince.c (upload_to_device): Differentiate between the search for + binary and source files. + +2004-07-30 Andrew Cagney <cagney@gnu.org> + + * complaints.c (_initialize_complaints): Pass NULL to + add_setshow_zinteger_cmd for help_doc. + * cli/cli-decode.c (add_setshow_cmd_full): Handle a NULL help_doc. + +2004-07-30 Andrew Cagney <cagney@gnu.org> + + Fix PR i18n/761. + * Makefile.in (.SUFFIXES): Add po .gmo, and .pox. + (.PHONY): Add all-po install-po, uninstall-po, clean-po, + $(PACKAGE).pot and update-po. + (all-po, .po.gmo, .po.pox, install-po, $(PACKAGE).pot) + (po/$(PACKAGE).pot, clean-po, uninstall-po, install-po) + (update-po): New rules. + (localedir): Define using autoconf. + (diststuff): Add $(PACKAGE).pot and $(CATALOGS) + (GDB_CFLAGS): Define LOCALEDIR using $(localedir). + (XGETTEXT, GMSGFMT, MSGMERGE, PACKAGE, CATALOGS): Define. + * configure.in: Generate CATALOGS and LINGUAS from contents of + src/gdb/po/ directory. Set @localedir@ in Makefile.in. + * configure: Re-generate. + * po/gdbtext: New file + +2004-07-30 Jerome Guitton <guitton@gnat.com> + + * MAINTAINERS: Reorder Write After Approval list in alphabetical + order. + +2004-07-30 David Lecomber <dsl@sources.redhat.com> + + * dwarf2read.c (read_file_scope): Set producer if attribute + present. + (struct dwarf2_cu): Added new member producer. + +2004-07-30 Jerome Guitton <guitton@gnat.com> + + * inflow.c (kill_command): release file handles in BFD. + * exec.c (exec_file_attach): Ditto. + * symfile.c (symbol_file_add_with_addrs_or_offsets): Ditto. + +2004-07-29 Andrew Cagney <cagney@gnu.org> + + * PROBLEMS (mips-irix): Note that it is broken. + +2004-07-29 Andrew Cagney <cagney@gnu.org> + + * config/mips/xm-irix5.h (REGISTER_U_ADDR): Move from here ... + * config/mips/nm-irix5.h (REGISTER_U_ADDR): ... to here. + + * config/xm-nbsd.h: Delete file. + * config/arm/xm-nbsd.h: Delete file. + * config/i386/xm-nbsd.h: Delete file. + * config/ns32k/xm-nbsd.h: Delete file. + * config/ns32k/nbsdaout.mh (XM_FILE): Delete. + * config/i386/nbsdelf.mh (XM_FILE): Delete. + * config/i386/nbsdaout.mh (XM_FILE): Delete. + * config/arm/nbsdelf.mh (XM_FILE): Delete. + * config/arm/nbsdaout.mh (XM_FILE): Delete. + + * config/i386/xm-i386v.h (KERNEL_U_ADDR): Move from here ... + * config/i386/nm-i386v42mp.h (KERNEL_U_ADDR): ... to here, ... + * config/i386/nm-i386v4.h (KERNEL_U_ADDR): ... here, ... + * config/i386/nm-i386v.h (KERNEL_U_ADDR): ... and here. + * config/vax/xm-vax.h (KERNEL_U_ADDR): Move from here ... + * config/vax/nm-vax.h (KERNEL_U_ADDR): ... to here. + + * config/powerpc/xm-linux.h: Delete empty file. + * config/powerpc/ppc64-linux.mh (XM_FILE): Delete. + * config/powerpc/linux.mh (XM_FILE): Delete. + * config/m68k/xm-linux.h: Delete empty file. + * config/m68k/linux.mh (XM_FILE): Delete. + * config/ia64/xm-linux.h: Delete empty file. + * config/ia64/linux.mh (XM_FILE): Delete. + * config/arm/xm-linux.h: Delete empty file. + * config/arm/linux.mh (XM_FILE): Delete. + + * config/powerpc/xm-linux.h (KERNEL_U_ADDR): Move from here ... + * config/powerpc/nm-linux.h (KERNEL_U_ADDR): ... to here. + * config/m68k/xm-linux.h (KERNEL_U_ADDR): Move from here ... + * config/m68k/nm-linux.h (KERNEL_U_ADDR): ... to here. + * config/ia64/xm-linux.h (KERNEL_U_ADDR): Move from here ... + * config/ia64/nm-linux.h (KERNEL_U_ADDR): ... to here. + * config/arm/xm-linux.h (KERNEL_U_ADDR): Move from here ... + * config/arm/nm-linux.h (KERNEL_U_ADDR): ... to here. + + * config/m68k/xm-m68k.h: Delete file. + * config/m68k/xm-linux.h: Do not include "m68k/xm-m68k.h". Update + copyright. + (HOST_LONG_DOUBLE_FORMAT): Delete macro. + * config/pa/xm-linux.h: Delete empty file. + * config/pa/linux.mh (XM_FILE): Delete. + * config/i386/xm-i386.h: Delete empty file. + * config/i386/xm-nbsd.h, config/i386/xm-go32.h: Do not include + "i386/xm-i386.h". + * config/i386/obsdaout.mh (XM_FILE): Delete. + * config/i386/obsd64.mh (XM_FILE): Delete. + * config/i386/fbsd64.mh (XM_FILE): Delete. + * config/i386/nto.mh (XM_FILE): Delete. + * config/i386/obsd.mh (XM_FILE): Delete. + * config/i386/linux64.mh (XM_FILE): Delete. + * config/i386/linux.mh (XM_FILE): Delete. + * config/i386/i386sol2.mh (XM_FILE): Delete. + * config/i386/i386gnu.mh (XM_FILE): Delete. + * config/i386/fbsd.mh (XM_FILE): Delete. + * config/i386/nbsd64.mh (XM_FILE): Delete. + +2004-07-29 Andrew Cagney <cagney@gnu.org> + + * config/pa/xm-linux.h: Do not include "floatformat.h". + (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) + (HOST_LONG_DOUBLE_FORMAT): Delete macros. + * config/i386/xm-i386.h: Do not include "floatformat.h". + (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) + (HOST_LONG_DOUBLE_FORMAT): Delete macros. + * doublest.c (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) + (HOST_LONG_DOUBLE_FORMAT): Delete macros. Use + GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT and + GDB_HOST_LONG_DOUBLE_FORMAT instead. + * configure.in (GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT) + (GDB_HOST_LONG_DOUBLE_FORMAT): Define. + * configure, config.in: Regenerate. + * configure.host (gdb_host_float_format, gdb_host_double_format) + (gdb_host_long_double_format): Set according to the host. + +2004-07-29 Andrew Cagney <cagney@gnu.org> + + * Makefile.in (CONFIG_CLEAN): Delete duplicate definition. + +2004-07-28 Andrew Cagney <cagney@gnu.org> + + * PROBLEMS: Mention threads/1650. + * NEWS: Mention the NPTL fix. + +2004-07-28 Andrew Cagney <cagney@gnu.org> + + * cli/cli-decode.c (add_setshow_cmd): Delete function. + (add_setshow_cmd_full): Make static. + * command.h (add_setshow_cmd, add_setshow_cmd_full): Delete. + (add_setshow_filename_cmd, add_setshow_string_cmd): Declare. + * cli/cli-decode.c (add_setshow_filename_cmd) + (add_setshow_string_cmd): New functions. + * nto-tdep.c (_initialize_nto_tdep): Update. Fix parameters. + * mips-tdep.c (_initialize_mips_tdep): Update. + * m32r-rom.c (_initialize_m32r_rom): Update. Update copyright. + * cli/cli-logging.c (_initialize_cli_logging): Update. + * complaints.c (_initialize_complaints): Update. + * remote.c (_initialize_remote): Update. + +2004-07-28 Andrew Cagney <cagney@gnu.org> + + * cli/cli-decode.c (add_setshow_zinteger_cmd) + (add_setshow_cmd, add_setshow_auto_boolean_cmd) + (add_setshow_boolean_cmd, add_setshow_cmd_full): Add help_doc and + print parameters. Make string parameters constant. + * command.h: Update. Update copyright. + * remote.c (add_packet_config_cmd, _initialize_remote): Ditto. + * observer.c (_initialize_observer): Ditto. + * frame.c (_initialize_frame): Ditto. + * complaints.c (_initialize_complaints): Ditto. + * maint.c (_initialize_maint_cmds): Ditto. + * target.c (initialize_targets): Ditto. + * cli/cli-logging.c (_initialize_cli_logging): Ditto. + * infcall.c (_initialize_infcall): Ditto. + * arm-tdep.c (_initialize_arm_tdep): Ditto. + * m32r-rom.c (_initialize_m32r_rom): Ditto. + * remote-rdi.c (_initialize_remote_rdi): Ditto. + * d10v-tdep.c (_initialize_d10v_tdep): Ditto. + * mips-tdep.c (_initialize_mips_tdep): Ditto. + +2004-07-28 Andrew Cagney <cagney@gnu.org> + + * gdbtypes.c (lookup_primitive_typename): Delete function. + * gdbtypes.h (lookup_primitive_typename): Delete declaration. + * ada-lex.l: Use language_lookup_primitive_type_by_name. + * gdbtypes.c (lookup_typename): Ditto. + * f-exp.y (yylex): Ditto. + * c-exp.y (yylex): Ditto, eliminate assignment in "if". + + * scm-lang.c (c_builtin_types): Delete extern declaration. + (scm_language_defn): Replace + string_char_type and primitive_type_vector with + la_language_arch_info. + * jv-lang.c (java_language_defn): Replace + string_char_type and primitive_type_vector with + la_language_arch_info. + * config/i386/i386sco4.mh (NATDEPFILES): Remove reference to + c_builtin_types in comment. + * c-lang.h (struct language_arch_info): Declare opaque. + (c_language_arch_info): Declare. + (c_builtin_types): Delete declaration. + * c-lang.c (c_language_arch_info): Set string_char_type to + builtin_char, not builtin_true_char. Make global. + (c_builtin_types): Delete array. + (asm_language_defn, minimal_language_defn): Replace + string_char_type and primitive_type_vector with + la_language_arch_info. + +2004-07-28 Andrew Cagney <cagney@gnu.org> + + * gdbtypes.h (struct builtin_type): Rename true_char to + builtin_true_char. + * gdbtypes.c (gdbtypes_post_init): Update. + * c-lang.c (arch_info): New function. + (enum c_primitive_types): New enum. + (c_language_defn): Instead of string_char_type and + primitive_type_vector set la_language_arch_info. + +2004-07-28 Andrew Cagney <cagney@gnu.org> + + * language.h (struct language_arch_info): Fix typo + s/primative/primitive/. + * gdbtypes.c (lookup_primitive_typename): Ditto. + * language.c (language_lookup_primitive_type_by_name) + (unknown_language_arch_info): Ditto. + +2004-07-27 Andrew Cagney <cagney@gnu.org> + + * defs.h (enum language): Add nr_languages. + * language.h (struct language_arch_info): Define. + (struct language_defn): Add la_language_arch_info. + (language_lookup_primative_type_by_name): Declare. + (language_string_char_type): Declare. + * language.c (_initialize_language, language_gdbarch_post_init) + (struct language_gdbarch, language_gdbarch_data): Implement + per-architecture language information. + (unknown_language_arch_info, language_string_char_type) + (language_lookup_primative_type_by_name): New functions. + (unknown_language_defn, auto_language_defn) + (local_language_defn): Set la_language_arch_info to + unknown_language_arch_info. + (unknown_builtin_types): Delete. + * gdbtypes.c (lookup_primitive_typename): Use + language_lookup_primative_type_by_name. + (create_string_type): Use language_string_char_type. + * values.c (value_from_string): Use language_string_char_type. + * scm-lang.c (scm_language_defn): Add NULL la_language_arch_info. + * p-lang.c (pascal_language_defn): Ditto. + * m2-lang.c (m2_language_defn): Ditto. + * jv-lang.c (java_language_defn): Ditto. + * objc-lang.c (objc_language_defn): Ditto. + * f-lang.c (f_language_defn): Ditto. + * c-lang.c (c_language_defn, cplus_language_defn) + (asm_language_defn, minimal_language_defn): Ditto. + +2004-07-27 Andrew Cagney <cagney@gnu.org> + + * gdbtypes.h (struct builtin_type): Declare. + (builtin_type): Declare. + * d10v-tdep.c (d10v_register_type): Use builtin_type. + * gdbtypes.c (_initialize_gdbtypes): Register gdbtypes_post_init. + (gdbtypes_post_init): New function. + (builtin_type): New function. + +2004-07-27 Kei Sakamoto <sakamoto.kei@renesas.com> + + * remote-m32r-sdi.c: Fix breakpoint bug. + (send_cmd, send_one_arg_cmd, send_two_arg_cmd, send_three_arg_cmd, + recv_char_data, recv_long_data): New functions to replace communication + sequences. + +2004-07-26 Michael Chastain <mec.gnu@mindspring.com> + + Document PR threads/1650. + * PROBLEMS (Threads): Document problem with many threads + +2004-07-26 Andrew Cagney <cagney@gnu.org> + + * gdb-mi.el: Move from here ... + * mi/gdb-mi.el: ... to here. + +2004-07-26 Andrew Cagney <cagney@gnu.org> + + Problem reported by Ashley Pittman <ashley@quadrics.com>. + * main.c (captured_main): When in batch mode always detach. + +2004-07-26 Andrew Cagney <cagney@gnu.org> + + * MAINTAINERS: Mark the xstormy16, sh64, ns32k, mn10300, mcore, + and h8300 as broken. + * NEWS: END-OF-LIFE frame compatibility module. + * PROBLEMS: For "Stack backtraces", remove powerpc, hppa and mips + specific comments. + +2004-07-26 Andrew Cagney <cagney@gnu.org> + + * cli/cli-decode.c (deprecated_add_show_from_set): Deprecate. + * xcoffsolib.c (_initialize_xcoffsolib): Update. + * wince.c (_initialize_wince): Update. + * win32-nat.c (_initialize_win32_nat): Update. + * varobj.c (_initialize_varobj): Update. + * valops.c (_initialize_valops): Update. + * utils.c (initialize_utils, initialize_utils): Update. + * tui/tui-win.c (_initialize_tui_win): Update. + * top.c (init_main): Update. + * symfile.c (_initialize_symfile): Update. + * source.c (_initialize_source): Update. + * somsolib.c (_initialize_som_solib): Update. + * solib.c (_initialize_solib): Update. + * solib-frv.c (_initialize_frv_solib): Update. + * serial.c (_initialize_serial): Update. + * ser-go32.c (_initialize_ser_dos, _initialize_ser_dos): Update. + * remote.c (_initialize_remote, _initialize_remote): Update. + * remote-vx.c (_initialize_vx): Update. + * remote-utils.c (_initialize_sr_support): Update. + * remote-sds.c (_initialize_remote_sds): Update. + * remote-mips.c (_initialize_remote_mips): Update. + * remote-e7000.c (_initialize_remote_e7000): Update. + * proc-api.c (_initialize_proc_api): Update. + * printcmd.c: Update. + * parse.c (_initialize_parse): Update. + * pa64solib.c (_initialize_pa64_solib): Update. + * p-valprint.c (_initialize_pascal_valprint): Update. + * monitor.c (_initialize_remote_monitors): Update. + * mips-tdep.c (_initialize_mips_tdep): Update. + * mcore-tdep.c (_initialize_mcore_tdep): Update. + * maint.c (_initialize_maint_cmds): Update. + * lin-lwp.c (_initialize_lin_lwp): Update. + * language.c (_initialize_language): Update. + * kod.c (_initialize_kod): Update. + * infrun.c (set_schedlock_func, _initialize_infrun): Update. + * i386-tdep.c (_initialize_i386_tdep): Update. + * gdbtypes.c (build_gdbtypes, _initialize_gdbtypes): Update. + * gdbarch.sh: Update. + * gdbarch.c: Re-generate. + * gdb-events.sh: Update. + * gdb-events.c: Re-generate. + * frame.c (_initialize_frame): Update. + * exec.c: Update. + * demangle.c (_initialize_demangler): Update. + * dcache.c (_initialize_dcache): Update. + * cris-tdep.c (_initialize_cris_tdep, cris_version_update): Update. + * cp-valprint.c (_initialize_cp_valprint): Update. + * corefile.c (_initialize_core): Update. + * command.h: Update. + * cli/cli-decode.h: Update. + * cli/cli-cmds.c (init_cli_cmds): Update. + * charset.c (_initialize_charset): Update. + * breakpoint.c (_initialize_breakpoint): Update. + * arm-tdep.c (_initialize_arm_tdep_initialize_arm_tdep): Update. + * alpha-tdep.c (_initialize_alpha_tdep): Update. + * aix-thread.c (_initialize_aix_thread): Update. + +2004-07-24 Mark Kettenis <kettenis@gnu.org> + + Partial fix for PR backtrace/1718. + * i386-tdep.c (i386_analyze_frame_setup): Handle more instructions + that GCC migrates into the prolugue. Don't handle any + instructions that clobber %ebx. + +2004-07-23 Andrew Cagney <cagney@gnu.org> + + Use regcache_raw_collect instead of regcache_collect. + * regcache.h (regcache_collect): Delete declaration. + * regcache.c (regcache_colect): Delete function. + * win32-nat.c (do_child_store_inferior_registers): Update. + * sol-thread.c (sol_thread_store_registers): Update. + * shnbsd-tdep.c (shnbsd_fill_reg): Update. + * rs6000-nat.c (store_register): Update. + * remote.c (store_register_using_P, remote_store_registers): Update. + * ppcnbsd-tdep.c (ppcnbsd_fill_reg): Update. + * ppc-linux-nat.c (store_altivec_register, store_spe_register) + (fill_vrregset, store_spe_registers, fill_gregset) + (fill_gregset): Update. + * nto-procfs.c (procfs_store_registers): Update. + * mipsnbsd-tdep.c (mipsnbsd_fill_reg): Update. + * mips-linux-tdep.c (fill_gregset, mips64_fill_gregset): Update. + * m68klinux-nat.c (store_register, fill_gregset): Update. + * m68k-tdep.c (fill_gregset): Update. + * infptrace.c (store_register): Update. + * i386-nto-tdep.c (i386nto_regset_fill): Update. + * i386-linux-nat.c (store_register, fill_gregset): Update. + * hppa-linux-nat.c (fill_gregset): Update. + * go32-nat.c (store_register): Update. + * armnbsd-nat.c (store_register, store_regs, store_fp_register) + (store_fp_regs): Update. + * arm-linux-nat.c (store_nwfpe_single, store_nwfpe_double) + (store_nwfpe_extended, store_fpregister, store_fpregs) + (store_register, store_regs, fill_gregset, fill_fpregset): Update. + * alpha-tdep.c (alpha_fill_int_regs, alpha_fill_fp_regs): Update. + * aix-thread.c (fill_gprs64, fill_fprs, fill_sprs64, fill_sprs32) + (store_regs_user_thread, store_regs_kernel_thread): Update. + +2004-07-24 Mark Kettenis <kettenis@gnu.org> + + * dwarf2-frame.c (struct dwarf2_cie): Delete `addr_size' member. + (decode_frame_entry_1): Use DW_EH_PE_absptr as default for CIE + encoding. + (dwarf2_build_frame_info): Adjust for removal of `addr_size' + member of `struct comp_unit'. + +2004-07-23 Andrew Cagney <cagney@gnu.org> + + * infrun.c (handle_inferior_event): Separate the STEP_OVER_ALL and + DEPRECATED_IGNORE_HELPER_CALL cases, only #ifdef the latter. + +2004-07-23 Martin Hunt <hunt@redhat.com> + Kevin Buettner <kevinb@redhat.com> + + * dwarf2-frame.c (execute_cfa_program): Fix typo in which the + alignment was being added to the offset instead of multiplied. + +2004-07-23 Mark Kettenis <kettenis@gnu.org> + + * sparc64obsd-tdep.c (sparc64obsd_pc_in_sigtramp): Adjust for + changed signal trampoline in OpenBSD 3.5-current. + + * sparc64nbsd-nat.c: Include "regcache.h", <sys/types.h>, + <machine/pcb.h> and "bsd-kvm.h". + (sparc64nbsd_supply_pcb): New function. + (_initialize_sparc64nbsd_nat): Renamed from + _initialize_sparcnbsd_nat. Enable libkvm interface. + * Makefile.in (sparc64nbsd-nat.o): Update dependencies. + * config/sparc/nbsd64.mh (NATDEPFILES): Add bsd-kvm.o + (LOADLIBES): New variable. + + * config/sparc/obsd64.mt (TDEPFILES): Add sparcobsd-tdep.o. + + * sparcnbsd-nat.c (sparc32nbsd_supply_pcb): Fix typo in comment. + +2004-07-21 Andrew Cagney <cagney@gnu.org> + + Use regcache_raw_supply instead of supply_register. + * regcache.h (supply_register): Delete declaration. + * regcache.c (supply_register): Delete function. + * wince.c (do_child_fetch_inferior_registers): Update. + * win32-nat.c (do_child_fetch_inferior_registers) + (fetch_elf_core_registers): Update. + * v850ice.c (v850ice_fetch_registers): Update. + * thread-db.c (thread_db_store_registers): Update. + * sol-thread.c (sol_thread_store_registers): Update. + * shnbsd-tdep.c (shnbsd_supply_reg): Update. + * rs6000-nat.c (fetch_register): Update. + * rom68k-rom.c (rom68k_supply_one_register): Update. + * remote.c (remote_wait, remote_async_wait): Update. + * remote-st.c (get_hex_regs): Update. + * remote-sim.c (gdbsim_fetch_register): Update. + * remote-sds.c (sds_fetch_registers): Update. + * remote-rdp.c (remote_rdp_fetch_register): Update. + * remote-rdi.c (arm_rdi_fetch_registers): Update. + * remote-mips.c (mips_wait, mips_fetch_registers): Update. + * remote-m32r-sdi.c (m32r_fetch_register): Update. + * remote-hms.c (init_hms_cmds): Update. + * remote-est.c (init_est_cmds): Update. + * remote-e7000.c (get_hex_regs, fetch_regs_from_dump) + (e7000_fetch_registers, sub2_from_pc, e7000_wait): Update. + * ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_supply_fpreg): Update. + * ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register) + (fetch_register, supply_vrregset, supply_vrregset) + (fetch_spe_registers): Update. + * ppc-bdm.c (bdm_ppc_fetch_registers): Update. + * monitor.c (monitor_supply_register): Update. + * mipsv4-nat.c (supply_gregset, supply_fpregset): Update. + * mipsnbsd-tdep.c (mipsnbsd_supply_reg) + (mipsnbsd_supply_fpreg): Update. + * mips-nat.c (fetch_inferior_registers) + (fetch_core_registers): Update. + * mips-linux-tdep.c (supply_32bit_reg, supply_gregset) + (supply_fpregset, mips64_supply_gregset) + (mips64_supply_fpregset): Update. + * m68klinux-nat.c (fetch_register, supply_gregset) + (supply_fpregset): Update. + * m68k-tdep.c (supply_gregset, supply_fpregset): Update. + * m32r-rom.c (init_m32r_cmds, init_mon2000_cmds): Update. + * lynx-nat.c (fetch_inferior_registers, fetch_core_registers): Update. + * irix5-nat.c (supply_gregset, supply_fpregset): Update. + * infptrace.c (fetch_register): Update. + * ia64-linux-nat.c (supply_gregset, supply_fpregset): Update. + * ia64-aix-nat.c (supply_gregset, supply_fpregset): Update. + * i386gnu-nat.c (fetch_fpregs, supply_gregset) + (gnu_fetch_registers, gnu_store_registers): Update. + * i386-nto-tdep.c (i386nto_supply_gregset): Update. + * i386-linux-nat.c (fetch_register, supply_gregset) + (dummy_sse_values): Update. + * hpux-thread.c (hpux_thread_fetch_registers): Update. + * hppah-nat.c (fetch_register): Update. + * hppa-linux-nat.c (fetch_register, supply_gregset) + (supply_fpregset): Update. + * go32-nat.c (fetch_register): Update. + * dve3900-rom.c (fetch_bitmapped_register) + (_initialize_r3900_rom): Update. + * cris-tdep.c (supply_gregset): Update. + * abug-rom.c (init_abug_cmds): Update. + * core-aout.c (fetch_core_registers): Update. + * armnbsd-nat.c (supply_gregset, supply_fparegset) + (fetch_register, fetch_fp_register): Update. + * arm-linux-nat.c (fetch_nwfpe_single, fetch_nwfpe_none) + (fetch_nwfpe_extended, fetch_fpregister, fetch_fpregs) + (fetch_register, fetch_regs, supply_gregset, supply_fpregset): Update. + * alphanbsd-tdep.c (fetch_core_registers): Update. + * alpha-tdep.c (alpha_supply_int_regs, alpha_supply_fp_regs): Update. + * alpha-nat.c (fetch_osf_core_registers) + (fetch_osf_core_registers, fetch_osf_core_registers): Update. + * aix-thread.c (supply_gprs64, supply_reg32, supply_fprs) + (supply_sprs64, supply_sprs32, fetch_regs_kernel_thread): Update. + +2004-07-21 Andrew Cagney <cagney@gnu.org> + + * PROBLEMS: Mention breakpoints/1702. + * NEWS: For signal trampolines, cite s390 GNU/Linux as a system + that is known to work. + +2004-07-21 Andrew Cagney <cagney@gnu.org> + + * config/mips/tm-mips.h (DEPRECATED_IGNORE_HELPER_CALL): Deprecate. + * mips-tdep.c (mips_dump_tdep, mips_ignore_helper): Update. + * infrun.c (DEPRECATED_IGNORE_HELPER_CALL): Delete macro. + (handle_inferior_event): Wrap call to deprecated + IGNORE_HELPER_CALL in #ifdef. + * config/mips/tm-nbsd.h: Update. + +2004-07-20 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (rs6000_gdbarch_init): The register set used for + bfd_mach_ppc has no segment registers. + + Include PowerPC SPR numbers for special-purpose registers. + * rs6000-tdep.c (struct reg): Add new member, 'spr_num'. + (R, R4, R8, R16, F, P, R32, R64, R0): Include value for + new member in initializer. + (S, S4, SN4, S64): New macros for defining special-purpose + registers. + (PPC_UISA_SPRS, PPC_UISA_NOFP_SPRS, PPC_OEA_SPRS, registers_power, + registers_403, registers_403GC, registers_505, registers_860, + registers_601, registers_602, registers_603, registers_604, + registers_750, registers_e500): Use them. + + * rs6000-tdep.c (rs6000_gdbarch_init): Delete variable 'power'; + replace references with expression used to initialize variable. + +2004-07-20 Andrew Cagney <cagney@gnu.org> + + * breakpoint.c (deprecated_read_memory_nobpt): Rename + read_memory_nobpt. + * sparc-linux-tdep.c (sparc_linux_sigtramp_start): Update. + * s390-tdep.c (s390_readinstruction, s390_in_function_epilogue_p) + (s390_sigtramp_frame_sniffer): Update. + * mn10300-tdep.c (mn10300_analyze_prologue): Update. + * mipsnbsd-tdep.c (mipsnbsd_sigtramp_offset): Update. + * mips-tdep.c (mips_fetch_instruction, mips16_fetch_instruction) + (mips32_fetch_instruction): Update. + * mcore-tdep.c (get_insn): Update. + * m68klinux-tdep.c (m68k_linux_pc_in_sigtramp): Update. + * i386nbsd-tdep.c (i386nbsd_sigtramp_offset): Update. + * i386ly-tdep.c (i386lynx_saved_pc_after_call): Update. + * i386-linux-tdep.c (i386_linux_sigtramp_start) + (i386_linux_rt_sigtramp_start): Update. + * i386-linux-nat.c (child_resume): Update. + * hppa-tdep.c (skip_prologue_hard_way, hppa_frame_cache): Update. + * hppa-linux-tdep.c (insns_match_pattern): Update. + * gdbcore.h: Update. + * frv-tdep.c (frv_gdbarch_adjust_breakpoint_address): Update. + * frame.c (safe_frame_unwind_memory): Update. + * amd64-linux-tdep.c (amd64_linux_sigtramp_start): Update. + * alphanbsd-tdep.c (alphanbsd_sigtramp_offset): Update. + * alpha-tdep.c (alpha_read_insn): Update. + +2004-07-20 Andrew Cagney <cagney@gnu.org> + + * tramp-frame.h (struct tramp_frame): Change "insn" to a struct + containing both bytes and mask. Add "frame_type". + * tramp-frame.c (tramp_frame_start): Update. + (tramp_frame_prepend_unwinder): Update. + * mips-linux-tdep.c (mips_linux_o32_sigframe) + (mips_linux_o32_rt_sigframe, mips_linux_n32_rt_sigframe) + (mips_linux_n64_rt_sigframe): Update. Make "static const". + * ppcnbsd-tdep.c (tramp_frame ppcnbsd_sigtramp): Update. + +2004-07-19 Eli Zaretskii <eliz@gnu.org> + + * config/djgpp/fnchange.lst: Add remapping for bfd/elf32-cr*.c, + bfd/elf32-sh-symbian.c, bfd/elf32-sh64-com.c, + sim/testsuite/sim/mips/hilo-hazard-[123].s, and + sim/testsuite/sim/mips/fpu64-ps-sb1.s. + +2004-07-17 Andrew Cagney <cagney@gnu.org> + + * NEWS, PROBLEMS: Update for 6.2. + + * README: Update to 6.2. + + * utils.c (xvasprintf): Call xstrvprintf. + + * parse.c: Update copyright. + (null_post_parser): Eliminate ARGSUSED. + + * ppc-linux-nat.c (store_spe_registers): Eliminate K&R C. + * tui/tui-win.c (tui_get_cmd_list): Ditto. + * symfile-mem.c (_initialize_symfile_mem): Ditto. + + * ppc-linux-tdep.c (ppc_linux_init_abi): Add [sic] to Linux. + * ppc-linux-nat.c: Use "Linux kernel". + * hppa-linux-tdep.c: Use GNU/Linux. + * hppa-linux-nat.c: Use GNU/Linux. + * dwarfread.c: Add [sic] to use of Linux. + + * hppa-linux-nat.c: Do not include <string.h>. + (supply_fpregset): Remove "register" attribute. + + * solib-frv.c (fetch_loadmap): Use xfree, not free. + +2004-07-17 Mark Kettenis <kettenis@gnu.org> + + * configure.in: Define _MSE_INT_H on Solaris 9 too. + * configure, config.in: Regenerated. + + * vaxbsd-nat.c: Include <sys/types.h>, <machine/pcb.h> and + "bsd-kvm.h". + (vaxbsd_supply_pcb): New function. + (_initialize_vaxbsd_nat): New prototype and function. + * config/vax/nbsdaout.mh (NATDEPFILES): Add bsd-kvm.o, solib.o and + solib-sunos.o. + (LOADLIBES): New variable. + * config/vax/nbsdelf.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + * config/vax/obsd.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + * Makefile.in (vaxbsd-nat.o): Update dependencies. + +2004-07-16 Andrew Cagney <cagney@gnu.org> + + * defs.h (event_loop_p): Replace variable declaration with macro, + always 1. + * main.c (captured_main): Delete options "-async" and "-noasync". + (event_loop_p): Delete variable. + * NEWS: Mention that "-async" and "-noasync" were removed. + +2004-07-16 Andrew Cagney <cagney@gnu.org> + + * remote-m32r-sdi.c: Re-indent. + +2004-07-16 Jim Blandy <jimb@redhat.com> + + * ppc-tdep.h (ppc_spr_asr): Add missing OEA SPR. + (ppc_spr_mi_dbcam, ppc_spr_mi_dbram0, ppc_spr_mi_dbram1) + (ppc_spr_md_cam, ppc_spr_md_ram0, ppc_spr_md_ram1): Add + missing MPC823 SPRs. + (ppc_spr_m_twb): Renamed from ppc_spr_md_twb; the old name was + incorrect. (This was corrected in GDB's register name tables on + 2004-07-14.) + + * rs6000-tdep.c (registers_602): Correct register name: "esassr" + should be "esasrr" ("ESA Save and Restore Register"). + +2004-07-16 Andrew Cagney <cagney@gnu.org> + + * infrun.c (insert_step_resume_breakpoint): Delete gdb_assert + calls, no longer applicable. Update comments and rename parameter + "step_frame" to "return_frame". + +2004-07-16 Andrew Cagney <cagney@gnu.org> + + * frame.c (fprint_field): New function. + (fprint_frame_id): Use fprint_field. + +2004-07-15 Joel Brobecker <brobecker@gnat.com> + + * ada-lang.c (ada_language_defn): Remove commented out code. + +2004-07-15 Jim Blandy <jimb@redhat.com> + + * ppc-tdep.h (struct gdbarch_tdep): New member: ppc_sr0_regnum. + * rs6000-tdep.c (rs6000_gdbarch_init): Initialize it. + +2004-07-14 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (COMMON_UISA_NOFP_REGS): Delete; unused. + + * ppc-tdep.h (ppc_num_vrs): New enum constant. + + * ppc-tdep.h (ppc_num_srs): New enum constant. + + * ppc-tdep.h (ppc_spr_mq, ppc_spr_xer, ppc_spr_rtcu, ppc_spr_rtcl) + (ppc_spr_lr, ppc_spr_ctr, ppc_spr_cnt, ppc_spr_dsisr, ppc_spr_dar) + (ppc_spr_dec, ppc_spr_sdr1, ppc_spr_srr0, ppc_spr_srr1) + (ppc_spr_eie, ppc_spr_eid, ppc_spr_nri, ppc_spr_sp, ppc_spr_cmpa) + (ppc_spr_cmpb, ppc_spr_cmpc, ppc_spr_cmpd, ppc_spr_icr) + (ppc_spr_der, ppc_spr_counta, ppc_spr_countb, ppc_spr_cmpe) + (ppc_spr_cmpf, ppc_spr_cmpg, ppc_spr_cmph, ppc_spr_lctrl1) + (ppc_spr_lctrl2, ppc_spr_ictrl, ppc_spr_bar, ppc_spr_vrsave) + (ppc_spr_sprg0, ppc_spr_sprg1, ppc_spr_sprg2, ppc_spr_sprg3) + (ppc_spr_ear, ppc_spr_tbl, ppc_spr_tbu, ppc_spr_pvr) + (ppc_spr_spefscr, ppc_spr_ibat0u, ppc_spr_ibat0l, ppc_spr_ibat1u) + (ppc_spr_ibat1l, ppc_spr_ibat2u, ppc_spr_ibat2l, ppc_spr_ibat3u) + (ppc_spr_ibat3l, ppc_spr_dbat0u, ppc_spr_dbat0l, ppc_spr_dbat1u) + (ppc_spr_dbat1l, ppc_spr_dbat2u, ppc_spr_dbat2l, ppc_spr_dbat3u) + (ppc_spr_dbat3l, ppc_spr_ic_cst, ppc_spr_ic_adr, ppc_spr_ic_dat) + (ppc_spr_dc_cst, ppc_spr_dc_adr, ppc_spr_dc_dat, ppc_spr_dpdr) + (ppc_spr_dpir, ppc_spr_immr, ppc_spr_mi_ctr, ppc_spr_mi_ap) + (ppc_spr_mi_epn, ppc_spr_mi_twc, ppc_spr_mi_rpn, ppc_spr_mi_cam) + (ppc_spr_mi_ram0, ppc_spr_mi_ram1, ppc_spr_md_ctr, ppc_spr_m_casid) + (ppc_spr_md_ap, ppc_spr_md_epn, ppc_spr_md_twb, ppc_spr_md_twc) + (ppc_spr_md_rpn, ppc_spr_m_tw, ppc_spr_md_dbcam, ppc_spr_md_dbram0) + (ppc_spr_md_dbram1, ppc_spr_ummcr0, ppc_spr_upmc1, ppc_spr_upmc2) + (ppc_spr_usia, ppc_spr_ummcr1, ppc_spr_upmc3, ppc_spr_upmc4) + (ppc_spr_zpr, ppc_spr_pid, ppc_spr_mmcr0, ppc_spr_pmc1) + (ppc_spr_sgr, ppc_spr_pmc2, ppc_spr_dcwr, ppc_spr_sia) + (ppc_spr_mmcr1, ppc_spr_pmc3, ppc_spr_pmc4, ppc_spr_sda) + (ppc_spr_tbhu, ppc_spr_tblu, ppc_spr_dmiss, ppc_spr_dcmp) + (ppc_spr_hash1, ppc_spr_hash2, ppc_spr_icdbdr, ppc_spr_imiss) + (ppc_spr_esr, ppc_spr_icmp, ppc_spr_dear, ppc_spr_rpa) + (ppc_spr_evpr, ppc_spr_cdbcr, ppc_spr_tsr, ppc_spr_602_tcr) + (ppc_spr_403_tcr, ppc_spr_ibr, ppc_spr_pit, ppc_spr_esasrr) + (ppc_spr_tbhi, ppc_spr_tblo, ppc_spr_srr2, ppc_spr_sebr) + (ppc_spr_srr3, ppc_spr_ser, ppc_spr_hid0, ppc_spr_dbsr) + (ppc_spr_hid1, ppc_spr_iabr, ppc_spr_dbcr, ppc_spr_iac1) + (ppc_spr_dabr, ppc_spr_iac2, ppc_spr_dac1, ppc_spr_dac2) + (ppc_spr_l2cr, ppc_spr_dccr, ppc_spr_ictc, ppc_spr_iccr) + (ppc_spr_thrm1, ppc_spr_pbl1, ppc_spr_thrm2, ppc_spr_pbu1) + (ppc_spr_thrm3, ppc_spr_pbl2, ppc_spr_fpecr, ppc_spr_lt) + (ppc_spr_pir, ppc_spr_pbu2): New enum constants for PowerPC + special-purpose register numbers. + + * rs6000-tdep.c (registers_860): Correct register name. (No PPC + manual mentions 'md_twb', but many mention 'm_twb', and at that + point in the register list.) + +2004-07-14 Andrew Cagney <cagney@gnu.org> + + * utils.c (internal_warning_problem): Fix typo, "internal-warning" + instead of "internal-error". + +2004-07-10 Joel Brobecker <brobecker@gnat.com> + + * hppa-hpux-tdep.c: Fix a compilation failure due to a comment + that was inserted inside a comment. + +2004-07-10 Randolph Chung <tausq@debian.org> + + * hppa-hpux-tdep.c (hppa_hpux_som_find_global_pointer): New + function. + (hppa_hpux_push_dummy_code): New function. + (hppa_hpux_init_abi): Set push_dummy_code and call_dummy_location. + Set find_global_pointer method. + +2004-07-10 Mark Kettenis <kettenis@gnu.org> + + * NEWS: Mention BSD libkvm interface. + +2004-07-10 Michael Snyder <msnyder@redhat.com> + + * symfile.c (generic_load): Comment typo. + * stack.c (get_selected_block): Ditto. + * regcache.c (regcache_cooked_read): Ditto. + * monitor.c (monitor_debug): Ditto. + * mips-tdep.c (mips_read_pc): Ditto. + * i386-linux-nat.c (ps_get_thread_area): Ditto. + * gdb_mbuild.sh: Ditto. + * gdbarch.sh: Ditto. + * gdbarch.h: Ditto. + +2004-07-09 Paul N. Hilfinger <Hilfinger@gnat.com> + + * ada-tasks.c: Remove file. + + Remove ARI problems: + + * ada-exp.y (write_var_from_sym): Reformat to put operator at + beginning of line. + + * ada-lang.c (MAX_OF_SIZE): Rename max_of_size. + Add comment. + Add comment concerning MAX_OF_TYPE and MIN_OF_TYPE. + (MIN_OF_SIZE): Rename min_of_size. Add comment. + (UMAX_OF_SIZE): Renmae umax_of_size. Add comment. + (UMIN_OF_SIZE): Remove. + (max_of_type): New function to replace orphan macro in gdbtypes.h + (min_of_type): Ditto. + (discrete_type_high_bound): Use max_of_type. + (discrete_type_low_bound): Use min_of_type. + (possible_user_operator_p): Move operator to beginning of line. + (ada_is_variant_part): Ditto. + (ensure_lval): Rewrite to avoid deprecated operations. + (ada_finish_decode_line_1): Use gdbarch_convert_from_func_ptr_addr + rather than adding DEPRECATED_FUNCTION_START_OFFSET. + (ada_enum_name): Remove assignments in 'if' statements. + (build_ada_types): Add gdbarch parameter. + (_initialize_ada_language): Replace deprecated_register_gdbarch_swap + with gdbarch_data_register_post_init. + Use add_setshow_uinteger_cmd rather than add_set_cmd and + add_show_from_set. + + * ada-valprint.c (inspect_it): Remove declaration. + (repeat_count_threshold): Remove declaration. + (ada_print_floating): Remove assignments in 'if' statements. + (print_str): Move operator to beginning of line. + +2004-07-08 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (registers_powerpc_nofp): Unused; deleted. + +2004-07-08 Bob Rossi <bob@brasko.net> + + * symtab.c (lookup_symtab): check return value of symtab_to_fullname + +2004-07-06 Jeff Johnston <jjohnstn@redhat.com> + + * language.h (struct_language_defn): Add new function pointer: + la_class_name_from_physname. Also add new prototype for + language_class_name_from_physname. + * language.c (language_class_name_from_physname): New function. + (unk_lang_class_name): Ditto. + (unknown_language_defn, auto_language_defn): Change + to add unk_lang_class_name function pointer for + la_class_name_from_physname. + (local_language_defn): Ditto. + * dwarf2read.c (guess_structure_name): Change to call + language_class_name_from_physname. + (determine_class_name): Ditto. + * cp-support.c (class_name_from_physname): Renamed. + (cp_class_name_from_physname): New name of function. + * cp-support.h: Ditto. + * c-lang.c (c_language_defn): Change to add NULL + for class_name_from_physname function pointer. + (cplus_language_defn): Change to add cp_class_name_from_physname. + * jv-lang.c (java_class_name_physname): New function. + (java_find_last_component): New static routine. + (java_language_defn): Add java_class_name_from_physname pointer. + * ada-lang.c (ada_language_defn): Change to add NULL + for class_name_from_physname function pointer. + * f-lang.c (f_language_defn): Ditto. + * m2-lang.c (m2_language_defn): Ditto. + * objc-lang.c (objc_language_defn): Ditto. + * p-lang.c (pascal_language_defn): Ditto. + * scm-lang.c (scm_language_defn): Ditto. + +2004-07-06 Andrew Cagney <cagney@gnu.org> + + Patch from Bart Robinson. + * corelow.c (core_open): Add variable "flags", or in O_LARGEFILE. + (O_LARGEFILE): Define to 0, if not defined. + +2004-07-03 Mark Kettenis <kettenis@gnu.org> + + * m68kbsd-nat.c: Include "gdbcore.h", <sys/types.h>, + <machine/pcb.h> and "bsd-kvm.h". + (PCB_REGS_FP, PCB_REGS_SP): Define if not already defined. + (m68kbsd_supply_pcb): New function. + (_initialize_m68kbsd_nat): New prototype and function. + * Makefile.in (m68kbsd-nat.o): Update dependencies. + * config/m68k/nbsdelf.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + * config/m68k/obsd.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + + * bsd-kvm.c (bsd_kvm_cmdlist): Remove unecessary initialization. + +2004-07-03 Mark Kettenis <kettenis@gnu.org> + + * bsd-kvm.c: Include "cli/cli-cmds.h", "command.h", "value.h" and + <sys/proc.h>. + (bsd_kvm_cmdlist): New variable. + (bsd_kvm_cmd, bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd): New functions. + (bsd_kvm_add_target): Register "kvm" command prefix, "kvm pcb" + command and "kvm proc" command. + * Makefile.in (bsd-kvm.o): Update dependencies. + +2004-07-02 Mark Kettenis <kettenis@gnu.org> + + * osabi.c: Update copyright year. + (generic_elf_osabi_sniffer): Tweak comment. Look for OS-specific + notes if EI_OSABI is set to ELFOSABI_HPUX. + +2004-07-01 Michael Snyder <msnyder@redhat.com> + + * win32-nat.c (core_dll_symbols_add): Re-indent a small section + that seems to have gotten whacked out of line. + +2004-07-01 Mark Kettenis <kettenis@gnu.org> + + * dbxread.c (process_one_symbol) [PCC_SOL_BROKEN]: Remove dead + code. + +2004-07-01 Paul N. Hilfinger <Hilfinger@gnat.com> + + * ada-lang.c (decode_packed_array): Minor change to comment. + (ada_value_slice_ptr): New function. + (ada_value_slice): New function. + (ada_evaluate_subexp): Remove XVS-suffix code from subscripting + test. Don't know why it is there. + Change slice code to use ada_value_slice_ptr and ada_value_slice, and + to avoid dereferencing huge arrays from which one is slicing. + (empty_array): Correct to return an array rather than + a subrange value. + * ada-valprint.c (print_optional_low_bound): Don't print lower bound + on empty arrays (let'em use 'FIRST instead). + +2004-07-01 Paul N. Hilfinger <Hilfinger@gnat.com> + + Address complaints from gdb_ari.sh: + + * ada-exp.y: Include gdb_string.h rather than string.h. + (convert_char_literal): Reformat declaration. + * ada-lang.h: Include opaque struct declaration for struct frame_info. + * ada-lex.l: Change use of free to xfree (the macro would do so + anyway, but this is harmless). + Include gdb_string.h rather than string.h. + * ada-valprint.c (ada_val_print_stub): Change PTR => void*. + + * ada-lang.c (parse): Remove K&Rism in parameter list. + (is_name_suffix): Correct Linux => GNU/Linux in comment. + +2004-06-30 Mark Kettenis <kettenis@gnu.org> + + * dbxread.c (process_one_symbol) [SUN_FIXED_LBRAC_BUG]: Remove + dead code. + +2004-06-30 Mark Kettenis <kettenis@gnu.org> + + * alphabsd-nat.c: Update copyright year. + (getregs_supplies): Use ALPHA_PC_REGNUM instead of PC_REGNUM. + +2004-06-29 Joel Brobecker <brobecker@gnat.com> + + * i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): New function. + (i386_cygwin_in_solib_call_trampoline): New function. + (i386_cygwin_init_abi): Initialize the in_solib_call_trampoline + and skip_trampoline_code gdbarch methods. + +2004-06-29 Jim Blandy <jimb@redhat.com> + + * Makefile.in (gdb_callback_h): Renamed from callback_h to the + name actually used in the dependency lists. + +2004-06-29 Randolph Chung <tausq@debian.org> + + * NEWS (New native configurations): Mention GNU/Linux/hppa. + +2004-06-29 Corinna Vinschen <vinschen@redhat.com> + + * win32-nat.c (child_pid_to_exec_file): New function. + (init_child_ops): Add child_pid_to_exec_file as to_pid_to_exec_file + functionality. + +2004-06-28 Andrew Cagney <cagney@gnu.org> + + * defs.h (xstrvprintf): Declare. + * utils.c (xstrvprintf): New function. + (internal_vproblem, xstrprintf, xasprintf) + (vfprintf_maybe_filtered, vfprintf_unfiltered): Use xstrvprintf. + * serial.c (serial_printf): Ditto. + * complaints.c (vcomplaint): Ditto. + +2004-06-29 Corinna Vinschen <vinschen@redhat.com> + + * infcmd.c (attach_command): Move call to target_terminal_inferior + behind loading symbol table. + +2004-06-28 Andrew Cagney <cagney@gnu.org> + + * rdi-share/ardi.c (angel_RDI_ExecuteOrStep): Revert 2004-06-24 + change - add back extern deprecated_ui_loop_hook declaration. + +2004-06-28 Andrew Cagney <cagney@gnu.org> + + * xcoffsolib.c (xcoff_solib_address): Replace xasprintf with + xstrprintf. + * varobj.c (varobj_gen_name, create_child, c_name_of_child) + (c_value_of_variable): Ditto. + * utils.c (internal_vproblem): Ditto. + * solib-aix5.c (build_so_list_from_mapfile): Ditto. + * remote.c (add_packet_config_cmd): Ditto. + * remote-rdp.c (rdp_set_command_line): Ditto. + * regcache.c (regcache_dump): Ditto. + * frv-tdep.c (new_variant, new_variant): Ditto. + * fbsd-proc.c (child_pid_to_exec_file): Ditto. + (fbsd_find_memory_regions): Ditto. + * breakpoint.c (create_thread_event_breakpoint) + (create_breakpoints): Ditto. + * aix-thread.c (aix_thread_pid_to_str): Ditto. + * ada-lang.c (is_package_name): Ditto. Also delete xmalloc call. + +2004-06-28 Joel Brobecker <brobecker@gnat.com> + + * ada-lang.c: Re-indent file, with some massaging to help indent + a bit when the result is otherwise really too ugly. + +2004-06-27 Ulrich Weigand <uweigand@de.ibm.com> + + * frame.h (struct frame_id): Change bit field type of stack_addr_p, + code_addr_p and special_addr_p to 'unsigned int'. + +2004-06-27 Mark Kettenis <kettenis@gnu.org> + + * i386v4-nat.c: Update copyright year and tweak comment. + (regmap): Remove trailing comma. + (supply_gregset): Rename local variable i to regnum. Call + regcache_raw_supply instead of supply_register. + (fill_gregset): Rename argument regno to regnum. Call + regcache_raw_collect instead of regcache_collect. + +2004-06-27 Ulrich Weigand <uweigand@de.ibm.com> + + * frame.h (struct frame_id): New fields stack_addr_p, code_addr_p + and special_addr_p. + (frame_id_build, frame_id_build_special): Update comments. + (frame_id_build_wild): New prototype. + * frame.c (frame_id_build, frame_id_build_special): Fill in new + struct frame_id fields. + (frame_id_build_wild): New function. + (frame_id_eq, frame_id_inner): Use new struct frame_id fields. + +2004-06-27 Mark Kettenis <kettenis@gnu.org> + + * config/djgpp/fnchange.lst: Add entries for hppabsd-nat.c and + hppabsd-tdep.c. + +2004-06-27 Joel Brobecker <brobecker@gnat.com> + + * ada-lang.c: Minor reformatting to conform to GNU coding standards. + +2004-06-27 Joel Brobecker <brobecker@gnat.com> + + * ada-lang.c: Re-indent file. + +2004-06-27 Joel Brobecker <brobecker@gnat.com> + + * ada-lang.c (symtab_symbol_info): Remove unused declaration. + (no_symtab_msg): Likewise. + +2004-06-27 Andreas Schwab <schwab@suse.de> + + * source.c: Fix whitespace. + +2004-06-27 Mark Kettenis <kettenis@gnu.org> + + * configure.in: Include <sys/param.h> for td_pcb test. + * configure: Regenerated. + + * i386nbsd-nat.c: New file. + * Makefile.in (ALLDEPFILES): Add i386nbsd-nat.c, i386nbsd-tdep.c, + i386obsd-nat.c and i386obsd-tdep.c. + (i386nbsd-nat.o): New dependency. + * config/i386/obsd.mh (NATDEPFILES): Add i386nbsd-nat.o and + bsd-kvm.o. + (LOADLIBES): New variable. + * config/i386/nbsdelf.mh (NATDEPFILES): Add i386nbsd-nat.o and + bsd-kvm.o. + (LOADLIBES): New variable. + + * config/i386/fbsd64.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + + * bsd-kvm.c (bsd_kvm_fetch_registers): Directly return after + fetching from BSD_KVM_PADDR. Correctly lookup address for + "_thread0". + + * amd64fbsd-nat.c: Include <sys/types.h, <machine/pcb.h> and + "bsd-kvm.h". + (amd64fbsd_supply_pcb): New funcion. + (_initialize_amd64fbsd_nat): Enable libkvm interface. + +2004-06-27 <david@streamline-computing.com> + + Partial fix for PR cli/1056. + * valarith.c: Check for zero in division and remainder + evaluation. + +2004-06-27 Mark Kettenis <kettenis@gnu.org> + + * i387-tdep.c: Remove excessive whitespace. + +2004-06-26 Andrew Cagney <cagney@gnu.org> + + * gdb-events.sh (deprecated_set_gdb_event_hooks): Deprecated. + * gdb-events.h, gdb-events.c: Re-generate. + * tui/tui-hooks.c (tui_install_hooks): Update. + (tui_remove_hooks): Update. + * mi/mi-cmd-break.c (mi_cmd_break_insert): Update. + +2004-06-26 Mark Kettenis <kettenis@gnu.org> + + * amd64fbsd-nat.c: Don't include <sys/procfs.h> and "gregset.h". + (gregset_t, fpregset_t): Remove typedefs. + (REG_OFFSET): Rename argument. + (amd64bsd_r_reg_offset): Rename from reg_offset. + (supply_gregset, fill_gregset, supply_fpregset, fill_fpregset): + Remove functions. + (_initialize_amd64fbsd_nat): Use amd64fbsd64_r_reg_offset instead + of reg_offset. + * Makefile.in (amd64fbsd-nat.o): Update dependencies. + + * amd64-nat.c (amd64_supply_native_gregset): Fix comment. + + * vax-tdep.c: Tweak comment. + + Add OpenBSD/hppa support. + * NEWS (New native configurations): Mention OpenBSD/hppa. + * hppabsd-nat.c, hppabsd-tdep.c, config/pa/obsd.mh, + config/pa/obsd.mt, config/pa/nm-obsd.h, config/pa/tm-bsd.h: New + files. + * Makefile.in (ALLDEPFILES): Add hppabsd-nat.c and hppabsd-tdep.c. + (hppabsd-nat.o, hppabsd-tdep.c): New dependencies. + * configure.host: Add hppa*-*-openbsd*. + * configure.tgt: Add hppa*-*-openbsd*. + +2004-06-25 Andrew Cagney <cagney@gnu.org> + + * defs.h (deprecated_ui_loop_hook): Deprecated. + * wince.c (child_wait): Update. + * win32-nat.c (child_wait): Update. + * v850ice.c (v850ice_wait): Update. + * top.c (deprecated_ui_loop_hook): Update. + * serial.h: Update. + * ser-unix.c (do_hardwire_readchar, do_hardwire_readchar) + (do_unix_readchar): Update. + * ser-tcp.c (net_open): Update. + * remote-sim.c (gdb_os_poll_quit): Update. + * rdi-share/ardi.c (angel_RDI_ExecuteOrStep): Update. + +2004-06-24 Andrew Cagney <cagney@gnu.org> + + * defs.h (deprecated_pre_add_symbol_hook) + (deprecated_post_add_symbol_hook): Deprecated. + * symfile.c (symbol_file_add_with_addrs_or_offsets) + (symbol_file_add_with_addrs_or_offsets): Update references. + +2004-06-24 Andrew Cagney <cagney@gnu.org> + + * defs.h (post_add_symbol_hook, pre_add_symbol_hook) + (ui_loop_hook, selected_frame_level_changed_hook): Declare. + * wince.c (ui_loop_hook): Delete extern declaration. + * win32-nat.c (ui_loop_hook): Delete extern declaration.. + * v850ice.c (ui_loop_hook): Delete extern declaration.. + * ser-unix.c (ui_loop_hook): Delete extern declaration.. + * ser-tcp.c (ui_loop_hook): Delete extern declaration.. + * remote-sim.c (ui_loop_hook): Delete extern declaration.. + * rdi-share/ardi.c (angel_RDI_ExecuteOrStep): Delete extern. + ui_loop_hook declaration. + +2004-06-24 Andrew Cagney <cagney@gnu.org> + + * objfiles.h (struct entry_info): Delete entry_func_lowpc and + entry_func_highpc fields. + * objfiles.c (init_entry_point_info): Do not clear + entry_func_lowpc and entry_func_highpc. + (objfile_relocate): Do not relocate entry_func_lowpc and + entry_func_highpc. + * dwarfread.c (read_func_scope): Do not set entry_func_lowpc and + entry_func_highpc. + * dwarf2read.c (read_func_scope): Do not set entry_func_lowpc and + entry_func_highpc. + * blockframe.c (legacy_frame_chain_valid): Replace tests against + entry_func_lowpc and entry_func_highpc with call to + inside_entry_func. + +2004-06-24 Mark Kettenis <kettenis@gnu.org> + + * sparc64-tdep.c (sparc64_store_arguments): Fix passing + quad-precision floating point arguments in registers. + +2004-06-24 Mark Kettenis <kettenis@gnu.org> + + From Michael Mueller <m.mueller99@kay-mueller.de>: + * sparc64-tdep.c (sparc64_frame_base_address): Take BIAS into + account. + +2004-06-22 Jeff Johnston <jjohnstn@redhat.com> + + * infrun.c (handle_inferior_event): Initialize stopped_by_watchpoint + to -1. + * breakpoint.c (bpstat_stop_status): Move check for ignoring + untriggered watchpoints to a separate if clause. Update function + comment regarding STOPPED_BY_WATCHPOINT argument. + +2004-06-22 Jim Blandy <jimb@redhat.com> + + * gdbarch.sh: Doc fix. + +2004-06-21 Martin Hunt <hunt@redhat.com> + Kevin Buettner <kevinb@redhat.com> + + * config/mips/tm-mips.h (SP_REGNUM): Delete define. + * mips-tdep.h (MIPS_SP_REGNUM): Define. + * mips-tdep.c (mips_gdbarch_init): Set SP_REGNUM via call + to set_gdbarch_sp_regnum(). Use cooked register number. + (SP_REGNUM): Replace all occurrences with MIPS_SP_REGNUM. + +2004-06-21 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh: When the macro field is empty, do not generate a + macro definition. When the macro field is "=", generate the macro + name from the upper-case function name. + (NUM_REGS, NUM_PSEUDO_REGS, SP_REGNUM, PC_REGNUM, PS_REGNUM) + (FP0_REGNUM, STAB_REG_TO_REGNUM, ECOFF_REG_TO_REGNUM) + (DWARF_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM) + (REGISTER_NAME, DEPRECATED_REGISTER_VIRTUAL_TYPE) + (DEPRECATED_REGISTER_BYTES, DEPRECATED_REGISTER_BYTE) + (DEPRECATED_REGISTER_RAW_SIZE, DEPRECATED_REGISTER_VIRTUAL_SIZE) + (DEPRECATED_SAVE_DUMMY_FRAME_TOS, DEPRECATED_FP_REGNUM) + (DEPRECATED_TARGET_READ_FP, DEPRECATED_PUSH_ARGUMENTS) + (DEPRECATED_PUSH_RETURN_ADDRESS, DEPRECATED_DUMMY_WRITE_SP) + (DEPRECATED_REGISTER_SIZE, CALL_DUMMY_LOCATION) + (DEPRECATED_DO_REGISTERS_INFO, REGISTER_SIM_REGNO) + (REGISTER_BYTES_OK, CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER) + (GET_LONGJMP_TARGET, DEPRECATED_INIT_FRAME_PC) + (BELIEVE_PCC_PROMOTION, DEPRECATED_GET_SAVED_REGISTER) + (CONVERT_REGISTER_P, REGISTER_TO_VALUE, VALUE_TO_REGISTER) + (POINTER_TO_ADDRESS, ADDRESS_TO_POINTER, INTEGER_TO_ADDRESS) + (DEPRECATED_POP_FRAME, DEPRECATED_STORE_STRUCT_RETURN) + (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE) + (DEPRECATED_EXTRACT_RETURN_VALUE, DEPRECATED_STORE_RETURN_VALUE) + (DEPRECATED_USE_STRUCT_CONVENTION) + (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS) + (DEPRECATED_FRAME_INIT_SAVED_REGS) + (DEPRECATED_INIT_EXTRA_FRAME_INFO, SKIP_PROLOGUE, INNER_THAN) + (BREAKPOINT_FROM_PC, MEMORY_INSERT_BREAKPOINT) + (MEMORY_REMOVE_BREAKPOINT, DECR_PC_AFTER_BREAK) + (DEPRECATED_FUNCTION_START_OFFSET, FRAME_ARGS_SKIP) + (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION, DEPRECATED_FRAME_CHAIN) + (DEPRECATED_FRAME_CHAIN_VALID, DEPRECATED_FRAME_SAVED_PC) + (DEPRECATED_FRAME_ARGS_ADDRESS, DEPRECATED_FRAME_LOCALS_ADDRESS) + (DEPRECATED_SAVED_PC_AFTER_CALL, FRAME_NUM_ARGS) + (DEPRECATED_STACK_ALIGN, DEPRECATED_REG_STRUCT_HAS_ADDR) + (FRAME_RED_ZONE_SIZE, ADDR_BITS_REMOVE, SMASH_TEXT_ADDRESS) + (SOFTWARE_SINGLE_STEP, SKIP_TRAMPOLINE_CODE) + (IN_SOLIB_CALL_TRAMPOLINE, IN_SOLIB_RETURN_TRAMPOLINE) + (ELF_MAKE_MSYMBOL_SPECIAL, COFF_MAKE_MSYMBOL_SPECIAL) + (NAME_OF_MALLOC, CANNOT_STEP_BREAKPOINT) + (HAVE_NONSTEPPABLE_WATCHPOINT, ADDRESS_CLASS_TYPE_FLAGS) + (FETCH_POINTER_ARGUMENT): Replace the macro name with "=". + +2004-06-21 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh: For gdbarch_dump, print the "function" rather than + macro name, and the function rather than macro value. Only wrap + macro print statements in #ifdef. Move format logic to where it + is needed. + * gdbarch.c: Re-generate. + + * gdbarch.sh (read): Delete "print_p" and "description", add + "garbage_at_eol". Check for non-empty garbage at end-of-line. + Delete references to print_p. + (TARGET_ARCHITECTURE): Delete print predicate. + * gdbarch.c: Re-generate. + + * gdbarch.sh: Check that multi-arch methods do not provide a + macro. + (register_type, unwind_dummy_id, push_dummy_call, push_dummy_code) + (print_registers_info, print_float_info, print_vector_info) + (adjust_breakpoint_address, remote_translate_xfer_address) + (construct_inferior_arguments, skip_solib_resolver, unwind_pc) + (address_class_type_flags_to_name, unwind_sp): Remove the macro + name from the multi-arch definition. + +2004-06-20 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh: Sort by the function, instead of macro name. + * gdbarch.c: Re-generate. + +2004-06-20 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh: Use the function, instead of macro name in + errors and the log file. + (return_value): Remove stray ":" in spec. + + * gdbarch.sh (RETURN_VALUE): Default to legacy_return_value. + * gdbarch.h, gdbarch.c: Re-generate. + * Makefile.in (arch-utils.o): Update dependencies. + * values.c (using_struct_return): Move code calling + USE_STRUCT_CONVENTION to legacy_return_value, simplify. + * stack.c (return_command): Move code calling STORE_RETURN_VALUE + to legacy_return_value, simplify. + * infcmd.c (print_return_value): Move code calling + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS and EXTRACT_RETURN_VALUE + to legacy_return_value, simplify. + * infcall.c (call_function_by_hand): Move code calling + EXTRACT_RETURN_VALUE to legacy_return_value, simplify. + * arch-utils.c: Update copyright. Include "gdbcore.h". + (legacy_return_value): New function. + * arch-utils.h: Update copyright. + (legacy_return_value): Declare. + +2004-06-20 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh (DEPRECATED_USE_STRUCT_CONVENTION): Deprecated. + * gdbarch.h, gdbarch.c: Re-generate. + * values.c (using_struct_return): Update call. + * mcore-tdep.c: Update comment. + * infcall.c (call_function_by_hand): Update comment. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * arch-utils.h (always_use_struct_convention): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sh64-tdep.c (sh64_gdbarch_init): Update. + * sh-tdep.c (sh_gdbarch_init): Update. + * rs6000-tdep.c (rs6000_gdbarch_init): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * m32r-tdep.c (m32r_gdbarch_init): Update. + * ia64-tdep.c (ia64_gdbarch_init): Update. + * h8300-tdep.c (h8300_gdbarch_init): Update. + * frv-tdep.c (frv_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * alpha-tdep.c (alpha_gdbarch_init): Update. + +2004-06-18 Michael Chastain <mec.gnu@mindspring.com> + + * PROBLEMS: Add more specific information, and a work-around, + for PR gdb/1458. + +2004-06-18 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh (DEPRECATED_FUNCTION_START_OFFSET): Deprecated. + * gdbarch.h, gdbarch.c: Re-generate. + * ada-lang.c (ada_finish_decode_line_1): Update. + * infrun.c (handle_inferior_event): Update. + * infcall.c (find_function_addr): Update. + * linespec.c (minsym_found): Update. + * symtab.c (find_function_start_sal, skip_prologue_using_sal): + Update. + * blockframe.c (legacy_frameless_look_for_prologue): Update. + * cli/cli-cmds.c (disassemble_command): Update. + * vax-tdep.c (vax_gdbarch_init): Update. + +2004-06-18 Mark Kettenis <kettenis@gnu.org> + + * i386-tdep.c (i386_collect_fpregset): Fix comment. + +2004-06-17 Andrew Cagney <cagney@gnu.org> + + GDB 6.1.1 released from the GDB 6.1 branch. + * NEWS: Merge in 6.1.1 NEWS from 6.1 branch. + * PROBLEMS: Ditto. + +2004-06-16 Daniel Jacobowitz <dan@debian.org> + + PR gdb/1658 + * dwarf2read.c (dwarf_decode_lines): Read the length of the extended + operation as a uleb128. Found by Michael Coulter. + +2004-06-16 Paul N. Hilfinger <Hilfinger@gnat.com> + + * ada-tasks.c: Rename build_task_list to ada_build_task_list, and + make it non-static. + * ada-lang.h (task_control_block): declaration moved from ada-task.c + to ada-lang.h; this is needed to be able to implement the kill command + in multi-task mode. + (task_ptid): Ditto. + (task_entry): Ditto. + (task_list): Ditto. + (ada_build_task_list): Ditto. + + * ada-lang.c: Conditionalize routines and data structures related + to breakpoints, exceptions, completion, and symbol caching on + GNAT_GDB, since these are not yet used in the submitted public sources. + (ada_main_name): Editorial: Move definition out of exception-related + code. + +2004-06-15 Andrew Cagney <cagney@gnu.org> + + * mips-tdep.c (non_heuristic_proc_desc): Delete call to + deprecated_pc_in_call_dummy. + +2004-06-15 Alan Modra <amodra@bigpond.net.au> + + * dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of + bfd_get_section_size_before_reloc or _raw_size. + * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. + * dwarf2read.c (dwarf2_locate_sections): Likewise. + (dwarf2_read_section): Likewise. + * elfread.c (elf_locate_sections): Likewise. + * gcore.c (derive_heap_segment): Likewise. + * mipsread.c (read_alphacoff_dynamic_symtab): Likewise. + * remote-e7000.c (e7000_load): Likewise. + * remote-m32r-sdi.c (m32r_load): Likewise. + * remote-mips.c (mips_load_srec): Likewise. + (pmon_load_fast): Likewise. + * remote.c (compare_sections_command): Likewise. + * symfile.c (add_section_size_callback): Likewise. + (load_section_callback): Likewise. + (pc_in_unmapped_range): Likewise. + (pc_in_mapped_range): Likewise. + (sections_overlap): Likewise. + (list_overlays_command): Likewise. + (simple_overlay_update_1): Likewise. + (simple_overlay_update): Likewise. + * tracepoint.c (remote_set_transparent_ranges): Likewise. + * win32-nat.c (core_section_load_dll_symbols): Likewise. + +2004-06-14 Randolph Chung <tausq@debian.org> + + * Makefile.in (hppa-hpux-tdep.o): Update dependency. + * hppa-hpux-tdep.c (hp_cxx_exception_support_initialized): Make + static. + (hppa_hpux_inferior_created): New function. + (hppa_hpux_init_abi): Register observer. + * symfile.c (hp_cxx_exception_support_initialized) + (RESET_HP_UX_GLOBALS): Remove HPUXHPPA specific hacks. + (symbol_file_add_main_1, symbol_file_clear): Likewise. + +2004-06-14 Randolph Chung <tausq@debian.org> + + * MAINTAINERS (Write After Approval): Alphabetize my entry + correctly. + +2004-06-14 Andrew Cagney <cagney@gnu.org> + + * MAINTAINERS (testsuite): List Michael Chastain as the lead + testsuite maintainer. + +2004-06-13 Andrew Cagney <cagney@gnu.org> + + * infcmd.c (print_return_value): Fix logic, allow + DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS when struct_return. + + * gdbarch.sh: For predicates, do not check GDB_MULTI_ARCH when + defining any macros. + * gdbarch.h: Re-generate. + + * gdbarch.sh: Delete "level" attribute. Only check for a macro + redefinition when multi-arch greater than GDB_MULTI_ARCH_PARTIAL. + * gdbarch.h: Re-generate. + + * values.c (generic_use_struct_convention): Don't check gcc_p. + + * gdbarch.sh (DEPRECATED_MAX_REGISTER_RAW_SIZE) + (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Delete. + * gdbarch.h, gdbarch.c: Regenerate. + * ns32k-tdep.h (NS32K_MAX_REGISTER_RAW_SIZE) + (NS32K_MAX_REGISTER_VIRTUAL_SIZE): Delete macros. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set + deprecated_max_register_raw_size and + deprecated_max_register_virtual_size. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * ns32k-tdep.c (ns32k_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * cris-tdep.c (cris_gdbarch_init): Ditto. + + * gdbarch.sh (RETURN_VALUE_ON_STACK): Delete method. + * gdbarch.h, gdbarch.c: Re-generate. + * m68hc11-tdep.c (m68hc11_return_value_on_stack): Delete function. + (m68hc11_use_struct_convention): Delete function. + (m68hc11_extract_struct_value_address): Delete function. + (m68hc11_return_value): New function. + (m68hc11_gdbarch_init): Instead of store_return_value, + extract_return_value, return_value_on_stack, + deprecated_extract_struct_value_address and use_struct_convention, + set return_value. + * values.c (using_struct_return): Do not call + RETURN_VALUE_ON_STACK. + * arch-utils.h (generic_return_value_on_stack_not): Delete + declaration. + * arch-utils.c (generic_return_value_on_stack_not): Delete + function. + +2004-06-12 Andrew Cagney <cagney@gnu.org> + + * values.c (register_value_being_returned): Delete function. + * infcmd.c (legacy_return_value): Delete function. + * infcall.c (call_function_by_hand): Inline + "register_value_being_returned", simplify. + * values.c (using_struct_return): Update comment, refer to + print_return_value instead of register_value_being_returned. + * infcmd.c (print_return_value): Inline calls to + register_value_being_returned and legacy_return_value. Simplify. + +2004-06-11 Randolph Chung <tausq@debian.org> + + * somread.c (som_symtab_read): Exclude gcc local symbols. + +2004-06-11 Randolph Chung <tausq@debian.org> + + * infrun.c (handle_inferior_event): Handle the case when a + trampoline ends up in the runtime resolver, and if the trampoline + has no name. Rearrange the code so that all the trampoline + processing happens before other step-out-of-range handling. + +2004-06-11 Martin Hunt <hunt@redhat.com> + + * mips-tdep.c (mips_gdbarch_init): Recognize vr4120 + has no fpu. + +2004-06-10 Andrew Cagney <cagney@gnu.org> + + * blockframe.c (legacy_inside_entry_func): Delete. + (legacy_frame_chain_valid): Inline call to + legacy_inside_entry_func, simplify. + +2004-06-10 Bob Rossi <bob@brasko.net> + + * dbxread.c (read_dbx_symtab): Set pst->dirname when known. + * dwarf2read.c (partial_die_info): Add dirname field. + (dwarf2_build_psymtabs_hard): Set pst->dirname when known. + (read_partial_die): Save away DW_AT_comp_dir. + * defs.h (symtab_to_filename): Removed. + * source.c (find_and_open_source): Added. + (open_source_file): Just calls find_and_open_source. + (symtab_to_filename): Removed. + (symtab_to_fullname, psymtab_to_fullname): Added. + * source.h (psymtab_to_fullname,symtab_to_fullname): Added. + * symtab.c (lookup_symtab): Call symtab_to_fullname instead of + symtab_to_filename. + * symtab.h (partial_symtab): Add dirname field. + * mi/mi-cmd-file.c (FILENAME,FULLNAME): Added. + (mi_cmd_file_list_exec_source_file): Call new function + symtab_to_fullname to find fullname. + (mi_cmd_file_list_exec_source_files): Added. + * mi/mi-cmds.c (mi_cmd_mi_cmds): Add -file-list-exec-source-files. + * mi/mi-cmds.h (mi_cmd_file_list_exec_source_files): Added. + +2004-06-10 Andrew Cagney <cagney@gnu.org> + + * avr-tdep.c (avr_gdbarch_init): Do not set use_struct_convention + to generic_use_struct_convention, the default value. + + * mn10300-tdep.c (mn10300_type_align): Call internal_error instead + of abort. + + * ns32k-tdep.c (ns32k_push_arguments): New function. + (ns32k_gdbarch_init): Set deprecated_push_arguments. + * infcall.c (call_function_by_hand): Call error instead of + legacy_push_arguments. + * value.h (legacy_push_arguments): Delete declaration. + * valops.c (legacy_push_arguments): Delete function. + (value_push): Delete function. + +2004-06-10 Brian Ford <ford@vss.fsi.com> + + * coffread.c (coff_symfile_read): Prevent mixed debugging formats + from corrupting/reinitializing the psymtab. Support DWARF 2 frame + info. + * dbxread.c (elfstab_build_psymtabs): Remove bogus comment. + +2004-06-10 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.h (deprecated_pc_in_call_dummy): Delete "sp" and "fp" + parameters. + * dummy-frame.c (deprecated_pc_in_call_dummy): Update. + * arm-tdep.c (arm_pc_is_thumb_dummy): Call + deprecated_pc_in_call_dummy instead of + DEPRECATED_PC_IN_CALL_DUMMY. + (arm_skip_prologue): Ditto. + * xstormy16-tdep.c (xstormy16_pop_frame, xstormy16_scan_prologue) + (xstormy16_frame_saved_pc, xstormy16_frame_chain): Ditto. + * v850-tdep.c (v850_find_callers_reg, v850_frame_chain) + (v850_pop_frame, v850_frame_saved_pc, v850_frame_init_saved_regs): + Ditto. + * sh64-tdep.c (sh64_frame_chain, sh64_get_saved_pr) + (sh64_init_extra_frame_info, sh64_get_saved_register) + (sh64_pop_frame): Ditto. + * mips-tdep.c (non_heuristic_proc_desc): Ditto. + * mcore-tdep.c (mcore_find_callers_reg, mcore_frame_saved_pc) + (mcore_pop_frame, mcore_init_extra_frame_info): Ditto. + * h8300-tdep.c (h8300_frame_chain, h8300_frame_saved_pc) + (h8300_pop_frame): Ditto. + * blockframe.c (legacy_inside_entry_func) + (legacy_frame_chain_valid): Ditto. + * frame.c (frame_type_from_pc, legacy_get_prev_frame): Update call + to deprecated_pc_in_call_dummy. + +2004-06-09 Andrew Cagney <cagney@gnu.org> + + * gdbarch.sh (REGISTER_TO_VALUE, VALUE_TO_REGISTER): Do not + provide a default value. + (CONVERT_REGISTER_P): Default to generic_convert_register_p. + * gdbarch.h, gdbarch.c: Re-generate. + * arch-utils.c (generic_convert_register_p): Rename + legacy_convert_register_p + (legacy_register_to_value, legacy_value_to_register): Delete + functions. + * arch-utils.h (generic_convert_register_p): Rename + legacy_convert_register_p. + (legacy_register_to_value, legacy_value_to_register): Delete + declarations. + + * gdbarch.sh (DEPRECATED_REGISTER_CONVERT_TO_RAW) + (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL) + (DEPRECATED_REGISTER_CONVERTIBLE): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * infcmd.c (default_print_registers_info): Simplify. + * findvar.c (value_of_register): Simplify. + * mi/mi-main.c (get_register): Simplify. + * arch-utils.c (legacy_convert_register_p): Always return 0. + (legacy_register_to_value, legacy_value_to_register): Always call + internal_error. + + * infptrace.c (child_xfer_memory) [CLEAR_INSN_CACHE]: Delete + #ifdef CLEAR_INSN_CACHE code. + * target.c (generic_mourn_inferior) [CLEAR_DEFERRED_STORES]: + Delete #ifdef CLEAR_DEFERRED_STORES code. + + * solib-svr4.c [HANDLE_SVR4_EXEC_EMULATORS]: Delete #ifdef code. + + * config/ia64/tm-linux.h (TARGET_ELF64): Delete macro, Update + copyright. + * config/ia64/tm-aix.h (TARGET_ELF64): Ditto. + + * config/mips/mipsv4.mh: Delete file. + + * config/pa/tm-hppa64.h (HPREAD_ADJUST_STACK_ADDRESS): Delete + unreferenced macro. + (hpread_adjust_stack_address): Delete declaration. + +2004-06-08 Andrew Cagney <cagney@gnu.org> + + * infptrace.c [ATTACH_DETACH]: Remove #ifdef wrappers. + (attach, detach): When neither PT_ATTACH / PT_DETACH nor + PTRACE_ATTACH / PTRACE_DETACH available call error. + (PT_ATTACH, PT_DETACH): Move definition to attach / detach. + * infttrace.c (update_thread_state_after_attach, attach, detach): + Remove #ifdef wrappers. + * inftarg.c (child_attach, child_detach): Remove #ifdef wrappers. + * gnu-nat.c [ATTACH_DETACH]: Remove #ifdef wrappers. + * config/nm-bsd.h (ATTACH_DETACH): Delete. + * config/nm-sysv4.h (ATTACH_DETACH): Delete. + * config/nm-nbsd.h (ATTACH_DETACH): Delete. + * config/nm-linux.h (ATTACH_DETACH): Delete. + * config/rs6000/nm-rs6000.h (ATTACH_DETACH): Delete. + * config/pa/nm-hppah.h (ATTACH_DETACH): Delete. + * config/i386/nm-i386sco5.h (ATTACH_DETACH): Delete. + * config/i386/nm-i386sco4.h (ATTACH_DETACH): Delete. + * config/i386/nm-i386gnu.h (ATTACH_DETACH): Delete. + +2004-06-08 Corinna Vinschen <vinschen@redhat.com> + + * configure.in: Set $configdir to the right OS specific value. + Use value when setting $tcldir and $tkdir. + * configure: Regenerate. + +2004-06-06 Paul Brook <paul@codesourcery.com> + + * gdb/dwarf2-frame.c (decode_frame_entry_1): Decode version 3 CIE + records. + +2004-06-08 Paul N. Hilfinger <Hilfinger@gnat.com> + + * ada-lang.c (lookup_symbol_in_language): New function to allow + re-use of another language's symbol lookup code. (Placed here + temporarily while Ada support is being integrated into the public + tree). + (restore_language): New auxiliary function for + lookup_symbol_in_language. + * ada-lang.h (lookup_symbol_in_language): Declare (Placed here + temporarily while Ada support is being integrated into the public + tree). + +2004-06-08 Alexandre Oliva <aoliva@redhat.com> + + * Makefile.in (check//%): New. + + * mn10300-tdep.c (mn10300_extract_return_value): Rewrite. + (mn10300_store_return_value): Rewrite. + (mn10300_type_align): New. + (mn10300_use_struct_convention): Rewrite. + (mn10300_return_value): New, using all of the above. + (mn10300_pop_frame_regular): Add saved_regs_size. + (mn10300_gdbarch_init): Remove deprecated rewritten entry points. + + * mn10300-tdep.c (mn10300_analyze_prologue): Don't compute saved + regs if PC is on movm. + +2004-06-07 Jim Blandy <jimb@redhat.com> + + Add native Linux support for the PowerPC E500. + * ppc-tdep.h (struct gdbarch_tdep): New member: 'ppc_gprs_pseudo_p'. + * rs6000-tdep.c (rs6000_gdbarch_init): Initialize it to false on + all architectures except the E500. + * ppc-linux-nat.c: (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): New + #definitions. + (struct gdb_evrregset_t): New type. + (have_ptrace_getsetevrregs): New variable. + (get_spe_registers, read_spliced_spe_reg, fetch_spe_register, + fetch_spe_registers): New functions. + (fetch_register): Call fetch_spe_register as appropriate. + Assert that we're only passed raw register numbers. + (fetch_ppc_registers): Call fetch_spe_registers as appropriate. + Don't fetch gprs if they're pseudoregisters. + (set_spe_registers, write_spliced_spe_reg, store_spe_register, + store_spe_registers): New functions. + (store_register): Call store_spe_register as appropriate. + Assert that we're only passed raw register numbers. + (store_ppc_registers): Call store_spe_registers as appropriate. + Don't store gprs if they're pseudoregisters. + +2004-06-07 Jeff Johnston <jjohnstn@redhat.com> + + * thread-db.c (thread_get_info_callback): Fill in the thread_info + struct if one exists, even if we are dealing with a zombie thread. + +2004-06-07 Andrew Cagney <cagney@gnu.org> + + * target.h (PC_REQUIRES_RUN_BEFORE_USE): Delete definition. + * config/pa/tm-hppa.h (DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE): + Rename PC_REQUIRES_RUN_BEFORE_USE. + * breakpoint.c (breakpoint_sals_to_pc): Update. Wrap reference in + #ifdef. + +2004-06-07 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_frame_cache): Handle the cases when we start + unwinding after sp has been saved to the stack but before the end + of the prologue, and after the fp has been modified but before it has + been saved to the stack. + (hppa_frame_base_address, hppa_frame_base, hppa_frame_base_sniffer): + Remove superfluous definitions. + (hppa_gdbarch_init): Remove superfluous frame base sniffer. + +2004-06-07 Guy Martin <gmsoft@gentoo.org> + + Committed by Randolph Chung. + * hppa-linux-nat.c: Include the correct version of the header file + depending on the kernel version. + +2004-06-06 Randolph Chung <tausq@debian.org> + + * infrun.c (trap_expected_after_continue): Remove HP_OS_BUG workaround. + (proceed, init_wait_for_inferior, handle_inferior_event): Likewise. + +2004-06-06 Randolph Chung <tausq@debian.org> + + * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline) + (hppa_hpux_skip_trampoline_code): Don't cache symbol values. + * hppa-linux-tdep.c (hppa_linux_in_dyncall): Likewise. + * hppa-tdep.c (hppa_symbol_address): New function definition. + * hppa-tdep.h (hppa_symbol_address): New function declaration. + +2004-06-06 Randolph Chung <tausq@debian.org> + + * hppa-tdep.h (struct value): Forward declaration. + (gdbarch_tdep): Define tdep find_global_pointer method. + * hppa-tdep.c (hppa32_push_dummy_call): Find the global pointer + associated with the function we are trying to call, and write it + to the gp register. + (hppa32_convert_from_funct_ptr_addr): New function. + (hppa_find_global_pointer): New function. + (hppa_gdbarch_init): Set default find_global_pointer method; set + convert_from_func_ptr_addr method. + * hppa-linux-tdep.c (hppa_linux_find_global_pointer): New function. + (hppa_linux_init_abi): Set find_global_pointer method. + * Makefile.in (hppa-linux-tdep.o): Add value.h dependency. + +2004-06-06 Randolph Chung <tausq@debian.org> + + * gdbarch.sh (PUSH_DUMMY_CALL): Change CORE_ADDR func_addr argument + to struct value *function. + * gdbarch.c: Regenerate. + * gdbarch.h: Likewise. + * infcall.c (call_function_by_hand): Pass entire function value + to push_dummy_call. + + * Makefile.in (alpha-tdep.o, frv-tdep.o, ia64-tdep.o, mips-tdep.o) + (ppc-sysv-tdep.o, rs6000-tdep.o): Update dependencies. + * alpha-tdep.c (alpha_push_dummy_call): Update call signature. + * amd64-tdep.c (amd64_push_dummy_call): Likewise. + * arm-tdep.c (arm_push_dummy_call): Likewise. + * avr-tdep.c (avr_push_dummy_call): Likewise. + * cris-tdep.c (cris_push_dummy_call): Likewise. + * d10v-tdep.c (d10v_push_dummy_call): Likewise. + * frv-tdep.c (frv_push_dummy_call): Likewise. + * h8300-tdep.c (h8300_push_dummy_call): Likewise. + * hppa-tdep.c (hppa32_push_dummy_call) + (hppa64_push_dummy_call): Likewise. + * i386-tdep.c (i386_push_dummy_call): Likewise. + * ia64-tdep.c (ia64_push_dummy_call): Likewise. + * m32r-tdep.c (m32r_push_dummy_call): Likewise. + * m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise. + * m68k-tdep.c (m68k_push_dummy_call): Likewise. + * m88k-tdep.c (m88k_push_dummy_call): Likewise. + * mips-tdep.c (mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call) + (mips_o32_push_dummy_call, mips_o64_push_dummy_call): Likewise. + * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call) + (ppc64_sysv_abi_push_dummy_call): Likewise. + * ppc-tdep.h (ppc_sysv_abi_push_dummy_call) + (ppc64_sysv_abi_push_dummy_call): Likewise. + * rs6000-tdep.c (rs6000_push_dummy_call): Likewise. + * s390-tdep.c (s390_push_dummy_call): Likewise. + * sh-tdep.c (sh_push_dummy_call_fpu) + (sh_push_dummy_call_nofpu): Likewise. + * sparc-tdep.c (sparc32_push_dummy_call): Likewise. + * sparc64-tdep.c (sparc64_push_dummy_call): Likewise. + * vax-tdep.c (vax_push_dummy_call): Likewise. + +2004-06-04 Jim Blandy <jimb@redhat.com> + + * ppc-linux-nat.c (fetch_register): Don't forget to pass the + gdbarch argument to register_size. + + * rs6000-tdep.c (rs6000_store_return_value): Use + regcache_cooked_write_part instead of + deprecated_write_register_bytes. + (rs6000_gdbarch_init): Register it for gdbarch_store_return_value, + not gdbarch_deprecated_store_return_value. + + * ppc-linux-nat.c (store_register, fetch_register): Remove + incorrect assertions. Simplify and generalize handling of + transfers whose sizes are not multiples of, or less than, sizeof + (PTRACE_XFER_TYPE). + +2004-06-04 Jeff Johnston <jjohnstn@redhat.com> + + * infrun.c (handle_inferior_event): Don't treat an invalid ptid + as a new thread event. + * thread-db.c (thread_get_info_callback): If the thread is a + zombie, return TD_THR_ZOMBIE. + (thread_from_lwp): If thread_get_info_callback returns + TD_THR_ZOMBIE, check if the thread is still on the thread list + and return a -1 ptid if not found. + (thread_db_wait): If thread_from_lwp returns a -1 ptid, then + change the status to TARGET_WAITKIND_SPURIOUS. + +2004-06-03 Corinna Vinschen <vinschen@redhat.com> + + * sh-tdep.c (sh3e_sh4_store_return_value): Correctly store + double values in little endian mode. + +2004-06-02 Albert Chin-A-Young <china@thewrittenword.com> + + Committed by Andrew Cagney. + * gdb/dictionary.c, gdb/gdbtypes.h: Remove trailing comma + after last enum constant to avoid error from IBM C + compiler. + +2004-06-02 Jim Blandy <jimb@redhat.com> + + * ppc-linux-nat.c (store_register, fetch_register): Rename 'mess' + to 'message', and make it local to the lone block that uses it. + + * ppc-linux-nat.c (store_register): Remove unused local 'offset'. + +2004-06-02 Paul N. Hilfinger <hilfinger@gnat.com> + + * ada-exp.y: Update copyright notice. + Include block.h. + + Replace REGNAME, LAST, INTERNAL_VARIABLE with + SPECIAL_VARIABLE and unify the treatment of these cases. + + (write_attribute_call0): Remove. + (write_attribute_call1): Remove. + (write_attribute_calln): Remove. + (save_qualifier): Add missing semicolon. + + (simple_exp,exp): Decomment (i.e., reactivate) code that was + temporarily disabled to allow compilation with FSF head version. + + (simple_exp syntax): Remove use of OP_ADA_ATTRIBUTE and + use individual operators (OP_*) for all attributes. + (exp syntax): Use write_int. + Handle STRING literals with OP_STRING. + (variable syntax): Add limit parameter to calls to + write_object_renaming. + + (temp_parse_space): New definition to hold entities that need + only live until the next call to ada_parse. + (string_to_operator): Rename fields of ada_opname_table entries. + + (write_var_from_sym): Record block. + (write_var_from_name): Minor reformatting. + Make sure saved name is properly encoded in the case of multiple + matches, and set its language to Ada. + Update comment. + Modify to indicate unresolved name as symbol in the UNRESOLVED + namespace, allocated in temp_parse_space. + (write_int): New function. + + (write_object_renaming): Add max_depth parameter to limit + chains of object renamings. + Handle case where root of renaming expression is itself a renaming. + Use temp_parse_space for temporary name buffer. + Handle renamings to dereferenced pointers (___XEXA suffices). + + (ada_parse, yyerror, string_to_operator, + write_var_from_sym, write_var_from_name, write_attribute_call0, + write_attribute_call1, write_attribute_calln, + write_object_renaming): Protoize. + + (_initialize_ada_exp): New function. + + * ada-lang.c: Update copyright notice. + General terminology change to conform to GNAT compiler usage: + mangle => encode, demangle => decode + Include gdb_obstack.h. + Include gdb_regex.h + Include frame.h + Include hashtab.h + Include completer.h + Include gdb_stat.h + Include block.h + Include infcall.h + + (ADA_RETAIN_DOTS): Make sure this is defined. + (TRUNCATION_TOWARDS_ZERO): Define. + (struct string_vector): Define. + (unresolved_names): Remove definition. + (xnew_string_vector): New function. + (string_vector_append): New function. + (extract_string): Make static. + (ada_unqualified_name): New function. + (add_angle_brackets): New function. + (function_name_from_pc): New function. + (place_on_stack): Rename to ensure_lval. + + (ensure_lval): Renamed from place_on_stack. + Make identity on lvals. + Update comment. + (is_nonfunction): New interface. + Only symbols in LOC_CONST class can be enumerals. + (fill_in_ada_prototype): Remove; now independent of language. + (add_defn_to_vec): Add obstack and symtab arguments. + Use obstack to hold collected definitions. + (num_defns_collected): New function. + (defns_collected): New function. + (ada_resolve_subexp): Rename to resolve_subexp. + (resolve_subexp): Renamed from ada_resolve_subexp. + (ada_op_name): Return non-const result. + (ada_decoded_op_name): Renamed from ada_op_name, now used for + other purposes. + + (to_fixed_array_type): Add declaration. + (coerce_unspec_val_to_type): Remove offset parameter. + (find_sal_from_funcs_and_line): New interface. + (find_line_in_linetable): Ditto. + + (all_sals_for_line): Rename to ada_sals_for_line and make + global. + Add new parameter. When set, do not ask the user to choose the + instance, but use the first one found instead. + Use given line number in returned sals. + Fix comment. + Skip the prologue if funfirstline is set. + Correct for memory leak when 0 lines found. + + (value_pos_atr): Use pos_atr. + (pos_atr): New function. + (standard_lookup): Add block parameter. + + (makeTimeStart): Remove declaration and uses. + (makeTimeStop): Remove declaration and uses. + + (ada_completer_word_break_characters): Allow for VMS. + (ADA_MAIN_PROGRAM_SYMBOL_NAME): Make into constant. + (raise_sym_name): New constant. + (raise_unhandled_sym_name): New constant. + (raise_assert_sym_name): New constant. + (process_raise_exception_name): New constant. + (longest_exception_template): New constant. + (warning_limit): New variable to limit warnings during expression + evaluation. + (warnings_issued): New variable to keep track of warnings issued. + (known_runtime_file_name_patterns): New constant. + (known_auxiliary_function_name_patterns): New constant. + (symbol_list_obstack): New variable. + + (field_name_match,is_suffix,is_suppressed_name,ada_encode, + ada_decode,ada_match_name,encoded_ordered_before,equiv_types, + lesseq_defined_than,is_nondebugging_type,is_name_suffix,wild_match, + find_sal_from_funcs_and_line, ada_breakpoint_rewrite, + ada_is_tagged_type, ada_is_parent_field, ada_is_wrapper_field, + ada_variant_discrim_name, field_alignment, dynamic_template_type, + ada_is_character_type, ada_is_aligner_type, ada_is_vax_floating_type): + Replace use of deprecated STREQ and STREQN macros by calls to strncmp + and strcmp. + + (ada_get_field_index): New function. + (lim_warning): New function. + (ada_translate_error_message): New function. + (MAX_OF_SIZE): New function. + (MIN_OF_SIZE): New function. + (UMAX_OF_SIZE): New function. + (UMIN_OF_SIZE): New function. + (discrete_type_high_bound): New function. + (discrete_type_low_bound): New function. + (base_type): New function. + (do_command): Remove. + + (ada_update_initial_language): Use language_ada, not language_unknown. + (ada_encode): Renamed from ada_mangle. + Obey ADA_RETAIN_DOTS. + (ada_decode): Renamed from ada_demangle. + Update coding conventions. + (decoded_names_store): New hash table. + (ada_decode_symbol): New function. + (ada_la_decode): New function. + + (modify_general_field): Correct computations of offset and bit + position. + (desc_base_type): Handle ref types, too. + (ada_is_direct_array_type): New function. + + (ada_is_simple_array): Rename to ada_is_simple_array_type. + (ada_is_array_descriptor): Rename to ada_is_array_descriptor_type. + (ada_is_bogus_array_descriptor,ada_type_of_array, + ada_coerce_to_simple_array_ptr,ada_coerce_to_simple_array, + ada_type_match,convert_actual,ada_evaluate_subexp): Use renamed + ada_is_array_descriptor_type. + + (ada_coerce_to_simple_array_type): Fix incorrect value freeing. + (ada_is_packed_array_type): Handle pointers or + references to packed arrays as well. + (packed_array_type): Uncomment use of TYPE_FLAG_FIXED_INSTANCE. + (decode_packed_array_type): Search for the packed array type + symbol in the currently selected block and associated + superblocks too. + Use lookup_symbol again. + + (decode_packed_array): Handle pointers and references. + Update call to coerce_unspec_val_to_type. + (decode_packed_array_type,value_subscript_packed): Limit warnings. + (ada_value_primitive_packed_val): Improve comment. + + (ada_index_type): Substitute int type for "undefined". + (ada_index_type,ada_array_bound_from_type,ada_array_bound, + ada_array_langth, ada_is_string_type): Use renamed + ada_is_simple_array_type. + (empty_array): New function. + + (ada_resolve): Rename to resolve. + (resolve): Make static. + Call renamed resolve_subexp. + Update comment. + (ada_resolve_subexp): Rename to resolve_subexp. + (resolve_subexp): Update comment. + Decomment disabled code. + Add LOC_COMPUTED* cases. + Modify to use temporary struct symbols (marked as being in + UNDEF_NAMESPACE) to indicate unresolved names, instead of + OP_UNRESOLVED_VALUE. + Remove OP_ATTRIBUTE; use individual opcodes for attributes. + Add OP_STRING case. + Remove OP_ARRAY. + Use SYMBOL_PRINT_NAME instead of ada_demangle. + Use new ada_lookup_symbol_list interface. + Use new ada_resolve_function interface. + Remove OP_TYPE case. + + (ada_args_match): Idiot proof against null actuals. + Use intermediate variables to clarify. + (ada_resolve_function): Update comment and interface. + (mangled_ordered_before): Rename to encoded_ordered_before and + update comment. + (sort_choices): Update comment and interface. + Use SYMBOL_LINKAGE_NAME in place of SYMBOL_NAME. + (user_select_syms): New interface. + Use new sort_choices interface. + Use SYMBOL_PRINT_NAME rather than SYMBOL_SOURCE_NAME. + (possible_user_operator_p): Idiot-proof against null values. + (ada_simple_renamed_entity): Don't make cleanup; rely on + caller to free result string. + Remove const from return type. + (make_array_descriptor): Rename uses of place_on_stack to + ensure_lval. + Make sure that arrays are on stack. + + (HASH_SIZE): Define. + (struct cache_entry): Define. + (cache_space): Define. + (cache): Define. + (clear_ada_sym_cache): New function. + (find_entry): New function. + (lookup_cached_symbol): New function. + (defn_vector_size): Define. + (cache_symbol): New function. + (defn_symbols): Remove. + + (standard_lookup): Use lookup_symbol_in_language to get effect of + C lookup. + Cache results. + + (symbol_completion_match): New function. + (symbol_completion_add): New function. + (ada_make_symbol_completion_list): New function. + + (ada_lookup_partial_symbol,ada_lookup_simple_minsym, + add_symbols_from_enclosing_procs,remove_extra_symbols): Replace + DEPRECATED_SYMBOL_NAME with SYMBOL_LINKAGE_NAME. + (symtab_for_sym): Handle LOC_COMPUTED, LOC_COMPUTED_ARG. + + (ada_lookup_simple_minsym): New function. + (ada_lookup_minimal_symbol): Use ada_lookup_simple_minsym. + + (add_symbols_from_enclosing_procs): New interface. + Conditionalize more helpfully. + Don't bother if program isn't running. + Use new interface to get_frame_block. + Limit number of levels searched with MAX_LEXICAL_LEVELS, just in case. + + (remove_extra_symbols): New interface. + (xget_renaming_scope): New function. + (is_package_name): New function. + (renaming_is_visible): New function. + (remove_out_of_scope_renamings): New function. + + (ada_lookup_symbol_list): New interface. + Properly reinitialize the symbol list obstack. + Don't call add_symbols_from_enclosing_procs if we start from a + static or global block. + Use new interfaces to ada_add_block_symbols, add_defn_to_vec, + add_symbols_from_enclosing_procs. + Add symtab data to cached entries. + Handle symbols prefixed with + "standard__" specially; strip prefix and don't look in local symbols. + Do not include out of scope renaming symbols in list of + symbols returned. + Add const to block parameter. + Move check for non-local, non-global symbols earlier. + Remove timing stuff. + (ada_lookup_symbol): New interface. + Find symtab as well. + (ada_lookup_symbol_nonlocal): New function. + + (is_name_suffix): Enhance suffix detection to recognize + an optional "__[:digit:]+" before any "\.[:digit:]+" suffix. + (is_dot_digits_suffix): New function. + (wild_match): Ignore ".[:digit:]*" suffixes during matches. + + (ada_add_block_symbols): New interface. Use obstack to return results + in a vector of struct ada_symbol_infos. Add symtab argument. + Use new interface to add_defn_to_vec. + Remove calls to fill_in_ada_prototype. + Use BLOCK_BUCKETS, BLOCK_BUCKET. + + (ada_finish_decode_line_1): Add const qualification to local to fix + warning. + Start looking in static block for functions to avoid attempts + to search frame chain for up-level variables. + Adapt to new ada_sals_for_line interface. + Use new interfaces to ada_lookup_symbol_list and user_select_syms. + Handle quoting of the function name inside the spec string. + Skip prologue when funfirstline is set and update the + function documentation to that effect. + + (debug_print_lines, debug_print_block, debug_print_blocks, + debug_print_symtab): Remove. + + (ada_main_name): New function. + (ada_exception_breakpoint_type): New function. + (is_known_support_routine): New function. + (ada_find_printable_frame): Renamed from find_printable_frame and made + global. + Remove level parameter. + Use new interface to select_frame. + + (begin_command): Remove. + (ada_adjust_exception_stop): New function. + (ada_print_exception_stop): New function. + (exception_name_from_cond): New function. + (ada_report_exception_break): Replace disabled code with + conditionalization on GNAT_GDB. + Get the exception name from the condition string. + Remove and move functionality into new functions + ada_print_exception_breakpoint_task and + ada_print_exception_breakpoint_nontask. + (error_breakpoint_runtime_sym_not_found): New function. + (is_runtime_sym_defined): New function. + (ada_breakpoint_rewrite): Uncomment suppressed code. + Use symbolic error-message and runtime-symbol names. + Surround runtime symbol names in quotes. + Allow non-specific breakpoints on exceptions and assertions before + program starts. + + (ada_is_tagged_type): Add parameter. + (ada_is_tag_type): New function. + (ada_tag_type): Use new ada_lookup_struct_elt_type interface. + (ada_variant_discrim_type): Ditto. + (value_tag_from_contents_and_address): New function. + (type_from_tag): New function. + (struct tag_args): New structure used to communicate with + ada_tag_name_1. + (ada_tag_name_1): New function. + (ada_tag_name): New function. + + (ada_scan_number): Update comment. + (find_struct_field): New function. + (ada_search_struct_field): Make static. + (ada_value_struct_elt): New version that returns references when + given pointers or references to structs. + (ada_lookup_struct_elt_type): Add 'refok' parameter. + (ada_which_variant_applies): Use new ada_lookup_struct_elt_type + interface. + (ada_value_ind): Use new ada_to_fixed_value interface. + (ada_coerce_ref): Ditto. + (field_offset): Remove. + + (ada_find_any_symbol): New function, extracted from ada_find_any_type. + (ada_find_renaming_symbol): New function. + (ada_prefer_type): Prefer named types over unnamed ones. + (variant_field_index): New function. + (contains_variant_part): Removed: subsumed by variant_field_index. + (ada_template_to_fixed_record_type): New function, mostly from + template_to_fixed_record_type. + (template_to_fixed_record_type): + Do not scan the type fields beyond the last one; prevents a + potential SEGV. + Handle case where variant field is listed BEFORE discriminant it + depends on. + Fix calculation of record length when bit length is + not evenly divisible by char length. + Move code to ada_template_to_fixed_record_type and call it. + + (template_to_static_fixed_type): Revise comment. + Modify to work on ordinary record types as well as templates, + so as to handle fields that use ___XVE or ___XVU encodings. + (to_record_with_fixed_variant_part): Fill out comment. + Initialize C++ stuff in right type. + Allow case where DVAL is null. + Handle case where variant field is not last. + Fix typo concerning record length. + (to_fixed_record_type): Decomment disabled code. + (to_fixed_record_type): Use variant_field_index instead of + contains_variant_part. + (to_fixed_variant_branch_type): Ditto. + (to_fixed_array_type): Decomment disabled code. + (ada_to_fixed_type): Convert tagged types to the specific type. + Deactivate the size-check for array types in order to avoid + some false size alarms. + (to_static_fixed_type): Decomment disabled code. + Modify to call template_to_static_fixed_type + on ordinary structs, not just ___XVE- and ___XVU-encoded fields. + (ada_to_fixed_value_create): Renamed version of old ada_to_fixed_value. + Remove valaddr argument, as it is never really used. + (ada_to_fixed_value): Change interface to act on single struct value* + operand. + (adjust_pc_past_prologue): New function. + (ada_attribute_name): Modify to take enum exp_opcode argument. + + (ada_enum_name): Recognize new homonym-distinguishing convention. + Adjust local variable's type to remove compiler warning. + Fix a small problem in the part that unqualifies the enumeration name. + (ada_value_binop): New function. + (ada_value_equal): New function. + + (ada_evaluate_subexp): Use new ada_lookup_struct_elt_type interface. + Don't give error message when not doing normal evaluation + and a tagged type doesn't seem to contain a structure member. + Give error message for packed arrays. + For indexing arrays, handle pointers to packed arrays correctly. + Handle case of 'first and 'last attributes of bare integral type + without encoded subtype info. + Remove some unnecessary casts. + Fix uninitialized value of type in computing 'first, 'last, or 'length + of array object. + Add BINOP_EQUAL and BINOP_NOTEQUAL cases. + Remove binop_user_defined_p tests and value_x_binop and value_x_unop + calls. + Attributes are now exp_opcode values. + Correct treatment of 'modulus. + Better error message for taking 'length of wrong kind of type; + improve comment. + Change EVAL_NORMAL to noside for consistency. + Use ada_value_binop for DIV, MOD, REM. + Make special case out of array of length 0, since an argument + of 0 upsets some platforms' malloc. + Use OP_STRING instead of OP_ARRAY. + For slice, add check that we have an array type before extracting + a slice out of it. Avoids a SEGV. + When evaluating an array slice, if the array type is a reference to + an aligner type, then replace the aligner type by the actual type. + Decomment disabled code. + Remove some dead code. + Use temporary struct symbols (marked as being in UNDEF_NAMESPACE) + to indicate unresolved names, instead of OP_UNRESOLVED_VALUE. + Rename BINOP_MBR to BINOP_IN_BOUNDS, TERNOP_MBR to TERNOP_IN_RANGE, + and UNOP_MBR to UNOP_IN_RANGE. + If an array type has a parallel ___XVE type, then use it. + Turn arrays into pointers for lvalue arrays. + Change TERNOP_SLICE code to work even when bounds are unknown, ignoring + bounds error and handle 0-length slices. + Use lim_warning. + When selecting fields, apply ada_to_fixed_value (because the fields + might have ___XVU or ___XVE encodings even if not dynamic.) + Use ada_to_fixed_value_create and new ada_to_fixed_value interface. + (ada_is_system_address_type): New function. + + (get_var_value): Use new interface to ada_lookup_symbol_list. + (get_int_var_value): New interface. + (to_fixed_range_type): Allow unknown bound, with warning. + (ada_is_modular_type): Decomment disabled code. + (ADA_OPERATORS): New definition. + (ada_operator_length): New function. + (ada_expr_op_name): New function. + (ada_forward_operator_length): New function. + (ada_dump_subexp_body): New function. + (ada_print_subexp): New function. + (ada_exp_descriptor): New constant. + (ada_op_print_tab): Add 'size. Remove FIXMEs. + (ada_language_defn): Add ada_exp_descriptor entry. + Change ada_parse => parse. + Add post-parser entry. + Use ada-specific non-local symbol lookup. + Don't use C-style arrays. + String lower-bound is 1. + Decomment disabled code. + (parse): New function. + New fields ada_translate_error_message, ada_lookup_symbol, + ada_lookup_minimal_symbol. + + * ada-lang.h: Update copyright dates. + Replace the mangle/demangle terminology throughout by the + more appropriate encode/decode one. + Include breakpoint.h. + Forward declare struct partial_symbol, struct block. + (ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS): Define. + (EXTRACT_ADDRESS): Remove. + (EXTRACT_INT): Remove. + (ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS): Define. + (MAX_ENCLOSING_FRAME_LEVELS): Define. + (MAX_RENAMING_CHAIN_LENGTH): Define. + (struct ada_opname_map): mangled => decoded, demangled=>encoded. + + (enum task_states): Remove. + ada_task_states: Remove. + (fat_string): Remove. + (struct entry_call): Remove. + (struct task_fields): Remove. + (struct task_entry): Remove. + + (struct ada_symbol_info): Define. + (enum ada_attribute): Remove. + (enum ada_operator): Define. + + (ada_get_field_index): Declare. + (ada_coerce_to_simple_array): Rename to ada_coerce_to_simple_array_ptr. + (ada_is_simple_array): Rename to ada_is_simple_array_type. + (ada_is_array_descriptor): Rename to ada_is_array_descriptor_type. + (ada_lookup_symbol_list): New interface. + (ada_decode_symbol): Declare. + (ada_decode): Declare. + (ada_lookup_symbol): New interface. + (ada_update_initial_language): Declare. + (ada_lookup_simple_minsym): Declare. + (user_select_syms): New interface. + (ada_sals_for_line): Declare. + (ada_is_tagged_type): New interface. + (ada_tag_name): Declare. + (ada_lookup_struct_elt_type): Remove declaration. + (ada_search_struct_field): Remove declaration. + (ada_attribute_name): New interface. + (ada_is_system_address_type): Declare. + (ada_to_fixed_value): Remove declaration. + (ada_template_to_fixed_record_type_1): Declare. + (get_int_var_value): New interface. + (ada_find_any_symbol): Declare. + (ada_find_renaming_symbol): Declare. + (ada_mangle): Rename to ada_encode. + (ada_simple_renamed_entity): Remove const. + (ada_main_name): Declare. + (get_current_task): Rename to ada_get_current_task. + (get_entry_number): Remove declaration. + (ada_report_exception_break): Remove declaration. + (ada_print_exception_breakpoint_nontask): Declare. + (ada_print_exception_breakpoint_task): Declare. + (ada_find_printable_frame): Declare. + + * ada-lex.l: Update copyright notices. + Use xmalloc and xfree instead of malloc and free. + Use new interface to name_lookup. + Use new interface to + ada_mangle=>ada_encode. + Redo handling of '$...' variable to parallel current treatment + in c-exp.y. + (resize_tempbuf, canonicalizeNumeral, is_digit_in_base, + digit_to_int, strtoulst, processInt, processReal, processId, + block_lookup, name_lookup, find_dot_all, subseqMatch, processAttribute, + yywrap): Protoize. + + (processInt): Use cast to remove harmless warning. + (processReal): Modify to get rid of compiler warning on scan formats. + + (processId): Replace xmalloc with obstack_alloc for name and remove + call to ada_name_string_cleanup. + Remove obsolete disabled code. + (name_lookup): Ditto. + New interface. + Use obsavestring on temp_parse_space instead of savestring + on name, and remove call to ada_name_string_cleanup. + Free string returned from ada_simple_renamed_entity. + Use new interface to ada_lookup_symbol_list. + Decomment disabled code. + Treat LOC_COMPUTED and LOC_COMPUTED_ARG symbols as variables, + not types. + When a type name lookup succeeds as a result of + lookup_primitive_typename, check for regular type entry that has not + yet been read in. + Limit length of chain of renamed symbols we are willing to follow. + Do not break names beginning with "standard__" into segments. + (block_lookup): Use new interface to ada_lookup_symbol_list. + + * ada-typeprint.c: Update copyright notice. + (demangled_type_name): Rename to decoded_type_name. + (ada_typedef_print): Use SYMBOL_PRINT_NAME. + (print_range_bound): Correct handling of negative + bounds that make the index type looked unsigned under STABS. + (print_dynamic_range_bound): Use new interface to get_int_var_value. + (print_range_type_named): Use the builtin int type if no type + corresponding to the given type name could be found. + (print_array_type): ada_is_simple_array => ada_is_simple_array_type. + Add some bullet-proofing. + (print_variant_clauses): Allow for variant branches with ___XVU + encodings that are not dynamic fields. + Use new interface to ada_is_tagged_type. + (print_record_type): Allow for fields with ___XVE encodings that + are not dynamic fields. + Use new interface to ada_is_tagged_type. + (ada_print_type): ada_is_array_descriptor => + ada_is_array_descriptor_type. + + * ada-valprint.c: Update copyright notice. + Include gdb_string.h + Include infcall.h + (ui_memcpy): New function. + (ada_print_floating): New function. + (ada_print_str): Order arguments correctly. + Correct handling of empty arrays and arrays of 0-length items. + ada_is_array_descriptor => ada_is_array_descriptor_type + Print values of type System.Address in hexadecimal format. + Use ada_print_floating to print floating-point numbers in Ada format. + Print class tag values with type names. + No longer print the address of reference values. Avoids + a potential confusion. + (ada_value_print): Stop printing the object type for reference + values, but preserve that behavior for access types. Avoids + a potential confusion. + Simplify one conditional expression, as the first part is now + necessarily true. + ada_is_array_descriptor => ada_is_array_descriptor_type + Add check for arrays for null records, and print them by hand. + +2004-06-01 Jim Blandy <jimb@redhat.com> + + * ppc-tdep.h: Delete unused 'regoff' member. + * rs6000-tdep.c (rs6000_gdbarch_init): Don't initialize it. + +2004-06-01 Michael Chastain <mec.gnu@mindspring.com> + + Fix PR symtab/1661. + * hpread.c (hpread_pxdb_needed): Call memset after alloca. + (hpread_read_struct_type): Likewise. + +2004-06-01 Andrew Cagney <cagney@gnu.org> + + * mi/mi-cmd-env.c (env_execute_cli_command): Use xstrprintf + instead of xasprintf. + * mi/mi-main.c (mi_error_last_message, mi_cmd_exec_interrupt) + (mi_cmd_thread_select, mi_cmd_thread_list_ids) + (mi_cmd_data_list_register_names) + (mi_cmd_data_list_changed_registers) + (mi_cmd_data_list_register_values) + (get_register, mi_cmd_data_write_register_values) + (mi_cmd_data_write_register_values) + (mi_cmd_data_assign, mi_cmd_data_evaluate_expression) + (mi_cmd_target_download, mi_cmd_target_select) + (mi_cmd_data_read_memory, mi_cmd_data_write_memory) + (mi_execute_cli_command, mi_execute_async_cli_command) + (mi_execute_async_cli_command): Ditto. + * mi/mi-interp.c (mi_cmd_interpreter_exec) Ditto. + * mi/mi-cmd-var.c (mi_cmd_var_create): Ditto. + + * mi/mi-cmds.h (mi_error_last_message): Delete declaration. + * mi/mi-interp.c (mi_cmd_interpreter_exec): Call + error_last_message instead of mi_error_last_message. + * mi/mi-main.c (mi_error_last_message): Delete function. + + * mi/mi-main.c (mi_cmd_data_read_memory): Add missing return for + "invalid number of columns" error. Delete redundant "out of + memory" check. + +2004-05-31 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-nat.c: Don't include <sys/procfs.h>. + (gregset_t, fpregset_t): Remove typedefs. + (CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER): Remove macros. + (REG_OFFSET): Rename argument. + (i386bsd_r_reg_offset): Rename from reg_offset. + (REG_ADDR): Remove macro. + (cannot_fetch_register, supply_gregset, fill_gregset): Remove + functions. + (i386bsd_supply_gregset, i386bsd_collect_gregset): New functions. + (fetch_inferior_registers): Use `struct reg' and `struct fpreg' + instead of gregset_t and fpregset_t. Use i386bsd_supply_gregset + instead of supply_gregset. + (store_inferior_registers): Use `struct reg' and `struct fpreg' + instead of gregset_t and fpregset_t. Use i386bsd_collect_gregset + instead of fill_gregset. + (register_u_addr): Use i386_r_reg_offset instead of REG_ADDR. + + * i386bsd-nat.c: Don't include "gregset.h". + (supply_gregset, fill_gregset): Make static. + (supply_fpregset, fill_fpregset): Remove. + * Makefile.in (i386bsd-nat.o): Update dependencies. + +2004-05-30 Mark Kettenis <kettenis@gnu.org> + + * fbsd-proc.c: Include "regcache.h", "regset.h" and + "gdb_assert.h". Con't include "gregset.h". + (fbsd_make_corefile_notes): Use regset-based core file support + instead off fill_gregset and fill_fpregset. + * Makefile.in (fbsd-proc.o): Update dependencies. + + * m88k-tdep.c (m88k_analyze_prologue): Fix handling of branch + instructions. + (m88k_frame_prev_register): Simplify code a bit. + + * amd64-tdep.c (amd64_supply_fpregset): Adjust comment. + (amd64_collect_fpregset): New function. + (amd64_regset_from_core_section): Use amd64_collect_fpregset. + + * hppa-tdep.h (hppa_regnum): Add HPPA_R31_REGNUM. + + * i386-tdep.c (i386_supply_gregset): Adjust comment. + (i386_collect_gregset): New function. + (i386_supply_fpregset): Adjust comment. + (i386_collect_fpregset): New function. + (i386_regset_from_core_section): Use i386_collect_gregset and + i386_collect_fpregset. + + * hppa-tdep.c (hppa_frame_prev_register_helper): Reimplement to + handle VALUEP being null. + + * regset.h (collect_regset_ftype): Unconstify fourth argument. + +2004-05-29 Mark Kettenis <kettenis@gnu.org> + + * MAINTAINERS: Undelete m88k. Add myself as maintainer. + + * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Adjust for new + assembler in OpenBSD 3.5-current. + (amd64obsd_sigcontext_addr): Likewise. + +2004-05-28 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c: Use the modern gdbarch methods for handling the + register set, so our regcache isn't declared "legacy" and our E500 + pseudoregister read and write functions aren't ignored. + (rs6000_register_byte, rs6000_register_raw_size, + rs6000_register_virtual_type, rs6000_register_convertible, + rs6000_register_convert_to_virtual, + rs6000_register_convert_to_raw): Deleted. + (rs6000_register_type, rs6000_convert_register_p, + rs6000_register_to_value, rs6000_value_to_register): New + functions. + (rs6000_gdbarch_init): Don't register + gdbarch_deprecated_register_size, + gdbarch_deprecated_register_bytes, + gdbarch_deprecated_register_byte, + gdbarch_deprecated_register_raw_size, + gdbarch_deprecated_register_virtual_type, + gdbarch_deprecated_register_convertible, + gdbarch_deprecated_register_convert_to_virtual, or + gdbarch_deprecated_register_convert_to_raw methods. Instead, + register gdbarch_register_type, gdbarch_convert_register_p, + gdbarch_register_to_value, and gdbarch_value_to_register methods. + +2004-05-26 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (rs6000_dwarf2_stab_reg_to_regnum): Deleted. + (rs6000_stab_reg_to_regnum, rs6000_dwarf2_reg_to_regnum): New + functions, updated to match the register numberings used in GCC. + (rs6000_gdbarch_init): Register rs6000_stab_reg_to_regnum and + rs6000_dwarf2_reg_to_regnum as register number conversions + functions for STABS and Dwarf2. + +2004-05-26 Randolph Chung <tausq@debian.org> + + * infttrace.h (target_waitkind): Forward declare type instead of pulling + in header file. + +2004-05-25 Joel Brobecker <brobecker@gnat.com> + + * NEWS: Document new "start" command. + +2004-05-25 Randolph Chung <tausq@debian.org> + + * hppa-linux-tdep.c (hppa_linux_init_abi): sizeof(long double) == 8 on + hppa-linux. + +2004-05-25 Randolph Chung <tausq@debian.org> + + * hppa-hpux-tdep.c (offsetof): Define. + (hppa_hpux_pc_in_sigtramp, hppa32_hpux_frame_saved_pc_in_sigtramp) + (hppa32_hpux_frame_base_before_sigtramp) + (hppa32_hpux_frame_find_saved_regs_in_sigtramp) + (hppa64_hpux_frame_saved_pc_in_sigtramp) + (hppa64_hpux_frame_base_before_sigtramp) + (hppa64_hpux_frame_find_saved_regs_in_sigtramp): Remove unused + functions. + (struct hppa_hpux_sigtramp_unwind_cache, hppa_hpux_tramp_reg) + (hppa_hpux_sigtramp_frame_unwind_cache) + (hppa_hpux_sigtramp_frame_this_id) + (hppa_hpux_sigtramp_frame_prev_register) + (hppa_hpux_sigtramp_frame_unwind) + (hppa_hpux_sigtramp_unwind_sniffer): New signal trampoline unwinder. + (hppa_hpux_init_abi): Register sigtramp unwinder. + * Makefile.in (hppa-hpux-tdep.o): Update dependencies. + +2004-05-25 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_fallback_frame_cache): Handle stack adjustment, + and multiple stack unwinds. + (hppa_stub_unwind_sniffer): Handle unwind from pc == 0. + +2004-05-25 Andrew Cagney <cagney@gnu.org> + + * symfile.h (symbol_file_add_from_memory): Delete declaration. + * symfile-mem.h: Delete file. + * symfile-mem.c: Do not include "symfile-mem.h". + (symbol_file_add_from_memory): Make static. Use "struct bfd" and + "struct bfd_section". When an error do not bother returning NULL. + (add_symbol_file_from_memory_command): Use "struct bfd" and + "struct bfd_section". + * Makefile.in (symfile_mem_h): Delete. + (symfile-mem.o): Update dependencies. + +2004-05-25 Nick Roberts <nickrob@gnu.org> + + * gdb-mi.el: New file. + +2004-05-25 Andrew Cagney <cagney@gnu.org> + + * inftarg.c: Include "observer.h". + (child_attach, child_create_inferior): Notify inferior_created. + * corelow.c: Include "observer.h". + (core_open): Notify inferior_created. + * Makefile.in (inftarg.o, corelow.o): Update dependencies. + +2004-05-25 Andrew Cagney <cagney@gnu.org> + + * target.h (struct target_ops): Add from_tty to + to_create_inferior. + (target_create_inferior, find_default_create_inferior): Update. + * infcmd.c (run_command): Update. + * wince.c (child_create_inferior): Update. + * win32-nat.c (child_create_inferior): Update. + * uw-thread.c (uw_thread_create_inferior): Update. + * thread-db.c (thread_db_create_inferior): Update. + * target.c (debug_to_create_inferior) + (find_default_create_inferior): Update. + (maybe_kill_then_create_inferior): Update. + * sol-thread.c (sol_thread_create_inferior): Update. + * remote.c (extended_remote_async_create_inferior) + (extended_remote_create_inferior): Update. + * remote-vx.c (vx_create_inferior): Update. + * remote-st.c (st2000_create_inferior): Update. + * remote-sim.c (gdbsim_create_inferior): Update. + * remote-sds.c (sds_create_inferior): Update. + * remote-rdp.c (remote_rdp_create_inferior): Update. + * remote-rdi.c (arm_rdi_create_inferior): Update. + * remote-m32r-sdi.c (m32r_create_inferior): Update. + * remote-e7000.c (e7000_create_inferior): Update. + * procfs.c (procfs_create_inferior): Update. + * ocd.c (ocd_create_inferior): Update. + * ocd.h (ocd_create_inferior): Update. + * nto-procfs.c (procfs_create_inferior): Update. + * monitor.c (monitor_create_inferior): Update. + * lin-lwp.c (lin_lwp_create_inferior): Update. + * inftarg.c (child_create_inferior): Update. + * hpux-thread.c (hpux_thread_create_inferior): Update. + * gnu-nat.c (gnu_create_inferior): Update. + +2004-05-25 Andrew Cagney <cagney@gnu.com> + + * MAINTAINERS: Update e-mail address. + +2004-05-24 Randolph Chung <tausq@debian.org> + + * thread.c (info_threads_command, thread_apply_all_command) + (thread_apply_command, thread_command, do_captured_thread_select): + Remove HPUXHPPA-specific code. + +2004-05-24 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Remove + unused symbols. + * hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Remove, since there are no more + references. + +2004-05-24 Joel Brobecker <brobecker@gnat.com> + + * infcmd.c (kill_if_already_running): New function, extracted + from run_command(). + (run_command): Replace extracted code by call to + kill_if_already_running(). + (start_command): New function. + (_initialize_infcmd): Add "start" command. + +2004-05-24 Mark Kettenis <kettenis@gnu.org> + + Add OpenBSD/m88k support. + * NEWS (New native configurations): Mention OpenBSD/m88k. + * m88k-tdep.c, m88k-tdep.h, m88kbsd-nat.c, config/m88k/nm-obsd.h, + config/m88k/obsd.mh, config/m88k/obsd.mt: New files. + * Makefile.in (m88k_tdep_h): New variable. + (ALLDEPFILES): Add m88k-tdep.c and m88kbsd-nat.c. + (m88kbsd-nat.o, m88k-tdep.o): New dependencies. + * configure.host: Add m88*-*-openbsd*. + * configure.tgt: Add m88*-*-openbsd*. + +2004-05-24 Jim Blandy <jimb@redhat.com> + + * MAINTAINERS (tracing bytecode stuff): Allow global maintainers + to approve changes. + +2004-05-24 Kevin Buettner <kevinb@redhat.com> + + * symtab.c (fixup_section): Search section table when lookup by + name fails. + +2004-05-24 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c: Fix handling of 8-byte structures; they should not + be "small_struct". + +2004-05-24 Mark Kettenis <kettenis@gnu.org> + + * m68kbsd-nat.c (m68kbsd_collect_gregset): Specify correct + register number in regcache_raw_collect call. + (m68kbsd_collect_fpregset): Likewise. + * vaxbsd-nat.c (vaxbsd_collect_gregset): Likewise. + + * regset.h (struct regset): Add back `regset' member. + +2004-05-23 Mark Kettenis <kettenis@gnu.org> + + * configure.in: Check for td_pcb in `struct thread'. + * configure, config.in: Regenerated. + + * dpx2-nat.c: Remove file. + * Makefile.in (ALLDEPFILES): Remove dpx2-nat.c. + (dpx2-nat.o): Remove dependencies. + + * amd64obsd-nat.c: Include "gdbcore.h", "regcache.h", + <sys/types.h>, <machine/frame.h>, <machine/pcb.h> and "bsd-kvm.h". + (amd64obsd_supply_pcb): New function. + (_initialize_amd64obsd_nat): Enable libkvm interface. + * Makefile.in (amd64obsd-nat.o): Update dependencies. + * config/i386/obsd64.mh (NATDEPFILES): Add bsd-kvm.o + (LOADLIBES): New variable. + + * sparcnbsd-nat.c: Include "gdbcore.h", "regcache.h", + <sys/types.h>, <machine/pcb.h> and "bsd-kvm.h". + (sparc32nbsd_supply_pcb): New function. + (_initialize_sparcnbsd_nat): Enable libkvm interface. + * Makefile.in (sparcnbsd-nat.o): Update dependencies. + * config/sparc/nbsdelf.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + +2004-05-22 Mark Kettenis <kettenis@gnu.org> + + * bsd-kvm.c, bsd-kvm.h: New files. + * i386fbsd-nat.c: Include <sys/types.h>, <machine/pcb.h> and + "bsd-kvm.h". + (i386fbsd_supply_pcb): New function. + * Makefile.in (ALLDEPFILES): Add bsd-kvm.c. + (i386fbsd-nat.o): Update dependencies. + (bsd_kvm_h): New variable. + (bsd-kvm.o): New dependency. + * config/i386/fbsd.mh (NATDEPFILES): Add bsd-kvm.o. + (LOADLIBES): New variable. + + * regset.c: Tweak comment. + (regset_alloc): Remove descr argument. Use GDBARCH_OBSTACK_ZALLOC + macro. + * regset.h: Update copyright year. + (struct regset): Remove `descr' member, add `gdbarch' member. + (regset_alloc): Adjust prototype and comment. + * i386-tdep.c (i386_supply_gregset): Get TDEP from REGSET->arch. + (i386_supply_fpregset): Likewise. + (i386_regset_from_core_section): Update call to regset_alloc. + * i386obsd-tdep.c (i386obsd_aout_supply_regset): Get TDEP from + REGSET->arch. + (i386obsd_aout_regset_from_core_section): Update call to + regset_alloc. + * i386nbsd-tdep.c (i386nbsd_aout_supply_regset): Get TDEP from + REGSET->arch. + (i386nbsd_aout_regset_from_core_section): Update call to + regset_alloc. + * amd64-tdep.c (amd64_supply_fpregset): Get TDEP from + REGSET->arch. + (amd64_regset_from_core_section): Update call to regset_alloc. + * amd64obsd-tdep.c (amd64obsd_supply_regset): Get TDEP from + REGSET->arch. + (amd64obsd_regset_from_core_section): Update call to regset_alloc. + * sparcnbsd-tdep.c (sparc32nbsd_supply_gregset): Directly pass + &sparc32nbsd_gregset in sparc32_supply_gregset call. + (sparc32nbsd_init_abi): Update call to regset_alloc. + * sparc64obsd-tdep.c (sparc64obsd_supply_gregset): Directly pass + &sparc64obsd_core_gregset in sparc64_supply_gregset call. + (sparc64obsd_init_abi): Update call to regset_alloc. + * sparc64nbsd-tdep.c (sparc64nbsd_supply_gregset): Directly pass + &sparc64nbsd_gregset in sparc64_supply_gregset call. + (sparc64nbsd_init_abi): Update call to regset_alloc. + * sparc64fbsd-tdep.c (sparc64fbsd_supply_gregset): Directly pass + &sparc64fbsd_gregset in sparc64_supply_gregset call. + (sparc64fbsd_init_abi): Update call to regset_alloc. + +2004-05-22 Jim Blandy <jimb@redhat.com> + + * ppc-tdep.h (spe_register_p): New declaration. + (struct gdbarch_tdep): New members: ppc_acc_regnum and + ppc_spefscr_regnum. + * rs6000-tdep.c (spe_register_p): New function. + (rs6000_dwarf2_stab_reg_to_regnum): Recognize numbers for acc and + spefscr. + (rs6000_gdbarch_init): Initialize the new members of the tdep + structure. + +2004-05-21 Jim Blandy <jimb@redhat.com> + + * ppc-linux-nat.c (fetch_register): Move code back to be next + to the comment that describes it. (Moved code, instead of + comment, for symmetry with store_register.) + + Allocate regset structures in the gdbarch's obstack, not using + xmalloc. + * regset.c (regset_alloc): Renamed from regset_xmalloc. + Add 'arch' argument. Allocate the regset on arch's obstack, not + using xmalloc. + * regset.h (regset_alloc): Update declaration. + * am64-tdep.c (amd64_regset_from_core_section): Update call; pass + gdbarch argument. + * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same. + * i386-tdep.c (i386_regset_from_core_section): Same. + * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same. + * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same. + * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same. + * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same. + * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same. + * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same. + +2004-05-21 Joel Brobecker <brobecker@gnat.com> + + * config/djgpp/fnchange.lst: Undo previous change, was useless. + +2004-05-21 Jim Blandy <jimb@redhat.com> + + * dwarf2expr.c (execute_stack_op): Add 'break' statements after + cases for DW_OP_div and DW_OP_shr. (Thanks to Reva Cuthbertson.) + +2004-05-20 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (rs6000_push_dummy_call): Formatting fixes. + +2004-05-20 Mark Kettenis <kettenis@gnu.org> + + * regset.h: Make prototype const-correct. + * regset.c (regset_xmalloc): Make const-correct. + +2004-05-20 Paul N. Hilfinger <hilfinger@gnat.com> + + * symtab.h (SYMBOL_SEARCH_NAME): New definition. + (SYMBOL_MATCHES_SEARCH_NAME): New definition. + (symbol_search_name): Declare. + + * dictionary.c (iter_name_first_hashed): Match on SYMBOL_SEARCH_NAME. + (iter_name_next_hashed): Ditto. + (iter_name_next_linear): Ditto. + (insert_symbol_hashed): Hash on SYMBOL_SEARCH_NAME. + + * symtab.c (lookup_partial_symbol): Assume symbols ordered by + search name, using SYMBOL_SEARCH_NAME and SYMBOL_MATCHES_SEARCH_NAME. + (symbol_search_name): New function. + + * symfile.c (compare_psymbols): Order by SYMBOL_SEARCH_NAME. + + * minsyms.c (build_minimal_symbol_hash_tables): Change + test for adding to demangled hash table to check for difference + between SYMBOL_SEARCH_NAME and SYMBOL_LINKAGE_NAME. + +2004-05-19 Jim Blandy <jimb@redhat.com> + + Use a constructor function to create regset structures. + * regset.h (supply_regset_ftype, collect_regset_ftype): New typedefs. + (struct regset): Use supply_regset_ftype. Add new + 'collect_regset' member. + (regset_xmalloc): New declaration. + * regset.c: New file. + * am64-tdep.c (amd64_regset_from_core_section): Use + regset_xmalloc to construct regset structures. + * amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same. + * i386-tdep.c (i386_regset_from_core_section): Same. + * i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same. + * i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same. + * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same. + * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same. + * sparc64obsd-tdep.c (sparc64obsd_init_abi): Same. + * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same. + * Makefile.in (COMMON_OBS): Add regset.o. + (regset.o): New rule. + +2004-05-19 Joel Brobecker <brobecker@gnat.com> + + * config/djgpp/fnchange.lst: Add entries for pthread_cond_wait.exp + and pthread_cond_wait.c. + +2004-05-18 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (rs6000_gdbarch_init): Initialize tdep fields + before the mach-specific switch, and then let the individual cases + override the defaults, rather than leaving them uninitialized + until the switch and then setting them in each case. + +2004-05-18 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_frame_cache): Check for validity of r31 for + millicode functions. + +2004-05-18 Randolph Chung <tausq@debian.org> + + * somsolib.c (som_solib_remove_inferior_hook): Make all the size + references to dld_flags_buffer consistent. + +2004-05-18 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_frame_cache): If a frame pointer is available, use + it for unwinding the stack. + +2004-05-18 Randolph Chung <tausq@debian.org> + + * config/pa/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE, SKIP_TRAMPOLINE_CODE) + Undefine these so we can overide them using gdbarch. + +2004-05-18 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_stub_frame_unwind_cache): Don't do export stub + handling for 64-bit HPUX (elf). + +2004-05-18 Daniel Jacobowitz <dan@debian.org> + + * alpha-tdep.c (alpha_gdbarch_init): Use LL suffix for large + constants. + * amd64-tdep.c (amd64_skip_prologue): Likewise. + * ia64-tdep.c (examine_prologue): Likewise. + * ns32k-tdep.c (ns32k_fix_call_dummy): Remove unused function. + * v850-tdep.c (v850_fix_call_dummy): Likewise. + +2004-05-18 Mark Kettenis <kettenis@gnu.org> + + * vax-tdep.c (vax_return_value): Implement + RETURN_VALUE_ABI_RETURNS_ADDRESS. + +2004-05-17 Mark Kettenis <kettenis@gnu.org> + + * vax-tdep.c (vax_return_value): Fix typo. + +2004-05-17 Andrew Cagney <cagney@redhat.com> + + * MAINTAINERS: Mark Salter was also responsible for + testsuite/config/ + + * NEWS: Mention signal fixes. + +2004-05-17 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_stub_frame_unwind_cache): For HPUX stub unwinding, + check to see if we are unwinding an export stub. Export stubs clobber + the %rp in the call path and stores the original rp in a stack slot. + +2004-05-17 Jim Blandy <jimb@redhat.com> + + * MAINTAINERS: Update address for J.T. Conklin. + +2004-05-17 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c: Remove superfluous #include's. + * Makefile.in (hppa-tdep.o): Update dependencies. + +2004-05-17 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (THREAD_INITIAL_FRAME_SYMBOL): Delete unused symbol. + (THREAD_INITIAL_FRAME_SYM_LEN): Likewise. + (unwind_command, hppa_alignof, prologue_inst_adjust_sp) + (is_branch, inst_saves_gr, inst_saves_fr, compare_unwind_entries) + (read_unwind_info, internalize_unwinds, record_text_segment_lowaddr): + Remove static function declarations. + +2004-05-17 Mark Kettenis <kettenis@gnu.org> + + * alphabsd-nat.c: Update copyright year. + (getregs_supplies): Replace PC_REGNUM with ALPHA_PC_REGNUM. + + * m68k-tdep.h (m68k_regnum): Add M68K_D2_REGNUM, M68K_D7_REGNUM + and M68K_A2_REGNUM. + + * m68k-tdep.c (m68k_svr4_return_value): Implement + RETURN_VALUE_ABI_RETURNS_ADDRESS. + +2004-05-16 Mark Kettenis <kettenis@gnu.org> + + * sol-thread.c Update copyright year. Fix various coding + standards violations. Tweak a few comments. + (td_err_string, td_state_string, thread_to_lwp, lwp_to_thread): + Delete prototypes. + +2004-05-15 Randolph Chung <tausq@debian.org> + + * hppa-tdep.h (hppa_frame_prev_register_helper): Pass save_regs + as pointer instead of array reference since HPUX compiler does + not accept unsized array arguments. + * somsolib.c (dld_flags_buffer): Use constant array size. + +2004-05-15 Mark Kettenis <kettenis@gnu.org> + + * amd64obsd-tdep.c (amd64obsd_sigtramp_p): Replace hexadecimal + offset with decimal offset. + (amd64obsd_sigcontext_addr): Return correct address for entire + signal trampoline. + + * vax-tdep.c (vax_frame_num_args): Use get_frame_base_address + instead of get_frame_base. + + * i386bsd-nat.c (supply_gregset): Use regcache_raw_supply. + (fill_gregset): Use regcache_raw_collect. + + * config/djgpp/fnchange.lst: Add entries for ppcobsd-nat.c and + ppcobsd-tdep.c. + + * config/sparc/tm-nbsd64.h: Remove file. + * config/tm-sunos.h: Remove file. + +2004-05-15 Joel Brobecker <brobecker@gnat.com> + + * rs6000-tdep.c (store_param_on_stack_p): New function, + an improved version of some code extracted from skip_prologue(). + (skip_prologue): Use store_param_on_stack_p() to detect + instructions saving a parameter on the stack. Detect when r0 + is used to save a parameter. + Do not mark "li rx, SIMM" instructions as part of the prologue, + unless the following instruction is also part of the prologue. + +2004-05-14 Andrew Cagney <cagney@redhat.com> + + * infrun.c (handle_inferior_event): Simplify + STEP_OVER_UNDEBUGGABLE. + + * infrun.c (handle_step_into_function): Delete function. + (handle_inferior_event): Inline calls to + handle_step_into_function. + +2004-05-14 Jerome Guitton <guitton@gnat.com> + + * rs6000-nat.c: Fix a comment. + +2004-05-12 David Anderson <davea@sgi.com> + + Committed by Jim Blandy <jimb@redhat.com>: + * regcache.c (struct regcache_descr): fix comment spelling. + +2004-05-13 J. Brobecker <brobecker@gnat.com> + + * aix-thread.c: s/ppc_floating_point_p/ppc_floating_point_unit_p/. + Fixes a link link failure. + +2004-05-13 J. Brobecker <brobecker@gnat.com> + + * aix-thread.c (store_regs_kernel_thread): Fix a little obvious + error that was causing the build to fail. + +2004-05-13 J. Brobecker <brobecker@gnat.com> + + * aix-thread.c: #include "gdb_string.h". Needed for memset and memcopy. + * Makefile.in (aix-thread.o): Add dependency on gdb_string.h. + +2004-05-13 Andrew Cagney <cagney@redhat.com> + + * infrun.c (handle_inferior_event): Check for + STEP_OVER_UNDEBUGGABLE after signal trampolines and function + calls. Update comments. + +2004-05-13 Jim Blandy <jimb@redhat.com> + + * aix-thread.c (pdc_read_regs, supply_gprs64, supply_fprs) + (fetch_regs_user_thread, fetch_regs_kernel_thread) + (store_regs_user_thread, store_regs_kernel_thread): Use + ppc_num_gprs and ppc_num_fprs instead of '32' and '31'. + * ppc-linux-nat.c (fill_gregset): Same. + * ppc-linux-tdep.c (ppc_linux_supply_gregset) + (ppc_linux_sigtramp_cache): Same. + * ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_fill_reg) + (ppcnbsd_sigtramp_cache_init): Same. + * rs6000-nat.c (fetch_core_registers): Same. + * rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset) + (rs6000_frame_cache): Same. + + * aix-thread.c (supply_gprs64, fetch_regs_user_thread) + (store_regs_user_thread): Use tdep->ppc_gp0_regnum, instead + of assuming that the gprs are numbered starting with zero. + * ppc-linux-nat.c (fill_gregset): Same. + * ppc-linux-tdep.c (ppc_linux_supply_gregset): Same. + * ppcnbsd-nat.c (getregs_supplies): Same. + * ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_fill_reg): Same. + * rs6000-nat.c (fetch_core_registers): Same. + * rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset): Same. + +2004-05-07 Michael Snyder <msnyder@redhat.com> + + * tracepoint.c (scope_info): Add handling for LOC_COMPUTED, + LOC_COMPUTED_ARG, and LOC_INDIRECT. + +2004-05-13 Andrew Cagney <cagney@redhat.com> + + * infrun.c (handle_inferior_event): Use frame_unwind_id. + +2004-05-13 Bryce McKinlay <mckinlay@redhat.com> + + * dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust + base_address for shared libraries. + +2004-05-13 Bryce McKinlay <mckinlay@redhat.com> + + * MAINTAINERS (write after approval): Add myself. + +2004-05-13 Ulrich Weigand <uweigand@de.ibm.com> + + * breakpoint.c (bpstat_stop_status): Add new argument + STOPPED_BY_WATCHPOINT. Use it instead of testing + target_stopped_data_address agaist 0 to check whether + or not we stopped due to a hardware watchpoint. + * breakpoint.h (bpstat_stop_status): Adapt prototype. + * infrun.c (handle_inferior_event): Call bpstat_stop_status + with new argument. + +2004-05-12 Jim Blandy <jimb@redhat.com> + + * configure.in: When checking whether we should use the -bbigtoc + option, don't forget to restore the original value of LDFLAGS. + * configure: Regenerated. + +2004-05-12 Andrew Cagney <cagney@redhat.com> + + * thread.c (load_infrun_state): Delete step_sp. + * infrun.c (context_switch): Ditto. + * inferior.h (step_sp): Ditto. + * infcmd.c (step_sp, step_1, step_once, until_next_command): Ditto. + * gdbthread.h (struct thread_info, save_infrun_state) + (restore_infrun_state): Ditto. + +2004-05-12 Ulrich Weigand <uweigand@de.ibm.com> + + * MAINTAINERS (write after approval): Add myself. + +2004-05-12 Andrew Cagney <cagney@redhat.com> + + * infrun.c (adjust_pc_after_break): Rewrite decr logic, + eliminate reference to step_sp. + (struct execution_control_state, init_execution_control_state) + (handle_inferior_event, keep_going): Delete update_step_sp and + step_sp. + * infcmd.c (step_sp): Note that variable is unused. + +2004-05-11 Andrew Cagney <cagney@redhat.com> + + * infrun.c (step_over_function): Delete function. + (handle_step_into_function): Use insert_step_resume_breakpoint. + (insert_step_resume_breakpoint): Fix assertion. + +2004-05-11 Nick Roberts <nickrob@gnu.org> + + * utils.c (defaulted_query): Just use the normal query input type + when printing the annotations. + +2004-05-11 Andrew Cagney <cagney@redhat.com> + + * infrun.c (handle_inferior_event): Simplify code handling + step-into or return-from a signal trampoline. + +2004-05-11 Andrew Cagney <cagney@redhat.com> + + * ppcnbsd-tdep.c: Include "gdb_assert.h". + * Makefile.in (ppcnbsd-tdep.o): Update dependencies. + +2004-05-10 Jim Blandy <jimb@redhat.com> + + * ppc-bdm.c (bdm_ppc_fetch_registers): Replace utterly broken code + with a call to internal_error. + + * ppc-tdep.h (struct gdbarch_tdep): Change definition of + ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this + processor variant lacks those registers. + (ppc_floating_point_unit_p): Change description to make it clear + that this returns info about the ISA, not the ABI. + * rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to + return true or false by checking tdep->ppc_fp0_regnum and + tdep->ppc_fpscr_regnum. The original code replicated the BFD + arch/mach switching done in rs6000_gdbarch_init; it's better to + keep that logic there, and just check the results here. + (rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and + tdep->ppc_fpscr_regnum to -1 to indicate that we have no + floating-point registers. + (ppc_supply_fpregset, ppc_collect_fpregset) + (rs6000_push_dummy_call, rs6000_extract_return_value) + (rs6000_store_return_value): Assert that we have floating-point + registers. + (rs6000_dwarf2_stab_reg_to_regnum): Add FIXME. + (rs6000_frame_cache): Don't note the locations at which + floating-point registers were saved if we have no fprs. + * aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP + registers. + (fetch_regs_user_thread, fetch_regs_kernel_thread) + (store_regs_user_thread, store_regs_kernel_thread): Only call + supply_fprs / fill_fprs if we actually have floating-point + registers. + (special_register_p): Check ppc_fpscr_regnum before matching + against it. + (supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't + supply / collect fpscr if we don't have it. + * ppc-bdm.c: #include "gdb_assert.h". + (bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we + have floating-point registers, since I can't test this code on + FP-free systems to adapt it. + * ppc-linux-nat.c (ppc_register_u_addr): Don't match against the + fpscr and floating point register numbers if they don't exist. + (fetch_register): Assert that we have floating-point registers + before we reach the code that handles them. + (store_register): Same. And use tdep instead of calling + gdbarch_tdep again. + (fill_fpregset): Don't try to collect FP registers and fpscr if we + don't have them. + (ppc_linux_sigtramp_cache): Don't record the saved locations of + fprs and fpscr if we don't have them. + (ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we + don't have them. + * ppcnbsd-nat.c: #include "gdb_assert.h". + (getfpregs_supplies): Assert that we have floating-point registers. + * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. + * ppcobsd-tdep.c: #include "gdb_assert.h". + (ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we + have floating-point registers. + * rs6000-nat.c (regmap): Don't match against the fpscr and + floating point register numbers if they don't exist. + (fetch_inferior_registers, store_inferior_registers, + fetch_core_registers): Only fetch / store / supply the + floating-point registers and the fpscr if we have them. + * Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o) + (ppcobsd-tdep.o): Update dependencies. + +2004-05-10 Andrew Cagney <cagney@redhat.com> + + * infrun.c (through_sigtramp_breakpoint): Delete variable. + (context_switch): Do not switch through_sigtramp_breakpoint. + * gdbthread.h (save_infrun_state, load_infrun_state) + (struct thread_info): Delete through_sigtramp_breakpoint parameter + and structure member. + * thread.c (load_infrun_state, save_infrun_state): Update. + +2004-05-10 Mark Kettenis <kettenis@gnu.org> + + * m68kbsd-tdep.c (m68kbsd_elf_init_abi): Call m68k_svr4_init_abi. + +2004-05-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl> + + * acinclude.m4: Quote macro names being defined by AC_DEFUN + throughout. + * aclocal.m4: Regenerate. + +2004-05-10 Nathan J. Williams <nathanw@wasabisystems.com> + + * alphanbsd-tdep.c: Fix include of "gdb_string.h". + +2004-05-10 Andrew Cagney <cagney@redhat.com> + + * infrun.c (check_sigtramp2): Delete function. + (handle_inferior_event): When single stepping, and taking a + signal, set a breakpoint at the signal return address. Delete + redundant calls to check_sigtramp2. + (insert_step_resume_breakpoint): New function. + (through_sigtramp_breakpoint, handle_inferior_event) + (follow_exec, wait_for_inferior, fetch_inferior_event) + (currently_stepping, keep_going): Delete most uses of + through_sigtramp_breakpoint, not that it should be deleted. + (delete_breakpoint_current_contents): Delete function. + +2004-05-10 Randolph Chung <tausq@debian.org> + + * config/pa/linux.mt (TM_FILE): Use new tm-linux.h for hppa-linux + target. + * config/pa/tm-linux.h: New file. + +2004-05-10 Daniel Jacobowitz <drow@mvista.com> + + * cli/cli-setshow.c (cmd_show_list): Check for "show" in the middle + of prefixes. Don't print the prefix twice in the CLI. + +2004-05-10 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (ppc_collect_gregset): When regnum == -1, do + collect all the gprs. + + * rs6000-tdep.c (ppc_collect_gregset): Correct off-by-one error in + loop collecting gprs. + +2004-05-09 Andrew Cagney <cagney@redhat.com> + + * remote-vx.c (net_step): Delete step-range code. + * remote.c (remote_resume, init_all_packet_configs) + (set_remote_protocol_E_packet_cmd) + (show_remote_protocol_E_packet_cmd) + (remote_protocol_E, show_remote_cmd, _initialize_remote) + (remote_protocol_e, set_remote_protocol_e_packet_cmd) + (show_remote_protocol_e_packet_cmd): Ditto. + +2004-05-09 Mark Kettenis <kettenis@gnu.org> + + * hppa-tdep.h (enum hppa_regnum): Name enum, add HPPA_R1_REGNUM. + + * hppa-tdep.h: Update copyright year. + (struct trad_frame_saved_reg): Add opaque declaration. + + * amd64-tdep.c (amd64_return_value): Implement + RETURN_VALUE_ABI_RETURNS_ADDRESS. + + * m68k-tdep.c (m68k_convert_register_p, m68k_register_to_value) + (m68k_value_to_register): New functions. + (m68k_gdbarch_init): Set convert_register_p, register_to_value and + value_to_register. + + * defs.h (enum return_value_convention): Add + RETURN_VALUE_ABI_RETURNS_ADDRESS and + RETURN_VALUE_ABI_PRESERVES_ADDRESS. + * infcmd.c (legacy_return_value): New function. + (print_return_value): Rwerite to implement + RETURN_VALUE_ABI_RETURNS_ADDRESS. + * values.c (using_struct_return): Check for inequality to + RETURN_VALUE_REGISTER_CONVENTION instead of equality to + RETURN_VALUE_STRUCT_CONVENTION. + * i386-tdep.c (i386_return_value): Implement + RETURN_VALUE_ABI_RETURNS_ADDRESS. + + * vax-tdep.c: Tweak comments. Reorder include files. Don't + include "symtab.h", "opcode/vax.h" and "inferior.h". + (vax_skip_prologue): Replace calls to read_memory_integer by calls + to read_memory_unsigned_integer. + (vax_gdbarch_init): Reorder. + (_initialize_vax_tdep): Spell out prototype. + * Makefile.in (vax-tdep.o): Update dependencies. + +2004-05-08 Andrew Cagney <cagney@redhat.com> + + * infrun.c (resume): Delete call to DO_DEFERRED_STORES. + * target.c (target_detach, target_disconnect): Ditto. + + * infcall.c (call_function_by_hand): When no + DEPRECATED_SAVE_DUMMY_FRAME_TOS call generic_save_dummy_frame_tos. + * rs6000-tdep.c (rs6000_gdbarch_init): Do not set + DEPRECATED_SAVE_DUMMY_FRAME_TOS. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + + * gdbarch.sh (DEPRECATED_FIX_CALL_DUMMY): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * ns32k-tdep.c (ns32k_gdbarch_init): Do not set + deprecated_fix_call_dummy. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * infcall.c (call_function_by_hand): Do not call + DEPRECATED_FIX_CALL_DUMMY. + + * gdbarch.sh (DEPRECATED_CALL_DUMMY_WORDS) + (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * arm-linux-tdep.c (arm_linux_call_dummy_words) + (arm_linux_init_abi): Do not set deprecated_call_dummy_words or + deprecated_sizeof_call_dummy_words. + * arm-tdep.c (arm_call_dummy_words, arm_gdbarch_init): Ditto. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto. + * v850-tdep.c (v850_gdbarch_init): Ditto. + * sh64-tdep.c (sh64_gdbarch_init): Ditto. + * ns32k-tdep.c (ns32k_call_dummy_words, ns32k_gdbarch_init): Ditto. + * mn10300-tdep.c (mn10300_gdbarch_init): Ditto. + * mcore-tdep.c (mcore_gdbarch_init): Ditto. + * arch-utils.h (legacy_call_dummy_words) + (legacy_sizeof_call_dummy_words): Delete declarations. + * arch-utils.c (legacy_call_dummy_words) + (legacy_sizeof_call_dummy_words): Delete variables. + + * gdbarch.sh (DEPRECATED_PUSH_DUMMY_FRAME): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * inferior.h (PUSH_DUMMY_FRAME): Delete macro. + * infcall.c (call_function_by_hand): Eliminate call to + DEPRECATED_PUSH_DUMMY_FRAME. + * ns32k-tdep.c (ns32k_gdbarch_init): Do not set deprecated + push_dummy_frame. + (ns32k_push_dummy_frame): Delete function. + + * ns32k-tdep.c (ns32k_gdbarch_init): Do not set + deprecated_call_dummy_breakpoint_offset or + deprecated_call_dummy_start_offset. + * dummy-frame.c, arm-tdep.c: Update comments. + * gdbarch.sh (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET) + (DEPRECATED_CALL_DUMMY_START_OFFSET): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + + * infcall.c (legacy_push_dummy_code): Delete function. + (push_dummy_code): Delete call. + + * gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * blockframe.c (legacy_frame_chain_valid): Simplify by eliminating + DEPRECATED_USE_GENERIC_DUMMY_FRAMES. + * infcall.c (legacy_push_dummy_code, call_function_by_hand): Ditto. + * frame.c (frame_type_from_pc, legacy_get_prev_frame): Ditto. + + * breakpoint.h (deprecated_frame_in_dummy): Delete declaration. + (struct frame_info): Delete opaque declaration. + * breakpoint.c (deprecated_frame_in_dummy): Delete function. + * frame.c (get_frame_type): Delete call. + + * ns32k-tdep.c (ns32k_gdbarch_init): Do not set deprecated + pc_in_call_dummy. + * inferior.h (deprecated_pc_in_call_dummy_on_stack): Delete. + * blockframe.c (deprecated_pc_in_call_dummy_on_stack): Delete. + +2004-05-08 Mark Kettenis <kettenis@gnu.org> + + * alphanbsd-tdep.c: Include "gdb_string.h". + * armnbsd-tdep.c: Update copyright year. + Include "gdb_string.h". + * Makefile.in (alphanbsd-tdep.o, armnbsd-tdep.o): Update + dependencies. + + * delta68-nat.c: Remove file. + * m68k-tdep.c (delta68_in_sigtramp, delta68_frame_args_address) + (delta68_frame_saved_pc, delta68_frame_num_args): Remove functions. + * Makefile.in (ALLDEPFILES): Remove delta68-nat.c. + (delta68-nat.o): Remove dependency. + + * m68k-tdep.c (m68k_frameless_function_invocation): Remove + function. + (m68k_gdbarch_init): Don't set + deprecated_frameless_function_invocation. + +2004-05-07 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (skip_prologue_hard_way, hppa_frame_cache): Use + read_memory_nobpt for code reading when doing frame unwinding. + * hppa-linux-tdep.c (insns_match_pattern): Likewise. + +2004-05-07 Randolph Chung <tausq@debian.org> + + * hppa-linux-tdep.c (hppa_linux_sigtramp_find_sigcontext): Pass in pc + instead of sp, handle sigaltstack case. + (hppa_linux_sigtramp_frame_unwind_cache): Adjust calls to + hppa_linux_sigtramp_find_sigcontext, and set base to the frame of the + signal handler and not that of the caller. + (hppa_linux_sigtramp_unwind_sniffer): Adjust calls to + hppa_linux_sigtramp_find_sigcontext. + +2004-05-07 Randolph Chung <tausq@debian.org> + + * Makefile.in (ALLDEPFILES): Add hppa-linux-tdep.c and + hppa-linux-nat.c. + (hppa-linux-tdep.o, hppa-linux-nat.o): Define rules. + * hppa-linux-nat.c (fetch_register, store_register): Define. + (fetch_inferior_registers, store_inferior_registers): Define. + (supply_gregset): Add comment and clean up some unneeded code. + (fill_gregset): Add comment and fix so that it saves registers in + the right place in the gregset. + (fill_fpregset): Fix buffer overrun problem. + * config/pa/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define. + +2004-05-07 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_frame_prev_register_helper): New function to + do common handling of the pcoqt register. + (hppa_frame_prev_register, hppa_stub_frame_prev_register): Convert + to use helper function. + (hppa_frame_unwind_sniffer): Only use if unwind entry is present. + (hppa_fallback_frame_cache, hppa_fallback_frame_this_id) + (hppa_fallback_frame_prev_register, hppa_fallback_frame_unwind): New + generic fallback unwinder when all else fails. + (hppa_gdbarch_init): Add fallback sniffer. + * hppa-tdep.h (hppa_frame_prev_register_helper): Prototype. + * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_prev_register): Convert + to use helper function. + +2004-05-08 Joel Brobecker <brobecker@gnat.com> + + * config/djgpp/fnchange.lst: Add translation rules for + gdb.arch/powerpc-aix-prologue.c and gdb.arch/powerpc-aix-prologue.exp. + +2004-05-08 Mark Kettenis <kettenis@gnu.org> + + * frame.c (get_prev_frame_1): Work around GCC bug. + * frame.h: Add comment about GCC bug. + +2004-05-07 Andrew Cagney <cagney@redhat.com> + + * observer.c: Include "commands.h" and "gdbcmd.h". + (observer_debug, _initialize_observer): Add the + command "set/show debug observer". + * observer.sh: When observer debugging, log notify calls. + * Makefile.in (observer.o): Update dependencies. + +2004-05-07 Jason Molenda (jmolenda@apple.com) + + * cli/cli-decode.c: Fix "SHOW_DOR" comment typeos. + +2004-05-07 Jim Blandy <jimb@redhat.com> + + * aix-thread.c (fetch_regs_kernel_thread, fill_gprs64, + fill_gprs32, store_regs_kernel_thread): Use tdep->ppc_gp0_regnum + to recognize gpr regnums, instead of assuming that + tdep->ppc_fp0_regnum marks the end of the general-purpose + registers. + + * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Assert that + the given architecture has floating-point registers. + +2004-05-07 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Replace with + macro defined to 1. + * gdbarch.h, gdbarch.c: Re-generate. + * ns32k-tdep.c (ns32k_gdbarch_init): Do not set + deprecated_use_generic_dummy_frames. + +2004-05-07 Brian Ford <ford@vss.fsi.com> + + * NEWS: Mention Cygwin DWARF 2 support. + +2004-05-07 Andrew Cagney <cagney@redhat.com> + + * objfiles.h (struct entry_info): Delete unused fields + deprecated_entry_file_lowpc and deprecated_entry_file_highpc. + * objfiles.c (init_entry_point_info, objfile_relocate): Update. + * mipsread.c (mipscoff_symfile_read): Update. + * mdebugread.c (parse_partial_symbols): Update. + * dwarfread.c (read_file_scope): Update. + * dwarf2read.c (read_file_scope): Update. + * dbxread.c (read_dbx_symtab, read_dbx_symtab): Update. + * coffread.c (complete_symtab): Update. + +2004-05-07 Mark Kettenis <kettenis@gnu.org> + + * infcall.c (_initialize_infcall): Fix typo. + +2004-05-07 Andrew Cagney <cagney@redhat.com> + + * cli/cli-decode.c (add_setshow_zinteger_cmd): New function. + * command.h (add_setshow_zinteger_cmd): Declare. + +2004-05-06 Randolph Chung <tausq@debian.org> + + * config/pa/tm-hppa.h (RO_REGNUM, FLAGS_REGNUM, RP_REGNUM) + (HPPA_FP_REGNUM, HPPA_SP_REGNUM, SAR_REGNUM, IPSW_REGNUM) + (PCOQ_HEAD_REGNUM, PCSQ_HEAD_REGNUM, PCOQ_TAIL_REGNUM, PCSQ_TAIL_REGNUM) + (EIEM_REGNUM, IIR_REGNUM, ISR_REGNUM, IOR_REGNUM, SR4_REGNUM) + (RCR_REGNUM, PID0_REGNUM, PID1_REGNUM, PID2_REGNUM, PID3_REGNUM) + (CCR_REGNUM, TR0_REGNUM, CR27_REGNUM, HPPA_FP0_REGNUM, FP4_REGNUM) + (ARG0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM): Move *_REGNUM + definitions ... + * hppa-tdep.h: ... to here, with HPPA_ prefix. + * Makefile.in (hppah-nat.o): Add $(hppa_tdep_h) + * hppa-hpux-tdep.c (hppa32_hpux_frame_find_saved_regs_in_sig) + (hppa64_hpux_frame_find_saved_regs_in_sig) + (child_get_current_exception_event): Add HPPA_ prefix to *_REGNUM usage. + * hppa-linux-nat.c (GR_REGNUM, TR_REGNUM, greg_map): Likewise. + * hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum) + (hppa_linux_target_write_pc, hppa_linux_sigtramp_frame_unwind_cache) + (hppa_linux_sigtramp_frame_prev_register): Likewise. + * hppa-tdep.c (hppa32_return_value, hppa64_return_value) + (hppa32_push_dummy_call, hppa64_push_dummy_call, hppa64_frame_align) + (hppa_target_read_pc, hppa_target_write_pc, hppa_frame_cache) + (hppa_frame_prev_register, hppa_stub_frame_unwind_cache) + (hppa_stub_frame_prev_register, hppa_unwind_dummy_id) + (hppa_skip_permanent_breakpoint, hppa_instruction_nullified) + (hppa32_register_type, hppa_cannot_store_register) + (hppa_fetch_pointer_argument, hppa_pseudo_register_read): Likewise. + * hppah-nat.c (store_inferior_registers, fetch_register): Likewise. + * hpread.c (hpread_process_one_debug_symbol): Likewise. + * pa64solib.c (pa64_solib_have_load_event) + (pa64_solib_have_unload_event, pa64_solib_loaded_library_pathname) + (pa64_solib_unloaded_library_pathname): Likewise. + * somsolib.c (som_solib_have_load_event, som_solib_have_unload_event) + (som_solib_library_pathname): Likewise. + +2004-05-05 Jim Ingham <jingham@apple.com> + + * breakpoint.c (create_breakpoints): Copy the ignore count and + thread id over from the pended breakpoint to the actual + breakpoint. + +2004-05-05 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (PARM_BOUNDARY): Delete. + gdbarch.h, gdbarch.c: Re-generate. + * valops.c (PARM_BOUNDARY): Delete macro. + (value_push): Delete PARM_BOUNDARY code. + * m68k-tdep.c (m68k_gdbarch_init): Do not set parm_boundary. + +2004-05-04 Jim Blandy <jimb@redhat.com> + + * ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers): + Don't assume that the gprs, fprs, and UISA sprs are + contiguous, start at register number zero, and end with fpscr. + Instead, use the numbers from the tdep structure. + + * config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this + should no longer be used in code specific to the RS6000 and its + derivatives. + * ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member. + * rs6000-tdep.c (rs6000_gdbarch_init): Initialize + tdep->ppc_fp0_regnum. + (ppc_supply_fpregset, ppc_collect_fpregset) + (rs6000_push_dummy_call, rs6000_extract_return_value) + (rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value) + (rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of + FP0_REGNUM. + * aix-thread.c (supply_fprs, fetch_regs_kernel_thread) + (fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread): + Same. + * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers, + bdm_ppc_store_registers): Same. + * ppc-linux-nat.c (ppc_register_u_addr, fetch_register) + (store_register, fill_fpregset): Same. + * ppc-linux-tdep.c (ppc_linux_sigtramp_cache) + (ppc_linux_supply_fpregset): Same. + * ppcnbsd-nat.c (getfpregs_supplies): Same. + * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): + Same. + * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, + do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, + ppc64_sysv_abi_return_value): Same. + * rs6000-nat.c (regmap, fetch_inferior_registers) + (store_inferior_registers, fetch_core_registers): Same. + +2004-05-01 Mark Kettenis <kettenis@gnu.org> + + * m68knbsd-nat.c: Remove file. + * m68knbsd-tdep.c: Remove file. + * Makefile.in: (m68knbsd-nat.o, m68knbsd-tdep.o): Remove + dependencies. + * configure.host: Add m68k-*-netbsdelf*. + * configure.tgt (m68k-*-netbsd*): Set gdb_target to nbsd. + * config/m68k/nbsdaout.mh (NATDEPFILES): Add m68kbsd-nat.o, + solib.o and solib-sunos.o. Remove m68knbsd-nat.o, corelow.o. + (XM_FILE): Remove. + * config/m68k/nbsdelf.mh: New file. + * config/m68k/nbsd.mt: New file. + * config/m68k/nbsdaout.mt: Remove file. + * config/m68k/tm-nbsd.h: Don't include <sys/param.h>, + <machine/vmparam.h> and "m68k/tm-m68k.h". Include "solib.h". + (BPT_VECTOR, STACK_END_ADDR): Remove defines. + (DEPRECATED_SIGTRAMP_START, DEPRECATED_SIGTRAMP_END): Likewise. + (use_struct_convention): Remove prototype. + (USE_STRUCT_CONVENTION): Remove define. + * config/m68k/xm-nbsd.h: Remove file. + +2004-05-04 Michael Snyder <msnyder@redhat.com> + + * m68k-tdep.c (m68k_gdbarch_init): Default to using + reg_struct_return method (as gcc usually does for cross targets). + +2004-05-04 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + Committed by Andrew Cagney. + * s390-tdep.c (s390_sigtramp_frame_unwind_cache): Account for + alignment padding when accessing ucontext struct members. + +2004-05-04 Jim Blandy <jimb@redhat.com> + + * config/ppc-tdep.h (struct gdbarch_tdep): Delete + 'ppc_gplast_regnum' member. + (ppc_num_gprs): New enum constant. + * ppc-linux-nat.c (ppc_register_u_addr): Use tdep->ppc_gp0_regnum + and ppc_num_gprs instead of tdep->ppc_gplast_regnum. + * rs6000-nat.c (regmap, fetch_inferior_registers, + store_inferior_registers): Same. + * rs6000-tdep.c (e500_pseudo_register_read) + (e500_pseudo_register_write): Same. + (rs6000_gdbarch_init): Don't initialize tdep->ppc_gplast_regnum. + + * config/rs6000/tm-rs6000.h (FPLAST_REGNUM): Delete #definition. + * ppc-tdep.h (ppc_num_fprs): New enum constant. + * aix-thread.c (fetch_regs_kernel_thread, fill_fprs, + store_regs_kernel_thread): Use FP0_REGNUM + ppc_num_fprs, not + FPLAST_REGNUM. + * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers): + Same. + * ppc-linux-nat.c (ppc_register_u_addr): Same. + * rs6000-nat.c (regmap, fetch_inferior_registers) + (store_inferior_registers): Same. + + * aix-thread.c (fill_fprs): Fix off-by-one error comparing regno + with FPLAST_REGNUM. + +2004-05-03 Joel Brobecker <brobecker@gnat.com> + + * dwarf2read.c (dwarf2_create_include_psymtab): Fix build + failure detected by recent versions of GCC. + (psymtab_to_symtab_1): No longer use the PST_PRIVATE macro + to be consistent with the usage in dwarf2_create_include_psymtab. + +2004-05-03 Michael Snyder <msnyder@redhat.com> + + * mips-tdep.c (mips_gdbarch_init): Fix typo in comment. + (heuristic_proc_start): Whitespace cleanup. + +2004-05-04 Mark Kettenis <kettenis@gnu.org> + + * sun3-nat.c: Remove file. + * Makefile.in (tm-sun3.h tm-altos.h tm-sun2.h tm-3b1.h): Remove + dependencies. + (ALLDEPFILES): Remove sun3-nat.c. + (sun3-nat.o): Remove dependencies. + + * i386-interix-nat.c, i386-interix-tdep.c, + config/i386/nm-interix.h, config/i386/interix.mh, + config/i386/interix.mt: Remove files. + * Makefile.in (i386-interix-nat.o, i386-interix-tdep.o): Remove + dependencies. + +2004-05-03 Mark Kettenis <kettenis@gnu.org> + + * m68k-tdep.h (struct gdbarch_tdep): Add member + struct_value_regnum. + (m68k_svr4_init_abi): New prototype. + * m68k-tdep.c: Include "floatformat.h". Add comment about all the + different calling conventions. + (m68k_extract_return_value): Remove code dealing with single-field + structs. + (m68k_store_return_value): Remove code dealing with single-field + structs. Correctly store return values of 5, 6, 7 or 8 bytes. + (m68k_extract_struct_value_address): Remove function. + (m68k_svr4_extract_return_value,m68k_svr4_store_return_value) + (m68k_reg_struct_return_p, m68k_return_value) + (m68k_svr4_return_value): New functions. + (m68k_use_struct_convention): Remove function. + (m68k_push_dummy_call): Use new struct_value_regnum member of + `struct gdbarch_tdep' instead of hardcoded register number to + store STRUCT_ADDR. + (m68k_svr4_init_abi): New function. + (m68k_gdbarch_init): Don't set extract_return_value, + store_return_values, deprecated_extract_struct_value_address and + use_struct_convention. Set return_value instead. Initialize new + struct_value_regnum member of `struct gdbarch_tdep'. + * m68klinux-tdep.c: Update copyright year. + (m68k_linux_extract_return_value, m68k_linux_store_return_value) + (m68k_linux_extract_struct_value_address): Remove function. + (m68k_linux_init_abi): Don't set extract_return_value, + store_return_values, deprecated_extract_struct_value_address and + use_struct_convention. Call m68k_svr4_init_abi but override the + new struct_value_regnum member of `struct gdbarch_tdep'. + * Makefile.in (m68k-tdep.o): Update dependencies. + +2004-05-03 J. Brobecker <brobecker@gnat.com> + + * dwarf2read.c (line_header): Add new included_p field in + field file_names. + (partial_die_info): New field has_stmt_list. New field line_offset. + (dwarf2_create_include_psymtab): New function. + (dwarf2_build_include_psymtabs): New function. + (add_file_name): Add forward declaration. Initialize new field. + (dwarf_decode_lines): Add new parameter. Enhance this procedure + to be able to determine the list of files included by the + given unit, and build their associated psymtabs. + (dwarf2_build_psymtabs_hard): Build the psymtabs for the included + files as well. + (psymtab_to_symtab_1): Build the symtabs of all dependencies as well. + (read_file_scope): Update call to dwarf_decode_lines. + (read_partial_die): Handle DW_AT_stmt_list attributes. + +2004-05-02 Michael Chastain <mec.gnu@mindspring.com> + + Unfix PR gdb/1626. + * configure.in: Revert special case for osf5.*. + * configure: Regenerate. + +2004-05-02 Jim Blandy <jimb@redhat.com> + + Move the symbol-file-from-memory functions into their own file. + * symfile-mem.c, symfile-mem.h: New files. + * symfile.c (symbol_file_add_from_bfd): New function. + (symbol_file_add): Call symbol_file_add_from_bfd. + (symbol_file_add_from_memory, add_symbol_file_from_memory_command): + Moved to symfile-mem.c. + (_initialize_symfile): Move definition of + add-symbol-file-from-memory command to symfile-mem.c. + * symfile.h (symbol_file_add_from_bfd): New declaration. + * config/i386/linux.mt (TDEPFILES): Add symfile-mem.o. + * config/powerpc/linux.mt (TDEPFILES): Same. + * Makefile.in (SFILES): Add symfile-mem.c. + (symfile_mem_h): New variable. + (HFILES_NO_SRCDIR): Add symfile-mem.h. + (symfile-mem.o): New rule. + +2004-05-01 Andrew Cagney <cagney@redhat.com> + + * breakpoint.c (insert_bp_location): Use get_frame_id, and + frame_find_by_id instead of frame_relative_level. + (do_enable_breakpoint): Ditto. + * thread.c: Update copyright. + (info_threads_command): Ditto, simplify. + + * frame.c (deprecated_generic_get_saved_register): Delete + function, moved to "xstormy16-tdep.c". + * xstormy16-tdep.c (xstormy16_get_saved_register): Inline + deprecated_generic_get_saved_register from "frame.c". + (xstormy16_frame_saved_register): Call + xstormy16_get_saved_register. + * dummy-frame.c (deprecated_find_dummy_frame_regcache): Make + static. + * dummy-frame.h (deprecated_find_dummy_frame_regcache): Delete. + * frame.h (deprecated_generic_get_saved_register): Delete. + +2004-05-01 Michael Chastain <mec.gnu@mindspring.com> + + * dwarfread.c: Update documentation on the state of dwarf-1. + +2004-05-01 Andrew Cagney <cagney@redhat.com> + + * stack.c (select_frame_command): Delete call to + frame_relative_level. + (print_frame, set_backtrace_limit_command, backtrace_limit_info): + Delete #if0 code. + (frame_info): Do not print FRAMELESS. + (print_block_frame_labels): Replace DEPRECATED_STREQ. + (catch_info): Delete #if0 code. + + * frame.c (create_sentinel_frame): Set type to SENTINEL_FRAME. + * dummy-frame.c (dummy_frame_this_id): Use get_frame_type, instead + of frame_relative_level. + * sentinel-frame.c (sentinel_frame_unwinder): Set unwinder's type + to SENTINEL_FRAME. + * frame.h (enum frame_type): Add SENTINEL_FRAME. + * s390-tdep.c (s390_prologue_frame_unwind_cache): Delete calls to + frame_relative_level. + + * frame.h (deprecated_set_frame_type): Delete declaration. + * frame.c (deprecated_set_frame_type): Delete function, update + comments. + + * gdbarch.sh (DEPRECATED_PC_IN_SIGTRAMP): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * shnbsd-tdep.c (shnbsd_init_abi): Do not set pc_in_sigtramp. + (shnbsd_pc_in_sigtramp): Delete. + * i386-interix-tdep.c (i386_interix_init_abi): Do not set + pc_in_sigtramp. + * hppa-hpux-tdep.c (hppa_hpux_init_abi): Do not set + pc_in_sigtramp. + * frame.h: Update comments. + * ppc-linux-tdep.c: Update comments. + * breakpoint.c (bpstat_what): Update comments. + + * Makefile.in (m68klinux-tdep.o, m68klinux-nat.o): Fix + m68klinux-tdep.o's dependencies, were previously added to + m68klinux-nat.o. + + * alpha-tdep.c (alpha_sigtramp_frame_sniffer): Use pc_in_sigtramp. + * alpha-tdep.h (struct gdbarch_tdep): Add pc_in_sigtramp. + * alphafbsd-tdep.c (alphafbsd_init_abi): Update. + * alpha-osf1-tdep.c (alpha_osf1_init_abi): Update. + * alpha-linux-tdep.c (alpha_linux_init_abi): Update. + + * Makefile.in (m68klinux-nat.o): Update dependencies. + * m68klinux-tdep.c: Include "trad-frame.h" and "frame-unwind.h". + (m68k_linux_sigtramp_frame_cache) + (m68k_linux_sigtramp_frame_this_id) + (m68k_linux_sigtramp_frame_prev_register) + (m68k_linux_sigtramp_frame_unwind) + (m68k_linux_sigtramp_frame_sniffer) + (struct m68k_linux_sigtramp_info, m68k_linux_init_abi): Code from + m68k-tdep.h and m68k-tdep.c, add "linux" to function and variable + names, use trad-frame.h. + * m68k-tdep.h (struct gdbarch_tdep): Delete get_sigtramp_info. + (struct m68k_sigtramp_info): Delete. + * m68k-tdep.c (m68k_sigtramp_frame_cache) + (m68k_sigtramp_frame_this_id, m68k_sigtramp_frame_prev_register) + (m68k_sigtramp_frame_unwind, m68k_sigtramp_frame_sniffer) + (m68k_gdbarch_init): Delete all the sigtramp code, moved to + "m68klinux-tdep.c". + + * infrun.c (check_sigtramp2): Delete check for + DEPRECATED_PC_IN_SIGTRAMP and INNER_THAN. + +2004-05-01 Mark Kettenis <kettenis@gnu.org> + + * m68k-tdep.h (m68kbsd_fpreg_offset): New prototype. + +2004-05-01 Andrew Cagney <cagney@redhat.com> + + * frv-linux-tdep.c: Include "trad-frame.h" and "frame-unwind.h". + (frv_linux_sigtramp_frame_cache) + (frv_linux_sigtramp_frame_this_id) + (frv_linux_sigtramp_frame_prev_register) + (frv_linux_sigtramp_frame_unwind) + (frv_linux_sigtramp_frame_sniffer): Copied from frv-tdep.c, + include "linux" in function and variable names, directly call + frv_linux_pc_in_sigtramp and frv_linux_sigcontext_reg_addr, use + the latest trad-frame code. + (frv_linux_init_abi): Append frv_linux_sigtramp_frame_sniffer, do + not set frv_sigcontext_reg_addr or deprecated_pc_in_sigtramp + * Makefile.in (frv-linux-tdep.o): Update dependencies. + * frv-tdep.h (frv_set_sigcontext_reg_addr): Delete declaration. + * frv-tdep.c (frv_sigtramp_frame_cache) + (frv_sigtramp_frame_this_id, frv_sigtramp_frame_prev_register) + (frv_sigtramp_frame_unwind, frv_sigtramp_frame_sniffer): Moved to + frv-linux-tdep.c. + (frv_gdbarch_init): Do not append a sigtramp sniffer. + (struct gdbarch_tdep): Delete sigcontext_reg_addr. + (frv_set_sigcontext_reg_addr): Delete function. + + * gdbarch.sh (DEPRECATED_SIGTRAMP_START) + (DEPRECATED_SIGTRAMP_END): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * arch-utils.c (legacy_pc_in_sigtramp): Simplify. + * config/vax/tm-vaxbsd.h: Update copyright. + (DEPRECATED_SIGTRAMP_START, DEPRECATED_SIGTRAMP_END): Delete. + (DEPRECATED_IN_SIGTRAMP): Define. + * config/m68k/tm-nbsd.h: Update copyright. + (DEPRECATED_SIGTRAMP_START, DEPRECATED_SIGTRAMP_END): Delete. + (DEPRECATED_IN_SIGTRAMP): Define. + +2004-05-01 Mark Kettenis <kettenis@gnu.org> + + * dwarf2-frame.c (read_encoded_value): Handle DW_EH_PE_funcrel + encondings. Fixes PR gdb/1628. + + * dwarf2-frame.c (execute_cfa_program): Complain if we encounter a + DW_CFA_restore state without a matching DW_CFA_remember_state + instead of aborting. Fixes PR backtrace/1589. + +2004-04-30 Joel Brobecker <brobecker@gnat.com> + + * MAINTAINERS: Add self as AIX maintainer. + Update my e-mail address in write-after-approval section. + +2004-04-30 Andrew Cagney <cagney@redhat.com> + + * frame.c (frame_type_from_pc): Delete call to PC_IN_SIGTRAMP. + (legacy_get_prev_frame): Ditto. + + * mips-tdep.c (mips_pc_in_sigtramp): Delete. + (mips_gdbarch_init): Do not set pc_in_sigtramp. + * mipsread.c (sigtramp_address): Delete extern variable. + (mipscoff_new_init): Delete reference. + * mdebugread.c (sigtramp_address, sigtramp_end): Delete variables. + (fixup_sigtramp): Delete function. + * config/mips/tm-mips.h (sigtramp_address, sigtramp_end) + (fixup_sigtramp): Delete declarations. + + * ppcnbsd-tdep.c (ppcnbsd_init_abi): Do not set + deprecated_pc_in_sigtramp. + (ppcnbsd_pc_in_sigtramp): Delete function. + +2004-05-01 Mark Kettenis <kettenis@gnu.org> + + * config/m68k/nm-nbsd.h: Tweak comments. + * config/m68k/nm-nbsdaout.h: Likewise. + +2004-04-30 Andrew Cagney <cagney@redhat.com> + + * arm-tdep.c (arm_sigtramp_unwind_sniffer): Call + legacy_pc_in_sigtramp. + * ia64-tdep.c (ia64_sigtramp_frame_sniffer): Ditto. + +2004-05-01 Mark Kettenis <kettenis@gnu.org> + + Add OpenBSD/m68k support. + * NEWS (New native configurations): Mention OpenBSD/m68k. + * m68kbsd-tdep.c: New file. + * m68kbsd-nat.c: New file. + * Makefile.in (ALLDEPFILES): Add m68kbsd-nat.c and m68kbsd-tdep.c. + (m68kbsd-nat.o, m68kbsd-tdep.o): New dependencies. + * configure.host: Add m68k-*-openbsd. + * configure.tgt: Add m68k-*-openbsd. + * config/m68k/tm-obsd.h: New file. + * config/m68k/obsd.mt: New file. + * config/m68k/obsd.mh: New file. + * config/djgpp/fnchange.lst: Add entries for m68kbsd-nat.c and + m68kbsd-tdep.c. + +2004-04-30 Andrew Cagney <cagney@redhat.com> + + * mipsnbsd-tdep.c (mipsnbsd_pc_in_sigtramp): Delete function. + (mipsnbsd_init_abi): Do not set pc_in_sigtramp. + +2004-04-30 Mark Kettenis <kettenis@gnu.org> + + * m68k-tdep.c (REMOTE_BPT_VECTOR): Remove define. + * config/m68k/tm-nbsd.h (REMOTE_BPT_VECTOR): Remove define. + +2004-04-30 Brian Ford <ford@vss.fsi.com> + + Revert 2004-04-16 change. + * i386-tdep.c (i386_gdbarch_init): Fix comment typos. + (i386_coff_init_abi): Remove. + * i386-tdep.h (i386_coff_init_abi): Remove. + * i386-cygwin-tdep.c (i386_cygwin_init_abi): Remove call to above. + +2004-04-30 Andrew Cagney <cagney@redhat.com> + + * blockframe.c (find_pc_partial_function): Delete use of + DEPRECATED_PC_IN_SIGTRAMP, DEPRECATED_SIGTRAMP_START and + DEPRECATED_SIGTRAMP_END. + + * config/mips/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Delete. + * config/mips/tm-irix6.h (DEPRECATED_IN_SIGTRAMP): Delete. + * config/mips/tm-nbsd.h: Delete undef DEPRECATED_IN_SIGTRAMP. + * config/mips/tm-irix5.h (DEPRECATED_IN_SIGTRAMP): Delete. + * config/arm/tm-embed.h (DEPRECATED_IN_SIGTRAMP): Delete. + + * defs.h (deprecated_inside_entry_file): Delete declaration. + * blockframe.c (deprecated_inside_entry_file): Delete function. + (legacy_frame_chain_valid): Delete call. + * sh64-tdep.c (sh64_frame_chain): Delete call. + * objfiles.h: Update comments. + * i386-interix-tdep.c (i386_interix_frame_chain_valid): Delete + call. + * frame.c (get_prev_frame): Delete call, update comments. + +2004-04-30 Brian Ford <ford@vss.fsi.com> + + * MAINTAINERS (Write After Approval): Add myself. + +2004-04-30 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (BELIEVE_PCC_PROMOTION_TYPE): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * stabsread.c (define_symbol): Delete BELIEVE_PCC_PROMOTION_TYPE + code. + +2004-04-30 Andrew Cagney <cagney@redhat.com> + + * gdb-events.sh (selected_thread_changed) + (selected_frame_level_changed, target_changed): Delete. + * gdb-events.h, gdb-events.c: Re-generate. + * valops.c (value_assign): Update. + * stack.c (select_frame_command, up_silently_base) + (down_silently_base): Update. + +2004-04-29 Andrew Cagney <cagney@redhat.com> + + * mips-tdep.c (mips_register_type): Re-write, handle 32-bit ABI + registers correctly. + (print_gp_register_row, mips32_heuristic_proc_desc) + (mips_n32n64_push_dummy_call, mips_o32_push_dummy_call) + (mips_o64_push_dummy_call, mips_eabi_push_dummy_call): Eliminate + references to mips_isa_regsize. + +2004-04-29 Andrew Cagney <cagney@redhat.com> + + * mips-tdep.c (struct gdbarch_tdep): Delete + mips_fp_register_double. + (FP_REGISTER_DOUBLE): Delete macro, replace with test for + mips_abi_regsize. + (mips_gdbarch_init): Do not set mips_fp_register_double. + (mips_dump_tdep): Do not print FP_REGISTER_DOUBLE. + +2004-04-29 Joel Brobecker <brobecker@gnat.com> + + Committed by Andrew Cagney. + * infrun.c (handle_inferior_event): Rely on frame IDs to detect + function calls. + +2004-04-29 Andrew Cagney <cagney@redhat.com> + + * mips-tdep.c (mips_abi_regsize): Replace tdep parameter with + gdbarch, use mips_abi, update callers. + (mips_stack_argsize): Replace tdep parameter with gdbarch, use + mips_abi_regsize, update callers. + (struct gdbarch_tdep): Delete mips_default_stack_argsize and + mips_default_abi_regsize. + (mips_gdbarch_init): Do not set mips_default_stack_argsize and + mips_default_abi_regsize. + +2004-04-29 Andrew Cagney <cagney@redhat.com> + + * mips-tdep.c (mips_abi_regsize): Rename mips_saved_regsize. + (mips_abi_regsize_string): Rename mips_saved_regsize_string. + (struct gdbarch_tdep): Rename mips_default_saved_regsize to + mips_default_abi_regsize. + (mips_isa_regsize): Rename mips_regisze. + * mipsnbsd-tdep.c: Update. + * mips-linux-tdep.c: Update. + * irix5-nat.c: Update. + * mips-tdep.h (mips_isa_regsize): Update. + + * gdb-events.sh (WITH_GDB_EVENTS): Delete macro and references. + Delete all disabled code. + * gdb-events.h, gdb-events.c: Re-generate. + +2004-04-19 Jerome Guitton <guitton@gnat.com> + Mark Kettenis <kettenis@gnu.org> + + * i386-tdep.c (i386_skip_prologue): follow the last jump only if + the function begins with a branch instruction. + +2004-04-29 Mark Kettenis <kettenis@gnu.org> + + * i386-tdep.c: Fix spelling mistakes. + +2004-04-28 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> + Andrew Cagney <cagney@redhat.com> + + * configure.in (mips-sgi-irix5*): Define _KMEMUSER for + <sys/proc.h>. + * acconfig.h: Provide default _KMEMUSER value. + * config.in, configure: Re-generate. + * NEWS: Mention fix. + +2004-04-24 Randolph Chung <tausq@debian.org> + + * configure.host (hppa*-*-linux*): New target. + * configure.tgt (hppa*-*-linux*): Likewise. + * hppa-tdep.c (hppa_gdbarch_init): Set cannot_fetch_register, move + gdbarch_init_osabi() call earlier so that osabi-specific frame + unwinders can be registered first. + * config/djgpp/fnchange.lst: Add entries for hppa-linux-tdep.c and + hppa-linux-nat.c. + * config/pa/tm-hppa.h (ISR_REGNUM, PID0_REGNUM, PID1_REGNUM) + (PID2_REGNUM, PID3_REGNUM): Add definitions of some register numbers. + * config/pa/linux.mh: New file. + * config/pa/linux.mt: New file. + * config/pa/nm-linux.h: New file. + * config/pa/xm-linux.h: New file. + * hppa-linux-nat.c: New file. + * hppa-linux-tdep.c: New file. + +2004-04-28 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa32_return_value): Handle both 4- and 8-byte fp + return values. + (hppa32_push_dummy_call): Fix small struct and floating point argument + passing, and make sure the stack frame is properly aligned. + +2004-04-28 Andrew Cagney <cagney@redhat.com> + + * stack.c (print_stack_frame): Fix description. + + * NEWS: Mention gdb/gdbserver/configure execute permission + changed. PR server/519. + +2004-04-28 Andrew Cagney <cagney@redhat.com> + + * stack.c (print_stack_frame_stub): Delete declaration. + (struct print_stack_frame_args, print_stack_frame) + (print_frame_info, print_frame): Replace "source" with print what. + Replace "print" with "print_level". Replace "args" with + "print_args". + * frame.h (show_and_print_stack_frame, print_stack_frame) + (print_frame_info): Update declarations. + * stack.c (select_and_print_frame, frame_command) + (current_frame_command, up_command, down_command): Update calls - + use get_selected_frame, pass "enum print_what" for source, do not + call frame_relative_level. + * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Ditto. + * remote-rdp.c (remote_rdp_open): Ditto. + * remote-mips.c (common_open): Ditto. + * remote-e7000.c (e7000_start_remote): Ditto. + * ocd.c (ocd_start_remote): Ditto. + * mi/mi-main.c (mi_cmd_exec_return): Ditto. + * infrun.c (normal_stop): Ditto. + * inflow.c (kill_command): Ditto. + * infcmd.c (finish_command): Ditto. + * corelow.c (core_open): Ditto. + * tracepoint.c (finish_tfind_command): Ditto. + * thread.c (info_threads_command, info_threads_command) + (restore_current_thread, do_captured_thread_select): Ditto. + * ada-tasks.c (task_command): Ditto. + +2004-04-26 Orjan Friberg <orjanf@axis.com> + + * frame.c: Include "observer.h". + (frame_observer_target_changed): New function. + (_initialize_frame): Attach target_changed observer. + * regcache.c: Include "observer.h". + (regcache_observer_target_changed): New function. + (_initialize_regcache): Attach target_changed observer. + * valops.c: Include "observer.h". + (value_assign): Notify target_changed event when modifying register. + * Makefile.in (frame.o, regcache.o, valops.o): Add $(observer_h). + +2004-04-26 Orjan Friberg <orjanf@axis.com> + + From Paul Koning <pkoning@equallogic.com>: + * breakpoint.c (free_valchain): New function. + (insert_bp_location, delete_breakpoint): Use free_valchain. + (remove_breakpoint): Do not remove the valchain. + (bpstat_stop_status): If not stopped by watchpoint, skip + watchpoints when generating stop status list. + * infrun.c (handle_inferior_event): Make + stepped_after_stopped_by_watchpoint a global variable. + * remote.c (remote_stopped_data_address): Return watch data + address rather than zero if stepped_after_stopped_by_watchpoint is + set. + +2004-04-25 Michael Chastain <mec.gnu@mindspring.com> + + Fix PR gdb/1626. + * configure.in: Check for curses after termcap. + On osf5.*, do not check for ncurses. + * configure: Regenerate. + +2004-04-25 Mark Kettenis <kettenis@gnu.org> + + * ppcobsd-nat.c: Include "ppc-tdep.h". + * Makefile.in (ppcobsd-nat.o): Update dependencies. + + * stack.c (return_command): Use CHECK_TYPEDEF on the return type. + Fixes PR tdep/1623 and PR tdep/1624. + +2004-04-24 Michael Chastain <mec.gnu@mindspring.com> + + * xmodem.h, xmodem.c: Remove files. + * Makefile.in: Remove references to xmodem.h, xmodem.c. + +2004-04-23 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_stub_unwind_cache, hppa_stub_frame_unwind_cache) + (hppa_stub_frame_this_id, hppa_stub_frame_prev_register) + (hppa_stub_frame_unwind, hppa_stub_unwind_sniffer): New stub unwinder + for handling stackless frames. + (hppa_gdbarch_init): Link in hppa_stub_unwind_sniffer. + +2004-04-23 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_frame_cache): Handle the case when frame unwind + starts at a pc before the frame is created. + +2004-04-23 Joel Brobecker <brobecker@gnat.com> + + * ChangeLog-2002: Fix year in one of the ChangeLog entries. + +2004-04-23 Jerome Guitton <guitton@gnat.com> + + * rs6000-tdep.c (rs6000_extract_return_value): When extracting a float, + use convert_typed_floating to get the appropriate format. + +2004-04-22 Randolph Chung <tausq@debian.org> + + * hppa-tdep.h (find_unwind_entry, hppa_get_field, hppa_extract_5_load) + (hppa_extract_5R_store, hppa_extract_5r_store, hppa_extract_17) + (hppa_extract_21, hppa_extract_14, hppa_low_sign_extend) + (hppa_sign_extend): Add prototype. + * hppa-tdep.c (get_field, extract_5_load, extract_5R_store) + (extract_5r_store, extract_17, extract_21, extract_14, low_sign_extend) + (sign_extend): Rename with hppa_ prefix and make non-static. Other + hppa targets will also use these functions. + (find_unwind_entry): Remove prototype (moved to hppa-tdep.h). + (hppa_in_solib_call_trampoline, hppa_in_solib_return_trampoline) + (hppa_skip_trampoline_code): Move to hppa-hpux-tdep.c + (hppa_gdbarch_init): Remove gdbarch setting of + skip_trampoline_code, in_solib_call_trampoline and + in_solib_return_trampoline. + * hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline) + (hppa64_hpux_in_solib_call_trampoline): New functions, split from + hppa_in_solib_call_trampoline. + (hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code): + Moved from hppa-tdep.c. + (hppa_hpux_init_abi): Set gdbarch for skip_trampoline_code, + in_solib_call_trampoline and in_solib_return_trampoline. + +2004-04-22 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_debug): New variable. + (find_unwind_entry, hppa_frame_cache): Add debug output. + (_initialize_hppa_tdep): Add command to set debug flag. + +2004-04-22 Andrew Cagney <cagney@redhat.com> + + * ppcnbsd-tdep.c: Update copyright. Include "tramp-frame.h" and + "trad-frame.h". + (ppcnbsd_sigtramp_cache_init, ppcnbsd_sigtramp): Implement a NetBSD + signal trampoline unwinder. + (ppcnbsd_init_abi): Register ppcnbsd_sigtramp. + +2004-04-22 Mark Kettenis <kettenis@gnu.org> + + Add OpenBSD/powerpc support. + * NEWS (New native configurations): Mention OpenBSD/powerpc. + * ppc-tdep.h (struct ppc_reg_offsets): New structure. + (ppc_supply_gregset, ppc_supply_fpregset, ppc_collect_gregset) + (ppc_collect_fpregset): New prototypes. + * ppcobsd-nat.c: New file. + * ppcobsd-tdep.c: New file. + * ppcobsd-tdep.h: New file. + * rs6000-tdep.c: Include "regset.h". + (ppc_supply_reg, ppc_collect_reg, ppc_supply_gregset) + (ppc_supply_fpregset, ppc_collect_gregset, ppc_collect_fpregset): + New functions. + * Makefile.in (ALLDEPFILES): Add pccobsd-nat.c and ppcobsd-tdep.c. + (ppcobsd-nat.o, ppcobsd-tdep.o): New dependencies. + (rs6000-tdep.o): Update dependencies. + * configure.host: Add powerpc-*-openbsd. + * configure.tgt: Add powerpc-*-openbsd. + * config/powerpc/obsd.mh: New file. + * config/powerpc/nm-obsd.h: New file. + * config/powerpc/obsd.mt: New file. + +2004-04-22 Andrew Cagney <cagney@redhat.com> + + * frame.h (show_frame_info): Delete declaration. + + * arm-tdep.c (arm_prologue_this_id): Delete redundant cycle test. + * m68hc11-tdep.c (m68hc11_frame_this_id): Ditto. + * m32r-tdep.c (m32r_frame_this_id): Ditto. + * frv-tdep.c (frv_frame_this_id): Ditto. + * avr-tdep.c (avr_frame_this_id): Ditto. + +2004-04-22 Elena Zannoni <ezannoni@redhat.com> + + * MAINTAINERS: Drop maintenance of gdb.stabs, and linespec.c. + +2004-04-22 Jim Blandy <jimb@redhat.com> + + * ppc-linux-nat.c (ppc_register_u_addr): Don't assume that r0 is + register number zero. + +2004-04-21 Michael Snyder <msnyder@redhat.com> + + * mips-tdep.c (heuristic_proc_start): + Warning() already prefixes "Warning: ". + +2004-04-21 Andrew Cagney <cagney@redhat.com> + + * annotate.h (deprecated_annotate_starting_hook) + (deprecated_annotate_stopped_hook) + (deprecated_annotate_exited_hook) + (deprecated_annotate_signal_hook) + (deprecated_annotate_signalled_hook): Deprecate. + * tracepoint.h (deprecated_create_tracepoint_hook) + (deprecated_delete_tracepoint_hook) + (deprecated_modify_tracepoint_hook) + (deprecated_trace_find_hook) + (deprecated_trace_start_stop_hook): Deprecate. + * target.h (deprecated_target_new_objfile_hook): Deprecate. + * remote.h (deprecated_target_resume_hook) + (deprecated_target_wait_loop_hook): Deprecate. + * gdbcore.h (deprecated_exec_file_display_hook) + (deprecated_file_changed_hook): Deprecate. + * frame.h (deprecated_selected_frame_level_changed_hook): Deprecate. + * defs.h (deprecated_modify_breakpoint_hook) + (deprecated_command_loop_hook, deprecated_show_load_progress) + (deprecated_print_frame_info_listing_hook) + (deprecated_query_hook, deprecated_warning_hook) + (deprecated_flush_hook, deprecated_create_breakpoint_hook) + (deprecated_delete_breakpoint_hook) + (deprecated_interactive_hook, deprecated_registers_changed_hook) + (deprecated_readline_begin_hook, deprecated_readline_hook) + (deprecated_readline_end_hook, deprecated_register_changed_hook) + (deprecated_memory_changed_hook, deprecated_init_ui_hook) + (deprecated_context_hook, deprecated_target_wait_hook) + (deprecated_attach_hook, deprecated_detach_hook) + (deprecated_call_command_hook, deprecated_set_hook) + (deprecated_error_hook, deprecated_error_begin_hook) + (deprecated_ui_load_progress_hook): Deprecate. + * valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update. + * tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update. + * target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update. + * remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update. + * main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update. + * exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update. + * cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update. + * annotate.c, aix-thread.c: Update. + +2004-04-21 Andrew Cagney <cagney@redhat.com> + + * Makefile.in (vaxnbsd-tdep.o): Update dependencies. + * vaxnbsd-tdep.c: Include "gdb_string.h". + + * symfile.c (symbol_file_add_from_memory): #if 0 function. + (add_symbol_file_from_memory_command): #if 0 function body, call + error instead. + +2004-04-21 Andrew Cagney <cagney@redhat.com> + + * gdbcore.h: Update copyright. + (deprecated_add_core_fns): Rename add_core_fns. + * win32-nat.c (_initialize_core_win32): Update. + * sun3-nat.c (_initialize_core_sun3): Update. + * shnbsd-tdep.c (_initialize_shnbsd_tdep): Update. + * rs6000-nat.c (_initialize_core_rs6000): Update. + * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Update. + * nto-tdep.c (_initialize_nto_tdep): Update. + * ns32knbsd-nat.c (_initialize_ns32knbsd_nat): Update. + * mipsnbsd-tdep.c (_initialize_mipsnbsd_tdep): Update. + * mips-nat.c (_initialize_core_mips): Update. + * mips-linux-tdep.c (_initialize_mips_linux_tdep): Update. + * m68knbsd-nat.c (_initialize_m68knbsd_nat): Update. + * m68klinux-nat.c (_initialize_m68k_linux_nat): Update. + * lynx-nat.c (_initialize_core_lynx): Update. + * irix5-nat.c (_initialize_core_irix5): Update. + * i386-interix-nat.c (_initialize_core_interix): Update. + * cris-tdep.c (_initialize_cris_tdep): Update. + * corelow.c (deprecated_add_core_fns): Update. + * core-regset.c (_initialize_core_regset): Update. + * core-aout.c (_initialize_core_aout): Update. + * armnbsd-nat.c (_initialize_arm_netbsd_nat): Update. + * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Update. + * alpha-nat.c (_initialize_core_alpha): Update. + +2004-04-21 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (registers_e500, registers_7400): Doc fixes. + +2004-04-19 Daniel Jacobowitz <drow@mvista.com> + + * dwarf2read.c (dwarf2_tmp_obstack, dwarf2_free_tmp_obstack): + Delete. + (dwarf_alloc_block): Take a CU argument. Use the comp_unit_obstack. + (read_attribute_value): Update calls to dwarf_alloc_block. + (dwarf2_build_psymtabs_hard): Don't initialize or clean up + dwarf2_tmp_obstack. + (psymtab_to_symtab_1): Likewise. Clean up using + free_stack_comp_unit. + (add_to_cu_func_list): Use the comp_unit_obstack. + +2004-04-19 Joel Brobecker <brobecker@gnat.com> + + * dwarf2read.c (dwarf2_flag_true_p): New function. + (die_is_declaration): Use the function above. Add some comments. + +2004-04-19 Mark Kettenis <kettenis@gnu.org> + + * sparcnbsd-tdep.c (_initialize_sparnbsd_tdep): Specify + architecture when registering sparcnbsd_core_osabi_sniffer. + Adjust comment. + +2004-04-18 Mark Kettenis <kettenis@gnu.org> + + * infcall.c (find_function_addr): Add FUNCTION_START_OFFSET to + return value. + + Based on a patch from Brian Ford <ford@vss.fsi.com>: + * i386-tdep.c: Correct register numbering scheme comments + throughout. + (i386_stab_reg_to_regnum): Rename to i386_dbx_reg_to_regnum. + (i386_dwarf_reg_to_regnum): Rename to i386_svr4_reg_to_regnum. + (i386_coff_init_abi, i386_elf_init_abi): Accomodate renames above. + (i386_gdb_arch_init): Likewise. + + * Makefile.in (ALLDEPFILES): List ppc-sysv-tdep.c, ppcnbsd-nat.c + and ppcnbsd-tdep.c instead of ppc-sysv-tdep.o, ppcnbsd-nat.o and + ppcnbsd-tdep.o. + + * m68k-tdep.h: Tweak comments. + * m68k-tdep.c: Tweak comment. + +2004-04-17 Randolph Chung <tausq@debian.org> + + * Makefile.in (hppa-hpux-tdep.o): Add $(hppa_tdep_h). + * hppa-hpux-tdep.c (hppa-tdep.h): Include. + (hppa_hpux_som_init_abi): Set is_elf to 0. + (hppa_hpux_elf_init_abi): Set is_elf to 1. + * hppa-tdep.c (low_text_segment_address): Remove global. + (record_text_segment_lowaddr): Pass in low address as parameter. Use + section offset to calculate segment address. + (internalize_unwinds): Define low_text_segment_address as local and + pass to record_text_segment_lowaddr for ELF targets. + (hppa_gdbarch_init): Zero fill tdep structure. + (hppa_dump_tdep): Print tdep structure. + * hppa-tdep.h (gdbarch_tdep): Add is_elf member to tdep structure. + +2004-04-17 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_pseudo_register_read): Define. + (hppa_gdbarch_init): Set pseudo_register_read. + * config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Remove. + * regcache.c (supply_register): Remove check for + DEPRECATED_CLEAN_UP_REGISTER_VALUE since we've removed the last user. + +2004-04-17 Randolph Chung <tausq@debian.org> + + * Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h) + * hppa-tdep.h (INSTRUCTION_SIZE): Move from tm-hppa.h. + (hpread_adjust_stack_address): Move to hpread.c. + * hppa-tdep.h (unwind_table_entry, unwind_stub_types, obj_unwind_info, + obj_private_struct): Move from tm-hppa.h. + * hpread.c (hppa-tdep.h): Include. + (hpread_adjust_stack_address): Move from hppa-tdep.c. + (hpread_read_function_type, hpread_read_doc_function_type) + (hpread_process_one_debug_symbol): Call hpread_adjust_stack_address + directly. + * pa64solib.c (hppa-tdep.h): Include. + * somsolib.c (hppa-tdep.h): Include. + * config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type, + inferior_status): Remove unused forward declarations. + (INSTRUCTION_SIZE): Move to hppa-tdep.c. + (unwind_table_entry, unwind_stub_types, obj_unwind_info, + obj_private_struct): Move to hppa-tdep.h. + (HPREAD_ADJUST_STACK_ADDRESS): Remove. + +2004-04-17 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_reg_struct_has_addr, hppa_skip_prologue) + (hppa_skip_trampoline_code, hppa_in_solib_call_trampoline) + (hppa_in_solib_return_trampoline, hppa_cannot_store_register) + (hppa_smash_text_address, hppa_target_read_pc, hppa_target_write_pc): + Remove forward declaration and make static. + (hppa_reg_struct_has_addr): Remove. + +2004-04-16 Joel Brobecker <brobecker@gnat.com> + + * observer.sh: Move comments in sed command to first column. + +2004-04-16 Jason Molenda (jmolenda@apple.com) + + * frame.c: Minor typeo corrections in comments. + +2004-04-16 Joel Brobecker <brobecker@gnat.com> + + * observer.c (observer_test_first_notification_function): Update + function profile. + (observer_test_second_notification_function): Likewise. + (observer_test_third_notification_function): Likewise. + +2004-04-16 Mark Kettenis <kettenis@gnu.org> + + From Brian Ford <ford@vss.fsi.com>: + * i386-tdep.c (i386_coff_init_abi): New function. + * i386-tdep.h (i386_coff_init_abi): New prototype. + * i386-cygwin-tdep.c (i386_cygwin_init_abi): Call it. Use correct + register number translation functions for DWARF and DWARF 2. + +2004-04-16 Joel Brobecker <brobecker@gnat.com> + + * dwarf2read.c: Back out my previous change, it was incorrect. + +2004-04-16 Daniel Jacobowitz <drow@mvista.com> + + * dwarf2read.c: Include "hashtab.h". + (struct dwarf2_cu): Add partial_dies, comp_unit_obstack, + has_namespace_info. + (struct partial_die_info): Add comments. Use bitfields to reduce + memory footprint. Add scope, scope_set, has_specification, + spec_offset, die_parent, die_child, and die_sibling. + (peek_die_abbrev): Add prototype. + (partial_read_comp_unit_head): New function, broken out from + dwarf2_build_psymtabs_hard. + (dwarf2_build_psymtabs_hard): Remove unused variable abbrev_ptr. + Use partial_read_comp_unit_head. Initialize the CU and + comp_unit_obstack. Update calls to read_partial_die and + scan_partial_symbols. Use free_stack_comp_unit and + load_partial_dies. + (scan_partial_symbols): Change PDI to a pointer. Use the child and + sibling pointers to walk partial DIEs. Call fixup_partial_die. + Update calls to helper functions. Remove NAMESPACE argument. + Update comments. + (partial_die_parent_scope, partial_die_full_name): New functions. + (add_partial_symbol): Remove namespace argument. Update call to + pdi_needs_namespace. Use partial_die_full_name. Handle + DW_TAG_namespace. Check has_namespace_info flag. + (pdi_needs_namespace): Remove NAMESPACE argument. Just check the + tag. Handle namespaces. + (add_partial_namespace, add_partial_enumeration): Simplify. + (guess_structure_name): New function, derived from + add_partial_structure. + (add_partial_structure): Remove. + (determine_class_name): Update comment. + (dwarf2_read_abbrevs): Set has_namespace_info flag. + (is_type_tag_for_partial, load_partial_dies): New functions. + (read_partial_die): Pass abbrev and abbrev_len as arguments. + Record specifications instead of following them immediately. + (find_partial_die_in_comp_unit, find_partial_die) + (fixup_partial_die, free_stack_comp_unit) + (hashtab_obstack_allocate, dummy_obstack_deallocate) + (partial_die_hash, partial_die_eq): New functions. + * Makefile.in (hashtab_h): Define. + (dwarf2read.o): Update dependencies. + (observer_inc, observer_h): Move to the correct section. + +2004-04-15 Joel Brobecker <brobecker@gnat.com> + + * dwarf2read.c (dwarf2_attribute_true_p): New function. + (die_is_declaration): Use the function above. Add comment. + +2004-04-15 Joel Brobecker <brobecker@gnat.com> + + * dwarf2read.c (read_structure_scope): Identify stub types + using die_is_declaration() only. + +2004-04-15 Roland McGrath <roland@redhat.com> + + * symfile.c (symbol_file_add_with_addrs_or_offsets): Take ABFD as + argument instead of NAME. + (symbol_file_add, reread_separate_symbols): Call symfile_bfd_open + in call to symbol_file_add_with_addrs_or_offsets. + (build_addr_info): New function, helper for ... + (symbol_file_add_from_memory): New function. + (add_symbol_file_from_memory_command): New function using that. + (_initialize_symfile): Register it for add-symbol-file-from-memory. + (pre_add_symbol_hook): Add const to argument type. + * symfile.h (symbol_file_add_from_memory): Declare it. + +2004-04-15 Mark Kettenis <kettenis@gnu.org> + + * NEWS (New native configurations): Mention OpenBSD/vax. + * configure.host: Add vax-*-openbsd*. + * config/vax/obsd.mh: New file. + * config/vax/nm-obsd.h: New file. + + * vax-tdep.c: Include "regset.h". + (vax_supply_gregset): New function. + (vax_gregset): New variable. + (vax_regset_from_core_section): New function. + (vax_gdbarch_init): Set regset_from_core_section. + * Makefile.in (vax-tdep.o): Update dependencies. + +2004-04-15 Andrew Cagney <cagney@redhat.com> + + * observer.c (normal_stop_subject, observer_notify_normal_stop) + (observer_normal_stop_notification_stub) + (observer_attach_normal_stop, observer_detach_normal_stop): + Delete, replaced by #include "observer.inc". + * infrun.c (normal_stop): Pass "stop_bpstat" to + observer_notify_normal_stop. + * Makefile.in (observer_inc): Define. + (observer.o): Update dependencies. + (observer.h, observer.inc): New rules. + * observer.h: Delete file. + * observer.sh: New file. + +2004-04-15 Mark Kettenis <kettenis@gnu.org> + + * vax-tdep.c (vax_frame_cache): Fix typo. + +2004-04-14 Mark Kettenis <kettenis@gnu.org> + + * NEWS (New native configurations): Mention NetBSD/vax. + * configure.host: Add vax-*-netbsdelf* and vax-*-netbsd*. + * config/vax/nbsdelf.mh: New file. + * config/vax/nbsdaout.mh: New file. + * config/vax/nm-nbsd.h: New file. + * config/vax/nm-nbsdaout.h: New file. + + * vaxnbsd-tdep.c: New file. + * Makefile.in (vaxnbsd-tdep.o): New dependency. + * configure.tgt: Add vax-*-netbsd* and vax-*-openbsd*. + * config/vax/nbsd.mt: New file. + * config/vax/tm-nbsd.h: New file. + + * Makefile.in (vaxbsd-nat.o): New dependency. + + * vax-tdep.h (vax_regnum): Add VAX_R0_REGNUM and VAX_R1_REGNUM. + * vax-tdep.c (vax_store_arguments): Remove struct_return and + struct_addr arguments. Don't push return value address. + (vax_push_dummy_call): Don't pass STRUCT_RETURN and STRUCT_ADDR as + arguments to vax_store_arguments. Store return value address in + R1. + (vax_store_struct_return, vax_extract_return_value) + (vax_store_return_value): Remove functions. + (vax_return_value): New function. + (vax_gdbarch_init): Set return value. Don't set + deprecated_store_struct_return, deprecated_extract_struct_return + and deprecated_store_return_value. + +2004-04-14 Andreas Schwab <schwab@suse.de> + + * ia64-tdep.c (ia64_libunwind_frame_prev_register): Handle null + value buffer. + * libunwind-frame.c (libunwind_frame_prev_register): Likewise. + +2004-04-14 Mark Kettenis <kettenis@gnu.org> + + * vax-tdep.c (vax_store_arguments, vax_push_dummy_call) + (vax_unwind_dummy_id): New functions. + (vax_push_dummy_frame, vax_pop_frame): Remove functions. + (vax_call_dummy_words, sizeof_vax_call_dummy_words): Remove + variables. + (vax_fix_call_dummy): Remove function. + (vax_gdbarch_init): Set push_dummy_call and unwind_dummy_id. + Don't set deprecated_push_dummy_frame, deprecated_pop_frame, + call_dummy_location, deprecated_call_dummy_words, + deprecated_sizeof_call_dummy_words, + deprecated_call_dummy_breakpoint_offset, + deprecated_use_generic_dummy_frames, deprecated_pc_in_call_dummy, + and deprecated_dummy_write_sp. + +2004-04-13 David Carlton <carlton@kealia.com> + + * MAINTAINERS: Move myself to "paper trail" section. + +2004-04-12 Mark Kettenis <kettenis@gnu.org> + + * vax-tdep.c: Include "frame-base.h", "frame-unwind.h" and + "trad-frame.h". + (vax_frame_init_saved_regs): Remove function. + (vax_sigtramp_saved_pc): Remove function. + (vax_frame_saved_pc): Remove function. + (vax_frame_args_address): Remove function. + (vax_frame_num_args): Rewrite. + (vax_frame_chain): Remove function. + (vax_push_dummy_frame): Replace DEPRECATED_FP_REGNUM with + VAX_FP_REGNUM. + (vax_pop_frame): Likewise. + (vax_saved_pc_after_call): Remove function. + (struct vax_frame_cache): New structure. + (vax_frame_cache): New function. + (vax_frame_this_id): New function. + (vax_frame_prev_register): New function. + (vax_frame_unwind): New variable. + (vax_frame_sniffer): New function. + (vax_frame_base_address): New function. + (vax_frame_args_address): New function. + (vax_frame_base): New variable. + (vax_unwind_pc): New function. + (vax_gdbarch_init): Don't set deprecated_init_frame_pc, + deprecated_fp_regnum, deprecated_saved_pc_after_call, + deprecated_frame_chain, deprecated_frame_saved_pc, + deprecated_frame_args_address and + deprecated_frame_init_saved_regs. + * Makefile.in (vax-tdep.o): Update dependencies. + + * vaxbsd-nat.c: New file. + + * vax-tdep.h: Update copyright year. Adjust comments. + (VAX_REGISTER_SIZE, VAX_REGISTER_BYTES, VAX_MAX_REGISTER_RAW_SIZE, + VAX_MAX_REGISTER_VIRTUAL_SIZE): Remove macros. + (vax_regnum): New enum. Replacing... + (VAX_AP_REGNUM, VAX_FP_REGNUM, VAX_SP_REGNUM, VAX_PC_REGNUM) + (VAX_PS_REGNUM): ... these removed macros. + * vax-tdep.c (vax_register_name): Remove prototype. + (vax_register_name): Reorganize somewhat. Use ARRAY_SIZE. + (vax_register_byte, vax_register_raw_size, + vax_register_virtual_size, vax_register_virtual_type): Remove + functions. + (vax_register_type): New function. + (vax_breakpoint_from_pc): Reorganize. + (vax_gdbarch_init): Set register_type. Don't set + deprecated_register_size, deprecated_register_bytes, + deprecated_register_byte, deprecated_register_raw_size, + deprecated_max_register_raw_size, + deprecated_register_virtual_size, + deprecated_max_register_virtual_size and + deprecated_register_virtual_type. Add comment on stack direction. + +2004-04-11 Mark Kettenis <kettenis@gnu.org> + + * amd64-tdep.h (amd64_regnum): Add AMD64_CS_REGNUM, + AMD64_SS_REGNUM, AMD64_DS_REGNUM, AMD64_ES_REGNUM, + AMD64_FS_REGNUM and AMD64_GS_REGNUM. + +2004-04-10 Randolph Chung <tausq@debian.org> + + * MAINTAINERS (write after approval): Add myself. + +2004-04-07 Randolph Chung <tausq@debian.org> + + * hppa-tdep.c (hppa_inner_than): Remove. + (is_pa_2): Remove unused static variable. + (hppa_gdbarch_init): Use core_addr_greaterthan instead of own version. + +2004-03-10 Paul N. Hilfinger <Hilfinger@gnat.com> + + * language.h (language_defn): Add new la_post_parser field. + * parser-defs.h (null_post_parser): New declaration (default for + la_post_parser). + + * parse.c (parse_exp_1): Move code to parse_exp_in_context and + insert call to that function. + (parse_exp_in_context): New function, including code formerly in + parse_exp_1. Calls language-dependent post-parser after + prefixification. + (parse_expression_in_context): New exported function. + (null_post_parser): New definition. + * expression.h (parse_expression_in_context): Add declaration. + + * p-lang.c (pascal_language_defn): Add trivial post-parser. + * c-lang.c (c_language_defn): Ditto. + (cplus_language_defn): Ditto. + (asm_language_defn): Ditto. + (minimal_language_defn): Ditto. + * f-lang.c (f_language_defn): Ditto. + * jv-lang.c (java_language_defn): Ditto. + * language.c (unknown_language_defn): Ditto. + (auto_language_defn): Ditto. + (local_language_defn): Ditto. + * m2-lang.c (m2_language_defn): Ditto. + * scm-lang.c (scm_language_defn): Ditto. + * obj-lang.c (objc_language_defn): Ditto. + +2004-04-10 Mark Kettenis <kettenis@gnu.org> + + * amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Remove function. + (amd64nbsd_mcontext_addr): New function. + (amd64nbsd_init_abi): Initialize TDEP->sigcontext_addr as + amd64nbsd_mcontext_addr. Directly initialize TDEP->sc_reg_offset + with amd64nbsd_r_reg_offset, instead of building it on the fly. + + * corelow.c (core_xfer_partial): Fix coding standards violation. + Add support for TARGET_OBJECT_WCOOKIE. + + * sparc-linux-tdep.c (sparc32_linux_init_abi): Don't set + deprecated_pc_in_sigtramp. + * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise. + * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Likewise. + * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Likewise. + * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Likewise. + * sparc64obsd-tdep.c (sparc64obsd_init_abi): Likewise. + * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Likewise. + * sparcobsd-tdep.c (sparc32obsd_init_abi): Likewise. + + * amd64-linux-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c, + i386-linux-tdep.c, i386-tdep.c, i386nbsd-tdep.c, i386obsd-tdep.c: + Fix typo. + + * amd64-tdep.c (amd64_supply_fxsave): Only fiddle with + I387_FISEG_REGNUM and I387_FOSEG_REGNUM in 64-bit mode. + (amd64_collect_fxsave): Likewise. + + * i386-sol2-tdep.c: Include "gdb_string.h". + (i386_sol2_sigtramp_p): Recognize signal trampoline based on its + name. + * Makefile.in (i386-sol2-tdep.o): Update dependencies. + +2004-04-10 Mark Kettenis <kettenis@gnu.org> + + * i386-sol2-tdep.c: Include "solib-svr4.h". + (i386_sol2_init_abi): Set solib_svr4_fetch_link_map_offsets. + * Makefile.in (i386-sol2-tdep.o): Update dependencies. + * config/i386/tm-i386sol2.h: Include :solib.h". + * config/i386/i386sol2.mh (NATDEPFILES): Remove solib.o, + solib-svr4.o and solib-legacy.o. + * config/i386/i386sol2.mt (TDEPFILES): Add solib.o and + solib-svr4.o. + +2004-04-09 Mark Kettenis <kettenis@gnu.org> + + * amd64-linux-nat.c (fetch_inferior_registers): Correctly check + whether a register is supplied by PTRACE_GETFPREGS. + (store_inferior_registers): Likewise. + * amd64bsd-nat.c (fetch_inferior_registers): Correctly check + whether a register is supplied by PT_GETFPREGS. + (store_inferior_registers): Likewise. + + * config/i386/linux.mt (TDEPFILES): Remove solib-legacy.o. + * config/i386/linux64.mt (TDEPFILES): Likewise. + + * i386-linux-nat.c: Update copyrigth year. Tweak comment. + + * amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new + sigtramp_p member of `struct gdbarch_tdep'. Also check whether + the program counter is in the range specified by `struct + gdbarch_tdep'. + * amd64-linux-tdep.c: Include "symtab.h". + (amd64_linux_pc_in_sigtramp): Remove function. + (amd64_linux_sigtramp_p): New function. + (amd64_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set + deprecated_pc_in_sigtramp. + * amd64nbsd-tdep.c: Include "symtab.h". + (amd64nbsd_sigtramp_p): New function. + (amd64nbsd_init_abi): Initialize TDEP->sigtramp_p. Don't set + deprecated_pc_in_sigtramp. + * amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h". Add a + few comments. + (amd64obsd_pc_in_sigtramp): Remove function. + (amd64obsd_sigtramp_p): New function. + (amd64obsd_init_abi): Initialize TDEP->sigtramp_p. Don't set + deprecated_pc_in_sigtramp. + * i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member. + (i386bsd_pc_ins_sigtramp): Remove prototype. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes. + * i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new + sigtramp_p member of `struct gdbarch_tdep'. Also check whether + the program counter is in the range specified by `struct + gdbarch_tdep'. + (i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions. + (i386_sigtramp_p, i386_svr4_sigtramp_p): New functions. + (i386_go32_pc_in_sigtramp): Remove function. + (i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp. + Initialize TDEP->sigtramp_p. + (i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL. + (i386_gdbarch_init): Initialize TDEP->sigtramp_p. Don't set + deprecated_pc_in_sigtramp. + * i386-linux-tdep.c: Adjust comments. + (i386_linux_pc_in_sigtramp): Remove function. + (i386_linux_sigtramp_p): New function. + (i386_linux_init_abi): Initialize TDEP->sigtramp_p. Don't set + deprecated_pc_in_sigtramp. + * i386-nto-tdep.c: Update copyright year. + (i386nto_pc_in_sigtramp): Remove function. + (i386nto_sigtramp_p): New function. + (i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of + SP_REGNUM. + (i386nto_init_abi): Initialize TDEP->sigtramp_p. Don't set + deprecated_pc_in_sigtramp. + * i386-sol2-tdep.c: Update copyright year. + (i386_sol2_pc_in_sigtramp): Remove function. + (i386_sol2_sigtramp_p): New function. + (i386_sol2_init_abi): Initialize TDEP->sigtramp_p. Don't set + deprecated_pc_in_sigtramp. + * i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function. + (i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions. + (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, + deprecated_sigtramp_start and deprecated_sigtramp_end. + * i386nbsd-tdep.c: Include "frame.h" and "symtab.h". + (i386nbsd_pc_in_sigtramp): Remove function. + (i386nbsd_sigtramp_p): New function. + (i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp, + deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize + TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p. + * i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h". + (i386obsd_pc_in_sigtramp): Remove function. + (i386obsd_sigtramp_p): New function. + (i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove + functions. + (i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp, + deprecated_sigtramp_start, deprecated_sigtramp_end. Initialize + TDEP->sigtramp_p. + * Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o, + amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update + dependencies. + + * config/i386/i386aout.mt: Remove file. + + * configure.tgt: Remove i[34567]86-*-go32*, + i[34567]86-*-msdosdjgpp*, i[34567]86-*-sco*, i[34567]86-*-sysv* + and i[34567]86-*-isc*. Set gdb_target to i386 for + i[34567]86-*-netware* and i[34567]86-*-*. + * config/i386/i386.mt: New file. + * config/i386/embed.mt: Remove file. + * config/i386/go32.mt: Remove file. + * config/i386/i386nw.mt: Remove file. + * config/i386/i386v.mt: Remove file. + * config/i386/tm-go32.h: Remove file. + + * tui/tui-hooks.c: Include "readline/readline.h" after + "gdb_curses.h" instead of before. + * tui/tui-io.c: Likewise. + + * tui/tui.c: Fix typo in comment. + + * sparc64-tdep.c (sparc_address_from_register): Remove function. + +2004-04-08 Andrew Cagney <cagney@redhat.com> + + * breakpoint.h (deprecated_exception_catchpoints_are_fragile) + (deprecated_exception_support_initialized): Declare. + * hppa-hpux-tdep.c (initialize_hp_cxx_exception_support) + (initialize_hp_cxx_exception_support) + (child_enable_exception_callback): Update. + * breakpoint.c (deprecated_exception_catchpoints_are_fragile) + (deprecated_exception_support_initialized): Rename + deprecated_exception_catchpoints_are_fragile and + deprecated_exception_support_initialized. + (breakpoint_init_inferior, breakpoint_init_inferior): Update. + + * symtab.c (deprecated_hp_som_som_object_present): Rename + hp_som_som_object_present. + * symtab.h (deprecated_hp_som_som_object_present): Declare. + * symfile.c (hp_som_som_object_present, RESET_HP_UX_GLOBALS): + Update. Delete extern declaration. + * valops.c (hp_som_som_object_present): Ditto. + * parse.c (deprecated_hp_som_som_object_present) + (parse_nested_classes_for_hpacc): Ditto. + * hpread.c (hp_som_som_object_present, hpread_expand_symtab): Ditto. + * hppa-hpux-tdep.c (hp_som_som_object_present) + (initialize_hp_cxx_exception_support): Ditto. + * eval.c (hp_som_som_object_present, evaluate_subexp_standard): Ditto. + * cp-valprint.c (hp_som_som_object_present) + (cp_print_class_method): Ditto. + * c-typeprint.c (hp_som_som_object_present): + (c_type_print_base): Ditto. + * c-exp.y (hp_som_som_object_present): Ditto. + +2004-04-08 Andrew Cagney <cagney@redhat.com> + + * frame-unwind.c (struct frame_unwind_table, frame_unwind_init) + (frame_unwind_prepend_unwinder, frame_unwind_append_sniffer) + (frame_unwind_find_by_frame): Re-implement the unwind code so + that it can both prepend and append sniffers. Replace + frame_unwind_register_unwinder with frame_unwind_prepend_unwinder. + * tramp-frame.c (tramp_frame_append): Use + frame_unwind_prepend_unwinder. + * frame-unwind.h (frame_unwind_prepend_unwinder): Replace + frame_unwind_register_unwinder. + * tramp-frame.h (tramp_frame_prepend_unwinder): Rename + tramp_frame_append. + * tramp-frame.c (tramp_frame_prepend_unwinder): Update. + * mips-linux-tdep.c (mips_linux_init_abi, mips_linux_init_abi) + (mips_linux_init_abi): Update. + +2004-04-08 Kevin Buettner <kevinb@redhat.com> + + * ppc-linux-tdep.c (ELF_NREG, ELF_NFPREG, ELF_NVRREG) + (ELF_FPREGSET_SIZE): Delete constants formerly used in core + file support. + +2004-04-07 Kevin Buettner <kevinb@redhat.com> + + * ia64-tdep.c (elf.h): Don't include. + (elf/ia64.h) [HAVE_LIBUNWIND_IA64_H]: Include. + +2004-04-07 Jason Molenda (jmolenda@apple.com) + + * frame.h: Typeo corrections in comments. + +2004-04-07 Jim Blandy <jimb@redhat.com> + + * i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for + %esp and %ebp + +2004-04-07 Mark Kettenis <kettenis@gnu.org> + + * config/sparc/linux.mt (TDEPFILES): Remove solib-legacy.o. + * config/sparc/linux64.mt (TDEPFILES): Likewise. + * config/sparc/sol2.mt (TDEPFILES): Add solib.o and solib-svr4.o. + * config/sparc/sol2.mh (NATDEPFILES): Remove solib.o, solib-svr4.o + and solib-legacy.o. + * config/sparc/sol2-64.mt (TDEPFILES): Add solib.o and + solib-svr4.o. + * config/sparc/tm-sol2.h: Update copyright year. Include + "solib.h". + + * sparc-sol2-tdep.c: Update copyright year. Include + "solib-svr4.h". + (sparc32_sol2_init_abi): Set solib_svr4_fetch_link_map_offsets. + * sparc64-sol2-tdep.c: Include "solib-svr4.h". + (sparc64_sol2_init_abi): Set solib_svr4_fetch_link_map_offsets. + * Makefile.in (sparc-sol2-tdep.o, sparc64-sol2-tdep.o): Update + dependencies. + +2004-04-06 Andrew Cagney <cagney@redhat.com> + + * infttrace.c: Include "infttrace.h". + * infttrace.h: Include "target.h". + * Makefile.in (infttrace_h): Update. + (infttrace.o): Update. + +2004-04-06 Andrew Cagney <cagney@redhat.com> + + * hppah-nat.c (hpux_has_forked, hpux_has_vforked) + (hpux_has_execd, hpux_has_syscall_event): Include "infttrace.h", + move extern declarations from here ... + * infttrace.h: ... to here. + * Makefile.in (hppah-nat.o): Update dependencies. + + * hppa-tdep.c (hppa_breakpoint_from_pc): Make static. + (hppa_gdbarch_init): Set gdbarch_breakpoint_from_pc + * config/pa/tm-hppa.h (BREAKPOINT_FROM_PC, BREAKPOINT32): + (hppa_breakpoint_from_pc): Delete. + + * MAINTAINERS: Mark hppa-elf as buildable with -Werror. + +2004-04-05 Andrew Cagney <cagney@redhat.com> + + * hppa-tdep.c: Do not include <sys/types.h>, <sys/param.h>, + <signal.h>, <sys/ptrace.h>, #include "a.out.encap.h", + <sys/file.h>. + +2004-04-06 Randolph Chung <tausq@debian.org> + + Committed by Andrew Cagney (mechanical change). + * hppa-tdep.c: (args_for_find_stub, hp_som_som_object_present, + exception_catchpoints_are_fragile, find_stub_with_shl_get, + cover_find_stub_with_shl_get, initialize_hp_cxx_exception_support, + child_enable_exception_callback, current_ex_event, + null_symtab_and_line, child_get_current_exception_event, + HP_ACC_EH_notify_hook, HP_ACC_EH_set_hook_value, + HP_ACC_EH_notify_callback, HP_ACC_EH_break, HP_ACC_EH_catch_throw, + HP_ACC_EH_catch_catch, __eh_notification, hp_cxx_exception_support, + hp_cxx_exception_support_initialized, eh_notify_hook_addr, + eh_notify_callback_addr, eh_break_addr, eh_catch_catch_addr, + eh_catch_throw_addr, break_callback_sal, setup_d_pid_in_inferior): + Move hpux-specific definitions ... + * hppa-hpux-tdep.c: ... to here. + +2004-04-05 Andrew Cagney <cagney@redhat.com> + + * hppa-tdep.c (hppa_frame_cache): Pass the frame's func to + skip_prologue_using_sal. + +2004-04-05 Andrew Cagney <cagney@redhat.com> + + * config/i386/tm-i386.h: Delete file. + * config/i386/tm-vxworks.h: Update copyright, do not include + "tm-i386.h". + * config/i386/tm-nto.h, config/i386/tm-linux.h: Ditto. + * config/i386/tm-i386sol2.h, config/i386/tm-i386lynx.h: Ditto. + * config/i386/tm-go32.h, config/i386/tm-cygwin.h: Ditto. + * config/i386/ncr3000.mt (TM_FILE): Delete. + * config/i386/interix.mt (TM_FILE): Delete. + * config/i386/i386v.mt (TM_FILE): Delete. + * config/i386/i386nw.mt (TM_FILE): Delete. + * config/i386/i386gnu.mt (TM_FILE): Delete. + * config/i386/i386aout.mt (TM_FILE): Delete. + * config/i386/embed.mt (TM_FILE): Delete. + +2004-04-05 Kevin Buettner <kevinb@redhat.com> + + * frv-tdep.h (fsr0_regnum, acc0_regnum, acc7_regnum, accg0123_regnum) + (accg4567_regnum, msr0_regnum, msr1_regnum, gner0_regnum) + (gner1_regnum, fner0_regnum, fner1_regnum, accg0_regnum) + (accg7_regnum): New constants. + (last_spr_regnum, last_pseudo_regnum): Update. + * frv-tdep.c (new_variant): Initialize names for fsr0, acc0-acc7, + accg0-accg7, msr0, msr1, gner0, gner1, fner0, and fner1. + (frv_pseudo_register_read, frv_pseudo_register_write): Add support + for accg registers. + (frv_register_sim_regno): Update spr_map[]. + +2004-04-04 Andrew Cagney <cagney@redhat.com> + + * config/mips/xm-riscos.h: Delete. + * config/mips/xm-mipsv4.h, config/mips/xm-mips.h: Delete. + * config/mips/tm-mipsv4.h, config/mips/riscos.mh: Delete. + * config/mips/nm-riscos.h, config/mips/nm-news-mips.h: Delete. + * config/mips/nm-mips.h, config/mips/news-mips.mh: Delete. + * config/mips/news-mips.mh, config/m68k/tm-m68kv4.h: Delete. + * config/mips/decstation.mh, config/mips/littlemips.mh: Delete. + * config/mips/mipsv4.mt, config/m68k/tm-sun3.h: Delete. + * config/m68k/xm-sun3os4.h, config/m68k/xm-sun3.h: Delete. + * config/m68k/xm-sun2.h, config/m68k/xm-m68kv4.h: Delete. + * config/m68k/xm-dpx2.h, config/m68k/xm-delta68.h: Delete. + * config/m68k/xm-3b1.h, config/m68k/tm-sun3os4.h: Delete. + * config/m68k/tm-m68klynx.h, config/m68k/tm-dpx2.h: Delete. + * config/m68k/tm-delta68.h, config/m68k/tm-3b1.h: Delete. + * config/m68k/sun3os4.mt, config/m68k/nm-sysv4.h: Delete. + * config/m68k/nm-sun3.h, config/m68k/sun3os4.mh: Delete. + * config/m68k/sun2os3.mh, config/m68k/nm-sun2.h: Delete. + * config/m68k/nm-m68klynx.h, config/m68k/sun3os3.mt: Delete. + * config/m68k/nm-dpx2.h, config/m68k/sun2os3.mt: Delete. + * config/m68k/dpx2.mh, config/m68k/sun3os3.mh: Delete. + * config/m68k/sun2os4.mh, config/m68k/nm-delta68.h: Delete. + * config/m68k/m68kv4.mt, config/m68k/m68klynx.mt: Delete. + * config/m68k/3b1.mt, config/m68k/m68klynx.mh: Delete. + * config/m68k/m68kv4.mh, config/m68k/sun2os4.mt: Delete. + * config/m68k/tm-sun2os4.h, config/m68k/3b1.mh: Delete. + * config/m68k/dpx2.mt, config/m68k/delta68.mt: Delete. + * config/m68k/tm-sun2.h, config/m68k/delta68.mh: Delete. + + * configure.tgt: Remove m68000-*-sunos3*, m68000-*-sunos4*, + m68*-bull-sysv*, m68*-att-*, m68*-motorola-*, m68*-*-lynxos*, + m68*-*-sunos3*, m68*-*-sunos4*, m68*-*-sysv4*, mips*-*-sysv4*. + * configure.host: Remove m680[01]0-sun-sunos3*, + m680[01]0-sun-sunos4*, m68*-att-*, m68*-bull*-sysv*, + m68*-*-lynxos*, m68*-*-sysv4*, m68*-motorola-*, m68*-sun-sunos3*, + m68*-sun-sunos4*, m68*-sun-*, mips-dec-*, mips-little-*, + mips-sony-*, mips-*-mach3*, mips-*-sysv4*, mips-*-sysv*, + mips-*-riscos*. + * NEWS: Mention removed systems. + +2004-04-04 Andrew Cagney <cagney@redhat.com> + + GDB 6.1 release created from 6.1 branch. + +2004-04-04 Andrew Cagney <cagney@redhat.com> + + * gnu-nat.c (gnu_wait): Use memcpy instead of bcopy. + * remote-vxmips.c (vx_read_register, vx_write_register): Ditto. + * remote-vx68.c (vx_read_register, vx_write_register): Ditto. + + * config/vax/xm-vax.h (FAULT_CODE_ORIGIN, INIT_STACK): Delete. + * config/alpha/xm-alphaosf.h (NO_SIGINTERRUPT): Delete. + * config/alpha/xm-alphalinux.h (NO_SIGINTERRUPT): Delete. + +2004-04-03 Jim Blandy <jimb@redhat.com> + + * MAINTAINERS: Chris Faylor has changed employers; add him to + "paper trail" section, and update his E-mail address. + +2004-04-03 Andrew Cagney <cagney@redhat.com> + + * frame-unwind.c (frame_unwind_find_by_frame): Delete check for + generic dummy frames. + * dummy-frame.c: Update copyright. + (dummy_frame_sniffer): Delete check for generic dummy frames. + + * config/pa/tm-hppa.h (REG_PARM_STACK_SPACE): Delete. + * config/pa/tm-hppa64.h (PA20W_CALLING_CONVENTIONS) + (REG_PARM_STACK_SPACE): Delete. + * hppa-tdep.c (hppa64_push_dummy_call, hppa32_push_dummy_call): + Inline reference to REG_PARM_STACK_SPACE. + + * config/pa/tm-hppah.h (FRAME_SAVED_PC_IN_SIGTRAMP) + (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP) + (hppa32_hpux_frame_find_saved_regs_in_sigtramp) + (FRAME_BASE_BEFORE_SIGTRAMP) + (hppa32_hpux_frame_base_before_sigtramp) + (hppa32_hpux_frame_saved_pc_in_sigtramp): Delete. + * config/pa/tm-hppa64.h (hppa64_hpux_frame_saved_pc_in_sigtramp) + (hppa64_hpux_frame_find_saved_regs_in_sigtramp) + (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP) + (FRAME_BASE_BEFORE_SIGTRAMP) + (hppa64_hpux_frame_base_before_sigtramp) + (FRAME_SAVED_PC_IN_SIGTRAMP): Delete. 2004-04-03 Andrew Cagney <cagney@redhat.com> * PROBLEMS: Mention that GDB doesn't build on HP/UX 11.00. +2004-04-02 Andrew Cagney <cagney@redhat.com> + + * sh64-tdep.c (sh64_init_extra_frame_info): Replace + DEPRECATED_CALL_DUMMY_LENGTH with 0, simplify. + * dummy-frame.h: Delete out-of-date comments. + * gdbarch.sh (DEPRECATED_CALL_DUMMY_LENGTH): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + 2004-04-02 Joel Brobecker <brobecker@gnat.com> - Committed by Andrew Cagney <cagney@redhat.com> + Committed by Andrew Cagney <cagney@redhat.com>. * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): Do not take into account an instruction saving a register if we have already seen an earlier instruction saving that same register. +2004-04-02 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * frame.c (legacy_get_prev_frame): Delete references to + DEPRECATED_INIT_FRAME_PC_FIRST. + + * infrun.c (pc_in_sigtramp): Delete function. + (check_sigtramp2): Inline call to pc_in_sigtramp, use + get_frame_type. + +2004-04-02 Andrew Cagney <cagney@redhat.com> + + * infrun.c (handle_step_into_function): Delete code conditional on + legacy_frame_p. + (handle_inferior_event, step_over_function): Ditto. + +2004-04-02 Andrew Cagney <cagney@redhat.com> + + * frame.c (get_prev_frame_1): Exclude signal trampolines from the + "previous frame inner to this frame" test. + +2004-04-02 Andrew Cagney <cagney@redhat.com> + + * frame.c (safe_frame_unwind_memory): New function. + * frame.h (safe_frame_unwind_memory): Declare. Update description + of /safe_/ methods. + * tramp-frame.c (tramp_frame_start): Re-order parmeters, add + "next_frame". Use safe_frame_unwind_memory. + (tramp_frame_sniffer): Update call to tramp_frame_start. + +2004-04-01 Daniel Jacobowitz <drow@mvista.com> + + * dwarf2read.c (dwarf2_objfile_data_key): New. + (struct dwarf2_per_objfile, dwarf2_per_objfile): New. + (dwarf_info_size, dwarf_abbrev_size, dwarf_line_size) + (dwarf_pubnames_size, dwarf_aranges_size, dwarf_loc_size) + (dwarf_macinfo_size, dwarf_str_size, dwarf_ranges_size) + (dwarf_frame_size, dwarf_eh_frame_size, dwarf_info_buffer) + (dwarf_abbrev_buffer, dwarf_line_buffer, dwarf_str_buffer) + (dwarf_macinfo_buffer, dwarf_ranges_buffer, dwarf_loc_buffer): + Remove variables. + (struct dwarf2_pinfo): Remove per-objfile members. Update comments. + (DWARF_ABBREV_SIZE, DWARF_LINE_SIZE) + (DWARF_LOC_SIZE, DWARF_MACINFO_SIZE, DWARF_STR_SIZE) + (DWARF_RANGES_SIZE, DWARF_INFO_BUFFER) + (DWARF_ABBREV_BUFFER, DWARF_LINE_BUFFER, DWARF_STR_BUFFER) + (DWARF_MACINFO_BUFFER, DWARF_RANGES_BUFFER, DWARF_LOC_BUFFER): + Remove macros. + (dwarf2_has_info): Take an objfile argument. Allocate per-objfile + data. + (dwarf2_locate_sections, dwarf2_build_psymtabs) + (dwarf2_build_psymtabs_easy, dwarf2_build_psymtabs_hard) + (skip_one_die, dwarf2_get_pc_bounds, dwarf2_read_abbrevs) + (read_partial_die, read_full_die, read_indirect_string) + (dwarf_decode_line_header, dwarf_decode_macros) + (dwarf2_symbol_mark_computed): Remove use of removed macros. + Update uses of removed variables. + (psymtab_to_symtab_1): Restore per-objfile data pointer. Remove use + of removed macros. + (_initialize_dwarf2_read): New function. + * symfile.h (dwarf2_has_info): Update prototype. + * coffread.c (coff_symfile_read): Update call to dwarf2_has_info. + * elfread.c (elf_symfile_read): Likewise. + +2004-04-01 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (rs6000_dwarf2_stab_reg_to_regnum): New, unified + function for register numbers on all the rs6000-derived targets. + (rs6000_gdbarch_init): Don't register a separate + gdbarch_dwarf2_reg_to_regnum function for the E500. Use + rs6000_dwarf2_stab_reg_to_regnum for both Dwarf 2 and stabs on all + variants. + + * i386-tdep.c: Add FIXME regarding STABS vs. Dwarf 2 register + numbering. + +2004-04-01 Paul N. Hilfinger <Hilfinger@gnat.com> + + * valarith.c: Update copyright notice. + (value_add): Handle range types. + (value_sub): Ditto. + (value_equal): Ditto. + (value_less): Ditto. + (value_neg): Ditto. + (value_complement): Ditto. + (value_binop): Simplify slightly by using is_integral_type and + eliminiating unnecessary COERCE_ENUMs. + +2004-03-31 Andrew Cagney <cagney@redhat.com> + + * frame.h (frame_unwind_id): Declare. + * frame.c (frame_unwind_id): New function. + (get_prev_frame_1): New function. + (frame_debug_got_null_frame): New function. + (get_prev_frame): Use frame_debug_got_null_frame. Move unwind + code proper to prev_frame, update description. + * infrun.c (step_over_function): Use frame_unwind_id. + 2004-04-31 J. Brobecker <brobecker@gnat.com> * hppa-tdep.c (hppa32_push_dummy_call): Set the Stack Pointer. (hppa64_push_dummy_call): Likewise. +2004-03-30 Jim Blandy <jimb@redhat.com> + + From Ulrich Weigand: + * utils.c (query): Do not use a va_list variable multiple times. + +2004-03-29 Daniel Jacobowitz <drow@mvista.com> + + * Makefile.in (linux_nat_h): Update dependencies. + * configure.in: Check for <gnu/libc-version.h>. + * configure: Regenerate. + * config.in: Regenerate. + * linux-nat.h: Include "target.h". Add waitstatus field to + struct lwp_info. + * lin-lwp.c (add_lwp): Initialize waitstatus.kind. + (lin_lwp_attach_lwp): Don't attach to LWPs we have already attached + to. + (lin_lwp_handle_extended): New function. Handle clone events. + (wait_lwp): Use lin_lwp_handle_extended. Update comment about + thread exit events. + (child_wait): Handle clone events. + (lin_lwp_wait: Use lin_lwp_handle_extended and handle clone events. + * linux-nat.c (linux_enable_event_reporting): Turn on + PTRACE_O_TRACECLONE. + (linux_handle_extended_wait): Handle clone events. + * thread-db.c: Include <gnu/libc-version.h>. + (struct private_thread_info): Add dying flag. + (enable_thread_event_reporting): Enable TD_DEATH for glibc 2.2 and + higher. + (attach_thread): Update comments. Handle dying threads. + (detach_thread): Set the dying flag. + (check_event): Always call attach_thread. + 2004-03-29 Daniel Jacobowitz <drow@mvista.com> * mips-tdep.c (mips_pdr_data): New. (non_heuristic_proc_desc): Use objfile_data and set_objfile_data. (_initialize_mips_tdep): Initialize mips_pdr_data. -2004-03-29 GDB Administrator <gdbadmin@sourceware.org> +2004-03-29 Corinna Vinschen <vinschen@redhat.com> + + * minsyms.c (install_minimal_symbols): Move dropping leading + char from linkage name from here... + (prim_record_minimal_symbol_and_info): ...to here. Simplify + test for "__gnu_compiled*" symbols. - * version.in: Bump to version 6.0.91. +2004-03-28 Jim Blandy <jimb@redhat.com> + + * rs6000-tdep.c (skip_prologue): Recognize moves from argument + registers to temp register r0 and byte stores as prologue + instructions. 2004-03-28 Andrew Cagney <cagney@redhat.com> @@ -39,6 +8538,16 @@ * tui/tui-regs.c (tui_show_registers): Make sure the TUI is active and switch the layout to force a display of register window. +2004-02-26 J. Brobecker <brobecker@gnat.com> + + * amd64-tdep.c (amd64_classify): make RANGE_TYPE objects be part + of the INTEGER class. + +2004-03-26 Jim Blandy <jimb@redhat.com> + + * ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight + bytes long on PPC GNU/Linux. + 2004-03-26 David Carlton <carlton@kealia.com> * PROBLEMS: Refer to gdb/1588 instead of gdb/826. @@ -76,6 +8585,134 @@ * remote-rdp.c (remote_rdp_fetch_register): Use MAX_REGISTER_SIZE. (remote_rdp_store_register): Likewise. +2004-03-24 Daniel Jacobowitz <drow@mvista.com> + + * Makefile.in (mips-linux-tdep.o): Update dependencies. + * mips-tdep.c (mips_gdbarch_init): Move frame predicates + to after osabi initialization. + * mips-linux-tdep.c: Include "trad-frame.h" and "tramp-frame.h". + (mips_linux_o32_sigframe_init, mips_linux_n32n64_sigframe_init): New + functions. + (mips_linux_o32_sigframe, mips_linux_o32_rt_sigframe) + (mips_linux_n32_rt_sigframe, mips_linux_n64_rt_sigframe): New + variables. + (mips_linux_init_abi): Append signal trampoline unwinders. + +2004-03-24 Andrew Cagney <cagney@redhat.com> + + * tramp-frame.h (TRAMP_SENTINEL_INSN): Define, document. + * tramp-frame.c: Include "gdb_assert.h". + (tramp_frame_start): Use TRAMP_SENTINEL_INSN. Use ULONGEST and + correct sizeof. + (tramp_frame_append): Validate the tramp frame's instructions. + * Makefile.in (tramp-frame.o): Update dependencies. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * trad-frame.h (trad_frame_set_reg_addr): Declare. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * MAINTAINERS (Past Maintainers): Add Mark Salter and Fernando + Nasser as past testsuite/lib/ (and other) maintainers. + +2004-03-23 Daniel Jacobowitz <drow@mvista.com> + + * infcmd.c (attach_command): Reread symbols if we already have + an exec file. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * rs6000-tdep.c (frame_get_saved_regs): Delete unused function. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (SIGTRAMP_START, SIGTRAMP_END): Deprecate. + * gdbarch.h, gdbarch.c: Re-generate. + * i386obsd-tdep.c (i386obsd_init_abi): Update. + * i386nbsd-tdep.c (i386nbsd_init_abi): Update. + * i386bsd-tdep.c (i386bsd_init_abi): Update. + * config/vax/tm-vaxbsd.h (DEPRECATED_SIGTRAMP_END) + (DEPRECATED_SIGTRAMP_START): Update. + * config/m68k/tm-nbsd.h (DEPRECATED_SIGTRAMP_END) + (DEPRECATED_SIGTRAMP_START): Update. + * blockframe.c (find_pc_sect_partial_function): Update. + * arch-utils.c (legacy_pc_in_sigtramp): Update. + +2004-03-23 Daniel Jacobowitz <drow@mvista.com> + + * remote.c (remote_open_1): Reopen the exec file and reread symbols + if necessary. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (PC_IN_SIGTRAMP): Change to a function with + predicate, deprecate. + * gdbarch.h, gdbarch.c: Re-generate. + * alpha-linux-tdep.c (alpha_linux_init_abi): Update. + * alpha-osf1-tdep.c (alpha_osf1_init_abi): Update. + * alpha-tdep.c (alpha_sigtramp_frame_sniffer): Update. + * alphafbsd-tdep.c (alphafbsd_init_abi): Update. + * alphanbsd-tdep.c (alphanbsd_init_abi): Update. + * amd64-linux-tdep.c (amd64_linux_init_abi): Update. + * amd64-tdep.c (amd64_sigtramp_frame_sniffer): Update. + * amd64nbsd-tdep.c (amd64nbsd_init_abi): Update. + * amd64obsd-tdep.c (amd64obsd_init_abi): Update. + * arm-tdep.c (arm_sigtramp_unwind_sniffer): Update. + * blockframe.c (find_pc_partial_function): Update. + * breakpoint.c (bpstat_what): Update. + * frame.c (frame_type_from_pc, legacy_get_prev_frame): Update. + * frv-linux-tdep.c (frv_linux_init_abi): Update. + * frv-tdep.c (frv_sigtramp_frame_sniffer): Update. + * hppa-hpux-tdep.c (hppa_hpux_init_abi): Update. + * i386-interix-tdep.c (i386_interix_init_abi): Update. + * i386-linux-tdep.c (i386_linux_init_abi): Update. + * i386-nto-tdep.c (i386nto_init_abi): Update. + * i386-sol2-tdep.c (i386_sol2_init_abi): Update. + * i386-tdep.c (i386_sigtramp_frame_sniffer) + (i386_svr4_init_abi, i386_go32_init_abi, i386_gdbarch_init): Update. + * i386bsd-tdep.c (i386bsd_init_abi): Update. + * i386nbsd-tdep.c (i386nbsd_init_abi): Update. + * i386obsd-tdep.c (i386obsd_init_abi): Update. + * ia64-tdep.c (ia64_sigtramp_frame_sniffer): Update. + * infrun.c (pc_in_sigtramp): Update. + * m68k-tdep.c (m68k_sigtramp_frame_sniffer): Update. + * m68klinux-tdep.c (m68k_linux_init_abi): Update. + * mips-tdep.c (mips_gdbarch_init): Update. + * mipsnbsd-tdep.c (mipsnbsd_init_abi): Update. + * ppc-linux-tdep.c: Update comment. + * ppcnbsd-tdep.c (ppcnbsd_init_abi): Update. + * shnbsd-tdep.c (shnbsd_init_abi): Update. + * sparc-linux-tdep.c (sparc32_linux_init_abi): Update. + * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Update. + * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Update. + * sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Update. + * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Update. + * sparc64obsd-tdep.c (sparc64obsd_init_abi): Update. + * sparcnbsd-tdep.c (sparc32nbsd_init_abi): Update. + * sparcobsd-tdep.c (sparc32obsd_init_abi): Update. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * tramp-frame.h, tramp-frame.h: New files. + * Makefile.in (SFILES, tramp_frame_h, COMMON_OBS, tramp-frame.o): + Update rules to include "tramp-frame.h" and "tramp-frame.c". + + * Makefile.in: Update all dependencies. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * Makefile.in (trad_frame_h): Add $(frame_h). + * trad-frame.h: Update copyright. Include "frame.h". + (struct trad_frame_cache, trad_frame_cache_zalloc): Declare. + (trad_frame_set_id, trad_frame_get_id): Declare. + (trad_frame_set_reg_addr, trad_frame_get_register): Declare. + * trad-frame.c: Update copyright. + (struct trad_frame_cache): Define. + (trad_frame_cache_zalloc): New function. + (trad_frame_set_id, trad_frame_get_id): New functions. + (trad_frame_set_reg_addr, trad_frame_get_register): New functions. + 2004-03-22 Andrew Cagney <cagney@redhat.com> * s390-tdep.c (struct s390_stub_unwind_cache): Rename @@ -92,11 +8729,190 @@ * s390-tdep.c (s390_pltstub_frame_sniffer): Handle invalid function pointer calls like PLT calls. +2004-03-22 Daniel Jacobowitz <drow@mvista.com> + + * mips-tdep.c (non_heuristic_proc_desc): Search using the specified + PC rather than the partial function start address. Use the start + address to sanity check the found PDR. + +2004-03-22 Daniel Jacobowitz <drow@mvista.com> + + * lin-lwp.c (lin_lwp_wait): Pass the LWP ID to + linux_handle_extended_wait. + +2004-03-22 Andrew Cagney <cagney@redhat.com> + + * rs6000-tdep.c (frame_initial_stack_address): Delete unused + function. + + * frame.h (generic_pop_current_frame): Delete declaration. + (deprecate_pop_dummy_frame): Deprecate + generic_pop_dummy_frame. + * dummy-frame.c (deprecated_pop_dummy_frame): Update. + (generic_pop_current_frame): Delete function. + * mn10300-tdep.c (mn10300_pop_frame): Eliminate call to + generic_pop_current_frame. + * v850-tdep.c (v850_pop_frame): Update. + * mcore-tdep.c (mcore_pop_frame): Update. + * sh64-tdep.c (sh64_pop_frame): Update. + * h8300-tdep.c (h8300_pop_frame): Update. + +2004-03-22 Andrew Cagney <cagney@redhat.com> + + * frame.h (deprecated_pc_in_call_dummy): Rename + generic_pc_in_call_dummy. + * dummy-frame.h (pc_in_dummy_frame): Delete declaration. + * dummy-frame.c (deprecated_pc_in_call_dummy): Rename + generic_pc_in_call_dummy. + (pc_in_dummy_frame): Make static. + * gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Update. + * gdbarch.h, gdbarch.c: Re-generate. + * dummy-frame.c (dummy_frame_sniffer): Simplify. + * frame.c (frame_type_from_pc): Call deprecated_pc_in_call_dummy. + (legacy_get_prev_frame): Ditto. + * inferior.h: Delete reference to generic_pc_in_call_dummy in + comment. + +2004-03-21 Andrew Cagney <cagney@redhat.com> + + * inferior.h (deprecated_pc_in_call_dummy_at_entry_point): Delete + declaration and out-of-date comment. + * blockframe.c (deprecated_pc_in_call_dummy_at_entry_point): + Delete function. + * mn10300-tdep.c (mn10300_gdbarch_init): Do not set + deprecated_pc_in_call_dummy. + + * infrun.c (handle_inferior_event): For non legacy frames, use the + frame ID and frame type to identify a signal trampoline. Update + comments. + +2004-03-21 Nathan J. Williams <nathanw@wasabisystems.com> + + * mipsnbsd-tdep.c: Update copyright. Include "mips-tdep.h". + * Makefile.in (mipsnbsd-tdep.o): Update dependencies. + +2004-03-21 Andrew Cagney <cagney@redhat.com> + + * frame-unwind.h: Update copyright. + (struct frame_data): Add opaque declaration. + (frame_sniffer_ftype): Declare. + (struct frame_unwind): Add "unwind_data" and "sniffer". + (frame_unwind_register_unwinder): Declare. + (frame_unwind_find_by_frame): Add parameter "this_cache". + * frame.c (get_frame_id, create_new_frame, legacy_get_prev_frame) + (legacy_get_prev_frame, legacy_get_prev_frame) + (get_frame_type): Pass the prologue_cache to + frame_unwind_find_by_frame. + * frame-unwind.c (struct frame_unwind_table_entry): Add field + "unwinder". + (frame_unwind_register_unwinder): New function. + (frame_unwind_find_by_frame): Handle an unwind sniffer. + +2004-03-20 Paul Hilfinger <hilfingr@nile.gnat.com> + + * bcache.c (print_percentage): Use floating point to avoid + incorrect results when portion*100 overflows. + +2004-03-19 Kevin Buettner <kevinb@redhat.com> + + * ppc_tdep.h (ppc_linux_frame_saved_pc) + (ppc_linux_init_extra_frame_info) + (ppc_linux_frameless_function_invocation) + (ppc_linux_frame_init_saved_regs, ppc_linux_frame_chain) + (rs6000_frame_saved_pc, rs6000_init_extra_frame_info) + (rs6000_frameless_function_invocation, rs6000_frame_init_saved_regs) + (rs6000_frame_chain): Delete declarations. + * ppc-linux-tdep.c (ppc_linux_frame_saved_pc) + (ppc_linux_init_extra_frame_info) + (ppc_linux_frameless_function_invocation) + (ppc_linux_frame_init_saved_regs, ppc_linux_frame_chain): Delete. + (ppc_linux_init_abi): Remove registration of above deleted functions. + * rs6000-tdep.c (rs6000_init_extra_frame_info) + (rs6000_frame_init_saved_regs, rs6000_init_frame_pc_first) + (rs6000_frame_args_address, rs6000_saved_pc_after_call) + (rs6000_pop_frame, rs6000_frameless_function_invocation) + (rs6000_frame_saved_pc, rs6000_frame_chain): Delete. + (rs6000_gdbarch_init): Remove registration of above deleted functions. + Use rs6000_unwind_pc(), rs6000_frame_sniffer(), + rs6000_unwind_dummy_id(), and rs6000_frame_base_sniffer() for + frame management for all OSABIs. + 2004-03-19 Andrew Cagney <cagney@redhat.com> + Committed by Kevin Buettner <kevinb@redhat.com>. + + * ppc-linux-tdep.c: Include "trad-frame.h", and "frame-unwind.h". + Update copyright. + (struct ppc_linux_sigtramp_cache, ppc_linux_sigtramp_cache) + (ppc_linux_sigtramp_this_id, ppc_linux_sigtramp_prev_register) + (ppc_linux_sigtramp_unwind, ppc_linux_sigtramp_sniffer) + (ppc_linux_init_abi): Add both 32- and 64-bit signal trampoline + unwinders. #ifdef legacy frame code. + * rs6000-tdep.c: Include "trad-frame.h", "frame-unwind.h", and + "frame-base.h". + (rs6000_unwind_pc, rs6000_unwind_dummy_id) + (struct rs6000_frame_cache, rs6000_frame_cache) + (rs6000_frame_this_id, rs6000_frame_prev_register) + (rs6000_frame_sniffer, rs6000_frame_unwind) + (rs6000_frame_base_address, rs6000_frame_base_sniffer) + (rs6000_frame_base): Implement a traditional frame unwinder. + (rs6000_gdbarch_init): When unknown, NetBSD, or GNU/Linux use the + frame unwinder. + +2004-03-19 Kevin Buettner <kevinb@redhat.com> + + * breakpoint.c (adjust_breakpoint_address): Don't adjust + breakpoint address for watchpoints or the catch eventpoints. + Add new paramter ``bptype''. Adjust all callers. + +2004-03-19 Andrew Cagney <cagney@redhat.com> + + * config/pa/tm-hppa.h (GDB_TARGET_IS_HPPA): Delete unused macro. + * PROBLEMS: Delete note that ARM does not use frame code, problem fixed. +2004-03-18 Andrew Cagney <cagney@redhat.com> + + * stack.c (return_command): Delete code wrapped in #ifdef + DEPRECATED_CALL_DUMMY_HAS_COMPLETED, macro no longer defined. + + * rs6000-tdep.c (skip_prologue): Record only the first LR save. + +2004-03-18 Andrew Cagney <cagney@redhat.com> + + * config/mips/tm-nbsd.h: Replace IN_SIGTRAMP with + DEPRECATED_IN_SIGTRAMP. + * config/powerpc/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Ditto. + * config/mips/tm-linux.h (DEPRECATED_IN_SIGTRAMP) Ditto. + * config/mips/tm-irix6.h (DEPRECATED_IN_SIGTRAMP): Ditto. + * config/mips/tm-irix5.h (DEPRECATED_IN_SIGTRAMP): Ditto. + * config/ia64/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Ditto. + * config/ia64/tm-aix.h (DEPRECATED_IN_SIGTRAMP): Ditto. + * config/arm/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Ditto. + * config/arm/tm-embed.h (DEPRECATED_IN_SIGTRAMP): Ditto. + * arch-utils.c (legacy_pc_in_sigtramp): Ditto. + * arch-utils.h: Remove reference to IN_SIGTRAMP in comment. + +2004-03-18 Andrew Cagney <cagney@redhat.com> + + * frame-base.c: Update copyright. Include "gdb_obstack.h". + (struct frame_base_table_entry): Define. + (struct frame_base_table): Re-implement as a linked list. + (frame_base_init): Re-implement. + (frame_base_table): Delete function. + (append_predicate): Delete function. + (frame_base_append_sniffer): Update. + (frame_base_set_default): Update. + (frame_base_find_by_frame): Update. + (_initialize_frame_base): Use gdbarch_data_register_pre_init. + * Makefile.in (frame-base.o): Update dependencies. + +2004-03-17 Andrew Cagney <cagney@redhat.com> + + * frame.c (legacy_get_prev_frame): Pass correct frame to + frame_unwind_find_by_frame. + 2004-03-17 David Carlton <carlton@kealia.com> * NEWS: Mention C++ nested types and namespaces @@ -112,6 +8928,64 @@ * dwarf2read.c (process_structure_scope): Process children even when we're a declaration. +2004-03-16 Andrew Cagney <cagney@redhat.com> + + * symtab.h (find_pc_sect_partial_function): Delete declaration. + * blockframe.c (find_pc_partial_function) + (find_pc_sect_partial_function): Merge into a single + find_pc_partial_function. + +2004-03-16 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-nat.c: s/regno/regnum/g. + (fetch_inferior_registers): Use I386_ST0_REGNUM instead of + FP0_REGNUM. + (store_inferior_registers): Likewise. + +2004-03-16 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-nat.c (fill_fpregset): Call i387_collect_fsave instead + of i387_fill_fsave. + (store_inferior_registers): Call i387_collect_fsave and + i387_collect_fxsave instead of i387_fill_fsave and + i387_fill_fxsave. + +2004-03-15 Andrew Cagney <cagney@redhat.com> + + * Makefile.in (frame-unwind.o): Update dependencies. + * frame-unwind.c: Include "gdb_obstack.h". + (frame_unwind_init): Replace "gdbarch" parameter with an "obstack" + parameter. + (append_predicate): Delete function. + (struct frame_unwind_table_entry): New structure. + (struct frame_unwind_table): Replace "sniffer" with "head" and + "tail". + (frame_unwind_append_sniffer): Update. + (frame_unwind_find_by_frame): Update. + (_initialize_frame_unwind): Registe frame_unwind_init using + gdbarch_data_register_pre_init. + +2004-03-15 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-nat.c: Update copyright year. + (CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER): Undefine and then + define unconditionally. + +2004-03-15 Mark Kettenis <kettenis@gnu.org> + + * i387-tdep.h (i387_collect_fsave): New prototype. + * i387-tdep.c (i387_collect_fsave): New function containing most + of the code from i387_fill_fsave. + (i387_fill_fsave): Call i387_collect_fsave. + +2004-03-15 Mark Kettenis <kettenis@gnu.org> + + * i386-linux-tdep.c: Update copyright year. + (i386_linux_svr4_fetch_link_map_offsets): Remove function. + (i386_linux_init_abi): Set solib_svr4_fetch_link_maop_offsets to + svr4_ilp32_link_map_offsets instead of + i386_linux_svr4_fetch_link_map_offsets. + 2004-03-15 David Carlton <carlton@kealia.com> Fix for PR c++/1553: @@ -123,10 +8997,144 @@ (determine_prefix_aux, class_name): Delete. (read_namespace): Set die->type. +2004-03-15 Kevin Buettner <kevinb@redhat.com> + + * breakpoint.c (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): Delete + unused macro definition. The definition in target.h (or perhaps + elsewhere) takes precedence. + +2004-03-15 Andrew Cagney <cagney@redhat.com> + + * ppc-tdep.h: Update copyright. + (ppc_linux_supply_gregset, ppc_linux_supply_fpregset): Change + function signatures to match "regsets.h". + * ppc-linux-tdep.c: Include "regset.h". + (ELF_GREGSET_SIZE): Delete. + (right_supply_register): New function. + (ppc_linux_supply_fpregset, ppc_linux_supply_gregset): Rewrite + using right_supply_register. + (ppc32_linux_supply_gregset, ppc64_linux_supply_gregset): New + functions. + (ppc64_linux_gregset, ppc32_linux_gregset): Define. + (ppc_linux_init_abi): Register ppc_linux_regset_from_core_section. + (_initialize_ppc_linux_tdep): Do not register + ppc_linux_regset_core_fns. + (ppc_linux_regset_from_core_section): Replace + fetch_core_registers. + (ppc_linux_regset_core_fns): Delete. + * ppc-linux-nat.c: (right_fill_reg): New function. + (supply_gregset): Update call to ppc_linux_supply_gregset. + (fill_gregset): Clear the register set, use right_fill_reg. + (supply_fpregset): Update call to ppc_linux_supply_fpregset. + (fill_fpregset): Use right_fill_reg, correctly compute FP offsets. + + * rs6000-tdep.c (rs6000_register_virtual_type): Make registers + unsigned. + +2004-03-15 Andrew Cagney <cagney@redhat.com> + + * gdbarch.sh (gdbarch_data_pre_init_fytpe) + (gdbarch_data_register_pre_init, gdbarch_data_post_init_fytpe) + (gdbarch_data_register_post_init): Replace gdbarch_data_init_ftype + and register_gdbarch_data. + (deprecated_set_gdbarch_data): Rename set_gdbarch_data. + (struct gdbarch_data): Replace "init" by "pre_init" and + "post_init". + * gdbarch.h, gdbarch.c: Re-generate. + * dwarf2-frame.c (dwarf2_frame_init): Replace "gdbarch" paramter + with"obstack", use OBSTACK_ZALLOC. + (dwarf2_frame_ops): Delete. + (dwarf2_frame_set_init_reg): Use gdbarch_data. + (dwarf2_frame_init_reg): Use gdbarch_data. + (_initialize_dwarf2_frame): Use gdbarch_data_register_pre_init. + * solib-svr4.c (set_solib_svr4_fetch_link_map_offsets) + (_initialize_svr4_solib): Update. + * user-regs.c (_initialize_user_regs): Update. + * reggroups.c (_initialize_reggroup): Update. + * regcache.c (_initialize_regcache): Update. + * mips-linux-tdep.c (_initialize_mips_linux_tdep): Update. + * libunwind-frame.c (_initialize_libunwind_frame): Update. + * gnu-v3-abi.c (init_gnuv3_ops): Update. + * frame-unwind.c (_initialize_frame_unwind): Update. + * frame-base.c (_initialize_frame_base): Update. + * user-regs.c (user_reg_add): Update. + * reggroups.c (reggroup_add): Update. + * mips-linux-tdep.c (set_mips_linux_register_addr): Update. + * libunwind-frame.c (libunwind_frame_set_descr): Update. + * frame-unwind.c (frame_unwind_append_sniffer): Update. + * frame-base.c (frame_base_table): Update. + * remote.c (_initialize_remote): Update. + * gdb_obstack.h (OBSTACK_ZALLOC, OBSTACK_CALLOC): Define. + +2004-03-15 Andrew Cagney <cagney@redhat.com> + + * cris-tdep.c (bfd_lookup_symbol): Delete unused function. + +2004-03-15 Kevin Buettner <kevinb@redhat.com> + + * Makefile.in (frv-linux-tdep.o): Add dependencies. + * frv-linux-tdep.c: New file. + * frv-tdep.c (struct gdbarch_tdep): Add new field + ``sigcontext_reg_addr''. + (frv_set_sigcontext_reg_addr, frv_sigtramp,frame_cache) + (frv_sigtramp_frame_this_id, frv_sigtramp_frame_prev_register) + (frv_sigramp_frame_sniffer): New functions. + (frv_sigtramp_frame_unwind): New static global. + (frv_gdbarch_init): Hook in ABI-specific overrides. Hook up frame + sniffers. + * frv-tdep.h (frv_set_sigcontext_reg_addr): New function. + * config/frv/frv.mt (TDEPFILES): Add frv-linux-tdep.o. + +2004-03-15 Kevin Buettner <kevinb@redhat.com> + + * frv-tdep.c (frv_analyze_prologue): Terminate prologue scan, + but not via a call to error(), when unable to read memory. + +2004-03-15 Kevin Buettner <kevinb@redhat.com> + + * frv-tdep.c (frv_call_dummy_words): Delete. + (frv_frame_unwind_cache): Delete unused variable, ``prev_sp''. + +2004-03-15 Andrew Cagney <cagney@redhat.com> + + * infrun.c (handle_step_into_function, step_over_function): Only + update and use STEP_FRAME_ID when the system is using legacy + frames. Update comments. + +2004-03-14 Mark Kettenis <kettenis@gnu.org> + + * amd64-linux-tdep.h: Remove file. + * amd64-linux-tdep.c: Don't include "inferior.h" and + "amd64-linux-tdep.h". Include "frame.h" and "solib-svr4.h". + (USER_R15, USER_R14, USER_R13, USER_R12, USER_RBP, USER_RBX) + (USER_R11, USER_R10, USER_R9, USER_R8, USER_RAX, USER_RCX) + (USER_RDX, USER_RSI, USER_RDI, USER_RIP, USER_CS, USER_EFLAGS) + (USER_RSP, USER_SS, USER_DS, USER_ES, USER_FS, USER_GS): Remove + macros. + (user_to_gdb_regmap): Remove variable. + (amd64_linux_gregset_reg_offset): New variable. + (amd64_core_fns): Remove variable. + (fetch_core_registers): Remove function. + (amd64_linux_supply_gregset, amd64_linux_fill_gregset): Remove + functions. + (_initialize_amd64_linux_tdep): Don't set add_core_fns. + * amd64-linux-nat.c: Don't include "amd64-linux-tdep.h". + * Makefile.in (amd64_linux_tdep_h): Remove. + (amd64-linux-nat.o): Update dependencies. + (amd64-linux-tdep.o): Update dependencies. + + * amd64-linux-nat.c (GETFPREGS_SUPPLIES): Remove macro. + (fetch_regs, fetch_fpregs, store_regs, store_fpregs): Remove + functions. + (fetch_inferior_registers, store_inferior_registers): Rewrite. + + * amd64-tdep.h (amd64_fill_fxsave): Remove prototype. + * amd64-tdep.c (amd64_fill_fxsave): Remove function. + 2004-03-14 Daniel Jacobowitz <drow@mvista.com> * dwarf2read.c (read_structure_type): Rename from - read_structure_scope. Don't create a symbol or call process_die. + read_structure_scope. Don't create a symbol or call process_die. Return immediately if die->type is set. Call read_type_die before dwarf2_add_member_fn. (process_structure_scope): New function. @@ -193,11 +9201,86 @@ * NEWS (New native configurations): Mention OpenBSD/amd64. -2004-03-10 J. Brobecker <brobecker@gnat.com> + * config/i386/nm-fbsd.h: Include "config/nm-bsd.h". + (PTRACE_ARG3_TYPE, FETCH_INFERIOR_REGISTERS, ATTACH_DETACH): + Remove defines. + * config/i386/nm-fbsd64.h: Likewise. + * config/i386/nm-obsd.h: Likewise. + * config/sparc/nm-fbsd.h: Likewise. Update copyright year. + * config/alpha/nm-fbsd.h: Likewise. Update copyright year. + +2004-03-12 Kevin Buettner <kevinb@redhat.com> + + * frv-tdep.c (set_variant_scratch_registers): New function. + * frv-tdep.h (scr0_regnum, scr1_regnum, scr2_regnum, scr3_regnum): + New constants. + + From Richard Sandiford <rsandifo@redhat.com>: + * frv-tdep.c (frv_gdbarch_init): Add FR450 support. + +2004-03-12 Kevin Buettner <kevinb@redhat.com> + + * frv-tdep.c, frv-tdep.h (first_gpr_regnum, sp_regnum, fp_regnum) + (struct_return_regnum, last_gpr_regnum, first_fpr_regnum) + (last_fpr_regnum, pc_regnum, first_spr_regnum, psr_regnum, ccr_regnum) + (cccr_regnum, fdpic_loadmap_exec_regnum, fdpic_loadmap_interp_regnum) + (tbr_regnum, brr_regnum, dbar0_regnum, dbar1_regnum, dbar2_regnum) + (dbar3_regnum, lr_regnum, lcr_regnum, iacc0h_regnum, iacc0l_regnum) + (last_spr_regnum, frv_num_regs, first_pseudo_regnum, iacc0_regnum) + (last_pseudo_regnum, frv_num_pseudo_regs): Move constant (enum) + definitions from frv-tdep.c to frv-tdep.h. + +2004-03-12 Kevin Buettner <kevinb@redhat.com> + + Add shared library support for FR-V FDPIC ABI: + * Makefile.in (solib-frv.o): Add dependencies. + * frv-tdep.c (find_func_descr, frv_convert_from_func_ptr_addr): + New functions. + (frv_push_dummy_call): Add support for FDPIC ABI. + (frv_gdbarch_init): Call set_gdbarch_convert_from_func_ptr_addr() + for FDPIC ABI. + * frv-tdep.h (frv_fdpic_find_global_pointer): Declare. + (frv_fdpic_find_canonical_descriptor): Declare. + * solib-frv.c: New file. + * config/frv/frv.mt (TDEPFILES): Add solib.o and solib-frv.o. + * config/frv/tm-frv.h (solib.h): Include. + +2004-03-12 Kevin Buettner <kevinb@redhat.com> + + * Makefile.in (elf_frv_h, frv_tdep_h): Define. + (frv-tdep.o): Update dependencies. + * frv-tdep.h: New file. + * frv-tdep.c (elf-bfd.h, elf/frv.h, osabi.h, frv-tdep.h): Include. + (fdpic_loadmap_exec_regnum, fdpic_loadmap_interp_regnum): New + constants. + (struct gdbarch_tdep): Add new member ``frv_abi''. + (frv_abi, frv_fdpic_loadmap_addresses, set_variant_abi_fdpic): New + functions. + (new_variant): Set ``frv_abi'' field. + (gdb_arch_init): Detect FDPIC executables. - * hppa-tdep.c (hppa_frame_cache): Avoid undefined return value. +2004-03-12 Mark Kettenis <kettenis@gnu.org> -2004-03-10 Kei Sakamoto <sakamoto.kei@renesas.com> + * solib-svr4.h: Change SOLIB_SVR4 wrapper into SOLIB_SVR4_H + wrapper. + +2004-03-11 Andrew Cagney <cagney@redhat.com> + + * solib-svr4.h: Add #ifndef SOLIB_SVR4 wrapper. + +2004-03-11 Kevin Buettner <kevinb@redhat.com> + + * solist.h (master_so_list): New function. + * solib.c (master_so_list): Likewise. + * solib-svr4.c (enable_break): Iterate over so_list entries + obtained from master list instead of entries obtained directly + via svr4_current_sos(). + +2004-03-10 Ben Elliston <bje@gnu.org> + + * MAINTAINERS: Update my mail address. + +2004-03-10 Kei Sakamoto <sakamoto.kei@renesas.com> * remote-m32r-sdi.c: Support hardware watchpoint. @@ -211,39 +9294,197 @@ 2004-03-09 Daniel Jacobowitz <drow@mvista.com> + * dwarf2read.c (skip_leb128, peek_die_abbrev, skip_one_die) + (skip_children): New functions. + (locate_pdi_sibling): Call skip_children. + +2004-03-09 Daniel Jacobowitz <drow@mvista.com> + * arm-tdep.c (arm_use_struct_convention): Look through typedefs. * gdbtypes.c (check_typedef): Update comments. 2004-03-09 Daniel Jacobowitz <drow@mvista.com> + * dwarf2read.c (struct comp_unit_head): Remove dwarf2_abbrevs array. + (struct dwarf2_cu): Add abbrev_obstack and dwarf2_abbrevs + pointer. Update comment about comp_unit_head. + (struct abbrev_info): Shorten two int flags. + (dwarf_alloc_abbrev): Take a CU argument. + (dwarf2_build_psymtabs_hard): Call dwarf2_free_abbrev_table + each time through the loop. Update cleanup argument. + (psymtab_to_symtab_1): Update cleanup call. + (dwarf2_read_abbrevs, dwarf2_alloc_abbrev): Allocate on the + abbrev_obstack. + (dwarf2_free_abbrev_table): Renamed from dwarf2_empty_abbrev_table. + Just call obstack_free and clear the pointer. + +2004-03-09 Daniel Jacobowitz <drow@mvista.com> + + * infrun.c (handle_inferior_event): Remove short-circuit code for + events in a different thread. + +2004-03-09 Daniel Jacobowitz <drow@mvista.com> + + * target.c (debug_to_xfer_memory): If targetdebug is 1, don't + print the whole transfer. + (initialize_targets): Update description of "set debug target". + +2004-03-09 Daniel Jacobowitz <drow@mvista.com> + * arm-tdep.c (thumb_get_next_pc): Handle Thumb BLX. +2004-03-08 Nathan J. Williams <nathanw@wasabisystems.com> + + * MAINTAINERS (write after approval): Add myself. + +2004-03-08 Corinna Vinschen <vinschen@redhat.com> + + * sh-tdep.c (sh_print_registers_info): Use for loop. + Don't skip multiple registers when a float register is encountered. + +2004-03-08 Corinna Vinschen <vinschen@redhat.com> + + Fix PR tdep/1291. + * sh-tdep.c (sh_analyze_prologue): Align PC relative addressing + to official SH documentation. + +2004-03-07 Andrew Cagney <cagney@redhat.com> + + * ppc-linux-nat.c (ppc_ptrace_cannot_fetch_store_register): Delete + unused function. + 2004-03-07 Daniel Jacobowitz <drow@mvista.com> * arm-tdep.c (thumb_get_next_pc): Handle BX. (arm_get_next_pc): Handle BX and BLX. +2004-03-07 Andrew Cagney <cagney@redhat.com> + + * hppa-tdep.c: Replace DEPRECATED_FP_REGNUM with HPPA_FP_REGNUM, + FP0_REGNUM with HPPA_FP0_REGNUM, and SP_REGNUM with + HPPA_SP_REGNUM. + (hppa_register_raw_size, hppa_register_byte, hppa_read_fp) + (hppa_target_read_fp): Delete. + (hppa_gdbarch_init): Do not set deprecated register_raw_size, + register_virtual_size, max_register_raw_size, + max_register_virtual_size, register_byte, register_size, + target_read_fp, fp_regnum, and register_bytes. Set register_type + instead of register_virtual_type. + (hppa32_register_type, hppa64_register_type): Replace + hppa32_register_virtual_type and hppa64_register_virtual_type. + * config/pa/tm-hppa.h (HPPA_FP0_REGNUM, HPPA_SP_REGNUM) + (HPPA_FP_REGNUM): Define. + + * hppa-tdep.c (hppa_gdbarch_init): Add missing "break". + + * config/pa/tm-hppa.h (DEPRECATED_DO_REGISTERS_INFO) + (pa_do_registers_info): Delete. + * hppa-tdep.c (pa_do_registers_info, pa_do_strcat_registers_info) + (pa_print_registers, pa_print_fp_reg, pa_strcat_registers) + (pa_strcat_fp_reg, pa_register_look_aside): Delete. + + * infcall.c (legacy_push_dummy_code): Delete #ifdef + GDB_TARGET_IS_HPPA code. + * config/pa/tm-hppa.h (DEPRECATED_FIX_CALL_DUMMY) + (hppa_fix_call_dummy, DEPRECATED_CALL_DUMMY_HAS_COMPLETED) + (DEPRECATED_DUMMY_WRITE_SP, CALL_DUMMY): Delete. + * config/pa/tm-hppa64.h (CALL_DUMMY): Delete. + * hppa-tdep.c (hppa_frame_chain, hppa_frame_chain_valid) + (hppa_push_dummy_frame, hppa_pop_frame, hppa_push_arguments) + (hppa_fix_call_dummy, hppa64_stack_align, hppa_frame_saved_pc) + (hppa_init_extra_frame_info, hppa_saved_pc_after_call) + (hppa64_call_dummy_breakpoint_offset, hppa_frame_init_saved_regs) + (hppa_frameless_function_invocation, hppa64_store_return_value) + (hppa_store_struct_return, hppa64_extract_return_value) + (hppa64_use_struct_convention, hppa_frame_find_saved_regs) + (hppa32_call_dummy_length, hppa64_call_dummy_length) + (find_dummy_frame_regs, FUNC_LDIL_OFFSET, FUNC_LDO_OFFSET) + (find_proc_framesize, deposit_21, restore_pc_queue) + (find_return_regnum, pc_in_interrupt_handler, deposit_14) + (rp_saved, pc_in_linker_stub): Delete. + + Unconditionally enable 64-bit frame and ABI code. + * hppa-tdep.c (hppa_gdbarch_init): Do not set deprecated + call_dummy_breakpoint_offset, call_dummy_length, stack_align, + push_dummy_frame, fix_call_dummy, push_arguments, + call_dummy_location, extract_return_value, use_struct_convention, + store_return_value, store_struct_return, saved_pc_after_call, + init_frame_pc, frame_init_saved_regs, init_extra_frame_info, + frame_chain, frame_chain_valid, frameless_function_invocation, + frame_saved_pc, and pop_frame. + + * hppa-tdep.c: Replace PC_REGNUM with PCOQ_HEAD_REGNUM. + (hppa64_return_value, hppa64_push_dummy_call): Rewrite. + (hppa_gdbarch_init): Do not set PC_REGNUM. + +2004-03-06 Mark Kettenis <kettenis@gnu.org> + + * config/alpha/tm-fbsd.h: Remove file. + * config/alpha/fbsd.mt: Tweak comment. + (TM_FILE): Set to tm-alpha.h. + +2004-03-05 Andrew Cagney <cagney@redhat.com> + + * infrun.c (step_over_function): When non-legacy code, and no + step_frame_id, use the unwinder to get the caller's frame ID. + +2004-03-05 Mark Kettenis <kettenis@gnu.org> + + * i386bsd-tdep.c (_initialize_i386bsd_tdep): Register + i386bsd_core_osabi_sniffer for bfd_arch_i386 instead of + bfd_arch_unknown. Adjust comment. + + * i386-nat.c: Fix typo in comment. Re-introduce paranoiac. + * i386obsd-tdep.c: Correct spelling in comment. + * i386nbsd-tdep.c: Correct spelling in comment. + * sparc-tdep.c: Correct spelling in comments. + 2004-03-05 David Carlton <carlton@kealia.com> * cp-namespace.c (cp_lookup_transparent_type_loop): Fix recursion bug. +2004-03-05 Mark Kettenis <kettenis@gnu.org> + + * sparc-tdep.c: Fix typo in comment. + +2004-03-04 J. Brobecker <brobecker@gnat.com> + + * hppa-tdep.c (hppa_frame_cache): Avoid undefined return value. + +2004-03-04 Daniel Jacobowitz <drow@mvista.com> + + * dwarf2read.c: Add comment describing memory lifetimes. + (struct dwarf2_pinfo): Update comment. + (dwarf2_add_field, dwarf2_add_member_fn, read_structure_scope) + (read_enumeration, new_symbol): Don't use obsavestring. + 2004-03-04 Mark Kettenis <kettenis@gnu.org> + * amd64-linux-nat.c (fill_fpregset): Call amd64_colletc_fxsave + instead of amd64_fill_fxsave. + * amd64bsd-nat.c (store_inferior_registers): Likewise. + * amd64fbsd-nat.c (fill_fpregset): Likewise. + * sparc-tdep.c (sparc_frame_cache): Don't bail out if %fp is zero. Reorganize code a bit. 2004-03-04 Orjan Friberg <orjanf@axis.com> * cris-tdep.c (cris_scan_prologue): Save the frame pointer's offset - when the frame pointer is pushed. Don't set the frame pointer's - address on the stack unless it's actually located there. + when the frame pointer is pushed. Don't set the frame pointer's + address on the stack unless it's actually located there. Set the SRP's address on the stack correctly when the PC is still in the prologue. (cris_return_value): New function. (cris_gdbarch_init): Clear deprecated store_return_value, extract_return_value. +2004-03-02 Jim Blandy <jimb@redhat.com> + + * stabsread.c (reg_value_complaint): The maximum register number + is one less than the number of registers. + 2004-03-02 Andrew Cagney <cagney@redhat.com> * i386-tdep.h (enum i386_regnum): Add I386_DS_REGNUM, @@ -252,10 +9493,17 @@ * amd64-nat.c (amd64_collect_native_gregset): Zero-extend the 32-bit segment registers. -2004-03-01 GDB Administrator <gdbadmin@sourceware.org> +2004-03-01 Andrew Cagney <cagney@redhat.com> - GDB 6.1 branch created. - * version.in: Bump to version 6.0.90. + * rs6000-tdep.c (rs6000_init_frame_pc_first): Fix compiler error, + use frame_relative_level and get_next_frame. + +2004-02-29 Andrew Cagney <cagney@redhat.com> + + * rs6000-tdep.c (rs6000_init_frame_pc_first): New function. + (rs6000_gdbarch_init): Set deprecated_init_frame_pc_first. + * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): + Delete macro. 2004-02-29 Daniel Jacobowitz <drow@mvista.com> @@ -391,7 +9639,7 @@ (cris_unwind_sp, cris_store_return_value, cris_extract_return_value) (cris_reg_struct_has_addr): New functions. (cris_examine, cris_frame_init_saved_regs, cris_frame_chain) - (cris_frame_saved_pc, cris_saved_pc_after_call, + (cris_frame_saved_pc, cris_saved_pc_after_call, (cris_store_struct_return, cris_frameless_function_invocation) (cris_pop_frame, cris_skip_prologue_main) (cris_abi_original_store_return_value) @@ -404,18 +9652,18 @@ (cris_push_return_address, cris_abi_update): Remove. (_initialize_cris_tdep): Remove ABI command. (cris_dump_tdep): Ditto. - (cris_gdbarch_init): Remove ABI command. + (cris_gdbarch_init): Remove ABI command. Set store_return_value, extract_return_value, push_dummy_code, push_dummy_call, frame_align, unwind_pc, unwind_sp, unwind_dummy_id, frame_unwind_append_sniffer, frame_base_set_default. Clear deprecated init_frame_pc, push_arguments, store_return_value, extract_return_value, fp_regnum, pc_in_call_dummy, call_dummy_words, sizeof_call_dummy_words, get_saved_register, push_return_address, - pop_frame, store_struct_return, frame_init_saved_regs, + pop_frame, store_struct_return, frame_init_saved_regs, init_extra_frame_info, frameless_function_invocation, frame_chain, frame_saved_pc, saved_pc_after_call, save_dummy_frame_tos, dummy_write_sp. - + 2004-02-26 Jeff Johnston <jjohnstn@redhat.com> * valprint.h (print_hex_chars, print_char_chars): New prototypes. @@ -487,7 +9735,7 @@ "x86-64-tdep.h". * amd64obsd-nat.c: Include "amd64-tdep.h" instead of "x86-64-tdep.h". - * configure.host: (x86_64-*-linux*): Set gdb_target to linux64. + * configure.host: (x86_64-*-linux*): Set gdb_target to linux64. * configure.tgt (x86_64-*-linux*): Set gdb_target to linux64. * Makefile.in (amd64_linux_tdep_h): Renamed from x86_64_linux_tdep_h. @@ -2673,7 +11921,7 @@ variable `funcaddr'. Fix some coding-standards problems. * sparc-tdep.c (sparc_regset_from_core_section): Check whether - SECT_SIZE is large enough, not wheter it's exactly the right size. + SECT_SIZE is large enough, not whether it's exactly the right size. (sparc32_gdbarch_init): Initialize TDEP->sizeof_gregset and TDEP->fpregset to zero. diff --git a/gnu/usr.bin/binutils/gdb/Makefile.in b/gnu/usr.bin/binutils/gdb/Makefile.in index f40809f874e..f4b987185b5 100644 --- a/gnu/usr.bin/binutils/gdb/Makefile.in +++ b/gnu/usr.bin/binutils/gdb/Makefile.in @@ -29,6 +29,7 @@ libdir = @libdir@ tooldir = $(libdir)/$(target_alias) datadir = @datadir@ +localedir = @localedir@ mandir = @mandir@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 @@ -65,6 +66,13 @@ DLLTOOL = @DLLTOOL@ WINDRES = @WINDRES@ MIG = @MIG@ +XGETTEXT = @XGETTEXT@ +GMSGFMT = @GMSGFMT@ +MSGMERGE = msgmerge + +PACKAGE = @PACKAGE@ +CATALOGS = @CATALOGS@ + # 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 @@ -308,7 +316,6 @@ 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@ @@ -320,7 +327,7 @@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@ # 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) +GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config -DLOCALEDIR="\"$(localedir)\"" $(DEFS) # M{H,T}_CFLAGS, if defined, have host- and target-dependent CFLAGS # from the config directory. @@ -372,7 +379,7 @@ CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(INTL) $(LIBIBERTY) \ $(LIBICONV) \ $(LIBIBERTY) $(WIN32LIBS) CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) \ - $(OPCODES) $(INTL_DEPS) $(CONFIG_DEPS) + $(OPCODES) $(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) @@ -505,7 +512,7 @@ TARGET_FLAGS_TO_PASS = \ # 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 \ +SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c \ ax-general.c ax-gdb.c \ bcache.c \ bfd-target.c \ @@ -540,9 +547,11 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ scm-exp.c scm-lang.c scm-valprint.c \ sentinel-frame.c \ serial.c ser-unix.c source.c \ - stabsread.c stack.c std-regs.c symfile.c symmisc.c symtab.c \ + stabsread.c stack.c std-regs.c symfile.c symfile-mem.c symmisc.c \ + symtab.c \ target.c thread.c top.c tracepoint.c \ trad-frame.c \ + tramp-frame.c \ typeprint.c \ ui-out.c utils.c ui-file.h ui-file.c \ user-regs.c \ @@ -561,7 +570,6 @@ 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 @@ -571,6 +579,7 @@ elf_reloc_macros_h = $(INCLUDE_DIR)/elf/reloc-macros.h elf_sh_h = $(INCLUDE_DIR)/elf/sh.h elf_arm_h = $(INCLUDE_DIR)/elf/arm.h $(elf_reloc_macros_h) elf_bfd_h = $(BFD_SRC)/elf-bfd.h +elf_frv_h = $(INCLUDE_DIR)/elf/frv.h $(elf_reloc_macros_h) libaout_h = $(BFD_SRC)/libaout.h libbfd_h = $(BFD_SRC)/libbfd.h remote_sim_h = $(INCLUDE_DIR)/gdb/remote-sim.h @@ -582,11 +591,14 @@ opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h #readline_history_h = $(READLINE_SRC)/history.h frv_desc_h = $(OPCODES_SRC)/frv-desc.h sh_opc_h = $(OPCODES_SRC)/sh-opc.h +gdb_callback_h = $(INCLUDE_DIR)/gdb/callback.h gdb_sim_arm_h = $(INCLUDE_DIR)/gdb/sim-arm.h gdb_sim_d10v_h = $(INCLUDE_DIR)/gdb/sim-d10v.h gdb_sim_frv_h = $(INCLUDE_DIR)/gdb/sim-frv.h +gdb_sim_ppc_h = $(INCLUDE_DIR)/gdb/sim-ppc.h gdb_sim_sh_h = $(INCLUDE_DIR)/gdb/sim-sh.h splay_tree_h = $(INCLUDE_DIR)/splay-tree.h +hashtab_h = $(INCLUDE_DIR)/hashtab.h # # $BUILD/ headers @@ -598,6 +610,8 @@ exc_request_S_h = exc_request_S.h msg_reply_S_h = msg_reply_S.h msg_U_h = msg_U.h notify_S_h = notify_S.h +observer_h = observer.h +observer_inc = observer.inc process_reply_S_h = process_reply_S.h # @@ -612,10 +626,10 @@ nm_h = @nm_h@ # gdb/ headers # -ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h) +ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h) $(breakpoint_h) +ada_lex_c = ada-lex.c $(gdb_string_h) alphabsd_tdep_h = alphabsd-tdep.h alpha_tdep_h = alpha-tdep.h -amd64_linux_tdep_h = amd64-linux-tdep.h amd64_nat_h = amd64-nat.h amd64_tdep_h = amd64-tdep.h $(i386_tdep_h) annotate_h = annotate.h $(symtab_h) $(gdbtypes_h) @@ -628,6 +642,7 @@ bcache_h = bcache.h bfd_target_h = bfd-target.h block_h = block.h breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h) +bsd_kvm_h = bsd-kvm.h buildsym_h = buildsym.h call_cmds_h = call-cmds.h charset_h = charset.h @@ -643,7 +658,7 @@ cp_support_h = cp-support.h $(symtab_h) dcache_h = dcache.h defs_h = defs.h $(config_h) $(ansidecl_h) $(gdb_locale_h) $(gdb_signals_h) \ $(libiberty_h) $(bfd_h) $(ui_file_h) $(xm_h) $(nm_h) $(tm_h) \ - $(fopen_same_h) $(gdbarch_h) + $(fopen_bin_h) $(gdbarch_h) dictionary_h = dictionary.h disasm_h = disasm.h doublest_h = doublest.h $(floatformat_h) @@ -656,10 +671,12 @@ event_loop_h = event-loop.h event_top_h = event-top.h exec_h = exec.h $(target_h) expression_h = expression.h $(symtab_h) $(doublest_h) +fbsd_nat_h = fbsd-nat.h f_lang_h = f-lang.h frame_base_h = frame-base.h frame_h = frame.h frame_unwind_h = frame-unwind.h $(frame_h) +frv_tdep_h = frv-tdep.h gdbarch_h = gdbarch.h gdb_assert_h = gdb_assert.h gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h) @@ -671,6 +688,7 @@ gdb_h = gdb.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_ptrace_h = gdb_ptrace.h gdb_regex_h = gdb_regex.h $(xregex_h) gdb_stabs_h = gdb-stabs.h gdb_stat_h = gdb_stat.h @@ -684,14 +702,17 @@ glibc_tdep_h = glibc-tdep.h gnu_nat_h = gnu-nat.h gregset_h = gregset.h hppa_tdep_h = hppa-tdep.h +i386bsd_nat_h = i386bsd-nat.h i386_linux_tdep_h = i386-linux-tdep.h i386_tdep_h = i386-tdep.h i387_tdep_h = i387-tdep.h ia64_tdep_h = ia64-tdep.h infcall_h = infcall.h +inf_child_h = inf-child.h inferior_h = inferior.h $(breakpoint_h) $(target_h) $(frame_h) inf_loop_h = inf-loop.h inflow_h = inflow.h $(terminal_h) +inf_ptrace_h = inf-ptrace.h infttrace_h = infttrace.h interps_h = interps.h jv_lang_h = jv-lang.h @@ -699,15 +720,16 @@ kod_h = kod.h language_h = language.h libunwind_frame_h = libunwind-frame.h $(libunwind_h) linespec_h = linespec.h -linux_nat_h = linux-nat.h +linux_nat_h = linux-nat.h $(target_h) m2_lang_h = m2-lang.h +m32r_tdep_h = m32r-tdep.h m68k_tdep_h = m68k-tdep.h +m88k_tdep_h = m88k-tdep.h macroexp_h = macroexp.h macroscope_h = macroscope.h $(macrotab_h) $(symtab_h) macrotab_h = macrotab.h main_h = main.h memattr_h = memattr.h -minimon_h = minimon.h mipsnbsd_tdep_h = mipsnbsd-tdep.h mips_tdep_h = mips-tdep.h monitor_h = monitor.h @@ -716,13 +738,13 @@ ns32k_tdep_h = ns32k-tdep.h nto_tdep_h = nto-tdep.h $(defs_h) $(solist_h) objc_lang_h = objc-lang.h objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) -observer_h = observer.h ocd_h = ocd.h osabi_h = osabi.h pa64solib_h = pa64solib.h parser_defs_h = parser-defs.h $(doublest_h) p_lang_h = p-lang.h ppcnbsd_tdep_h = ppcnbsd-tdep.h +ppcobsd_tdep_h = ppcobsd-tdep.h ppc_tdep_h = ppc-tdep.h proc_utils_h = proc-utils.h regcache_h = regcache.h @@ -757,7 +779,8 @@ target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h) terminal_h = terminal.h top_h = top.h tracepoint_h = tracepoint.h -trad_frame_h = trad-frame.h +trad_frame_h = trad-frame.h $(frame_h) +tramp_frame_h = tramp-frame.h $(frame_h) typeprint_h = typeprint.h ui_file_h = ui-file.h ui_out_h = ui-out.h @@ -771,7 +794,6 @@ version_h = version.h wince_stub_h = wince-stub.h wrapper_h = wrapper.h $(gdb_h) xcoffsolib_h = xcoffsolib.h -xmodem_h = xmodem.h # # gdb/cli/ headers @@ -825,9 +847,10 @@ 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 \ + symfile.h symfile-mem.h stabsread.h target.h terminal.h typeprint.h \ + xcoffsolib.h \ macrotab.h macroexp.h macroscope.h \ - c-lang.h f-lang.h \ + ada-lang.h c-lang.h f-lang.h \ jv-lang.h \ m2-lang.h p-lang.h \ complaints.h valprint.h \ @@ -874,6 +897,7 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \ infcall.o \ infcmd.o infrun.o \ expprint.o environ.o stack.o thread.o \ + inf-child.o \ interps.o \ main.o \ macrotab.o macrocmd.o macroexp.o macroscope.o \ @@ -888,7 +912,7 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \ dbxread.o coffread.o coff-pe-read.o elfread.o \ dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \ dwarf2expr.o dwarf2loc.o dwarf2-frame.o \ - c-lang.o f-lang.o objc-lang.o \ + ada-lang.o c-lang.o f-lang.o objc-lang.o \ ui-out.o cli-out.o \ varobj.o wrapper.o \ jv-lang.o jv-valprint.o jv-typeprint.o \ @@ -896,8 +920,8 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \ scm-exp.o scm-lang.o scm-valprint.o \ sentinel-frame.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 \ + ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o \ + ada-valprint.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 \ user-regs.o \ @@ -905,8 +929,9 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \ frame-base.o \ gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \ cp-namespace.o \ - reggroups.o \ - trad-frame.o + reggroups.o regset.o \ + trad-frame.o \ + tramp-frame.o TSOBS = inflow.o @@ -920,6 +945,7 @@ YYFILES = c-exp.c \ f-exp.c m2-exp.c p-exp.c YYOBJ = c-exp.o \ objc-exp.o \ + ada-exp.o \ jv-exp.o \ f-exp.o m2-exp.o p-exp.o @@ -949,6 +975,34 @@ check: force $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \ else true; fi +# The idea is to parallelize testing of multilibs, for example: +# make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu} +# will run 3 concurrent sessions of check, eventually testing all 10 +# combinations. GNU make is required for the % pattern to work, as is +# a shell that expands alternations within braces. If GNU make is not +# used, this rule will harmlessly fail to match. +check//%: force + @if [ -f testsuite/config.status ]; then \ + rootme=`pwd`; export rootme; \ + rootsrc=`cd $(srcdir); pwd`; export rootsrc; \ + target=`echo "$@" | sed 's,//.*,,'`; \ + variant=`echo "$@" | sed 's,^[^/]*//,,'`; \ + vardots=`echo "$$variant" | sed 's,/,.,g'`; \ + testdir=testsuite.$$vardots; \ + if [ ! -f $$testdir/Makefile ]; then \ + (cd testsuite && find . -name config.status) | \ + sed s,/config.status$$,, | sort | while read subdir; do \ + $(SHELL) $(srcdir)/../mkinstalldirs $$testdir/$$subdir && \ + (cd $$testdir/$$subdir && \ + $(SHELL) $$rootme/testsuite/$$subdir/config.status \ + --recheck && \ + $(SHELL) ./config.status); done; \ + else :; fi && cd $$testdir && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ + RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \ + "$$target"; \ + else true; fi + info dvi install-info clean-info html install-html: force @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do @@ -1139,15 +1193,6 @@ 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-altos.h: tm-m68k.h -tm-sun2.h tm-3b1.h: tm-m68k.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). @@ -1157,7 +1202,7 @@ xm-vaxbsd.h: xm-vax.h TAGS: $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR) @echo Making TAGS - @etags $(srcdir)/$(TM_FILE) \ + @etags $(srcdir)/$(DEPRECATED_TM_FILE) \ $(srcdir)/$(XM_FILE) \ $(srcdir)/$(NAT_FILE) \ `(for i in $(DEPFILES) $(TAGFILES_NO_SRCDIR); do \ @@ -1214,7 +1259,7 @@ do-maintainer-clean: @$(MAKE) $(FLAGS_TO_PASS) DO=maintainer-clean "DODIRS=$(SUBDIRS)" \ subdir_do -diststuff: $(DISTSTUFF) +diststuff: $(DISTSTUFF) $(PACKAGE).pot $(CATALOGS) cd doc; $(MAKE) $(MFLAGS) diststuff subdir_do: force @@ -1271,6 +1316,11 @@ version.c: Makefile version.in mv version.c-tmp version.c version.o: version.c $(version_h) +observer.h: observer.sh doc/observer.texi + ${srcdir}/observer.sh h ${srcdir}/doc/observer.texi observer.h + +observer.inc: observer.sh doc/observer.texi + ${srcdir}/observer.sh inc ${srcdir}/doc/observer.texi observer.inc lint: $(LINTFILES) $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \ @@ -1305,16 +1355,22 @@ ALLDEPFILES = \ arm-linux-nat.c arm-linux-tdep.c arm-tdep.c \ armnbsd-nat.c armnbsd-tdep.c \ avr-tdep.c \ + bsd-kvm.c \ coff-solib.c \ core-regset.c core-aout.c corelow.c \ - dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \ + dcache.c exec.c \ + fbsd-nat.c \ + fork-child.c \ glibc-tdep.c \ go32-nat.c h8300-tdep.c \ hppa-tdep.c hppa-hpux-tdep.c \ hppah-nat.c hpread.c \ + hppa-linux-tdep.c hppa-linux-nat.c \ + hppabsd-nat.c hppabsd-tdep.c \ i386-tdep.c i386v-nat.c i386-linux-nat.c \ i386v4-nat.c i386ly-tdep.c i386-cygwin-tdep.c \ i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c i386fbsd-tdep.c \ + i386nbsd-nat.c i386nbsd-tdep.c i386obsd-nat.c i386obsd-tdep.c \ i387-tdep.c \ i386-linux-tdep.c i386-nat.c \ i386gnu-nat.c i386gnu-tdep.c \ @@ -1323,18 +1379,22 @@ ALLDEPFILES = \ libunwind-frame.c \ lynx-nat.c m3-nat.c \ m68hc11-tdep.c \ + m32r-tdep.c \ + m32r-linux-nat.c m32r-linux-tdep.c \ m68k-tdep.c \ + m68kbsd-nat.c m68kbsd-tdep.c \ + m88k-tdep.c m88kbsd-nat.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 \ 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 \ + ppc-sysv-tdep.c ppc-linux-nat.c ppc-linux-tdep.c \ + ppcnbsd-nat.c ppcnbsd-tdep.c \ + ppcobsd-nat.c ppcobsd-tdep.c \ procfs.c \ remote-e7000.c \ remote-hms.c remote-m32r-sdi.c remote-mips.c \ @@ -1352,9 +1412,8 @@ ALLDEPFILES = \ sparc64-tdep.c sparc64fbsd-nat.c sparc64fbsd-tdep.c \ sparc64nbsd-nat.c sparc64nbsd-tdep.c sparc64obsd-tdep.c \ sparcnbsd-nat.c sparcnbsd-tdep.c sparcobsd-tdep.c \ - sun3-nat.c \ symm-tdep.c symm-nat.c \ - vax-tdep.c \ + vax-nat.c vax-tdep.c vaxbsd-nat.c vaxnbsd-tdep.c \ vx-share/xdr_ld.c vx-share/xdr_ptrace.c vx-share/xdr_rdb.c \ win32-nat.c \ xcoffread.c xcoffsolib.c \ @@ -1377,6 +1436,14 @@ main.o: main.c $(CC) -c $(INTERNAL_CFLAGS) $(TARGET_SYSTEM_ROOT_DEFINE) \ -DBINDIR=\"$(bindir)\" $(srcdir)/main.c +# FIXME: cagney/2004-09-16: "gnu-v3-abi.c", with a GCC 3.4 compiler, +# gets a "assignment from incompatible pointer type" warning. The +# return types - "enum gnu_v3_dtor_kinds" vs "enum ctor_kinds" - +# conflict. +gnu-v3-abi.o: $(srcdir)/gnu-v3-abi.c + $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) \ + $(srcdir)/gnu-v3-abi.c + # FIXME: cagney/2003-08-10: "monitor.c" gets -Wformat-nonliteral # errors. It turns out that that is the least of monitor.c's # problems. The function print_vsprintf appears to be using @@ -1410,11 +1477,79 @@ v850ice.o: $(srcdir)/v850ice.c $(GDBTK_CFLAGS) \ $(srcdir)/v850ice.c -# FIXME: cagney/2003-08-10: Do not try to build "valprint.c" with -# -Wformat-nonliteral. It relies on local_hex_format et.al. and -# that's a mess. It needs a serious overhaul. -valprint.o: $(srcdir)/valprint.c - $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/valprint.c + +# Message files. Based on code in gcc/Makefile.in. + +# Rules for generating translated message descriptions. Disabled by +# autoconf if the tools are not available. + +.SUFFIXES: .po .gmo .pox .pot +.PHONY: all-po install-po uninstall-po clean-po update-po $(PACKAGE).pot + +all-po: $(CATALOGS) + +# This notation should be acceptable to all Make implementations used +# by people who are interested in updating .po files. +update-po: $(CATALOGS:.gmo=.pox) + +# N.B. We do not attempt to copy these into $(srcdir). The snapshot +# script does that. +.po.gmo: + -test -d po || mkdir po + $(GMSGFMT) --statistics -o $@ $< + +# The new .po has to be gone over by hand, so we deposit it into +# build/po with a different extension. If build/po/$(PACKAGE).pot +# exists, use it (it was just created), else use the one in srcdir. +.po.pox: + -test -d po || mkdir po + $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \ + then echo po/$(PACKAGE).pot; \ + else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@ + +# This rule has to look for .gmo modules in both srcdir and the cwd, +# and has to check that we actually have a catalog for each language, +# in case they weren't built or included with the distribution. +install-po: + $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(datadir) + cats="$(CATALOGS)"; for cat in $$cats; do \ + lang=`basename $$cat | sed 's/\.gmo$$//'`; \ + if [ -f $$cat ]; then :; \ + elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \ + else continue; \ + fi; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + echo $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$$dir; \ + $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$$dir || exit 1; \ + echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + done +uninstall-po: + cats="$(CATALOGS)"; for cat in $$cats; do \ + lang=`basename $$cat | sed 's/\.gmo$$//'`; \ + if [ -f $$cat ]; then :; \ + elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \ + else continue; \ + fi; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + rm -f $(DESTDIR)$$dir/$(PACKAGE).mo; \ + done +# Delete po/*.gmo only if we are not building in the source directory. +clean-po: + -if [ ! -f Makefile.in ]; then rm -f po/*.gmo; fi + +# Rule for regenerating the message template (gdb.pot). Instead of +# forcing everyone to edit POTFILES.in, which proved impractical, this +# rule has no dependencies and always regenerates gdb.pot. This is +# relatively harmless since the .po files do not directly depend on +# it. The .pot file is left in the build directory. Since GDB's +# Makefile lacks a cannonical list of sources (missing xm, tm and nm +# files) force this rule. +$(PACKAGE).pot: po/$(PACKAGE).pot +po/$(PACKAGE).pot: force + -test -d po || mkdir po + sh -e $(srcdir)/po/gdbtext $(XGETTEXT) $(PACKAGE) . $(srcdir) + # # YACC/LEX dependencies @@ -1434,21 +1569,31 @@ valprint.o: $(srcdir)/valprint.c -e '/extern.*realloc/d' \ -e '/extern.*free/d' \ -e '/include.*malloc.h/d' \ - -e 's/malloc/xmalloc/g' \ - -e 's/realloc/xrealloc/g' \ + -e 's/\([^x]\)malloc/\1xmalloc/g' \ + -e 's/\([^x]\)realloc/\1xrealloc/g' \ -e '/^#line.*y.tab.c/d' \ < $@.tmp > $@.new -rm $@.tmp mv $@.new ./$*.c .l.c: - @if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \ - echo $(FLEX) -Isit $< ">" $@; \ - $(FLEX) -Isit $< > $@; \ - elif [ ! -f $@ -a ! -f $< ]; then \ - echo "ada-lex.c missing and flex not available."; \ - false; \ - elif [ ! -f $@ ]; then \ + if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \ + $(FLEX) -o$@ $< && \ + rm -f $@.new && \ + sed -e '/extern.*malloc/d' \ + -e '/extern.*realloc/d' \ + -e '/extern.*free/d' \ + -e '/include.*malloc.h/d' \ + -e 's/\([^x]\)malloc/\1xmalloc/g' \ + -e 's/\([^x]\)realloc/\1xrealloc/g' \ + -e 's/yy_flex_xrealloc/yyxrealloc/g' \ + < $@ > $@.new && \ + rm -f $@ && \ + mv $@.new $@; \ + elif [ -f $@ ]; then \ echo "Warning: $*.c older than $*.l and flex not available."; \ + else \ + echo "$@ missing and flex not available."; \ + false; \ fi .PRECIOUS: ada-exp.c ada-lex.c @@ -1465,28 +1610,26 @@ valprint.o: $(srcdir)/valprint.c abug-rom.o: abug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) $(m68k_tdep_h) -ada-exp.o: ada-exp.c $(defs_h) $(expression_h) $(value_h) $(parser_defs_h) \ - $(language_h) $(ada_lang_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ - $(frame_h) $(block_h) $(ada_lex_c) -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) $(block_h) \ - $(infcall_h) $(dictionary_h) -ada-lex.o: ada-lex.c -ada-tasks.o: ada-tasks.c $(defs_h) $(command_h) $(value_h) $(language_h) \ - $(inferior_h) $(symtab_h) $(target_h) $(regcache_h) $(gdbcore_h) \ - $(gregset_h) $(ada_lang_h) +ada-exp.o: ada-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(value_h) \ + $(parser_defs_h) $(language_h) $(ada_lang_h) $(bfd_h) $(symfile_h) \ + $(objfiles_h) $(frame_h) $(block_h) $(ada_lex_c) +ada-lang.o: ada-lang.c $(defs_h) $(gdb_string_h) $(demangle_h) \ + $(gdb_regex_h) $(frame_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) $(hashtab_h) $(gdb_obstack_h) $(ada_lang_h) \ + $(completer_h) $(gdb_stat_h) $(ui_out_h) $(block_h) $(infcall_h) \ + $(dictionary_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) $(infcall_h) +ada-valprint.o: ada-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ + $(gdbtypes_h) $(expression_h) $(value_h) $(demangle_h) $(valprint_h) \ + $(language_h) $(annotate_h) $(ada_lang_h) $(c_lang_h) $(infcall_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) + $(target_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) $(ppc_tdep_h) \ + $(gdb_string_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) $(alpha_tdep_h) \ @@ -1501,8 +1644,8 @@ alpha-mdebug-tdep.o: alpha-mdebug-tdep.c $(defs_h) $(frame_h) \ alpha-nat.o: alpha-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \ $(gdbcore_h) $(target_h) $(regcache_h) $(alpha_tdep_h) $(gregset_h) alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ - $(regcache_h) $(value_h) $(osabi_h) $(solib_svr4_h) $(alpha_tdep_h) \ - $(alphabsd_tdep_h) $(nbsd_tdep_h) + $(regcache_h) $(value_h) $(osabi_h) $(gdb_string_h) $(alpha_tdep_h) \ + $(alphabsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h) alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ $(value_h) $(osabi_h) $(gdb_string_h) $(objfiles_h) $(alpha_tdep_h) alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \ @@ -1510,33 +1653,37 @@ alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \ $(symtab_h) $(value_h) $(gdbcmd_h) $(gdbcore_h) $(dis_asm_h) \ $(symfile_h) $(objfiles_h) $(gdb_string_h) $(linespec_h) \ $(regcache_h) $(reggroups_h) $(arch_utils_h) $(osabi_h) $(block_h) \ - $(elf_bfd_h) $(alpha_tdep_h) + $(infcall_h) $(elf_bfd_h) $(alpha_tdep_h) amd64bsd-nat.o: amd64bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) + $(target_h) $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) \ + $(inf_ptrace_h) amd64fbsd-nat.o: amd64fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - $(gdb_assert_h) $(gregset_h) $(amd64_tdep_h) $(amd64_nat_h) + $(target_h) $(gdb_assert_h) $(fbsd_nat_h) $(amd64_tdep_h) \ + $(amd64_nat_h) $(bsd_kvm_h) amd64fbsd-tdep.o: amd64fbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ $(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \ $(amd64_tdep_h) $(solib_svr4_h) amd64-linux-nat.o: amd64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \ $(gdb_proc_service_h) $(gregset_h) $(amd64_tdep_h) \ - $(amd64_linux_tdep_h) $(i386_linux_tdep_h) $(amd64_nat_h) -amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(regcache_h) $(osabi_h) $(gdb_string_h) $(amd64_tdep_h) \ - $(amd64_linux_tdep_h) + $(i386_linux_tdep_h) $(amd64_nat_h) +amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ + $(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) $(amd64_tdep_h) \ + $(solib_svr4_h) amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \ - $(gdb_assert_h) $(i386_tdep_h) $(amd64_tdep_h) -amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \ - $(amd64_nat_h) + $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(amd64_tdep_h) +amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(target_h) $(gdb_assert_h) \ + $(amd64_tdep_h) $(amd64_nat_h) amd64nbsd-tdep.o: amd64nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ - $(gdbcore_h) $(osabi_h) $(gdb_assert_h) $(amd64_tdep_h) \ + $(gdbcore_h) $(osabi_h) $(symtab_h) $(gdb_assert_h) $(amd64_tdep_h) \ $(nbsd_tdep_h) $(solib_svr4_h) -amd64obsd-nat.o: amd64obsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \ - $(amd64_nat_h) +amd64obsd-nat.o: amd64obsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) \ + $(bsd_kvm_h) amd64obsd-tdep.o: amd64obsd-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ - $(osabi_h) $(regset_h) $(target_h) $(gdb_assert_h) $(gdb_string_h) \ - $(amd64_tdep_h) $(i387_tdep_h) $(solib_svr4_h) + $(symtab_h) $(objfiles_h) $(osabi_h) $(regset_h) $(target_h) \ + $(gdb_assert_h) $(gdb_string_h) $(amd64_tdep_h) $(i387_tdep_h) \ + $(solib_svr4_h) amd64-tdep.o: amd64-tdep.c $(defs_h) $(arch_utils_h) $(block_h) \ $(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \ $(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \ @@ -1546,7 +1693,7 @@ annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \ $(gdbtypes_h) $(breakpoint_h) arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \ $(gdbcmd_h) $(inferior_h) $(gdb_string_h) $(regcache_h) \ - $(gdb_assert_h) $(sim_regno_h) $(osabi_h) $(version_h) \ + $(gdb_assert_h) $(sim_regno_h) $(gdbcore_h) $(osabi_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) @@ -1556,8 +1703,8 @@ arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \ $(glibc_tdep_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) $(osabi_h) $(arm_tdep_h) \ - $(nbsd_tdep_h) $(solib_svr4_h) +armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \ + $(arm_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h) arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \ $(gdbcore_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \ $(doublest_h) $(value_h) $(arch_utils_h) $(osabi_h) \ @@ -1591,12 +1738,15 @@ breakpoint.o: breakpoint.c $(defs_h) $(symtab_h) $(frame_h) $(breakpoint_h) \ $(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \ $(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \ $(objfiles_h) $(source_h) $(linespec_h) $(completer_h) $(gdb_h) \ - $(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) \ - $(gdb_events_h) + $(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) $(solist_h) \ + $(observer_h) $(gdb_events_h) +bsd-kvm.o: bsd-kvm.c $(defs_h) $(cli_cmds_h) $(command_h) $(frame_h) \ + $(regcache_h) $(target_h) $(value_h) $(gdbcore_h) $(gdb_assert_h) \ + $(readline_h) $(bsd_kvm_h) buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(gdb_assert_h) \ - $(complaints_h) $(gdb_string_h) $(expression_h) $(language_h) \ - $(bcache_h) $(filenames_h) $(macrotab_h) $(demangle_h) $(block_h) \ + $(complaints_h) $(gdb_string_h) $(expression_h) $(bcache_h) \ + $(filenames_h) $(macrotab_h) $(demangle_h) $(block_h) \ $(cp_support_h) $(dictionary_h) $(buildsym_h) $(stabsread_h) c-exp.o: c-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(value_h) \ $(parser_defs_h) $(language_h) $(c_lang_h) $(bfd_h) $(symfile_h) \ @@ -1632,7 +1782,7 @@ corefile.o: corefile.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symtab_h) \ corelow.o: corelow.c $(defs_h) $(arch_utils_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \ $(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \ - $(exec_h) $(readline_h) $(gdb_assert_h) + $(exec_h) $(readline_h) $(observer_h) $(gdb_assert_h) core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \ $(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h) cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \ @@ -1674,11 +1824,10 @@ dbug-rom.o: dbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_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) $(objfiles_h) $(buildsym_h) $(stabsread_h) \ - $(gdb_stabs_h) $(demangle_h) $(language_h) $(complaints_h) \ - $(cp_abi_h) $(gdb_assert_h) $(aout_aout64_h) $(aout_stab_gnu_h) + $(gdb_stabs_h) $(demangle_h) $(complaints_h) $(cp_abi_h) \ + $(gdb_assert_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) dictionary.o: dictionary.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ @@ -1689,12 +1838,11 @@ disasm.o: disasm.c $(defs_h) $(target_h) $(value_h) $(ui_out_h) \ $(gdb_string_h) $(disasm_h) $(gdbcore_h) $(dis_asm_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) $(gdb_assert_h) \ $(gdb_string_h) dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \ $(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) \ - $(command_h) $(gdbcmd_h) + $(command_h) $(gdbcmd_h) $(gdb_string_h) 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) \ $(mips_tdep_h) @@ -1712,7 +1860,8 @@ dwarf2read.o: dwarf2read.c $(defs_h) $(bfd_h) $(symtab_h) $(gdbtypes_h) \ $(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) $(demangle_h) \ $(expression_h) $(filenames_h) $(macrotab_h) $(language_h) \ $(complaints_h) $(bcache_h) $(dwarf2expr_h) $(dwarf2loc_h) \ - $(cp_support_h) $(gdb_string_h) $(gdb_assert_h) + $(cp_support_h) $(hashtab_h) $(command_h) $(gdbcmd_h) \ + $(gdb_string_h) $(gdb_assert_h) dwarfread.o: dwarfread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(objfiles_h) \ $(elf_dwarf_h) $(buildsym_h) $(demangle_h) $(expression_h) \ $(language_h) $(complaints_h) $(gdb_string_h) @@ -1736,8 +1885,9 @@ exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \ expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ $(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \ $(gdb_string_h) $(block_h) -fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(gdb_string_h) $(elf_bfd_h) $(gregset_h) +fbsd-nat.o: fbsd-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(regcache_h) \ + $(regset_h) $(gdb_assert_h) $(gdb_string_h) $(elf_bfd_h) \ + $(fbsd_nat_h) f-exp.o: f-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(value_h) \ $(parser_defs_h) $(language_h) $(f_lang_h) $(bfd_h) $(symfile_h) \ $(objfiles_h) $(block_h) @@ -1751,18 +1901,23 @@ f-lang.o: f-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_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) -frame-base.o: frame-base.c $(defs_h) $(frame_base_h) $(frame_h) +frame-base.o: frame-base.c $(defs_h) $(frame_base_h) $(frame_h) \ + $(gdb_obstack_h) frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \ $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(user_regs_h) \ $(gdb_obstack_h) $(dummy_frame_h) $(sentinel_frame_h) $(gdbcore_h) \ $(annotate_h) $(language_h) $(frame_unwind_h) $(frame_base_h) \ - $(command_h) $(gdbcmd_h) + $(command_h) $(gdbcmd_h) $(observer_h) $(objfiles_h) frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \ - $(gdb_assert_h) $(dummy_frame_h) + $(gdb_assert_h) $(dummy_frame_h) $(gdb_obstack_h) +frv-linux-tdep.o: frv-linux-tdep.c $(defs_h) $(target_h) $(frame_h) \ + $(osabi_h) $(elf_bfd_h) $(elf_frv_h) $(frv_tdep_h) $(trad_frame_h) \ + $(frame_unwind_h) frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_string_h) $(inferior_h) $(gdbcore_h) \ $(arch_utils_h) $(regcache_h) $(frame_h) $(frame_unwind_h) \ $(frame_base_h) $(trad_frame_h) $(dis_asm_h) $(gdb_assert_h) \ - $(sim_regno_h) $(gdb_sim_frv_h) $(opcodes_frv_desc_h) $(symtab_h) + $(sim_regno_h) $(gdb_sim_frv_h) $(opcodes_frv_desc_h) $(symtab_h) \ + $(elf_bfd_h) $(elf_frv_h) $(osabi_h) $(infcall_h) $(frv_tdep_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) @@ -1801,66 +1956,78 @@ h8300-tdep.o: h8300-tdep.c $(defs_h) $(value_h) $(inferior_h) $(symfile_h) \ $(gdb_assert_h) $(dis_asm_h) hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \ $(gdbtypes_h) $(gdbcore_h) $(cp_abi_h) +hppabsd-nat.o: hppabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(hppa_tdep_h) +hppabsd-tdep.o: hppabsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \ + $(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \ + $(hppa_tdep_h) $(solib_svr4_h) hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \ - $(gdb_wait_h) $(regcache_h) $(gdb_string_h) + $(gdb_wait_h) $(regcache_h) $(gdb_string_h) $(infttrace_h) \ + $(hppa_tdep_h) hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \ - $(osabi_h) $(gdb_string_h) $(frame_h) -hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \ - $(value_h) $(regcache_h) $(completer_h) $(language_h) $(osabi_h) \ - $(gdb_assert_h) $(infttrace_h) $(arch_utils_h) $(symtab_h) \ - $(infcall_h) $(dis_asm_h) $(trad_frame_h) $(frame_unwind_h) \ - $(frame_base_h) $(a_out_encap_h) $(gdb_stat_h) $(gdb_wait_h) \ - $(gdbcore_h) $(gdbcmd_h) $(target_h) $(symfile_h) $(objfiles_h) \ + $(osabi_h) $(gdb_string_h) $(frame_h) $(frame_unwind_h) \ + $(trad_frame_h) $(symtab_h) $(objfiles_h) $(inferior_h) $(infcall_h) \ + $(observer_h) $(hppa_tdep_h) +hppa-linux-nat.o: hppa-linux-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(gdb_string_h) $(inferior_h) $(hppa_tdep_h) $(gregset_h) +hppa-linux-tdep.o: hppa-linux-tdep.c $(defs_h) $(gdbcore_h) $(osabi_h) \ + $(target_h) $(objfiles_h) $(solib_svr4_h) $(glibc_tdep_h) \ + $(frame_unwind_h) $(trad_frame_h) $(dwarf2_frame_h) $(value_h) \ + $(hppa_tdep_h) $(elf_common_h) +hppa-tdep.o: hppa-tdep.c $(defs_h) $(bfd_h) $(inferior_h) $(regcache_h) \ + $(completer_h) $(osabi_h) $(gdb_assert_h) $(arch_utils_h) \ + $(symtab_h) $(dis_asm_h) $(trad_frame_h) $(frame_unwind_h) \ + $(frame_base_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) \ $(hppa_tdep_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) \ - $(somsolib_h) $(gdb_assert_h) $(gdb_string_h) + $(somsolib_h) $(gdb_assert_h) $(hppa_tdep_h) $(gdb_string_h) hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \ $(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h) i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - $(gdb_assert_h) $(gregset_h) $(i386_tdep_h) $(i387_tdep_h) + $(gdb_assert_h) $(i386_tdep_h) $(i387_tdep_h) $(i386bsd_nat_h) \ + $(inf_ptrace_h) i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ $(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) $(i386_tdep_h) i386-cygwin-tdep.o: i386-cygwin-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \ $(i386_tdep_h) i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - $(i386_tdep_h) + $(target_h) $(fbsd_nat_h) $(i386_tdep_h) $(i386bsd_nat_h) \ + $(bsd_kvm_h) i386fbsd-tdep.o: i386fbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \ $(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_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) $(gregset_h) + $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) \ + $(gnu_nat_h) $(i387_tdep_h) $(gregset_h) i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) $(osabi_h) $(i386_tdep_h) -i386-interix-nat.o: i386-interix-nat.c $(defs_h) $(gdb_string_h) \ - $(gdbcore_h) $(gregset_h) $(regcache_h) -i386-interix-tdep.o: i386-interix-tdep.c $(defs_h) $(arch_utils_h) \ - $(frame_h) $(gdb_string_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \ - $(i386_tdep_h) $(inferior_h) $(libbfd_h) $(objfiles_h) $(osabi_h) \ - $(regcache_h) i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \ $(gregset_h) $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) \ $(gdb_proc_service_h) i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ $(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \ - $(solib_svr4_h) $(gdb_string_h) $(i386_tdep_h) $(i386_linux_tdep_h) \ - $(glibc_tdep_h) + $(gdb_string_h) $(i386_tdep_h) $(i386_linux_tdep_h) $(glibc_tdep_h) \ + $(solib_svr4_h) i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ $(regcache_h) $(target_h) $(osabi_h) $(i386_tdep_h) i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h) -i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \ - $(regcache_h) $(regset_h) $(osabi_h) $(gdb_assert_h) $(gdb_string_h) \ - $(i386_tdep_h) $(i387_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h) +i386nbsd-nat.o: i386nbsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \ + $(target_h) $(i386_tdep_h) $(i386bsd_nat_h) $(bsd_kvm_h) +i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ + $(gdbcore_h) $(regcache_h) $(regset_h) $(osabi_h) $(symtab_h) \ + $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) \ + $(nbsd_tdep_h) $(solib_svr4_h) i386-nto-tdep.o: i386-nto-tdep.c $(gdb_string_h) $(gdb_assert_h) $(defs_h) \ $(frame_h) $(target_h) $(regcache_h) $(solib_svr4_h) $(i386_tdep_h) \ $(nto_tdep_h) $(osabi_h) $(i387_tdep_h) i386obsd-nat.o: i386obsd-nat.c $(defs_h) $(i386_tdep_h) -i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \ - $(regcache_h) $(regset_h) $(osabi_h) $(target_h) $(gdb_assert_h) \ - $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h) +i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ + $(gdbcore_h) $(regcache_h) $(regset_h) $(symtab_h) $(objfiles_h) \ + $(osabi_h) $(target_h) $(gdb_assert_h) $(gdb_string_h) \ + $(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h) i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(osabi_h) \ - $(i386_tdep_h) + $(gdb_string_h) $(i386_tdep_h) $(solib_svr4_h) i386-stub.o: i386-stub.c i386-tdep.o: i386-tdep.c $(defs_h) $(arch_utils_h) $(command_h) \ $(dummy_frame_h) $(dwarf2_frame_h) $(doublest_h) $(floatformat_h) \ @@ -1889,11 +2056,14 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(arch_utils_h) $(floatformat_h) $(regcache_h) $(reggroups_h) \ $(frame_h) $(frame_base_h) $(frame_unwind_h) $(doublest_h) \ $(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) \ - $(elf_bfd_h) $(elf_h) $(dis_asm_h) $(ia64_tdep_h) \ + $(elf_bfd_h) $(dis_asm_h) $(infcall_h) $(ia64_tdep_h) $(elf_ia64_h) \ $(libunwind_frame_h) $(libunwind_ia64_h) infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \ $(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \ - $(objfiles_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h) + $(objfiles_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h) \ + $(dummy_frame_h) +inf-child.o: inf-child.c $(defs_h) $(regcache_h) $(memattr_h) $(symtab_h) \ + $(target_h) $(inferior_h) $(gdb_string_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) \ @@ -1905,19 +2075,23 @@ inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(target_h) $(event_loop_h) \ inflow.o: inflow.c $(defs_h) $(frame_h) $(inferior_h) $(command_h) \ $(serial_h) $(terminal_h) $(target_h) $(gdbthread_h) $(gdb_string_h) \ $(inflow_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) +inf-ptrace.o: inf-ptrace.c $(defs_h) $(observer_h) $(gdb_ptrace_h) \ + $(inflow_h) $(inferior_h) $(regcache_h) $(command_h) $(gdbcore_h) \ + $(inf_child_h) $(gdbcmd_h) $(gdb_string_h) $(gdb_wait_h) +infptrace.o: infptrace.c $(defs_h) $(command_h) $(frame_h) $(gdbcore_h) \ + $(inferior_h) $(regcache_h) $(target_h) $(gdb_assert_h) \ + $(gdb_wait_h) $(gdb_string_h) $(gdb_dirent_h) $(gdb_ptrace_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) \ $(observer_h) $(language_h) $(gdb_assert_h) inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ - $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h) + $(gdbcore_h) $(command_h) $(gdb_stat_h) $(observer_h) $(gdb_wait_h) \ + $(inflow_h) infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbthread_h) \ - $(gdbcore_h) + $(infttrace_h) $(gdbcore_h) interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ $(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \ $(gdb_events_h) $(gdb_assert_h) $(top_h) @@ -1950,14 +2124,10 @@ linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ $(symfile_h) $(objfiles_h) $(source_h) $(demangle_h) $(value_h) \ $(completer_h) $(cp_abi_h) $(parser_defs_h) $(block_h) \ $(objc_lang_h) $(linespec_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) \ - $(linux_nat_h) -linux-nat.o: linux-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdb_wait_h) \ - $(linux_nat_h) -linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(gdb_stat_h) \ - $(regcache_h) $(gregset_h) $(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) \ - $(cli_decode_h) $(gdb_string_h) $(linux_nat_h) +linux-nat.o: linux-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdb_string_h) \ + $(gdb_wait_h) $(gdb_assert_h) $(linux_nat_h) $(gdbthread_h) \ + $(gdbcmd_h) $(regcache_h) $(elf_bfd_h) $(gregset_h) $(gdbcore_h) \ + $(gdbthread_h) $(gdb_stat_h) lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(regcache_h) m2-exp.o: m2-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ @@ -1970,6 +2140,13 @@ 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) +m32r-linux-nat.o: m32r-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ + $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \ + $(gregset_h) $(m32r_tdep_h) +m32r-linux-tdep.o: m32r-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ + $(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \ + $(gdb_string_h) $(glibc_tdep_h) $(solib_svr4_h) $(trad_frame_h) \ + $(frame_unwind_h) $(m32r_tdep_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) @@ -1978,13 +2155,18 @@ m32r-tdep.o: m32r-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \ $(frame_base_h) $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) \ $(gdb_string_h) $(value_h) $(inferior_h) $(symfile_h) $(objfiles_h) \ $(language_h) $(arch_utils_h) $(regcache_h) $(trad_frame_h) \ - $(dis_asm_h) $(gdb_assert_h) + $(dis_asm_h) $(gdb_assert_h) $(osabi_h) $(m32r_tdep_h) m68hc11-tdep.o: m68hc11-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \ $(frame_base_h) $(dwarf2_frame_h) $(trad_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) $(reggroups_h) $(target_h) \ $(opcode_m68hc11_h) $(elf_m68hc11_h) $(elf_bfd_h) +m68kbsd-nat.o: m68kbsd-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(regcache_h) $(gdb_assert_h) $(m68k_tdep_h) $(bsd_kvm_h) +m68kbsd-tdep.o: m68kbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \ + $(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \ + $(m68k_tdep_h) $(solib_svr4_h) m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ $(language_h) $(gdbcore_h) $(gdb_string_h) $(regcache_h) \ $(m68k_tdep_h) $(gdb_stat_h) $(floatformat_h) $(target_h) \ @@ -1992,16 +2174,19 @@ m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \ m68klinux-tdep.o: m68klinux-tdep.c $(defs_h) $(gdbcore_h) $(doublest_h) \ $(floatformat_h) $(frame_h) $(target_h) $(gdb_string_h) \ $(gdbtypes_h) $(osabi_h) $(regcache_h) $(objfiles_h) $(symtab_h) \ - $(m68k_tdep_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) + $(m68k_tdep_h) $(trad_frame_h) $(frame_unwind_h) m68k-stub.o: m68k-stub.c m68k-tdep.o: m68k-tdep.c $(defs_h) $(dwarf2_frame_h) $(frame_h) \ - $(frame_base_h) $(frame_unwind_h) $(symtab_h) $(gdbcore_h) \ - $(value_h) $(gdb_string_h) $(gdb_assert_h) $(inferior_h) \ - $(regcache_h) $(arch_utils_h) $(osabi_h) $(dis_asm_h) $(m68k_tdep_h) \ - $(gregset_h) + $(frame_base_h) $(frame_unwind_h) $(floatformat_h) $(symtab_h) \ + $(gdbcore_h) $(value_h) $(gdb_string_h) $(gdb_assert_h) \ + $(inferior_h) $(regcache_h) $(arch_utils_h) $(osabi_h) $(dis_asm_h) \ + $(m68k_tdep_h) $(gregset_h) +m88kbsd-nat.o: m88kbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(target_h) $(m88k_tdep_h) $(inf_ptrace_h) +m88k-tdep.o: m88k-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) $(frame_h) \ + $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(gdbtypes_h) \ + $(regcache_h) $(regset_h) $(symtab_h) $(trad_frame_h) $(value_h) \ + $(gdb_assert_h) $(gdb_string_h) $(m88k_tdep_h) 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) \ @@ -2027,7 +2212,7 @@ mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \ $(complaints_h) $(demangle_h) $(gdb_assert_h) $(block_h) \ $(dictionary_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) + $(aout_aout64_h) $(aout_stab_gnu_h) $(expression_h) memattr.o: memattr.c $(defs_h) $(command_h) $(gdbcmd_h) $(memattr_h) \ $(target_h) $(value_h) $(language_h) $(gdb_string_h) mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \ @@ -2038,13 +2223,12 @@ 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_tdep_h) mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \ $(solib_svr4_h) $(osabi_h) $(mips_tdep_h) $(gdb_string_h) \ - $(gdb_assert_h) $(frame_h) -mips-nat.o: mips-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) + $(gdb_assert_h) $(frame_h) $(trad_frame_h) $(tramp_frame_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) $(nbsd_tdep_h) $(mipsnbsd_tdep_h) \ - $(solib_svr4_h) + $(mips_tdep_h) $(solib_svr4_h) mipsread.o: mipsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ $(objfiles_h) $(buildsym_h) $(stabsread_h) $(coff_sym_h) \ $(coff_internal_h) $(coff_ecoff_h) $(libcoff_h) $(libecoff_h) \ @@ -2055,7 +2239,8 @@ mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(gdb_assert_h) \ $(target_h) $(arch_utils_h) $(regcache_h) $(osabi_h) $(mips_tdep_h) \ $(block_h) $(reggroups_h) $(opcode_mips_h) $(elf_mips_h) \ $(elf_bfd_h) $(symcat_h) $(sim_regno_h) $(dis_asm_h) \ - $(frame_unwind_h) $(frame_base_h) $(trad_frame_h) + $(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(infcall_h) \ + $(floatformat_h) mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ $(regcache_h) $(gregset_h) mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ @@ -2095,7 +2280,8 @@ objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_assert_h) \ $(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) $(hashtab_h) \ $(breakpoint_h) $(block_h) $(dictionary_h) -observer.o: observer.c $(defs_h) $(observer_h) +observer.o: observer.c $(defs_h) $(observer_h) $(command_h) $(gdbcmd_h) \ + $(observer_inc) 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) @@ -2104,7 +2290,7 @@ osabi.o: osabi.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(osabi_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) $(exec_h) + $(regcache_h) $(exec_h) $(hppa_tdep_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) \ @@ -2118,24 +2304,31 @@ p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_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) + $(regcache_h) $(gdb_assert_h) ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdb_string_h) $(frame_h) \ - $(inferior_h) $(gdbcore_h) $(regcache_h) $(gdb_wait_h) $(gregset_h) \ - $(ppc_tdep_h) + $(inferior_h) $(gdbcore_h) $(regcache_h) $(gdb_assert_h) \ + $(gdb_wait_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) $(osabi_h) $(solib_svr4_h) \ - $(ppc_tdep_h) -ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(ppc_tdep_h) \ - $(ppcnbsd_tdep_h) + $(objfiles_h) $(regcache_h) $(value_h) $(osabi_h) $(regset_h) \ + $(solib_svr4_h) $(ppc_tdep_h) $(trad_frame_h) $(frame_unwind_h) +ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(gdb_assert_h) \ + $(gdbcore_h) $(regcache_h) $(bsd_kvm_h) $(ppc_tdep_h) \ + $(ppcnbsd_tdep_h) $(inf_ptrace_h) ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \ $(target_h) $(breakpoint_h) $(value_h) $(osabi_h) $(ppc_tdep_h) \ - $(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h) + $(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(tramp_frame_h) $(trad_frame_h) \ + $(gdb_assert_h) $(solib_svr4_h) +ppcobsd-nat.o: ppcobsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ + $(ppc_tdep_h) $(ppcobsd_tdep_h) +ppcobsd-tdep.o: ppcobsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \ + $(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \ + $(ppc_tdep_h) $(ppcobsd_tdep_h) $(solib_svr4_h) ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ $(regcache_h) $(value_h) $(gdb_string_h) $(gdb_assert_h) \ - $(ppc_tdep_h) $(target_h) $(objfiles_h) + $(ppc_tdep_h) $(target_h) $(objfiles_h) $(infcall_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) \ @@ -2161,9 +2354,10 @@ p-valprint.o: p-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \ $(language_h) $(target_h) $(annotate_h) $(p_lang_h) $(cp_abi_h) regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \ $(gdbcmd_h) $(regcache_h) $(reggroups_h) $(gdb_assert_h) \ - $(gdb_string_h) $(gdbcmd_h) + $(gdb_string_h) $(gdbcmd_h) $(observer_h) reggroups.o: reggroups.c $(defs_h) $(reggroups_h) $(gdbtypes_h) \ $(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h) +regset.o: regset.c $(defs_h) $(regset_h) $(gdb_assert_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) \ @@ -2226,14 +2420,16 @@ rom68k-rom.o: rom68k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) $(value_h) $(m68k_tdep_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) $(exec_h) $(gdb_stat_h) + $(gdb_stabs_h) $(regcache_h) $(arch_utils_h) $(ppc_tdep_h) $(exec_h) \ + $(gdb_stat_h) rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(target_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) $(arch_utils_h) \ - $(regcache_h) $(doublest_h) $(value_h) $(parser_defs_h) $(osabi_h) \ - $(libbfd_h) $(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) \ - $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) $(ppc_tdep_h) \ - $(gdb_assert_h) $(dis_asm_h) + $(regcache_h) $(regset_h) $(doublest_h) $(value_h) $(parser_defs_h) \ + $(osabi_h) $(infcall_h) $(sim_regno_h) $(gdb_sim_ppc_h) \ + $(reggroups_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \ + $(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \ + $(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \ + $(frame_unwind_h) $(frame_base_h) s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \ $(s390_tdep_h) s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \ @@ -2288,7 +2484,11 @@ solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_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) $(exec_h) $(solist_h) $(readline_h) + $(completer_h) $(filenames_h) $(exec_h) $(solist_h) $(observer_h) \ + $(readline_h) +solib-frv.o: solib-frv.c $(defs_h) $(gdb_string_h) $(inferior_h) \ + $(gdbcore_h) $(solist_h) $(frv_tdep_h) $(objfiles_h) $(symtab_h) \ + $(language_h) $(command_h) $(gdbcmd_h) $(elf_frv_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) @@ -2310,7 +2510,7 @@ somread.o: somread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_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) $(gdb_assert_h) $(exec_h) + $(regcache_h) $(gdb_assert_h) $(exec_h) $(hppa_tdep_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) \ @@ -2325,21 +2525,21 @@ sparc64fbsd-tdep.o: sparc64fbsd-tdep.c $(defs_h) $(frame_h) \ sparc64-linux-nat.o: sparc64-linux-nat.c $(defs_h) $(sparc64_tdep_h) \ $(sparc_nat_h) sparc64-linux-tdep.o: sparc64-linux-tdep.c $(defs_h) $(gdbarch_h) $(osabi_h) \ - $(solib_svr4_h) $(sparc64_tdep_h) + $(sparc64_tdep_h) sparc64-nat.o: sparc64-nat.c $(defs_h) $(gdbarch_h) $(sparc64_tdep_h) \ $(sparc_nat_h) -sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(sparc64_tdep_h) \ - $(sparc_nat_h) +sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(regcache_h) $(target_h) \ + $(sparc64_tdep_h) $(sparc_nat_h) $(bsd_kvm_h) sparc64nbsd-tdep.o: sparc64nbsd-tdep.c $(defs_h) $(frame_h) \ $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(regset_h) \ - $(symtab_h) $(solib_svr4_h) $(trad_frame_h) $(gdb_assert_h) \ - $(gdb_string_h) $(sparc64_tdep_h) $(nbsd_tdep_h) + $(symtab_h) $(objfiles_h) $(solib_svr4_h) $(trad_frame_h) \ + $(gdb_assert_h) $(gdb_string_h) $(sparc64_tdep_h) $(nbsd_tdep_h) sparc64obsd-tdep.o: sparc64obsd-tdep.c $(defs_h) $(frame_h) \ - $(frame_unwind_h) $(osabi_h) $(regset_h) $(symtab_h) $(solib_svr4_h) \ - $(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h) $(nbsd_tdep_h) + $(frame_unwind_h) $(osabi_h) $(regset_h) $(symtab_h) $(objfiles_h) \ + $(solib_svr4_h) $(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h) sparc64-sol2-tdep.o: sparc64-sol2-tdep.c $(defs_h) $(frame_h) \ $(frame_unwind_h) $(gdbarch_h) $(symtab_h) $(objfiles_h) $(osabi_h) \ - $(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h) + $(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h) $(solib_svr4_h) sparc64-tdep.o: sparc64-tdep.c $(defs_h) $(arch_utils_h) $(floatformat_h) \ $(frame_h) $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) \ $(gdbtypes_h) $(inferior_h) $(symtab_h) $(objfiles_h) $(osabi_h) \ @@ -2351,21 +2551,22 @@ sparc-linux-tdep.o: sparc-linux-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \ $(gdb_string_h) $(sparc_tdep_h) sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(target_h) \ $(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) $(sparc_tdep_h) \ - $(sparc_nat_h) -sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(sparc_tdep_h) $(sparc_nat_h) + $(sparc_nat_h) $(inf_ptrace_h) +sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(regcache_h) $(target_h) \ + $(sparc_tdep_h) $(sparc_nat_h) $(bsd_kvm_h) sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \ $(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(regset_h) \ $(solib_svr4_h) $(symtab_h) $(trad_frame_h) $(gdb_assert_h) \ $(gdb_string_h) $(sparc_tdep_h) $(nbsd_tdep_h) sparcobsd-tdep.o: sparcobsd-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \ $(frame_unwind_h) $(osabi_h) $(solib_svr4_h) $(symtab_h) \ - $(trad_frame_h) $(gdb_assert_h) $(sparc_tdep_h) $(nbsd_tdep_h) + $(trad_frame_h) $(gdb_assert_h) $(sparc_tdep_h) sparc-sol2-nat.o: sparc-sol2-nat.c $(defs_h) $(regcache_h) $(gregset_h) \ $(sparc_tdep_h) $(sparc64_tdep_h) sparc-sol2-tdep.o: sparc-sol2-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \ $(gdbcore_h) $(symtab_h) $(objfiles_h) $(osabi_h) $(regcache_h) \ $(target_h) $(trad_frame_h) $(gdb_assert_h) $(gdb_string_h) \ - $(sparc_tdep_h) + $(sparc_tdep_h) $(solib_svr4_h) sparc-stub.o: sparc-stub.c sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) \ $(floatformat_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \ @@ -2382,12 +2583,9 @@ stack.o: stack.c $(defs_h) $(gdb_string_h) $(value_h) $(symtab_h) \ $(gdbcore_h) $(target_h) $(source_h) $(breakpoint_h) $(demangle_h) \ $(inferior_h) $(annotate_h) $(ui_out_h) $(block_h) $(stack_h) \ $(gdb_assert_h) $(dictionary_h) $(reggroups_h) $(regcache_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) $(user_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) $(bfdlink_h) $(symtab_h) $(gdbtypes_h) \ $(gdbcore_h) $(frame_h) $(target_h) $(value_h) $(symfile_h) \ $(objfiles_h) $(source_h) $(gdbcmd_h) $(breakpoint_h) $(language_h) \ @@ -2395,16 +2593,19 @@ symfile.o: symfile.c $(defs_h) $(bfdlink_h) $(symtab_h) $(gdbtypes_h) \ $(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \ $(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \ $(gdb_string_h) $(gdb_stat_h) +symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \ + $(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_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) $(block_h) $(gdb_regex_h) \ - $(dictionary_h) $(gdb_string_h) + $(dictionary_h) $(gdb_string_h) $(readline_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) $(source_h) \ - $(filenames_h) $(objc_lang_h) $(hashtab_h) $(gdb_obstack_h) \ - $(block_h) $(dictionary_h) $(gdb_string_h) $(gdb_stat_h) $(cp_abi_h) + $(filenames_h) $(objc_lang_h) $(ada_lang_h) $(hashtab_h) \ + $(gdb_obstack_h) $(block_h) $(dictionary_h) $(gdb_string_h) \ + $(gdb_stat_h) $(cp_abi_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) $(gdb_assert_h) $(gdbcore_h) @@ -2429,6 +2630,9 @@ tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \ $(readline_history_h) trad-frame.o: trad-frame.c $(defs_h) $(frame_h) $(trad_frame_h) \ $(regcache_h) +tramp-frame.o: tramp-frame.c $(defs_h) $(tramp_frame_h) $(frame_unwind_h) \ + $(gdbcore_h) $(symtab_h) $(objfiles_h) $(target_h) $(trad_frame_h) \ + $(frame_base_h) $(gdb_assert_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) $(typeprint_h) \ @@ -2441,7 +2645,7 @@ user-regs.o: user-regs.c $(defs_h) $(user_regs_h) $(gdbtypes_h) \ utils.o: utils.c $(defs_h) $(gdb_assert_h) $(gdb_string_h) $(event_top_h) \ $(tui_h) $(gdbcmd_h) $(serial_h) $(bfd_h) $(target_h) $(demangle_h) \ $(expression_h) $(language_h) $(charset_h) $(annotate_h) \ - $(filenames_h) $(inferior_h) $(readline_h) + $(filenames_h) $(symfile_h) $(inferior_h) $(readline_h) uw-thread.o: uw-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \ $(regcache_h) $(gregset_h) v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \ @@ -2457,7 +2661,7 @@ 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) $(block_h) $(infcall_h) \ $(dictionary_h) $(cp_support_h) $(gdb_string_h) $(gdb_assert_h) \ - $(cp_support_h) + $(cp_support_h) $(observer_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) @@ -2467,9 +2671,15 @@ values.o: values.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(gdb_assert_h) $(regcache_h) $(block_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) \ - $(gdb_string_h) $(osabi_h) $(dis_asm_h) $(vax_tdep_h) +vaxbsd-nat.o: vaxbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(target_h) \ + $(vax_tdep_h) $(inf_ptrace_h) $(bsd_kvm_h) +vax-nat.o: vax-nat.c $(defs_h) $(inferior_h) $(gdb_assert_h) $(vax_tdep_h) +vaxnbsd-tdep.o: vaxnbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \ + $(vax_tdep_h) $(solib_svr4_h) $(gdb_string_h) +vax-tdep.o: vax-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) $(frame_h) \ + $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(gdbtypes_h) \ + $(osabi_h) $(regcache_h) $(regset_h) $(trad_frame_h) $(value_h) \ + $(gdb_string_h) $(vax_tdep_h) win32-nat.o: win32-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(command_h) $(completer_h) $(regcache_h) $(top_h) \ $(buildsym_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \ @@ -2487,10 +2697,11 @@ xcoffread.o: xcoffread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(gdb_stat_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) \ - $(arch_utils_h) $(regcache_h) $(gdbcore_h) $(objfiles_h) \ - $(dis_asm_h) +xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(frame_h) $(frame_base_h) \ + $(frame_unwind_h) $(dwarf2_frame_h) $(symtab_h) $(gdbtypes_h) \ + $(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) $(inferior_h) \ + $(gdb_string_h) $(gdb_assert_h) $(arch_utils_h) $(floatformat_h) \ + $(regcache_h) $(doublest_h) $(osabi_h) $(objfiles_h) # # gdb/cli/ dependencies @@ -2700,7 +2911,7 @@ mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(inferior_h) $(value_h) \ $(gdb_stat_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-env.c mi-cmd-file.o: $(srcdir)/mi/mi-cmd-file.c $(defs_h) $(mi_cmds_h) \ - $(mi_getopt_h) $(ui_out_h) $(symtab_h) $(source_h) + $(mi_getopt_h) $(ui_out_h) $(symtab_h) $(source_h) $(objfiles_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-file.c mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) \ $(gdb_string_h) @@ -2792,20 +3003,20 @@ tui-file.o: $(srcdir)/tui/tui-file.c $(defs_h) $(ui_file_h) $(tui_file_h) \ tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(defs_h) $(symtab_h) $(inferior_h) \ $(command_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(target_h) \ $(gdbcore_h) $(event_loop_h) $(event_top_h) $(frame_h) \ - $(breakpoint_h) $(gdb_events_h) $(ui_out_h) $(top_h) $(readline_h) \ - $(tui_h) $(tui_hooks_h) $(tui_data_h) $(tui_layout_h) $(tui_io_h) \ + $(breakpoint_h) $(gdb_events_h) $(ui_out_h) $(top_h) $(tui_h) \ + $(tui_hooks_h) $(tui_data_h) $(tui_layout_h) $(tui_io_h) \ $(tui_regs_h) $(tui_win_h) $(tui_stack_h) $(tui_windata_h) \ - $(tui_winsource_h) $(gdb_curses_h) + $(tui_winsource_h) $(gdb_curses_h) $(readline_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c tui-interp.o: $(srcdir)/tui/tui-interp.c $(defs_h) $(interps_h) $(top_h) \ $(event_top_h) $(event_loop_h) $(ui_out_h) $(cli_out_h) \ $(tui_data_h) $(readline_h) $(tui_win_h) $(tui_h) $(tui_io_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-interp.c tui-io.o: $(srcdir)/tui/tui-io.c $(defs_h) $(terminal_h) $(target_h) \ - $(event_loop_h) $(event_top_h) $(command_h) $(top_h) $(readline_h) \ - $(tui_h) $(tui_data_h) $(tui_io_h) $(tui_command_h) $(tui_win_h) \ + $(event_loop_h) $(event_top_h) $(command_h) $(top_h) $(tui_h) \ + $(tui_data_h) $(tui_io_h) $(tui_command_h) $(tui_win_h) \ $(tui_wingeneral_h) $(tui_file_h) $(ui_out_h) $(cli_out_h) \ - $(gdb_curses_h) + $(gdb_curses_h) $(readline_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-io.c tui-layout.o: $(srcdir)/tui/tui-layout.c $(defs_h) $(command_h) $(symtab_h) \ $(frame_h) $(source_h) $(tui_h) $(tui_data_h) $(tui_windata_h) \ @@ -2822,7 +3033,7 @@ tui-regs.o: $(srcdir)/tui/tui-regs.c $(defs_h) $(tui_h) $(tui_data_h) \ $(symtab_h) $(gdbtypes_h) $(gdbcmd_h) $(frame_h) $(regcache_h) \ $(inferior_h) $(target_h) $(gdb_string_h) $(tui_layout_h) \ $(tui_win_h) $(tui_windata_h) $(tui_wingeneral_h) $(tui_file_h) \ - $(gdb_curses_h) + $(reggroups_h) $(gdb_curses_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-regs.c tui-source.o: $(srcdir)/tui/tui-source.c $(defs_h) $(symtab_h) $(frame_h) \ $(breakpoint_h) $(source_h) $(symtab_h) $(tui_h) $(tui_data_h) \ diff --git a/gnu/usr.bin/binutils/gdb/NEWS b/gnu/usr.bin/binutils/gdb/NEWS index 5d4ef067185..507db27dc20 100644 --- a/gnu/usr.bin/binutils/gdb/NEWS +++ b/gnu/usr.bin/binutils/gdb/NEWS @@ -1,7 +1,248 @@ What has changed in GDB? (Organized release by release) -*** Changes since GDB 6.1: +*** Changes in GDB 6.3: + +* GDB works with GCC -feliminate-dwarf2-dups + +GDB now supports a more compact representation of DWARF-2 debug +information using DW_FORM_ref_addr references. These are produced +by GCC with the option -feliminate-dwarf2-dups and also by some +proprietary compilers. With GCC, you must use GCC 3.3.4 or later +to use -feliminate-dwarf2-dups. + +* Internationalization + +When supported by the host system, GDB will be built with +internationalization (libintl). The task of marking up the sources is +continued, we're looking forward to our first translation. + +* Ada + +Initial support for debugging programs compiled with the GNAT +implementation of the Ada programming language has been integrated +into GDB. In this release, support is limited to expression evaluation. + +* New native configurations + +GNU/Linux/m32r m32r-*-linux-gnu + +* Remote 'p' packet + +GDB's remote protocol now includes support for the 'p' packet. This +packet is used to fetch individual registers from a remote inferior. + +* END-OF-LIFE registers[] compatibility module + +GDB's internal register infrastructure has been completely rewritten. +The new infrastructure making possible the implementation of key new +features including 32x64 (e.g., 64-bit amd64 GDB debugging a 32-bit +i386 application). + +GDB 6.3 will be the last release to include the the registers[] +compatibility module that allowed out-of-date configurations to +continue to work. This change directly impacts the following +configurations: + +hppa-*-hpux +ia64-*-aix +mips-*-irix* +*-*-lynx +mips-*-linux-gnu +sds protocol +xdr protocol +powerpc bdm protocol + +Unless there is activity to revive these configurations, they will be +made OBSOLETE in GDB 6.4, and REMOVED from GDB 6.5. + +* OBSOLETE configurations and files + +Configurations that have been declared obsolete in this release have +been commented out. Unless there is activity to revive these +configurations, the next release of GDB will have their sources +permanently REMOVED. + +h8300-*-* +mcore-*-* +mn10300-*-* +ns32k-*-* +sh64-*-* +v850-*-* + +*** Changes in GDB 6.2.1: + +* MIPS `break main; run' gave an heuristic-fence-post warning + +When attempting to run even a simple program, a warning about +heuristic-fence-post being hit would be reported. This problem has +been fixed. + +* MIPS IRIX 'long double' crashed GDB + +When examining a long double variable, GDB would get a segmentation +fault. The crash has been fixed (but GDB 6.2 cannot correctly examine +IRIX long double values). + +* VAX and "next" + +A bug in the VAX stack code was causing problems with the "next" +command. This problem has been fixed. + +*** Changes in GDB 6.2: + +* Fix for ``many threads'' + +On GNU/Linux systems that use the NPTL threads library, a program +rapidly creating and deleting threads would confuse GDB leading to the +error message: + + ptrace: No such process. + thread_db_get_info: cannot get thread info: generic error + +This problem has been fixed. + +* "-async" and "-noasync" options removed. + +Support for the broken "-noasync" option has been removed (it caused +GDB to dump core). + +* New ``start'' command. + +This command runs the program until the begining of the main procedure. + +* New BSD Kernel Data Access Library (libkvm) interface + +Using ``target kvm'' it is now possible to debug kernel core dumps and +live kernel memory images on various FreeBSD, NetBSD and OpenBSD +platforms. Currently supported (native-only) configurations are: + +FreeBSD/amd64 x86_64-*-freebsd* +FreeBSD/i386 i?86-*-freebsd* +NetBSD/i386 i?86-*-netbsd* +NetBSD/m68k m68*-*-netbsd* +NetBSD/sparc sparc-*-netbsd* +OpenBSD/amd64 x86_64-*-openbsd* +OpenBSD/i386 i?86-*-openbsd* +OpenBSD/m68k m68*-openbsd* +OpenBSD/sparc sparc-*-openbsd* + +* Signal trampoline code overhauled + +Many generic problems with GDB's signal handling code have been fixed. +These include: backtraces through non-contiguous stacks; recognition +of sa_sigaction signal trampolines; backtrace from a NULL pointer +call; backtrace through a signal trampoline; step into and out of +signal handlers; and single-stepping in the signal trampoline. + +Please note that kernel bugs are a limiting factor here. These +features have been shown to work on an s390 GNU/Linux system that +include a 2.6.8-rc1 kernel. Ref PR breakpoints/1702. + +* Cygwin support for DWARF 2 added. + +* New native configurations + +GNU/Linux/hppa hppa*-*-linux* +OpenBSD/hppa hppa*-*-openbsd* +OpenBSD/m68k m68*-*-openbsd* +OpenBSD/m88k m88*-*-openbsd* +OpenBSD/powerpc powerpc-*-openbsd* +NetBSD/vax vax-*-netbsd* +OpenBSD/vax vax-*-openbsd* + +* END-OF-LIFE frame compatibility module + +GDB's internal frame infrastructure has been completely rewritten. +The new infrastructure making it possible to support key new features +including DWARF 2 Call Frame Information. To aid in the task of +migrating old configurations to this new infrastructure, a +compatibility module, that allowed old configurations to continue to +work, was also included. + +GDB 6.2 will be the last release to include this frame compatibility +module. This change directly impacts the following configurations: + +h8300-*-* +mcore-*-* +mn10300-*-* +ns32k-*-* +sh64-*-* +v850-*-* +xstormy16-*-* + +Unless there is activity to revive these configurations, they will be +made OBSOLETE in GDB 6.3, and REMOVED from GDB 6.4. + +* REMOVED configurations and files + +Sun 3, running SunOS 3 m68*-*-sunos3* +Sun 3, running SunOS 4 m68*-*-sunos4* +Sun 2, running SunOS 3 m68000-*-sunos3* +Sun 2, running SunOS 4 m68000-*-sunos4* +Motorola 680x0 running LynxOS m68*-*-lynxos* +AT&T 3b1/Unix pc m68*-att-* +Bull DPX2 (68k, System V release 3) m68*-bull-sysv* +decstation mips-dec-* mips-little-* +riscos mips-*-riscos* mips-*-sysv* +sonymips mips-sony-* +sysv mips*-*-sysv4* (IRIX 5/6 not included) + +*** Changes in GDB 6.1.1: + +* TUI (Text-mode User Interface) built-in (also included in GDB 6.1) + +The TUI (Text-mode User Interface) is now built as part of a default +GDB configuration. It is enabled by either selecting the TUI with the +command line option "-i=tui" or by running the separate "gdbtui" +program. For more information on the TUI, see the manual "Debugging +with GDB". + +* Pending breakpoint support (also included in GDB 6.1) + +Support has been added to allow you to specify breakpoints in shared +libraries that have not yet been loaded. If a breakpoint location +cannot be found, and the "breakpoint pending" option is set to auto, +GDB queries you if you wish to make the breakpoint pending on a future +shared-library load. If and when GDB resolves the breakpoint symbol, +the pending breakpoint is removed as one or more regular breakpoints +are created. + +Pending breakpoints are very useful for GCJ Java debugging. + +* Fixed ISO-C build problems + +The files bfd/elf-bfd.h, gdb/dictionary.c and gdb/types.c contained +non ISO-C code that stopped them being built using a more strict ISO-C +compiler (e.g., IBM's C compiler). + +* Fixed build problem on IRIX 5 + +Due to header problems with <sys/proc.h>, the file gdb/proc-api.c +wasn't able to compile compile on an IRIX 5 system. + +* Added execute permission to gdb/gdbserver/configure + +The shell script gdb/testsuite/gdb.stabs/configure lacked execute +permission. This bug would cause configure to fail on a number of +systems (Solaris, IRIX). Ref: server/519. + +* Fixed build problem on hpux2.0w-hp-hpux11.00 using the HP ANSI C compiler + +Older HPUX ANSI C compilers did not accept variable array sizes. somsolib.c +has been updated to use constant array sizes. + +* Fixed a panic in the DWARF Call Frame Info code on Solaris 2.7 + +GCC 3.3.2, on Solaris 2.7, includes the DW_EH_PE_funcrel encoding in +its generated DWARF Call Frame Info. This encoding was causing GDB to +panic, that panic has been fixed. Ref: gdb/1628. + +* Fixed a problem when examining parameters in shared library code. + +When examining parameters in optimized shared library code generated +by a mainline GCC, GDB would incorrectly report ``Variable "..." is +not available''. GDB now correctly displays the variable's value. *** Changes in GDB 6.1: diff --git a/gnu/usr.bin/binutils/gdb/README b/gnu/usr.bin/binutils/gdb/README index 9a7cc05404c..c30975da60c 100644 --- a/gnu/usr.bin/binutils/gdb/README +++ b/gnu/usr.bin/binutils/gdb/README @@ -1,5 +1,5 @@ - README for gdb-6.1 release - Updated 29 February, 2004 by Andrew Cagney + README for gdb-6.3 release + Updated 8, November, 2004 by Andrew Cagney This is GDB, the GNU source-level debugger. @@ -20,7 +20,7 @@ Unpacking and Installation -- quick overview In this release, the GDB debugger sources, the generic GNU include files, the BFD ("binary file description") library, the readline library, and other libraries all have directories of their own -underneath the gdb-6.1 directory. The idea is that a variety of GNU +underneath the gdb-6.3 directory. The idea is that a variety of GNU tools can share a common copy of these things. Be aware of variation over time--for example don't try to build gdb with a copy of bfd from a release other than the gdb release (such as a binutils release), @@ -29,22 +29,21 @@ Configuration scripts and makefiles exist to cruise up and down this directory tree and automatically build all the pieces in the right order. - When you unpack the gdb-6.1.tar.gz file, you'll find a directory -called `gdb-6.1', which contains: + When you unpack the gdb-6.3.tar.gz file, you'll find a directory +called `gdb-6.3', which contains: - COPYING config.sub intl missing opcodes - COPYING.LIB configure libiberty mkinstalldirs readline - Makefile.in configure.in libtool.m4 mmalloc sim - README djunpack.bat ltcf-c.sh move-if-change symlink-tree - bfd etc ltcf-cxx.sh mpw-README texinfo - config gdb ltcf-gcj.sh mpw-build.in utils - config-ml.in gettext.m4 ltconfig mpw-config.in ylwrap - config.guess include ltmain.sh mpw-configure - config.if install-sh md5.sum mpw-install + COPYING config-ml.in gdb ltcf-gcj.sh readline + COPYING.LIB config.guess gettext.m4 ltconfig sim + Makefile.def config.if include ltmain.sh src-release + Makefile.in config.sub install-sh md5.sum symlink-tree + Makefile.tpl configure libiberty missing texinfo + README configure.in libtool.m4 mkinstalldirs ylwrap + bfd djunpack.bat ltcf-c.sh move-if-change + config etc ltcf-cxx.sh opcodes You can build GDB right in the source directory: - cd gdb-6.1 + cd gdb-6.3 ./configure make cp gdb/gdb /usr/local/bin/gdb (or wherever you want) @@ -58,25 +57,25 @@ You can build GDB in any empty build directory: mkdir build cd build - <full path to your sources>/gdb-6.1/configure + <full path to your sources>/gdb-6.3/configure make cp gdb/gdb /usr/local/bin/gdb (or wherever you want) (Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly -different; see the file gdb-6.1/gdb/config/djgpp/README for details.) +different; see the file gdb-6.3/gdb/config/djgpp/README for details.) This will configure and build all the libraries as well as GDB. If `configure' can't determine your system type, specify one as its argument, e.g., `./configure sun4' or `./configure decstation'. - Make sure that your 'configure' line ends in 'gdb-6.1/configure': + Make sure that your 'configure' line ends in 'gdb-6.3/configure': - /berman/migchain/source/gdb-6.1/configure # RIGHT - /berman/migchain/source/gdb-6.1/gdb/configure # WRONG + /berman/migchain/source/gdb-6.3/configure # RIGHT + /berman/migchain/source/gdb-6.3/gdb/configure # WRONG The gdb package contains several subdirectories, such as 'gdb', 'bfd', and 'readline'. If your 'configure' line ends in -'gdb-6.1/gdb/configure', then you are configuring only the gdb +'gdb-6.3/gdb/configure', then you are configuring only the gdb subdirectory, not the whole gdb package. This leads to build errors such as: @@ -107,7 +106,7 @@ documentation and TeX (or `texi2roff') to typeset the printed version. GDB includes an already formatted copy of the on-line Info version of this manual in the `gdb/doc' subdirectory. The main Info file is -`gdb-6.1/gdb/doc/gdb.info', and it refers to subordinate files +`gdb-6.3/gdb/doc/gdb.info', and it refers to subordinate files matching `gdb.info*' in the same directory. If necessary, you can print out these files, or read them with any editor; but they are easier to read using the `info' subsystem in GNU Emacs or the @@ -119,7 +118,7 @@ Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'. If you have `makeinfo' installed, and are in the top level GDB -source directory (`gdb-6.1', in the case of version 6.1), you can make +source directory (`gdb-6.3', in the case of version 6.3), you can make the Info file by typing: cd gdb/doc @@ -128,7 +127,7 @@ the Info file by typing: If you want to typeset and print copies of this manual, you need TeX, a program to print its DVI output files, and `texinfo.tex', the Texinfo definitions file. This file is included in the GDB -distribution, in the directory `gdb-6.1/texinfo'. +distribution, in the directory `gdb-6.3/texinfo'. TeX is a typesetting program; it does not print files directly, but produces output files called DVI files. To print a typeset document, @@ -142,11 +141,11 @@ without any extension or a `.dvi' extension. This file tells TeX how to typeset a document written in Texinfo format. On its own, TeX cannot read, much less typeset a Texinfo file. `texinfo.tex' is distributed with GDB and is located in the -`gdb-6.1/texinfo' directory. +`gdb-6.3/texinfo' directory. If you have TeX and a DVI printer program installed, you can typeset and print this manual. First switch to the the `gdb' subdirectory of -the main source directory (for example, to `gdb-6.1/gdb') and then type: +the main source directory (for example, to `gdb-6.3/gdb') and then type: make doc/gdb.dvi @@ -169,71 +168,60 @@ preparing GDB for installation; you can then use `make' to build the a single directory, whose name is usually composed by appending the version number to `gdb'. - For example, the GDB version 6.1 distribution is in the `gdb-6.1' + For example, the GDB version 6.3 distribution is in the `gdb-6.3' directory. That directory contains: -`gdb-6.1/{COPYING,COPYING.LIB}' +`gdb-6.3/{COPYING,COPYING.LIB}' Standard GNU license files. Please read them. -`gdb-6.1/bfd' +`gdb-6.3/bfd' source for the Binary File Descriptor library -`gdb-6.1/config*' +`gdb-6.3/config*' script for configuring GDB, along with other support files -`gdb-6.1/gdb' +`gdb-6.3/gdb' the source specific to GDB itself -`gdb-6.1/include' +`gdb-6.3/include' GNU include files -`gdb-6.1/libiberty' +`gdb-6.3/libiberty' source for the `-liberty' free software library -`gdb-6.1/mmalloc' - source for the GNU memory-mapped malloc package - -`gdb-6.1/opcodes' +`gdb-6.3/opcodes' source for the library of opcode tables and disassemblers -`gdb-6.1/readline' +`gdb-6.3/readline' source for the GNU command-line interface NOTE: The readline library is compiled for use by GDB, but will not be installed on your system when "make install" is issued. -`gdb-6.1/sim' +`gdb-6.3/sim' source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc) -`gdb-6.1/intl' - source for the GNU gettext library, for internationalization. - This is slightly modified from the standalone gettext - distribution you can get from GNU. - -`gdb-6.1/texinfo' +`gdb-6.3/texinfo' The `texinfo.tex' file, which you need in order to make a printed manual using TeX. -`gdb-6.1/etc' +`gdb-6.3/etc' Coding standards, useful files for editing GDB, and other miscellanea. -`gdb-6.1/utils' - A grab bag of random utilities. - Note: the following instructions are for building GDB on Unix or Unix-like systems. Instructions for building with DJGPP for MS-DOS/MS-Windows are in the file gdb/config/djgpp/README. The simplest way to configure and build GDB is to run `configure' from the `gdb-VERSION-NUMBER' source directory, which in this example -is the `gdb-6.1' directory. +is the `gdb-6.3' directory. First switch to the `gdb-VERSION-NUMBER' source directory if you are not already in it; then run `configure'. For example: - cd gdb-6.1 + cd gdb-6.3 ./configure make @@ -249,8 +237,8 @@ you may need to run `sh' on it explicitly: sh configure If you run `configure' from a directory that contains source -directories for multiple libraries or programs, such as the `gdb-6.1' -source directory for version 6.1, `configure' creates configuration +directories for multiple libraries or programs, such as the `gdb-6.3' +source directory for version 6.3, `configure' creates configuration files for every directory level underneath (unless you tell it not to, with the `--norecursion' option). @@ -258,10 +246,10 @@ with the `--norecursion' option). directories in the GDB distribution, if you only want to configure that subdirectory; but be sure to specify a path to it. - For example, with version 6.1, type the following to configure only + For example, with version 6.3, type the following to configure only the `bfd' subdirectory: - cd gdb-6.1/bfd + cd gdb-6.3/bfd ../configure You can install `gdb' anywhere; it has no hardwired paths. However, @@ -290,13 +278,13 @@ directory. If the path to `configure' would be the same as the argument to `--srcdir', you can leave out the `--srcdir' option; it will be assumed.) - For example, with version 6.1, you can build GDB in a separate + For example, with version 6.3, you can build GDB in a separate directory for a Sun 4 like this: - cd gdb-6.1 + cd gdb-6.3 mkdir ../gdb-sun4 cd ../gdb-sun4 - ../gdb-6.1/configure + ../gdb-6.3/configure make When `configure' builds a configuration using a remote source @@ -317,8 +305,8 @@ called `configure' (or one of its subdirectories). The `Makefile' that `configure' generates in each source directory also runs recursively. If you type `make' in a source directory such -as `gdb-6.1' (or in a separate configured directory configured with -`--srcdir=PATH/gdb-6.1'), you will build all the required libraries, +as `gdb-6.3' (or in a separate configured directory configured with +`--srcdir=PATH/gdb-6.3'), you will build all the required libraries, and then build GDB. When you have multiple hosts or targets configured in separate @@ -361,7 +349,7 @@ you can use it to test your guesses on abbreviations--for example: Invalid configuration `i786v': machine `i786v' not recognized `config.sub' is also distributed in the GDB source directory -(`gdb-6.1', for version 6.1). +(`gdb-6.3', for version 6.3). `configure' options @@ -491,7 +479,7 @@ As an alternative, the bug report can be submitted, via e-mail, to the address "bug-gdb@gnu.org". When submitting a bug, please include the GDB version number (e.g., -gdb-6.1), and how you configured it (e.g., "sun4" or "mach386 host, +gdb-6.3), and how you configured it (e.g., "sun4" or "mach386 host, i586-intel-synopsys target"). Since GDB now supports so many different configurations, it is important that you be precise about this. If at all possible, you should include the actual banner that @@ -546,17 +534,17 @@ ftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot. Once DejaGNU is installed, you can run the tests in one of the following ways: - (1) cd gdb-6.1 + (1) cd gdb-6.3 make check-gdb or - (2) cd gdb-6.1/gdb + (2) cd gdb-6.3/gdb make check or - (3) cd gdb-6.1/gdb/testsuite + (3) cd gdb-6.3/gdb/testsuite make site.exp (builds the site specific file) runtest -tool gdb GDB=../gdb (or GDB=<somepath> as appropriate) diff --git a/gnu/usr.bin/binutils/gdb/abug-rom.c b/gnu/usr.bin/binutils/gdb/abug-rom.c index 543f70213f4..e54853913c9 100644 --- a/gnu/usr.bin/binutils/gdb/abug-rom.c +++ b/gnu/usr.bin/binutils/gdb/abug-rom.c @@ -144,7 +144,7 @@ init_abug_cmds (void) abug_cmds.getreg.term_cmd = ".\r"; /* getreg.term_cmd */ abug_cmds.dump_registers = "rd\r"; /* dump_registers */ abug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ - abug_cmds.supply_register = abug_supply_register; /* supply_register */ + abug_cmds.supply_register = abug_supply_register; abug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ abug_cmds.load = "lo 0\r"; /* download command */ abug_cmds.loadresp = "\n"; /* load response */ diff --git a/gnu/usr.bin/binutils/gdb/acconfig.h b/gnu/usr.bin/binutils/gdb/acconfig.h index 87560c7b001..5d1cd9e3351 100644 --- a/gnu/usr.bin/binutils/gdb/acconfig.h +++ b/gnu/usr.bin/binutils/gdb/acconfig.h @@ -154,9 +154,6 @@ /* Define if libunwind library is being used. */ #undef HAVE_LIBUNWIND -/* Multi-arch enabled. */ -#undef GDB_MULTI_ARCH - /* hostfile */ #undef GDB_XM_FILE @@ -165,3 +162,9 @@ /* nativefile */ #undef GDB_NM_FILE + +/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works + around a <sys/proc.h> problem on IRIX 5. */ +#ifndef _KMEMUSER +#undef _KMEMUSER +#endif diff --git a/gnu/usr.bin/binutils/gdb/aclocal.m4 b/gnu/usr.bin/binutils/gdb/aclocal.m4 index 40399a65d09..22bbb45b5d3 100644 --- a/gnu/usr.bin/binutils/gdb/aclocal.m4 +++ b/gnu/usr.bin/binutils/gdb/aclocal.m4 @@ -20,7 +20,7 @@ dnl This gets the standard macros, like the TCL, TK, etc ones. sinclude(../config/acinclude.m4) dnl CYGNUS LOCAL: This gets the right posix flag for gcc -AC_DEFUN(CY_AC_TCL_LYNX_POSIX, +AC_DEFUN([CY_AC_TCL_LYNX_POSIX], [AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP]) AC_MSG_CHECKING([if running LynxOS]) AC_CACHE_VAL(ac_cv_os_lynx, @@ -60,7 +60,7 @@ fi # makes configure think it's cross compiling. If --target wasn't used, then # we can't configure, so something is wrong. We don't use the cache # here cause if somebody fixes their compiler install, we want this to work. -AC_DEFUN(CY_AC_C_WORKS, +AC_DEFUN([CY_AC_C_WORKS], [# If we cannot compile and link a trivial program, we can't expect anything to work AC_MSG_CHECKING(whether the compiler ($CC) actually works) AC_TRY_COMPILE(, [/* don't need anything here */], @@ -79,7 +79,7 @@ fi AC_MSG_RESULT(yes) ]) -AC_DEFUN(CY_AC_PATH_TCLH, [ +AC_DEFUN([CY_AC_PATH_TCLH], [ # # Ok, lets find the tcl source trees so we can use the headers # Warning: transition of version 9 to 10 will break this algorithm @@ -168,7 +168,7 @@ AC_SUBST(TCLHDIR) ]) -AC_DEFUN(CY_AC_PATH_TCLCONFIG, [ +AC_DEFUN([CY_AC_PATH_TCLCONFIG], [ # # Ok, lets find the tcl configuration # First, look for one uninstalled. @@ -241,7 +241,7 @@ fi # Defined as a separate macro so we don't have to cache the values # from PATH_TCLCONFIG (because this can also be cached). -AC_DEFUN(CY_AC_LOAD_TCLCONFIG, [ +AC_DEFUN([CY_AC_LOAD_TCLCONFIG], [ . $TCLCONFIG AC_SUBST(TCL_VERSION) @@ -297,7 +297,7 @@ dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX) # - Symbols in tkConfig.sh are different than tclConfig.sh # - Acceptable for Tk to be missing but not Tcl. -AC_DEFUN(CY_AC_PATH_TKH, [ +AC_DEFUN([CY_AC_PATH_TKH], [ # # Ok, lets find the tk source trees so we can use the headers # If the directory (presumably symlink) named "tk" exists, use that one @@ -391,7 +391,7 @@ AC_SUBST(TKHDIR) ]) -AC_DEFUN(CY_AC_PATH_TKCONFIG, [ +AC_DEFUN([CY_AC_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. @@ -465,7 +465,7 @@ fi # Defined as a separate macro so we don't have to cache the values # from PATH_TKCONFIG (because this can also be cached). -AC_DEFUN(CY_AC_LOAD_TKCONFIG, [ +AC_DEFUN([CY_AC_LOAD_TKCONFIG], [ if test -f "$TKCONFIG" ; then . $TKCONFIG fi @@ -496,7 +496,7 @@ dnl AC_SUBST(TK_EXEC_PREFIX) # check for Itcl headers. -AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [ +AC_DEFUN([CY_AC_PATH_ITCLCONFIG], [ # # Ok, lets find the itcl configuration # First, look for one uninstalled. @@ -569,7 +569,7 @@ fi # Defined as a separate macro so we don't have to cache the values # from PATH_ITCLCONFIG (because this can also be cached). -AC_DEFUN(CY_AC_LOAD_ITCLCONFIG, [ +AC_DEFUN([CY_AC_LOAD_ITCLCONFIG], [ if test -f "$ITCLCONFIG" ; then . $ITCLCONFIG fi @@ -598,7 +598,7 @@ dnl AC_SUBST(ITCL_EXEC_PREFIX) # check for Itcl headers. -AC_DEFUN(CY_AC_PATH_ITCLH, [ +AC_DEFUN([CY_AC_PATH_ITCLH], [ AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir}) if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do @@ -622,7 +622,7 @@ AC_SUBST(ITCLHDIR) ]) -AC_DEFUN(CY_AC_PATH_ITKCONFIG, [ +AC_DEFUN([CY_AC_PATH_ITKCONFIG], [ # # Ok, lets find the itk configuration # First, look for one uninstalled. @@ -696,7 +696,7 @@ fi # Defined as a separate macro so we don't have to cache the values # from PATH_ITKCONFIG (because this can also be cached). -AC_DEFUN(CY_AC_LOAD_ITKCONFIG, [ +AC_DEFUN([CY_AC_LOAD_ITKCONFIG], [ if test -f "$ITKCONFIG" ; then . $ITKCONFIG fi @@ -723,7 +723,7 @@ dnl AC_SUBST(ITK_EXEC_PREFIX) AC_SUBST(ITK_LIB_SPEC) ]) -AC_DEFUN(CY_AC_PATH_ITKH, [ +AC_DEFUN([CY_AC_PATH_ITKH], [ AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir}) if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do @@ -957,7 +957,7 @@ dnl to use a different cache variable name in this macro if it is invoked dnl in a different context somewhere else. dnl gcc_AC_CHECK_DECL(SYMBOL, dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]]) -AC_DEFUN(gcc_AC_CHECK_DECL, +AC_DEFUN([gcc_AC_CHECK_DECL], [AC_MSG_CHECKING([whether $1 is declared]) AC_CACHE_VAL(gcc_cv_have_decl_$1, [AC_TRY_COMPILE([$4], @@ -975,7 +975,7 @@ dnl Check multiple functions to see whether each needs a declaration. dnl Arrange to define HAVE_DECL_<FUNCTION> to 0 or 1 as appropriate. dnl gcc_AC_CHECK_DECLS(SYMBOLS, dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]]) -AC_DEFUN(gcc_AC_CHECK_DECLS, +AC_DEFUN([gcc_AC_CHECK_DECLS], [for ac_func in $1 do changequote(, )dnl diff --git a/gnu/usr.bin/binutils/gdb/ada-tasks.c b/gnu/usr.bin/binutils/gdb/ada-tasks.c deleted file mode 100644 index 21d62d788ba..00000000000 --- a/gnu/usr.bin/binutils/gdb/ada-tasks.c +++ /dev/null @@ -1,819 +0,0 @@ -/* file ada-tasks.c: Ada tasking control for GDB - Copyright 1997 Free Software Foundation, Inc. - Contributed by Ada Core Technologies, Inc -. - This file is part of GDB. - - [$Id: ada-tasks.c,v 1.2 2004/05/21 20:23:03 kettenis Exp $] - Authors: Roch-Alexandre Nomine Beguin, Arnaud Charlet <charlet@gnat.com> - - 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. - -*/ - -#include <ctype.h> -#include "defs.h" -#include "command.h" -#include "value.h" -#include "language.h" -#include "inferior.h" -#include "symtab.h" -#include "target.h" -#include "regcache.h" -#include "gdbcore.h" - -#if (defined(__alpha__) && defined(__osf__) && !defined(__alpha_vxworks)) -#include <sys/procfs.h> -#endif - -#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)) -#include "gregset.h" -#endif - -#include "ada-lang.h" - -/* FIXME: move all this conditional compilation in description - files or in configure.in */ - -#if defined (VXWORKS_TARGET) -#define THREAD_TO_PID(tid,lwpid) (tid) - -#elif defined (linux) -#define THREAD_TO_PID(tid,lwpid) (0) - -#elif (defined (sun) && defined (__SVR4)) -#define THREAD_TO_PID thread_to_pid - -#elif defined (sgi) || defined (__WIN32__) || defined (hpux) -#define THREAD_TO_PID(tid,lwpid) ((int)lwpid) - -#else -#define THREAD_TO_PID(tid,lwpid) (0) -#endif - -#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) -#define THREAD_FETCH_REGISTERS dec_thread_fetch_registers -#define GET_CURRENT_THREAD dec_thread_get_current_thread -extern int dec_thread_get_registers (gdb_gregset_t *, gdb_fpregset_t *); -#endif - -#if defined (_AIX) -#define THREAD_FETCH_REGISTERS aix_thread_fetch_registers -#define GET_CURRENT_THREAD aix_thread_get_current_thread -#endif - -#if defined(VXWORKS_TARGET) -#define GET_CURRENT_THREAD() ((void*)inferior_pid) -#define THREAD_FETCH_REGISTERS() (-1) - -#elif defined (sun) && defined (__SVR4) -#define GET_CURRENT_THREAD solaris_thread_get_current_thread -#define THREAD_FETCH_REGISTERS() (-1) -extern void *GET_CURRENT_THREAD (); - -#elif defined (_AIX) || (defined(__alpha__) && defined(__osf__)) -extern void *GET_CURRENT_THREAD (); - -#elif defined (__WIN32__) || defined (hpux) -#define GET_CURRENT_THREAD() (inferior_pid) -#define THREAD_FETCH_REGISTERS() (-1) - -#else -#define GET_CURRENT_THREAD() (NULL) -#define THREAD_FETCH_REGISTERS() (-1) -#endif - -#define KNOWN_TASKS_NAME "system__tasking__debug__known_tasks" - -#define READ_MEMORY(addr, var) read_memory (addr, (char*) &var, sizeof (var)) -/* external declarations */ - -/* Global visible variables */ - -struct task_entry *task_list = NULL; -int ada__tasks_check_symbol_table = 1; -void *pthread_kern_addr = NULL; - -#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)) -gdb_gregset_t gregset_saved; -gdb_fpregset_t fpregset_saved; -#endif - -/* The maximum number of tasks known to the Ada runtime */ -const int MAX_NUMBER_OF_KNOWN_TASKS = 1000; - -/* the current task */ -int current_task = -1, current_task_id = -1, current_task_index; -void *current_thread, *current_lwp; - -char *ada_task_states[] = { - "Unactivated", - "Runnable", - "Terminated", - "Child Activation Wait", - "Accept Statement", - "Waiting on entry call", - "Async Select Wait", - "Delay Sleep", - "Child Termination Wait", - "Wait Child in Term Alt", - "", - "", - "", - "", - "Asynchronous Hold" -}; - -/* Global internal types */ - -static char *ada_long_task_states[] = { - "Unactivated", - "Runnable", - "Terminated", - "Waiting for child activation", - "Blocked in accept statement", - "Waiting on entry call", - "Asynchronous Selective Wait", - "Delay Sleep", - "Waiting for children termination", - "Waiting for children in terminate alternative", - "", - "", - "", - "", - "Asynchronous Hold" -}; - -/* Global internal variables */ - -static int highest_task_num = 0; -int thread_support = 0; /* 1 if the thread library in use is supported */ -static int gdbtk_task_initialization = 0; - -static int -add_task_entry (void *p_task_id, int index) -{ - struct task_entry *new_task_entry = NULL; - struct task_entry *pt; - - highest_task_num++; - new_task_entry = xmalloc (sizeof (struct task_entry)); - new_task_entry->task_num = highest_task_num; - new_task_entry->task_id = p_task_id; - new_task_entry->known_tasks_index = index; - new_task_entry->next_task = NULL; - pt = task_list; - if (pt) - { - while (pt->next_task) - pt = pt->next_task; - pt->next_task = new_task_entry; - pt->stack_per = 0; - } - else - task_list = new_task_entry; - return new_task_entry->task_num; -} - -int -get_entry_number (void *p_task_id) -{ - struct task_entry *pt; - - pt = task_list; - while (pt != NULL) - { - if (pt->task_id == p_task_id) - return pt->task_num; - pt = pt->next_task; - } - return 0; -} - -static struct task_entry * -get_thread_entry_vptr (void *thread) -{ - struct task_entry *pt; - - pt = task_list; - while (pt != NULL) - { - if (pt->thread == thread) - return pt; - pt = pt->next_task; - } - return 0; -} - -static struct task_entry * -get_entry_vptr (int p_task_num) -{ - struct task_entry *pt; - - pt = task_list; - while (pt) - { - if (pt->task_num == p_task_num) - return pt; - pt = pt->next_task; - } - return NULL; -} - -void -init_task_list (void) -{ - struct task_entry *pt, *old_pt; - - pt = task_list; - while (pt) - { - old_pt = pt; - pt = pt->next_task; - xfree (old_pt); - }; - task_list = NULL; - highest_task_num = 0; -} - -int -valid_task_id (int task) -{ - return get_entry_vptr (task) != NULL; -} - -void * -get_self_id (void) -{ - struct value *val; - void *self_id; - int result; - struct task_entry *ent; - extern int do_not_insert_breakpoints; - -#if !((defined(sun) && defined(__SVR4)) || defined(VXWORKS_TARGET) || defined(__WIN32__)) - if (thread_support) -#endif - { - ent = get_thread_entry_vptr (GET_CURRENT_THREAD ()); - return ent ? ent->task_id : 0; - } - - /* FIXME: calling a function in the inferior with a multithreaded application - is not reliable, so return NULL if there is no safe way to get the current - task */ - return NULL; -} - -int -get_current_task (void) -{ - int result; - - /* FIXME: language_ada should be defined in defs.h */ - /* if (current_language->la_language != language_ada) return -1; */ - - result = get_entry_number (get_self_id ()); - - /* return -1 if not found */ - return result == 0 ? -1 : result; -} - -/* Print detailed information about specified task */ - -static void -info_task (char *arg, int from_tty) -{ - void *temp_task; - struct task_entry *pt, *pt2; - void *self_id, *caller; - struct task_fields atcb, atcb2; - struct entry_call call; - int bounds[2]; - char image[256]; - int num; - - /* FIXME: language_ada should be defined in defs.h */ - /* if (current_language->la_language != language_ada) - { - printf_filtered ("The current language does not support tasks.\n"); - return; - } - */ - pt = get_entry_vptr (atoi (arg)); - if (pt == NULL) - { - printf_filtered ("Task %s not found.\n", arg); - return; - } - - temp_task = pt->task_id; - - /* read the atcb in the inferior */ - READ_MEMORY ((CORE_ADDR) temp_task, atcb); - - /* print the Ada task id */ - printf_filtered ("Ada Task: %p\n", temp_task); - - /* print the name of the task */ - if (atcb.image.P_ARRAY != NULL) - { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds); - bounds[1] = EXTRACT_INT (bounds[1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY), - (char *) &image, bounds[1]); - printf_filtered ("Name: %.*s\n", bounds[1], image); - } - else - printf_filtered ("<no name>\n"); - - /* print the thread id */ - - if ((long) pt->thread < 65536) - printf_filtered ("Thread: %ld\n", (long int) pt->thread); - else - printf_filtered ("Thread: %p\n", pt->thread); - - if ((long) pt->lwp != 0) - { - if ((long) pt->lwp < 65536) - printf_filtered ("LWP: %ld\n", (long int) pt->lwp); - else - printf_filtered ("LWP: %p\n", pt->lwp); - } - - /* print the parent gdb task id */ - num = get_entry_number (EXTRACT_ADDRESS (atcb.parent)); - if (num != 0) - { - printf_filtered ("Parent: %d", num); - pt2 = get_entry_vptr (num); - READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2); - - /* print the name of the task */ - if (atcb2.image.P_ARRAY != NULL) - { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS), - bounds); - bounds[1] = EXTRACT_INT (bounds[1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY), - (char *) &image, bounds[1]); - printf_filtered (" (%.*s)\n", bounds[1], image); - } - else - printf_filtered ("\n"); - } - else - printf_filtered ("No parent\n"); - - /* print the base priority of the task */ - printf_filtered ("Base Priority: %d\n", EXTRACT_INT (atcb.priority)); - - /* print the current state of the task */ - - /* check if this task is accepting a rendezvous */ - if (atcb.call == NULL) - caller = NULL; - else - { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call); - caller = EXTRACT_ADDRESS (call.self); - } - - if (caller != NULL) - { - num = get_entry_number (caller); - printf_filtered ("Accepting rendezvous with %d", num); - - if (num != 0) - { - pt2 = get_entry_vptr (num); - READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2); - - /* print the name of the task */ - if (atcb2.image.P_ARRAY != NULL) - { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS), - bounds); - bounds[1] = EXTRACT_INT (bounds[1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY), - (char *) &image, bounds[1]); - printf_filtered (" (%.*s)\n", bounds[1], image); - } - else - printf_filtered ("\n"); - } - else - printf_filtered ("\n"); - } - else - printf_filtered ("State: %s\n", ada_long_task_states[atcb.state]); -} - -#if 0 - -/* A useful function that shows the alignment of all the fields in the - tasks_fields structure - */ - -print_align (void) -{ - struct task_fields tf; - void *tf_base = &(tf); - void *tf_state = &(tf.state); - void *tf_entry_num = &(tf.entry_num); - void *tf_parent = &(tf.parent); - void *tf_priority = &(tf.priority); - void *tf_current_priority = &(tf.current_priority); - void *tf_image = &(tf.image); - void *tf_call = &(tf.call); - void *tf_thread = &(tf.thread); - void *tf_lwp = &(tf.lwp); - printf_filtered ("\n"); - printf_filtered ("(tf_base = 0x%x)\n", tf_base); - printf_filtered ("task_fields.entry_num at %3d (0x%x)\n", - tf_entry_num - tf_base, tf_entry_num); - printf_filtered ("task_fields.state at %3d (0x%x)\n", - tf_state - tf_base, tf_state); - printf_filtered ("task_fields.parent at %3d (0x%x)\n", - tf_parent - tf_base, tf_parent); - printf_filtered ("task_fields.priority at %3d (0x%x)\n", - tf_priority - tf_base, tf_priority); - printf_filtered ("task_fields.current_priority at %3d (0x%x)\n", - tf_current_priority - tf_base, tf_current_priority); - printf_filtered ("task_fields.image at %3d (0x%x)\n", - tf_image - tf_base, tf_image); - printf_filtered ("task_fields.call at %3d (0x%x)\n", - tf_call - tf_base, tf_call); - printf_filtered ("task_fields.thread at %3d (0x%x)\n", - tf_thread - tf_base, tf_thread); - printf_filtered ("task_fields.lwp at %3d (0x%x)\n", - tf_lwp - tf_base, tf_lwp); - printf_filtered ("\n"); -} -#endif - -/* Print information about currently known tasks */ - -static void -info_tasks (char *arg, int from_tty) -{ - struct value *val; - int i, task_number, state; - void *temp_task, *temp_tasks[MAX_NUMBER_OF_KNOWN_TASKS]; - struct task_entry *pt; - void *self_id, *caller, *thread_id = NULL; - struct task_fields atcb; - struct entry_call call; - int bounds[2]; - char image[256]; - int size; - char car; - -#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) - pthreadTeb_t thr; - gdb_gregset_t regs; -#endif - - static struct symbol *sym; - static struct minimal_symbol *msym; - static void *known_tasks_addr = NULL; - - int init_only = gdbtk_task_initialization; - gdbtk_task_initialization = 0; - - task_number = 0; - - if (PIDGET (inferior_ptid) == 0) - { - printf_filtered ("The program is not being run under gdb. "); - printf_filtered ("Use 'run' or 'attach' first.\n"); - return; - } - - if (ada__tasks_check_symbol_table) - { - thread_support = 0; -#if (defined(__alpha__) && defined(__osf__) & !defined(VXWORKS_TARGET)) || \ - defined (_AIX) - thread_support = 1; -#endif - - msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL); - if (msym != NULL) - known_tasks_addr = (void *) SYMBOL_VALUE_ADDRESS (msym); - else -#ifndef VXWORKS_TARGET - return; -#else - { - if (target_lookup_symbol (KNOWN_TASKS_NAME, &known_tasks_addr) != 0) - return; - } -#endif - - ada__tasks_check_symbol_table = 0; - } - - if (known_tasks_addr == NULL) - return; - -#if !((defined(sun) && defined(__SVR4)) || defined(VXWORKS_TARGET) || defined(__WIN32__) || defined (hpux)) - if (thread_support) -#endif - thread_id = GET_CURRENT_THREAD (); - - /* then we get a list of tasks created */ - - init_task_list (); - - READ_MEMORY ((CORE_ADDR) known_tasks_addr, temp_tasks); - - for (i = 0; i < MAX_NUMBER_OF_KNOWN_TASKS; i++) - { - temp_task = EXTRACT_ADDRESS (temp_tasks[i]); - - if (temp_task != NULL) - { - task_number = get_entry_number (temp_task); - if (task_number == 0) - task_number = add_task_entry (temp_task, i); - } - } - - /* Return without printing anything if this function was called in - order to init GDBTK tasking. */ - - if (init_only) - return; - - /* print the header */ - -#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) - printf_filtered - (" ID TID P-ID Pri Stack %% State Name\n"); -#else - printf_filtered (" ID TID P-ID Pri State Name\n"); -#endif - - /* Now that we have a list of task id's, we can print them */ - pt = task_list; - while (pt) - { - temp_task = pt->task_id; - - /* read the atcb in the inferior */ - READ_MEMORY ((CORE_ADDR) temp_task, atcb); - - /* store the thread id for future use */ - pt->thread = EXTRACT_ADDRESS (atcb.thread); - -#if defined (linux) - pt->lwp = (void *) THREAD_TO_PID (atcb.thread, 0); -#else - pt->lwp = EXTRACT_ADDRESS (atcb.lwp); -#endif - - /* print a star if this task is the current one */ - if (thread_id) -#if defined (__WIN32__) || defined (SGI) || defined (hpux) - printf_filtered (pt->lwp == thread_id ? "*" : " "); -#else - printf_filtered (pt->thread == thread_id ? "*" : " "); -#endif - - /* print the gdb task id */ - printf_filtered ("%3d", pt->task_num); - - /* print the Ada task id */ -#ifndef VXWORKS_TARGET - printf_filtered (" %9lx", (long) temp_task); -#else -#ifdef TARGET_64 - printf_filtered (" %#9lx", (unsigned long) pt->thread & 0x3ffffffffff); -#else - printf_filtered (" %#9lx", (long) pt->thread); -#endif -#endif - - /* print the parent gdb task id */ - printf_filtered - (" %4d", get_entry_number (EXTRACT_ADDRESS (atcb.parent))); - - /* print the base priority of the task */ - printf_filtered (" %3d", EXTRACT_INT (atcb.priority)); - -#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) - if (pt->task_num == 1 || atcb.state == Terminated) - { - printf_filtered (" Unknown"); - goto next; - } - - read_memory ((CORE_ADDR) atcb.thread, &thr, sizeof (thr)); - current_thread = atcb.thread; - regs.regs[SP_REGNUM] = 0; - if (dec_thread_get_registers (®s, NULL) == 0) - { - pt->stack_per = (100 * ((long) thr.__stack_base - - regs.regs[SP_REGNUM])) / thr.__stack_size; - /* if the thread is terminated but still there, the - stack_base/size values are erroneous. Try to patch it */ - if (pt->stack_per < 0 || pt->stack_per > 100) - pt->stack_per = 0; - } - - /* print information about stack space used in the thread */ - if (thr.__stack_size < 1024 * 1024) - { - size = thr.__stack_size / 1024; - car = 'K'; - } - else if (thr.__stack_size < 1024 * 1024 * 1024) - { - size = thr.__stack_size / 1024 / 1024; - car = 'M'; - } - else /* Who knows... */ - { - size = thr.__stack_size / 1024 / 1024 / 1024; - car = 'G'; - } - printf_filtered (" %4d%c %2d", size, car, pt->stack_per); - next: -#endif - - /* print the current state of the task */ - - /* check if this task is accepting a rendezvous */ - if (atcb.call == NULL) - caller = NULL; - else - { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call); - caller = EXTRACT_ADDRESS (call.self); - } - - if (caller != NULL) - printf_filtered (" Accepting RV with %-4d", - get_entry_number (caller)); - else - { - state = atcb.state; -#if defined (__WIN32__) || defined (SGI) || defined (hpux) - if (state == Runnable && (thread_id && pt->lwp == thread_id)) -#else - if (state == Runnable && (thread_id && pt->thread == thread_id)) -#endif - /* Replace "Runnable" by "Running" if this is the current task */ - printf_filtered (" %-22s", "Running"); - else - printf_filtered (" %-22s", ada_task_states[state]); - } - - /* finally, print the name of the task */ - if (atcb.image.P_ARRAY != NULL) - { - READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), - bounds); - bounds[1] = EXTRACT_INT (bounds[1]); - read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY), - (char *) &image, bounds[1]); - printf_filtered (" %.*s\n", bounds[1], image); - } - else - printf_filtered (" <no name>\n"); - - pt = pt->next_task; - } -} - -/* Task list initialization for GDB-Tk. We basically use info_tasks() - to initialize our variables, but abort that function before we - actually print anything. */ - -int -gdbtk_tcl_tasks_initialize (void) -{ - gdbtk_task_initialization = 1; - info_tasks ("", gdb_stdout); - - return (task_list != NULL); -} - -static void -info_tasks_command (char *arg, int from_tty) -{ - if (arg == NULL || *arg == '\000') - info_tasks (arg, from_tty); - else - info_task (arg, from_tty); -} - -/* Switch from one thread to another. */ - -static void -switch_to_thread (ptid_t ptid) -{ - if (ptid_equal (ptid, inferior_ptid)) - return; - - inferior_ptid = ptid; - flush_cached_frames (); - registers_changed (); - stop_pc = read_pc (); - select_frame (get_current_frame ()); -} - -/* Switch to a specified task. */ - -static int -task_switch (void *tid, void *lwpid) -{ - int res = 0, pid; - - if (thread_support) - { - flush_cached_frames (); - - if (current_task != current_task_id) - { - res = THREAD_FETCH_REGISTERS (); - } - else - { -#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)) - supply_gregset (&gregset_saved); - supply_fpregset (&fpregset_saved); -#endif - } - - if (res == 0) - stop_pc = read_pc (); - select_frame (get_current_frame ()); - return res; - } - - return -1; -} - -static void -task_command (char *tidstr, int from_tty) -{ - int num; - struct task_entry *e; - - if (!tidstr) - error ("Please specify a task ID. Use the \"info tasks\" command to\n" - "see the IDs of currently known tasks."); - - num = atoi (tidstr); - e = get_entry_vptr (num); - - if (e == NULL) - error ("Task ID %d not known. Use the \"info tasks\" command to\n" - "see the IDs of currently known tasks.", num); - - if (current_task_id == -1) - { -#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)) - fill_gregset (&gregset_saved, -1); - fill_fpregset (&fpregset_saved, -1); -#endif - current_task_id = get_current_task (); - } - - current_task = num; - current_task_index = e->known_tasks_index; - current_thread = e->thread; - current_lwp = e->lwp; - if (task_switch (e->thread, e->lwp) == 0) - { - /* FIXME: find_printable_frame should be defined in frame.h, and - implemented in ada-lang.c */ - /* find_printable_frame (deprecated_selected_frame, frame_relative_level (deprecated_selected_frame)); */ - printf_filtered ("[Switching to task %d]\n", num); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); - } - else - printf_filtered ("Unable to switch to task %d\n", num); -} - -void -_initialize_tasks (void) -{ - static struct cmd_list_element *task_cmd_list = NULL; - extern struct cmd_list_element *cmdlist; - - add_info ("tasks", info_tasks_command, - "Without argument: list all known Ada tasks, with status information.\n" - "info tasks n: print detailed information of task n.\n"); - - add_prefix_cmd ("task", class_run, task_command, - "Use this command to switch between tasks.\n\ - The new task ID must be currently known.", &task_cmd_list, "task ", 1, &cmdlist); -} diff --git a/gnu/usr.bin/binutils/gdb/alpha-nat.c b/gnu/usr.bin/binutils/gdb/alpha-nat.c index 0a78d949170..6fe6bdfeec6 100644 --- a/gnu/usr.bin/binutils/gdb/alpha-nat.c +++ b/gnu/usr.bin/binutils/gdb/alpha-nat.c @@ -99,7 +99,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size, { if (CANNOT_FETCH_REGISTER (regno)) { - supply_register (regno, NULL); + regcache_raw_supply (current_regcache, regno, NULL); continue; } addr = 8 * core_reg_mapping[regno]; @@ -108,7 +108,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size, /* ??? UNIQUE is a new addition. Don't generate an error. */ if (regno == ALPHA_UNIQUE_REGNUM) { - supply_register (regno, NULL); + regcache_raw_supply (current_regcache, regno, NULL); continue; } if (bad_reg < 0) @@ -116,7 +116,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size, } else { - supply_register (regno, core_reg_sect + addr); + regcache_raw_supply (current_regcache, regno, core_reg_sect + addr); } } if (bad_reg >= 0) @@ -267,6 +267,6 @@ static struct core_fns alpha_elf_core_fns = void _initialize_core_alpha (void) { - add_core_fns (&alpha_osf_core_fns); - add_core_fns (&alpha_elf_core_fns); + deprecated_add_core_fns (&alpha_osf_core_fns); + deprecated_add_core_fns (&alpha_elf_core_fns); } diff --git a/gnu/usr.bin/binutils/gdb/alpha-tdep.c b/gnu/usr.bin/binutils/gdb/alpha-tdep.c index 1599eb2a371..65fd5c1f0d6 100644 --- a/gnu/usr.bin/binutils/gdb/alpha-tdep.c +++ b/gnu/usr.bin/binutils/gdb/alpha-tdep.c @@ -40,6 +40,7 @@ #include "arch-utils.h" #include "osabi.h" #include "block.h" +#include "infcall.h" #include "elf-bfd.h" @@ -144,18 +145,6 @@ alpha_register_byte (int regno) return (regno * 8); } -static int -alpha_register_raw_size (int regno) -{ - return 8; -} - -static int -alpha_register_virtual_size (int regno) -{ - return 8; -} - /* The following represents exactly the conversion performed by the LDS instruction. This applies to both single-precision floating point and 32-bit integers. */ @@ -263,7 +252,7 @@ alpha_value_to_register (struct frame_info *frame, int regnum, structure to be returned is passed as a hidden first argument. */ static CORE_ADDR -alpha_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -281,6 +270,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct alpha_arg *m_arg; char arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS]; int required_arg_regs; + CORE_ADDR func_addr = find_function_addr (function, NULL); /* The ABI places the address of the called function in T12. */ regcache_cooked_write_signed (regcache, ALPHA_T12_REGNUM, func_addr); @@ -626,7 +616,7 @@ alpha_read_insn (CORE_ADDR pc) char buf[4]; int status; - status = read_memory_nobpt (pc, buf, 4); + status = deprecated_read_memory_nobpt (pc, buf, 4); if (status) memory_error (status, pc); return extract_unsigned_integer (buf, 4); @@ -863,14 +853,20 @@ alpha_sigtramp_frame_sniffer (struct frame_info *next_frame) CORE_ADDR pc = frame_pc_unwind (next_frame); char *name; - /* We shouldn't even bother to try if the OSABI didn't register - a sigcontext_addr handler. */ - if (!gdbarch_tdep (current_gdbarch)->sigcontext_addr) + /* NOTE: cagney/2004-04-30: Do not copy/clone this code. Instead + look at tramp-frame.h and other simplier per-architecture + sigtramp unwinders. */ + + /* We shouldn't even bother to try if the OSABI didn't register a + sigcontext_addr handler or pc_in_sigtramp hander. */ + if (gdbarch_tdep (current_gdbarch)->sigcontext_addr == NULL) + return NULL; + if (gdbarch_tdep (current_gdbarch)->pc_in_sigtramp == NULL) return NULL; /* Otherwise we should be in a signal frame. */ find_pc_partial_function (pc, &name, NULL, NULL); - if (PC_IN_SIGTRAMP (pc, name)) + if (gdbarch_tdep (current_gdbarch)->pc_in_sigtramp (pc, name)) return &alpha_sigtramp_frame_unwind; return NULL; @@ -1295,16 +1291,16 @@ alpha_supply_int_regs (int regno, const void *r0_r30, for (i = 0; i < 31; ++i) if (regno == i || regno == -1) - supply_register (i, (const char *)r0_r30 + i*8); + regcache_raw_supply (current_regcache, i, (const char *)r0_r30 + i*8); if (regno == ALPHA_ZERO_REGNUM || regno == -1) - supply_register (ALPHA_ZERO_REGNUM, NULL); + regcache_raw_supply (current_regcache, ALPHA_ZERO_REGNUM, NULL); if (regno == ALPHA_PC_REGNUM || regno == -1) - supply_register (ALPHA_PC_REGNUM, pc); + regcache_raw_supply (current_regcache, ALPHA_PC_REGNUM, pc); if (regno == ALPHA_UNIQUE_REGNUM || regno == -1) - supply_register (ALPHA_UNIQUE_REGNUM, unique); + regcache_raw_supply (current_regcache, ALPHA_UNIQUE_REGNUM, unique); } void @@ -1314,13 +1310,13 @@ alpha_fill_int_regs (int regno, void *r0_r30, void *pc, void *unique) for (i = 0; i < 31; ++i) if (regno == i || regno == -1) - regcache_collect (i, (char *)r0_r30 + i*8); + regcache_raw_collect (current_regcache, i, (char *)r0_r30 + i*8); if (regno == ALPHA_PC_REGNUM || regno == -1) - regcache_collect (ALPHA_PC_REGNUM, pc); + regcache_raw_collect (current_regcache, ALPHA_PC_REGNUM, pc); if (unique && (regno == ALPHA_UNIQUE_REGNUM || regno == -1)) - regcache_collect (ALPHA_UNIQUE_REGNUM, unique); + regcache_raw_collect (current_regcache, ALPHA_UNIQUE_REGNUM, unique); } void @@ -1330,10 +1326,11 @@ alpha_supply_fp_regs (int regno, const void *f0_f30, const void *fpcr) for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i) if (regno == i || regno == -1) - supply_register (i, (const char *)f0_f30 + (i - ALPHA_FP0_REGNUM) * 8); + regcache_raw_supply (current_regcache, i, + (const char *)f0_f30 + (i - ALPHA_FP0_REGNUM) * 8); if (regno == ALPHA_FPCR_REGNUM || regno == -1) - supply_register (ALPHA_FPCR_REGNUM, fpcr); + regcache_raw_supply (current_regcache, ALPHA_FPCR_REGNUM, fpcr); } void @@ -1343,10 +1340,11 @@ alpha_fill_fp_regs (int regno, void *f0_f30, void *fpcr) for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i) if (regno == i || regno == -1) - regcache_collect (i, (char *)f0_f30 + (i - ALPHA_FP0_REGNUM) * 8); + regcache_raw_collect (current_regcache, i, + (char *)f0_f30 + (i - ALPHA_FP0_REGNUM) * 8); if (regno == ALPHA_FPCR_REGNUM || regno == -1) - regcache_collect (ALPHA_FPCR_REGNUM, fpcr); + regcache_raw_collect (current_regcache, ALPHA_FPCR_REGNUM, fpcr); } @@ -1493,7 +1491,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Lowest text address. This is used by heuristic_proc_start() to decide when to stop looking. */ - tdep->vm_min_address = (CORE_ADDR) 0x120000000; + tdep->vm_min_address = (CORE_ADDR) 0x120000000LL; tdep->dynamic_sigtramp_offset = NULL; tdep->sigcontext_addr = NULL; @@ -1521,8 +1519,6 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, alpha_register_name); set_gdbarch_deprecated_register_byte (gdbarch, alpha_register_byte); - set_gdbarch_deprecated_register_raw_size (gdbarch, alpha_register_raw_size); - set_gdbarch_deprecated_register_virtual_size (gdbarch, alpha_register_virtual_size); set_gdbarch_register_type (gdbarch, alpha_register_type); set_gdbarch_cannot_fetch_register (gdbarch, alpha_cannot_fetch_register); @@ -1542,7 +1538,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Call info. */ - set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention); + set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention); set_gdbarch_extract_return_value (gdbarch, alpha_extract_return_value); set_gdbarch_store_return_value (gdbarch, alpha_store_return_value); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, alpha_extract_struct_value_address); @@ -1611,5 +1607,5 @@ search. The only need to set it is when debugging a stripped executable.", /* We need to throw away the frame cache when we set this, since it might change our ability to get backtraces. */ set_cmd_sfunc (c, reinit_frame_cache_sfunc); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); } diff --git a/gnu/usr.bin/binutils/gdb/alphanbsd-tdep.c b/gnu/usr.bin/binutils/gdb/alphanbsd-tdep.c index e72b6c5f41b..ad00f98a536 100644 --- a/gnu/usr.bin/binutils/gdb/alphanbsd-tdep.c +++ b/gnu/usr.bin/binutils/gdb/alphanbsd-tdep.c @@ -28,11 +28,11 @@ #include "osabi.h" #include "gdb_string.h" -#include "solib-svr4.h" #include "alpha-tdep.h" #include "alphabsd-tdep.h" #include "nbsd-tdep.h" +#include "solib-svr4.h" static void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, @@ -70,9 +70,9 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, /* Integer registers. */ for (regno = 0; regno < ALPHA_ZERO_REGNUM; regno++) - supply_register (regno, regs + (regmap[regno] * 8)); - supply_register (ALPHA_ZERO_REGNUM, NULL); - supply_register (PC_REGNUM, regs + (28 * 8)); + regcache_raw_supply (current_regcache, regno, regs + (regmap[regno] * 8)); + regcache_raw_supply (current_regcache, ALPHA_ZERO_REGNUM, NULL); + regcache_raw_supply (current_regcache, PC_REGNUM, regs + (28 * 8)); /* Floating point registers. */ alphabsd_supply_fpreg (fpregs, -1); @@ -155,7 +155,7 @@ alphanbsd_sigtramp_offset (CORE_ADDR pc) LONGEST off; int i; - if (read_memory_nobpt (pc, (char *) w, 4) != 0) + if (deprecated_read_memory_nobpt (pc, (char *) w, 4) != 0) return -1; for (i = 0; i < RETCODE_NWORDS; i++) @@ -169,7 +169,7 @@ alphanbsd_sigtramp_offset (CORE_ADDR pc) off = i * 4; pc -= off; - if (read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0) + if (deprecated_read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0) return -1; if (memcmp (ret, sigtramp_retcode, RETCODE_SIZE) == 0) @@ -206,8 +206,6 @@ alphanbsd_init_abi (struct gdbarch_info info, /* Hook into the MDEBUG frame unwinder. */ alpha_mdebug_init_abi (info, gdbarch); - set_gdbarch_pc_in_sigtramp (gdbarch, alphanbsd_pc_in_sigtramp); - /* NetBSD/alpha does not provide single step support via ptrace(2); we must use software single-stepping. */ set_gdbarch_software_single_step (gdbarch, alpha_software_single_step); @@ -216,6 +214,7 @@ alphanbsd_init_abi (struct gdbarch_info info, nbsd_lp64_solib_svr4_fetch_link_map_offsets); tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset; + tdep->pc_in_sigtramp = alphanbsd_pc_in_sigtramp; tdep->sigcontext_addr = alphanbsd_sigcontext_addr; tdep->jb_pc = 2; @@ -230,6 +229,6 @@ _initialize_alphanbsd_tdep (void) gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD_ELF, alphanbsd_init_abi); - add_core_fns (&alphanbsd_core_fns); - add_core_fns (&alphanbsd_elfcore_fns); + deprecated_add_core_fns (&alphanbsd_core_fns); + deprecated_add_core_fns (&alphanbsd_elfcore_fns); } diff --git a/gnu/usr.bin/binutils/gdb/amd64-linux-tdep.h b/gnu/usr.bin/binutils/gdb/amd64-linux-tdep.h deleted file mode 100644 index 5b960201f82..00000000000 --- a/gnu/usr.bin/binutils/gdb/amd64-linux-tdep.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Target-dependent definitions for GNU/Linux x86-64. - - Copyright 2003, 2004 Free Software Foundation, Inc. - - Contributed by Michal Ludvig, SuSE AG. - - 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. */ - -#ifndef AMD64_LINUX_TDEP_H -#define AMD64_LINUX_TDEP_H - -/* Fill GDB's register array with the general-purpose register values - in *GREGSETP. */ - -void amd64_linux_supply_gregset (char *regp); - -/* Fill register REGNO (if it is a general-purpose register) in - *GREGSETPS with the value in GDB's register array. If REGNO is -1, - do this for all registers. */ - -void amd64_linux_fill_gregset (char *regp, int regno); - -#endif /* amd64-linux-tdep.h */ diff --git a/gnu/usr.bin/binutils/gdb/amd64obsd-nat.c b/gnu/usr.bin/binutils/gdb/amd64obsd-nat.c index 0f9b5efac7f..6f8a6014b95 100644 --- a/gnu/usr.bin/binutils/gdb/amd64obsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/amd64obsd-nat.c @@ -22,6 +22,7 @@ #include "defs.h" #include "gdbcore.h" #include "regcache.h" +#include "target.h" #include "gdb_assert.h" @@ -138,6 +139,9 @@ _initialize_amd64obsd_nat (void) amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64obsd32_r_reg_offset); amd64_native_gregset64_reg_offset = amd64obsd_r_reg_offset; + /* We've got nothing to add to the common *BSD/amd64 target. */ + add_target (amd64bsd_target ()); + /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (amd64obsd_supply_pcb); } diff --git a/gnu/usr.bin/binutils/gdb/annotate.c b/gnu/usr.bin/binutils/gdb/annotate.c index 0ba9b42f6cd..c84c63d9610 100644 --- a/gnu/usr.bin/binutils/gdb/annotate.c +++ b/gnu/usr.bin/binutils/gdb/annotate.c @@ -35,11 +35,11 @@ static void print_value_flags (struct type *); static void breakpoint_changed (struct breakpoint *); -void (*annotate_starting_hook) (void); -void (*annotate_stopped_hook) (void); -void (*annotate_signalled_hook) (void); -void (*annotate_signal_hook) (void); -void (*annotate_exited_hook) (void); +void (*deprecated_annotate_starting_hook) (void); +void (*deprecated_annotate_stopped_hook) (void); +void (*deprecated_annotate_signalled_hook) (void); +void (*deprecated_annotate_signal_hook) (void); +void (*deprecated_annotate_exited_hook) (void); static int ignore_count_changed = 0; @@ -102,8 +102,8 @@ void annotate_starting (void) { - if (annotate_starting_hook) - annotate_starting_hook (); + if (deprecated_annotate_starting_hook) + deprecated_annotate_starting_hook (); else { if (annotation_level > 1) @@ -116,8 +116,8 @@ annotate_starting (void) void annotate_stopped (void) { - if (annotate_stopped_hook) - annotate_stopped_hook (); + if (deprecated_annotate_stopped_hook) + deprecated_annotate_stopped_hook (); else { if (annotation_level > 1) @@ -133,8 +133,8 @@ annotate_stopped (void) void annotate_exited (int exitstatus) { - if (annotate_exited_hook) - annotate_exited_hook (); + if (deprecated_annotate_exited_hook) + deprecated_annotate_exited_hook (); else { if (annotation_level > 1) @@ -145,8 +145,8 @@ annotate_exited (int exitstatus) void annotate_signalled (void) { - if (annotate_signalled_hook) - annotate_signalled_hook (); + if (deprecated_annotate_signalled_hook) + deprecated_annotate_signalled_hook (); if (annotation_level > 1) printf_filtered ("\n\032\032signalled\n"); @@ -183,8 +183,8 @@ annotate_signal_string_end (void) void annotate_signal (void) { - if (annotate_signal_hook) - annotate_signal_hook (); + if (deprecated_annotate_signal_hook) + deprecated_annotate_signal_hook (); if (annotation_level > 1) printf_filtered ("\n\032\032signal\n"); @@ -579,7 +579,7 @@ _initialize_annotate (void) { if (annotation_level > 1) { - delete_breakpoint_hook = breakpoint_changed; - modify_breakpoint_hook = breakpoint_changed; + deprecated_delete_breakpoint_hook = breakpoint_changed; + deprecated_modify_breakpoint_hook = breakpoint_changed; } } diff --git a/gnu/usr.bin/binutils/gdb/annotate.h b/gnu/usr.bin/binutils/gdb/annotate.h index ac3cec8f94f..cca14d38024 100644 --- a/gnu/usr.bin/binutils/gdb/annotate.h +++ b/gnu/usr.bin/binutils/gdb/annotate.h @@ -99,8 +99,8 @@ extern void annotate_elt_rep_end (void); extern void annotate_elt (void); extern void annotate_array_section_end (void); -extern void (*annotate_starting_hook) (void); -extern void (*annotate_stopped_hook) (void); -extern void (*annotate_signalled_hook) (void); -extern void (*annotate_signal_hook) (void); -extern void (*annotate_exited_hook) (void); +extern void (*deprecated_annotate_starting_hook) (void); +extern void (*deprecated_annotate_stopped_hook) (void); +extern void (*deprecated_annotate_signalled_hook) (void); +extern void (*deprecated_annotate_signal_hook) (void); +extern void (*deprecated_annotate_exited_hook) (void); diff --git a/gnu/usr.bin/binutils/gdb/arm-tdep.c b/gnu/usr.bin/binutils/gdb/arm-tdep.c index 00346908548..43de3b1f095 100644 --- a/gnu/usr.bin/binutils/gdb/arm-tdep.c +++ b/gnu/usr.bin/binutils/gdb/arm-tdep.c @@ -191,7 +191,7 @@ static int target_is_thumb; /* Flag set by arm_fix_call_dummy that tells whether the calling function is a Thumb function. This flag is checked by - arm_pc_is_thumb and arm_call_dummy_breakpoint_offset. */ + arm_pc_is_thumb. */ static int caller_is_thumb; @@ -234,7 +234,7 @@ arm_pc_is_thumb_dummy (CORE_ADDR memaddr) frame location (true if we have not pushed large data structures or gone too many levels deep) and that our 1024 is not enough to consider code regions as part of the stack (true for most practical purposes). */ - if (DEPRECATED_PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024)) + if (deprecated_pc_in_call_dummy (memaddr)) return caller_is_thumb; else return 0; @@ -269,39 +269,6 @@ arm_saved_pc_after_call (struct frame_info *frame) return ADDR_BITS_REMOVE (read_register (ARM_LR_REGNUM)); } -/* Determine whether the function invocation represented by FI has a - frame on the stack associated with it. If it does return zero, - otherwise return 1. */ - -static int -arm_frameless_function_invocation (struct frame_info *fi) -{ - CORE_ADDR func_start, after_prologue; - int frameless; - - /* Sometimes we have functions that do a little setup (like saving the - vN registers with the stmdb instruction, but DO NOT set up a frame. - The symbol table will report this as a prologue. However, it is - important not to try to parse these partial frames as frames, or we - will get really confused. - - So I will demand 3 instructions between the start & end of the - prologue before I call it a real prologue, i.e. at least - mov ip, sp, - stmdb sp!, {} - sub sp, ip, #4. */ - - func_start = (get_frame_func (fi) + FUNCTION_START_OFFSET); - after_prologue = SKIP_PROLOGUE (func_start); - - /* There are some frameless functions whose first two instructions - follow the standard APCS form, in which case after_prologue will - be func_start + 8. */ - - frameless = (after_prologue < func_start + 12); - return frameless; -} - /* A typical Thumb prologue looks like this: push {r7, lr} add sp, sp, #-28 @@ -407,7 +374,7 @@ arm_skip_prologue (CORE_ADDR pc) struct symtab_and_line sal; /* If we're in a dummy frame, don't even try to skip the prologue. */ - if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) + if (deprecated_pc_in_call_dummy (pc)) return pc; /* See what the symbol table says. */ @@ -993,15 +960,6 @@ arm_prologue_this_id (struct frame_info *next_frame, return; id = frame_id_build (cache->prev_sp, func); - - /* Check that we're not going round in circles with the same frame - ID (but avoid applying the test to sentinel frames which do go - round in circles). */ - if (frame_relative_level (next_frame) >= 0 - && get_frame_type (next_frame) == NORMAL_FRAME - && frame_id_eq (get_frame_id (next_frame), id)) - return; - *this_id = id; } @@ -1038,8 +996,8 @@ arm_prologue_prev_register (struct frame_info *next_frame, return; } - trad_frame_prev_register (next_frame, cache->saved_regs, prev_regnum, - optimized, lvalp, addrp, realnump, valuep); + trad_frame_get_prev_register (next_frame, cache->saved_regs, prev_regnum, + optimized, lvalp, addrp, realnump, valuep); } struct frame_unwind arm_prologue_unwind = { @@ -1131,8 +1089,8 @@ arm_sigtramp_prev_register (struct frame_info *next_frame, *this_cache = arm_make_sigtramp_cache (next_frame); cache = *this_cache; - trad_frame_prev_register (next_frame, cache->saved_regs, prev_regnum, - optimized, lvalp, addrp, realnump, valuep); + trad_frame_get_prev_register (next_frame, cache->saved_regs, prev_regnum, + optimized, lvalp, addrp, realnump, valuep); } struct frame_unwind arm_sigtramp_unwind = { @@ -1144,13 +1102,8 @@ struct frame_unwind arm_sigtramp_unwind = { static const struct frame_unwind * arm_sigtramp_unwind_sniffer (struct frame_info *next_frame) { - /* Note: If an ARM PC_IN_SIGTRAMP method ever needs to compare - against the name of the function, the code below will have to be - changed to first fetch the name of the function and then pass - this name to PC_IN_SIGTRAMP. */ - if (SIGCONTEXT_REGISTER_ADDRESS_P () - && PC_IN_SIGTRAMP (frame_pc_unwind (next_frame), (char *) 0)) + && legacy_pc_in_sigtramp (frame_pc_unwind (next_frame), (char *) 0)) return &arm_sigtramp_unwind; return NULL; @@ -1187,20 +1140,6 @@ arm_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame) return frame_unwind_register_unsigned (this_frame, ARM_SP_REGNUM); } -/* DEPRECATED_CALL_DUMMY_WORDS: - This sequence of words is the instructions - - mov lr,pc - mov pc,r4 - illegal - - Note this is 12 bytes. */ - -static LONGEST arm_call_dummy_words[] = -{ - 0xe1a0e00f, 0xe1a0f004, 0xe7ffdefe -}; - /* When arguments must be pushed onto the stack, they go on in reverse order. The code below implements a FILO (stack) to do this. */ @@ -1238,7 +1177,7 @@ pop_stack_item (struct stack_item *si) we should probably support some of them based on the selected ABI. */ static CORE_ADDR -arm_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -2738,9 +2677,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->lowest_pc = 0x20; tdep->jb_pc = -1; /* Longjump support not enabled by default. */ - set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_call_dummy_words); - set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0); - set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call); set_gdbarch_write_pc (gdbarch, arm_write_pc); @@ -2750,8 +2686,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_unwind_pc (gdbarch, arm_unwind_pc); set_gdbarch_unwind_sp (gdbarch, arm_unwind_sp); - set_gdbarch_deprecated_frameless_function_invocation (gdbarch, arm_frameless_function_invocation); - frame_base_set_default (gdbarch, &arm_normal_base); /* Address manipulation. */ @@ -2776,10 +2710,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM); set_gdbarch_deprecated_register_byte (gdbarch, arm_register_byte); - set_gdbarch_deprecated_register_bytes (gdbarch, - (NUM_GREGS * INT_REGISTER_SIZE - + NUM_FREGS * FP_REGISTER_SIZE - + NUM_SREGS * STATUS_REGISTER_SIZE)); set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS); set_gdbarch_register_type (gdbarch, arm_register_type); @@ -2793,7 +2723,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Returning results. */ set_gdbarch_extract_return_value (gdbarch, arm_extract_return_value); set_gdbarch_store_return_value (gdbarch, arm_store_return_value); - set_gdbarch_use_struct_convention (gdbarch, arm_use_struct_convention); + set_gdbarch_deprecated_use_struct_convention (gdbarch, arm_use_struct_convention); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, arm_extract_struct_value_address); /* Single stepping. */ @@ -2961,7 +2891,7 @@ _initialize_arm_tdep (void) &setlist); set_cmd_sfunc (new_set, set_disassembly_style_sfunc); deprecate_cmd (new_set, "set arm disassembly"); - deprecate_cmd (add_show_from_set (new_set, &showlist), + deprecate_cmd (deprecated_add_show_from_set (new_set, &showlist), "show arm disassembly"); /* And now add the new interface. */ @@ -2970,22 +2900,14 @@ _initialize_arm_tdep (void) helptext, &setarmcmdlist); set_cmd_sfunc (new_set, set_disassembly_style_sfunc); - add_show_from_set (new_set, &showarmcmdlist); - - add_setshow_cmd_full ("apcs32", no_class, - var_boolean, (char *) &arm_apcs_32, - "Set usage of ARM 32-bit mode.", - "Show usage of ARM 32-bit mode.", - NULL, NULL, - &setlist, &showlist, &new_set, &new_show); - deprecate_cmd (new_set, "set arm apcs32"); - deprecate_cmd (new_show, "show arm apcs32"); - - add_setshow_boolean_cmd ("apcs32", no_class, &arm_apcs_32, - "Set usage of ARM 32-bit mode. " - "When off, a 26-bit PC will be used.", - "Show usage of ARM 32-bit mode. " - "When off, a 26-bit PC will be used.", + deprecated_add_show_from_set (new_set, &showarmcmdlist); + + add_setshow_boolean_cmd ("apcs32", no_class, &arm_apcs_32, "\ +Set usage of ARM 32-bit mode.", "\ +Show usage of ARM 32-bit mode.", "\ +When off, a 26-bit PC will be used.\n\ +When off, a 26-bit PC will be used.", "\ +Usage of ARM 32-bit mode is %s.", NULL, NULL, &setarmcmdlist, &showarmcmdlist); @@ -3000,7 +2922,8 @@ _initialize_arm_tdep (void) "vfp - VFP co-processor.", &setarmcmdlist); set_cmd_sfunc (new_set, set_fp_model_sfunc); - set_cmd_sfunc (add_show_from_set (new_set, &showarmcmdlist), show_fp_model); + set_cmd_sfunc (deprecated_add_show_from_set (new_set, &showarmcmdlist), + show_fp_model); /* Add the deprecated "othernames" command. */ deprecate_cmd (add_com ("othernames", class_obscure, arm_othernames, @@ -3008,11 +2931,11 @@ _initialize_arm_tdep (void) "set arm disassembly"); /* Debugging flag. */ - add_setshow_boolean_cmd ("arm", class_maintenance, &arm_debug, - "Set ARM debugging. " - "When on, arm-specific debugging is enabled.", - "Show ARM debugging. " - "When on, arm-specific debugging is enabled.", + add_setshow_boolean_cmd ("arm", class_maintenance, &arm_debug, "\ +Set ARM debugging.", "\ +Show ARM debugging.", "\ +When on, arm-specific debugging is enabled.", "\ +ARM debugging is %s.", NULL, NULL, &setdebuglist, &showdebuglist); } diff --git a/gnu/usr.bin/binutils/gdb/armnbsd-tdep.c b/gnu/usr.bin/binutils/gdb/armnbsd-tdep.c index af423153870..cbceb412ab5 100644 --- a/gnu/usr.bin/binutils/gdb/armnbsd-tdep.c +++ b/gnu/usr.bin/binutils/gdb/armnbsd-tdep.c @@ -1,5 +1,6 @@ /* Target-specific functions for ARM running under NetBSD. - Copyright 2002, 2003 Free Software Foundation, Inc. + + Copyright 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -34,6 +35,9 @@ /* For compatibility with previous implemenations of GDB on arm/NetBSD, override the default little-endian breakpoint. */ static const char arm_nbsd_arm_le_breakpoint[] = {0x11, 0x00, 0x00, 0xe6}; +static const char arm_nbsd_arm_be_breakpoint[] = {0xe6, 0x00, 0x00, 0x11}; +static const char arm_nbsd_thumb_le_breakpoint[] = {0xfe, 0xde}; +static const char arm_nbsd_thumb_be_breakpoint[] = {0xde, 0xfe}; static int arm_netbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name) @@ -51,8 +55,26 @@ arm_netbsd_init_abi_common (struct gdbarch_info info, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); tdep->lowest_pc = 0x8000; - tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint; - tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint); + switch (info.byte_order) + { + case BFD_ENDIAN_LITTLE: + tdep->arm_breakpoint = arm_nbsd_arm_le_breakpoint; + tdep->thumb_breakpoint = arm_nbsd_thumb_le_breakpoint; + tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_le_breakpoint); + tdep->thumb_breakpoint_size = sizeof (arm_nbsd_thumb_le_breakpoint); + break; + + case BFD_ENDIAN_BIG: + tdep->arm_breakpoint = arm_nbsd_arm_be_breakpoint; + tdep->thumb_breakpoint = arm_nbsd_thumb_be_breakpoint; + tdep->arm_breakpoint_size = sizeof (arm_nbsd_arm_be_breakpoint); + tdep->thumb_breakpoint_size = sizeof (arm_nbsd_thumb_be_breakpoint); + break; + + default: + internal_error (__FILE__, __LINE__, + "arm_gdbarch_init: bad byte order for float format"); + } tdep->jb_pc = ARM_NBSD_JB_PC; tdep->jb_elt_size = ARM_NBSD_JB_ELEMENT_SIZE; @@ -105,5 +127,5 @@ _initialize_arm_netbsd_tdep (void) gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD_ELF, arm_netbsd_elf_init_abi); gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_OPENBSD_ELF, - arm_netbsd_elf_init_abi); + arm_netbsd_elf_init_abi); } diff --git a/gnu/usr.bin/binutils/gdb/bcache.c b/gnu/usr.bin/binutils/gdb/bcache.c index cadadb5cce6..0bc533ebfef 100644 --- a/gnu/usr.bin/binutils/gdb/bcache.c +++ b/gnu/usr.bin/binutils/gdb/bcache.c @@ -303,7 +303,7 @@ print_percentage (int portion, int total) if (total == 0) printf_filtered ("(not applicable)\n"); else - printf_filtered ("%3d%%\n", portion * 100 / total); + printf_filtered ("%3d%%\n", (int) (portion * 100.0 / total)); } diff --git a/gnu/usr.bin/binutils/gdb/blockframe.c b/gnu/usr.bin/binutils/gdb/blockframe.c index 265bd2e82f1..d752c8dd27f 100644 --- a/gnu/usr.bin/binutils/gdb/blockframe.c +++ b/gnu/usr.bin/binutils/gdb/blockframe.c @@ -43,118 +43,6 @@ void _initialize_blockframe (void); -/* Is ADDR inside the startup file? Note that if your machine has a - way to detect the bottom of the stack, there is no need to call - this function from DEPRECATED_FRAME_CHAIN_VALID; the reason for - doing so is that some machines have no way of detecting bottom of - stack. - - A PC of zero is always considered to be the bottom of the stack. */ - -int -deprecated_inside_entry_file (CORE_ADDR addr) -{ - if (addr == 0) - return 1; - if (symfile_objfile == 0) - return 0; - if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT - || CALL_DUMMY_LOCATION == AT_SYMBOL) - { - /* Do not stop backtracing if the pc is in the call dummy - at the entry point. */ - /* FIXME: Won't always work with zeros for the last two arguments */ - if (DEPRECATED_PC_IN_CALL_DUMMY (addr, 0, 0)) - return 0; - } - return (addr >= symfile_objfile->ei.deprecated_entry_file_lowpc && - addr < symfile_objfile->ei.deprecated_entry_file_highpc); -} - -/* Test whether PC is in the range of addresses that corresponds to - the "main" function. */ - -int -inside_main_func (CORE_ADDR pc) -{ - struct minimal_symbol *msymbol; - - if (symfile_objfile == 0) - return 0; - - msymbol = lookup_minimal_symbol (main_name (), NULL, symfile_objfile); - - /* If the address range hasn't been set up at symbol reading time, - set it up now. */ - - if (msymbol != NULL - && symfile_objfile->ei.main_func_lowpc == INVALID_ENTRY_LOWPC - && symfile_objfile->ei.main_func_highpc == INVALID_ENTRY_HIGHPC) - { - /* brobecker/2003-10-10: We used to rely on lookup_symbol() to - search the symbol associated to the "main" function. - Unfortunately, lookup_symbol() uses the current-language - la_lookup_symbol_nonlocal function to do the global symbol - search. Depending on the language, this can introduce - certain side-effects, because certain languages, for instance - Ada, may find more than one match. Therefore we prefer to - search the "main" function symbol using its address rather - than its name. */ - struct symbol *mainsym = - find_pc_function (SYMBOL_VALUE_ADDRESS (msymbol)); - - if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK) - { - symfile_objfile->ei.main_func_lowpc = - BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym)); - symfile_objfile->ei.main_func_highpc = - BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym)); - } - } - - /* Not in the normal symbol tables, see if "main" is in the partial - symbol table. If it's not, then give up. */ - if (msymbol != NULL && MSYMBOL_TYPE (msymbol) == mst_text) - { - CORE_ADDR maddr = SYMBOL_VALUE_ADDRESS (msymbol); - asection *msect = SYMBOL_BFD_SECTION (msymbol); - struct obj_section *osect = find_pc_sect_section (maddr, msect); - - if (osect != NULL) - { - int i; - - /* Step over other symbols at this same address, and symbols - in other sections, to find the next symbol in this - section with a different address. */ - for (i = 1; SYMBOL_LINKAGE_NAME (msymbol + i) != NULL; i++) - { - if (SYMBOL_VALUE_ADDRESS (msymbol + i) != maddr - && SYMBOL_BFD_SECTION (msymbol + i) == msect) - break; - } - - symfile_objfile->ei.main_func_lowpc = maddr; - - /* Use the lesser of the next minimal symbol in the same - section, or the end of the section, as the end of the - function. */ - if (SYMBOL_LINKAGE_NAME (msymbol + i) != NULL - && SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr) - symfile_objfile->ei.main_func_highpc = - SYMBOL_VALUE_ADDRESS (msymbol + i); - else - /* We got the start address from the last msymbol in the - objfile. So the end address is the end of the - section. */ - symfile_objfile->ei.main_func_highpc = osect->endaddr; - } - } - - return (symfile_objfile->ei.main_func_lowpc <= pc - && symfile_objfile->ei.main_func_highpc > pc); -} - /* Test whether THIS_FRAME is inside the process entry point function. */ int @@ -163,66 +51,6 @@ inside_entry_func (struct frame_info *this_frame) return (get_frame_func (this_frame) == entry_point_address ()); } -/* Similar to inside_entry_func, but accomodating legacy frame code. */ - -static int -legacy_inside_entry_func (CORE_ADDR pc) -{ - if (symfile_objfile == 0) - return 0; - - if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT) - { - /* Do not stop backtracing if the program counter is in the call - dummy at the entry point. */ - /* FIXME: This won't always work with zeros for the last two - arguments. */ - if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) - return 0; - } - - return (symfile_objfile->ei.entry_func_lowpc <= pc - && symfile_objfile->ei.entry_func_highpc > pc); -} - -/* Return nonzero if the function for this frame lacks a prologue. - Many machines can define DEPRECATED_FRAMELESS_FUNCTION_INVOCATION - to just call this function. */ - -int -legacy_frameless_look_for_prologue (struct frame_info *frame) -{ - CORE_ADDR func_start; - - func_start = get_frame_func (frame); - if (func_start) - { - func_start += FUNCTION_START_OFFSET; - /* NOTE: cagney/2004-02-09: Eliminated per-architecture - PROLOGUE_FRAMELESS_P call as architectures with custom - implementations had all been deleted. Eventually even this - function can go - GDB no longer tries to differentiate - between framed, frameless and stackless functions. They are - all now considered equally evil :-^. */ - /* If skipping the prologue ends up skips nothing, there must be - no prologue and hence no code creating a frame. There for - the function is "frameless" :-/. */ - return func_start == SKIP_PROLOGUE (func_start); - } - else if (get_frame_pc (frame) == 0) - /* A frame with a zero PC is usually created by dereferencing a - NULL function pointer, normally causing an immediate core dump - of the inferior. Mark function as frameless, as the inferior - has no chance of setting up a stack frame. */ - return 1; - else - /* If we can't find the start of the function, we don't really - know whether the function is frameless, but we should be able - to get a reasonable (i.e. best we can do under the - circumstances) backtrace by saying that it isn't. */ - return 0; -} - /* Return the innermost lexical block in execution in a specified stack frame. The frame address is assumed valid. @@ -343,10 +171,13 @@ clear_pc_function_cache (void) If it fails, it sets *NAME, *ADDRESS, and *ENDADDR to zero and returns 0. */ +/* Backward compatibility, no section argument. */ + int -find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, - CORE_ADDR *address, CORE_ADDR *endaddr) +find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, + CORE_ADDR *endaddr) { + struct bfd_section *section; struct partial_symtab *pst; struct symbol *f; struct minimal_symbol *msymbol; @@ -355,6 +186,21 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, int i; CORE_ADDR mapped_pc; + /* To ensure that the symbol returned belongs to the correct setion + (and that the last [random] symbol from the previous section + isn't returned) try to find the section containing PC. First try + the overlay code (which by default returns NULL); and second try + the normal section code (which almost always succeeds). */ + section = find_pc_overlay (pc); + if (section == NULL) + { + struct obj_section *obj_section = find_pc_section (pc); + if (obj_section == NULL) + section = NULL; + else + section = obj_section->the_bfd_section; + } + mapped_pc = overlay_mapped_address (pc, section); if (mapped_pc >= cache_pc_function_low @@ -362,17 +208,6 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, && section == cache_pc_function_section) goto return_cached_value; - /* If sigtramp is in the u area, it counts as a function (especially - important for step_1). */ - if (SIGTRAMP_START_P () && PC_IN_SIGTRAMP (mapped_pc, (char *) NULL)) - { - cache_pc_function_low = SIGTRAMP_START (mapped_pc); - cache_pc_function_high = SIGTRAMP_END (mapped_pc); - cache_pc_function_name = "<sigtramp>"; - cache_pc_function_section = section; - goto return_cached_value; - } - msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section); pst = find_pc_sect_psymtab (mapped_pc, section); if (pst) @@ -507,32 +342,6 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name, return 1; } -/* Backward compatibility, no section argument. */ - -int -find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, - CORE_ADDR *endaddr) -{ - struct bfd_section *bfd_section; - - /* To ensure that the symbol returned belongs to the correct setion - (and that the last [random] symbol from the previous section - isn't returned) try to find the section containing PC. First try - the overlay code (which by default returns NULL); and second try - the normal section code (which almost always succeeds). */ - bfd_section = find_pc_overlay (pc); - if (bfd_section == NULL) - { - struct obj_section *obj_section = find_pc_section (pc); - if (obj_section == NULL) - bfd_section = NULL; - else - bfd_section = obj_section->the_bfd_section; - } - return find_pc_sect_partial_function (pc, bfd_section, name, address, - endaddr); -} - /* Return the innermost stack frame executing inside of BLOCK, or NULL if there is no such frame. If BLOCK is NULL, just return NULL. */ @@ -561,83 +370,3 @@ block_innermost_frame (struct block *block) return frame; } } - -/* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK - below is for infrun.c, which may give the macro a pc without that - subtracted out. */ - -/* Is the PC in a call dummy? SP and FRAME_ADDRESS are the bottom and - top of the stack frame which we are checking, where "bottom" and - "top" refer to some section of memory which contains the code for - the call dummy. Calls to this macro assume that the contents of - SP_REGNUM and DEPRECATED_FP_REGNUM (or the saved values thereof), - respectively, are the things to pass. - - This won't work on the 29k, where SP_REGNUM and - DEPRECATED_FP_REGNUM don't have that meaning, but the 29k doesn't - use ON_STACK. This could be fixed by generalizing this scheme, - perhaps by passing in a frame and adding a few fields, at least on - machines which need them for DEPRECATED_PC_IN_CALL_DUMMY. - - Something simpler, like checking for the stack segment, doesn't work, - since various programs (threads implementations, gcc nested function - stubs, etc) may either allocate stack frames in another segment, or - allocate other kinds of code on the stack. */ - -int -deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address) -{ - return (INNER_THAN ((sp), (pc)) - && (frame_address != 0) - && INNER_THAN ((pc), (frame_address))); -} - -int -deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp, - CORE_ADDR frame_address) -{ - CORE_ADDR addr = entry_point_address (); - return ((pc) >= addr && (pc) <= (addr + DECR_PC_AFTER_BREAK)); -} - -/* Returns true for a user frame or a call_function_by_hand dummy - frame, and false for the CRT0 start-up frame. Purpose is to - terminate backtrace. */ - -int -legacy_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) -{ - /* Don't prune CALL_DUMMY frames. */ - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES - && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0)) - return 1; - - /* If the new frame pointer is zero, then it isn't valid. */ - if (fp == 0) - return 0; - - /* If the new frame would be inside (younger than) the previous frame, - then it isn't valid. */ - if (INNER_THAN (fp, get_frame_base (fi))) - return 0; - - /* If the architecture has a custom DEPRECATED_FRAME_CHAIN_VALID, - call it now. */ - if (DEPRECATED_FRAME_CHAIN_VALID_P ()) - return DEPRECATED_FRAME_CHAIN_VALID (fp, fi); - - /* If we're already inside the entry function for the main objfile, then it - isn't valid. */ - if (legacy_inside_entry_func (get_frame_pc (fi))) - return 0; - - /* If we're inside the entry file, it isn't valid. */ - /* NOTE/drow 2002-12-25: should there be a way to disable this check? It - assumes a single small entry file, and the way some debug readers (e.g. - dbxread) figure out which object is the entry file is somewhat hokey. */ - if (deprecated_inside_entry_file (frame_pc_unwind (fi))) - return 0; - - return 1; -} diff --git a/gnu/usr.bin/binutils/gdb/breakpoint.c b/gnu/usr.bin/binutils/gdb/breakpoint.c index 01a46b39f41..eac34b8534f 100644 --- a/gnu/usr.bin/binutils/gdb/breakpoint.c +++ b/gnu/usr.bin/binutils/gdb/breakpoint.c @@ -49,6 +49,8 @@ #include "cli/cli-script.h" #include "gdb_assert.h" #include "block.h" +#include "solist.h" +#include "observer.h" #include "gdb-events.h" @@ -99,7 +101,8 @@ static void check_duplicates (struct breakpoint *); static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int); -static CORE_ADDR adjust_breakpoint_address (CORE_ADDR bpaddr); +static CORE_ADDR adjust_breakpoint_address (CORE_ADDR bpaddr, + enum bptype bptype); static void describe_other_breakpoints (CORE_ADDR, asection *); @@ -265,13 +268,13 @@ int breakpoint_count; /* Pointer to current exception event record */ static struct exception_event_record *current_exception_event; -/* Indicator of whether exception catchpoints should be nuked - between runs of a program */ -int exception_catchpoints_are_fragile = 0; +/* Indicator of whether exception catchpoints should be nuked between + runs of a program. */ +int deprecated_exception_catchpoints_are_fragile = 0; /* Indicator of when exception catchpoints set-up should be - reinitialized -- e.g. when program is re-run */ -int exception_support_initialized = 0; + reinitialized -- e.g. when program is re-run. */ +int deprecated_exception_support_initialized = 0; /* This function returns a pointer to the string representation of the pathname of the dynamically-linked library that has just been @@ -626,7 +629,7 @@ commands_command (char *arg, int from_tty) shadow contents, not the breakpoints themselves. From breakpoint.c. */ int -read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len) +deprecated_read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len) { int status; struct bp_location *b; @@ -694,7 +697,7 @@ read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len) if (bp_addr > memaddr) { /* Copy the section of memory before the breakpoint. */ - status = read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr); + status = deprecated_read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr); if (status != 0) return status; } @@ -702,7 +705,7 @@ read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len) if (bp_addr + bp_size < memaddr + len) { /* Copy the section of memory after the breakpoint. */ - status = read_memory_nobpt (bp_addr + bp_size, + status = deprecated_read_memory_nobpt (bp_addr + bp_size, myaddr + bp_addr + bp_size - memaddr, memaddr + len - (bp_addr + bp_size)); if (status != 0) @@ -745,6 +748,23 @@ insert_catchpoint (struct ui_out *uo, void *args) return 0; } +/* Helper routine: free the value chain for a breakpoint (watchpoint). */ + +static void free_valchain (struct bp_location *b) +{ + struct value *v; + struct value *n; + + /* Free the saved value chain. We will construct a new one + the next time the watchpoint is inserted. */ + for (v = b->owner->val_chain; v; v = n) + { + n = v->next; + value_free (v); + } + b->owner->val_chain = NULL; +} + /* Insert a low-level "breakpoint" of some type. BPT is the breakpoint. Any error messages are printed to TMP_ERROR_STREAM; and DISABLED_BREAKS, PROCESS_WARNING, and HW_BREAKPOINT_ERROR are used to report problems. @@ -892,18 +912,17 @@ insert_bp_location (struct bp_location *bpt, must watch. As soon as a many-to-one mapping is available I'll convert this. */ - struct frame_info *saved_frame; - int saved_level, within_current_scope; + int within_current_scope; struct value *mark = value_mark (); struct value *v; + struct frame_id saved_frame_id; - /* Save the current frame and level so we can restore it after + /* Save the current frame's ID so we can restore it after evaluating the watchpoint expression on its own frame. */ /* FIXME drow/2003-09-09: It would be nice if evaluate_expression took a frame parameter, so that we didn't have to change the selected frame. */ - saved_frame = deprecated_selected_frame; - saved_level = frame_relative_level (deprecated_selected_frame); + saved_frame_id = get_frame_id (deprecated_selected_frame); /* Determine if the watchpoint is within scope. */ if (bpt->owner->exp_valid_block == NULL) @@ -919,6 +938,8 @@ insert_bp_location (struct bp_location *bpt, if (within_current_scope) { + free_valchain (bpt); + /* Evaluate the expression and cut the chain of values produced off from the value chain. @@ -998,10 +1019,8 @@ insert_bp_location (struct bp_location *bpt, bpt->owner->disposition = disp_del_at_next_stop; } - /* Restore the frame and level. */ - if (saved_frame != deprecated_selected_frame - || saved_level != frame_relative_level (deprecated_selected_frame)) - select_frame (saved_frame); + /* Restore the selected frame. */ + select_frame (frame_find_by_id (saved_frame_id)); return val; } @@ -1504,15 +1523,6 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) if ((is == mark_uninserted) && (b->inserted)) warning ("Could not remove hardware watchpoint %d.", b->owner->number); - - /* Free the saved value chain. We will construct a new one - the next time the watchpoint is inserted. */ - for (v = b->owner->val_chain; v; v = n) - { - n = v->next; - value_free (v); - } - b->owner->val_chain = NULL; } else if ((b->owner->type == bp_catch_fork || b->owner->type == bp_catch_vfork || @@ -1635,8 +1645,8 @@ breakpoint_init_inferior (enum inf_context context) default: /* Likewise for exception catchpoints in dynamic-linked executables where required */ - if (ep_is_exception_catchpoint (b) && - exception_catchpoints_are_fragile) + if (ep_is_exception_catchpoint (b) + && deprecated_exception_catchpoints_are_fragile) { warning_needed = 1; delete_breakpoint (b); @@ -1645,8 +1655,8 @@ breakpoint_init_inferior (enum inf_context context) } } - if (exception_catchpoints_are_fragile) - exception_support_initialized = 0; + if (deprecated_exception_catchpoints_are_fragile) + deprecated_exception_support_initialized = 0; /* Don't issue the warning unless it's really needed... */ if (warning_needed && (context != inf_exited)) @@ -1759,37 +1769,6 @@ software_breakpoint_inserted_here_p (CORE_ADDR pc) return 0; } -/* Return nonzero if FRAME is a dummy frame. We can't use - DEPRECATED_PC_IN_CALL_DUMMY because figuring out the saved SP would - take too much time, at least using frame_register() on the 68k. - This means that for this function to work right a port must use the - bp_call_dummy breakpoint. */ - -int -deprecated_frame_in_dummy (struct frame_info *frame) -{ - struct breakpoint *b; - - /* This function is used by two files: get_frame_type(), after first - checking that !DEPRECATED_USE_GENERIC_DUMMY_FRAMES; and - sparc-tdep.c, which doesn't yet use generic dummy frames anyway. */ - gdb_assert (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES); - - ALL_BREAKPOINTS (b) - { - if (b->type == bp_call_dummy - && frame_id_eq (b->frame_id, get_frame_id (frame)) - /* We need to check the PC as well as the frame on the sparc, - for signals.exp in the testsuite. */ - && (get_frame_pc (frame) - >= (b->loc->address - - DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * DEPRECATED_REGISTER_SIZE)) - && get_frame_pc (frame) <= b->loc->address) - return 1; - } - return 0; -} - /* breakpoint_thread_match (PC, PTID) returns true if the breakpoint at PC is valid for process/thread PTID. */ @@ -2582,7 +2561,9 @@ which its expression is valid.\n"); } /* Get a bpstat associated with having just stopped at address - BP_ADDR. */ + BP_ADDR in thread PTID. STOPPED_BY_WATCHPOINT is 1 if the + target thinks we stopped due to a hardware watchpoint, 0 if we + know we did not trigger a hardware watchpoint, and -1 if we do not know. */ /* Determine whether we stopped at a breakpoint, etc, or whether we don't understand this stop. Result is a chain of bpstat's such that: @@ -2599,7 +2580,7 @@ which its expression is valid.\n"); commands, FIXME??? fields. */ bpstat -bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid, int stopped_by_watchpoint) { struct breakpoint *b, *temp; /* True if we've hit a breakpoint (as opposed to a watchpoint). */ @@ -2634,6 +2615,18 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) continue; } + /* Continuable hardware watchpoints are treated as non-existent if the + reason we stopped wasn't a hardware watchpoint (we didn't stop on + some data address). Otherwise gdb won't stop on a break instruction + in the code (not from a breakpoint) when a hardware watchpoint has + been defined. */ + + if ((b->type == bp_hardware_watchpoint + || b->type == bp_read_watchpoint + || b->type == bp_access_watchpoint) + && !stopped_by_watchpoint) + continue; + if (b->type == bp_hardware_breakpoint) { if (b->loc->address != bp_addr) @@ -2748,8 +2741,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) struct value *v; int found = 0; - addr = target_stopped_data_address (); - if (addr == 0) + if (!target_stopped_data_address (¤t_target, &addr)) continue; for (v = b->val_chain; v; v = v->next) { @@ -3016,7 +3008,7 @@ bpstat_what (bpstat bs) /* step_resume entries: a step resume breakpoint overrides another breakpoint of signal handling (see comment in wait_for_inferior - at first PC_IN_SIGTRAMP where we set the step_resume breakpoint). */ + at where we set the step_resume breakpoint). */ /* We handle the through_sigtramp_breakpoint the same way; having both one of those and a step_resume_breakpoint is probably very rare (?). */ @@ -3932,8 +3924,8 @@ breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr, char astr1[40]; char astr2[40]; - strcpy (astr1, local_hex_string_custom ((unsigned long) from_addr, "08l")); - strcpy (astr2, local_hex_string_custom ((unsigned long) to_addr, "08l")); + strcpy (astr1, hex_string_custom ((unsigned long) from_addr, 8)); + strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8)); if (have_bnum) warning ("Breakpoint %d address previously adjusted from %s to %s.", bnum, astr1, astr2); @@ -3947,13 +3939,25 @@ breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr, this function is simply the identity function. */ static CORE_ADDR -adjust_breakpoint_address (CORE_ADDR bpaddr) +adjust_breakpoint_address (CORE_ADDR bpaddr, enum bptype bptype) { if (!gdbarch_adjust_breakpoint_address_p (current_gdbarch)) { /* Very few targets need any kind of breakpoint adjustment. */ return bpaddr; } + else if (bptype == bp_watchpoint + || bptype == bp_hardware_watchpoint + || bptype == bp_read_watchpoint + || bptype == bp_access_watchpoint + || bptype == bp_catch_fork + || bptype == bp_catch_vfork + || bptype == bp_catch_exec) + { + /* Watchpoints and the various bp_catch_* eventpoints should not + have their addresses modified. */ + return bpaddr; + } else { CORE_ADDR adjusted_bpaddr; @@ -4062,7 +4066,8 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) memset (b, 0, sizeof (*b)); b->loc = allocate_bp_location (b, bptype); b->loc->requested_address = sal.pc; - b->loc->address = adjust_breakpoint_address (b->loc->requested_address); + b->loc->address = adjust_breakpoint_address (b->loc->requested_address, + bptype); if (sal.symtab == NULL) b->source_file = NULL; else @@ -4254,7 +4259,7 @@ create_thread_event_breakpoint (CORE_ADDR address) b->enable_state = bp_enabled; /* addr_string has to be used or breakpoint_re_set will delete me. */ - xasprintf (&b->addr_string, "*0x%s", paddr (b->loc->address)); + b->addr_string = xstrprintf ("*0x%s", paddr (b->loc->address)); return b; } @@ -4384,6 +4389,46 @@ disable_breakpoints_in_shlibs (int silent) } } +/* Disable any breakpoints that are in in an unloaded shared library. Only + apply to enabled breakpoints, disabled ones can just stay disabled. */ + +void +disable_breakpoints_in_unloaded_shlib (struct so_list *solib) +{ + struct breakpoint *b; + int disabled_shlib_breaks = 0; + +#if defined (PC_SOLIB) + /* See also: insert_breakpoints, under DISABLE_UNSETTABLE_BREAK. */ + ALL_BREAKPOINTS (b) + { + if ((b->loc->loc_type == bp_loc_hardware_breakpoint + || b->loc->loc_type == bp_loc_software_breakpoint) + && breakpoint_enabled (b) + && !b->loc->duplicate) + { + char *so_name = PC_SOLIB (b->loc->address); + if (so_name + && !strcmp (so_name, solib->so_name)) + { + b->enable_state = bp_shlib_disabled; + /* At this point, we cannot rely on remove_breakpoint + succeeding so we must mark the breakpoint as not inserted + to prevent future errors occurring in remove_breakpoints. */ + b->loc->inserted = 0; + if (!disabled_shlib_breaks) + { + target_terminal_ours_for_output (); + warning ("Temporarily disabling breakpoints for unloaded shared library \"%s\"", + so_name); + } + disabled_shlib_breaks = 1; + } + } + } +#endif +} + /* Try to reenable any breakpoints in shared libraries. */ void re_enable_breakpoints_in_shlibs (void) @@ -4622,7 +4667,8 @@ set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_id frame_id) if (b->type == bp_longjmp_resume) { b->loc->requested_address = pc; - b->loc->address = adjust_breakpoint_address (b->loc->requested_address); + b->loc->address = adjust_breakpoint_address (b->loc->requested_address, + b->type); b->enable_state = bp_enabled; b->frame_id = frame_id; check_duplicates (b); @@ -4707,13 +4753,13 @@ mention (struct breakpoint *b) stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); - /* FIXME: This is misplaced; mention() is called by things (like hitting a - watchpoint) other than breakpoint creation. It should be possible to - clean this up and at the same time replace the random calls to - breakpoint_changed with this hook, as has already been done for - delete_breakpoint_hook and so on. */ - if (create_breakpoint_hook) - create_breakpoint_hook (b); + /* FIXME: This is misplaced; mention() is called by things (like + hitting a watchpoint) other than breakpoint creation. It should + be possible to clean this up and at the same time replace the + random calls to breakpoint_changed with this hook, as has already + been done for deprecated_delete_breakpoint_hook and so on. */ + if (deprecated_create_breakpoint_hook) + deprecated_create_breakpoint_hook (b); breakpoint_create_event (b->number); if (b->ops != NULL && b->ops->print_mention != NULL) @@ -4897,7 +4943,7 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, else /* addr_string has to be used or breakpoint_re_set will delete me. */ - xasprintf (&b->addr_string, "*0x%s", paddr (b->loc->address)); + b->addr_string = xstrprintf ("*0x%s", paddr (b->loc->address)); b->cond_string = cond_string[i]; b->ignore_count = ignore_count; b->enable_state = bp_enabled; @@ -4921,6 +4967,10 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, be copied too. */ if (pending_bp->commands) b->commands = copy_command_lines (pending_bp->commands); + + /* We have to copy over the ignore_count and thread as well. */ + b->ignore_count = pending_bp->ignore_count; + b->thread = pending_bp->thread; } mention (b); } @@ -5024,7 +5074,8 @@ breakpoint_sals_to_pc (struct symtabs_and_lines *sals, Give the target a chance to bless sals.sals[i].pc before we try to make a breakpoint for it. */ - if (PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc)) +#ifdef DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE + if (DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc)) { if (address == NULL) error ("Cannot break without a running program."); @@ -5032,6 +5083,7 @@ breakpoint_sals_to_pc (struct symtabs_and_lines *sals, error ("Cannot break on %s without a running program.", address); } +#endif } } @@ -5879,7 +5931,8 @@ watch_command_1 (char *arg, int accessflag, int from_tty) scope_breakpoint->loc->requested_address = get_frame_pc (prev_frame); scope_breakpoint->loc->address - = adjust_breakpoint_address (scope_breakpoint->loc->requested_address); + = adjust_breakpoint_address (scope_breakpoint->loc->requested_address, + scope_breakpoint->type); /* The scope breakpoint is related to the watchpoint. We will need to act on them together. */ @@ -5894,11 +5947,6 @@ watch_command_1 (char *arg, int accessflag, int from_tty) in hardware. If the watchpoint can not be handled in hardware return zero. */ -#if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT) -#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(BYTE_SIZE) \ - ((BYTE_SIZE) <= (DEPRECATED_REGISTER_SIZE)) -#endif - #if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT) #define TARGET_REGION_OK_FOR_HW_WATCHPOINT(ADDR,LEN) \ (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(LEN)) @@ -6074,7 +6122,7 @@ until_break_command (char *arg, int from_tty, int anywhere) get_frame_id (deprecated_selected_frame), bp_until); - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); else old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); @@ -6086,7 +6134,7 @@ until_break_command (char *arg, int from_tty, int anywhere) where we get a chance to do that is in fetch_inferior_event, so we must set things up for that. */ - if (event_loop_p && target_can_async_p ()) + if (target_can_async_p ()) { /* In this case the arg for the continuation is just the point in the exec_cleanups chain from where to start doing @@ -6108,7 +6156,7 @@ until_break_command (char *arg, int from_tty, int anywhere) sal.pc = get_frame_pc (prev_frame); breakpoint = set_momentary_breakpoint (sal, get_frame_id (prev_frame), bp_until); - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) make_cleanup_delete_breakpoint (breakpoint); else make_exec_cleanup_delete_breakpoint (breakpoint); @@ -6117,7 +6165,7 @@ until_break_command (char *arg, int from_tty, int anywhere) proceed (-1, TARGET_SIGNAL_DEFAULT, 0); /* Do the cleanups now, anly if we are not running asynchronously, of if we are, but the target is still synchronous. */ - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) do_cleanups (old_chain); } @@ -6862,13 +6910,15 @@ delete_breakpoint (struct breakpoint *bpt) if (bpt->type == bp_none) return; - if (delete_breakpoint_hook) - delete_breakpoint_hook (bpt); + if (deprecated_delete_breakpoint_hook) + deprecated_delete_breakpoint_hook (bpt); breakpoint_delete_event (bpt->number); if (bpt->loc->inserted) remove_breakpoint (bpt->loc, mark_inserted); + free_valchain (bpt->loc); + if (breakpoint_chain == bpt) breakpoint_chain = bpt->next; @@ -7091,6 +7141,8 @@ breakpoint_re_set_one (void *bint) struct breakpoint *b = (struct breakpoint *) bint; struct value *mark; int i; + int not_found; + int *not_found_ptr = NULL; struct symtabs_and_lines sals; char *s; enum enable_state save_enable; @@ -7141,11 +7193,19 @@ breakpoint_re_set_one (void *bint) save_enable = b->enable_state; if (b->enable_state != bp_shlib_disabled) b->enable_state = bp_disabled; + else + /* If resetting a shlib-disabled breakpoint, we don't want to + see an error message if it is not found since we will expect + this to occur until the shared library is finally reloaded. + We accomplish this by giving decode_line_1 a pointer to use + for silent notification that the symbol is not found. */ + not_found_ptr = ¬_found; set_language (b->language); input_radix = b->input_radix; s = b->addr_string; - sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL, NULL); + sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, (char ***) NULL, + not_found_ptr); for (i = 0; i < sals.nelts; i++) { resolve_sal_pc (&sals.sals[i]); @@ -7190,7 +7250,8 @@ breakpoint_re_set_one (void *bint) b->line_number = sals.sals[i].line; b->loc->requested_address = sals.sals[i].pc; b->loc->address - = adjust_breakpoint_address (b->loc->requested_address); + = adjust_breakpoint_address (b->loc->requested_address, + b->type); /* Used to check for duplicates here, but that can cause trouble, as it doesn't check for disabled @@ -7494,8 +7555,8 @@ disable_breakpoint (struct breakpoint *bpt) check_duplicates (bpt); - if (modify_breakpoint_hook) - modify_breakpoint_hook (bpt); + if (deprecated_modify_breakpoint_hook) + deprecated_modify_breakpoint_hook (bpt); breakpoint_modify_event (bpt->number); } @@ -7535,8 +7596,6 @@ disable_command (char *args, int from_tty) static void do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition) { - struct frame_info *save_selected_frame = NULL; - int save_selected_frame_level = -1; int target_resources_ok, other_type_used; struct value *mark; @@ -7583,6 +7642,9 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition) bpt->type == bp_read_watchpoint || bpt->type == bp_access_watchpoint) { + struct frame_id saved_frame_id; + + saved_frame_id = get_frame_id (get_selected_frame ()); if (bpt->exp_valid_block != NULL) { struct frame_info *fr = @@ -7595,9 +7657,6 @@ is valid is not currently in scope.\n", bpt->number); bpt->enable_state = bp_disabled; return; } - - save_selected_frame = deprecated_selected_frame; - save_selected_frame_level = frame_relative_level (deprecated_selected_frame); select_frame (fr); } @@ -7632,14 +7691,13 @@ have been allocated for other watchpoints.\n", bpt->number); } } - if (save_selected_frame_level >= 0) - select_frame (save_selected_frame); + select_frame (frame_find_by_id (saved_frame_id)); value_free_to_mark (mark); } } - if (modify_breakpoint_hook) - modify_breakpoint_hook (bpt); + if (deprecated_modify_breakpoint_hook) + deprecated_modify_breakpoint_hook (bpt); breakpoint_modify_event (bpt->number); } @@ -7748,6 +7806,10 @@ _initialize_breakpoint (void) static struct cmd_list_element *breakpoint_show_cmdlist; struct cmd_list_element *c; +#ifdef SOLIB_ADD + observer_attach_solib_unloaded (disable_breakpoints_in_unloaded_shlib); +#endif + breakpoint_chain = 0; /* Don't bother to call set_breakpoint_count. $bpnum isn't useful before a breakpoint is set. */ @@ -8061,7 +8123,7 @@ such is available. (However, any hardware watchpoints that were\n\ created before setting this to nonzero, will continue to use watchpoint\n\ hardware.)", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); can_use_hw_watchpoints = 1; @@ -8079,16 +8141,13 @@ pending breakpoint behavior", 0/*allow-unknown*/, &showlist); add_setshow_auto_boolean_cmd ("pending", no_class, &pending_break_support, "\ -Set debugger's behavior regarding pending breakpoints.\n\ -If on, an unrecognized breakpoint location will cause gdb to create a\n\ -pending breakpoint. If off, an unrecognized breakpoint location results in\n\ -an error. If auto, an unrecognized breakpoint location results in a\n\ -user-query to see if a pending breakpoint should be created.","\ -Show debugger's behavior regarding pending breakpoints.\n\ +Set debugger's behavior regarding pending breakpoints.", "\ +Show debugger's behavior regarding pending breakpoints.", "\ If on, an unrecognized breakpoint location will cause gdb to create a\n\ pending breakpoint. If off, an unrecognized breakpoint location results in\n\ an error. If auto, an unrecognized breakpoint location results in a\n\ -user-query to see if a pending breakpoint should be created.", +user-query to see if a pending breakpoint should be created.", "\ +Debugger's behavior regarding pending breakpoints is %s.", NULL, NULL, &breakpoint_set_cmdlist, &breakpoint_show_cmdlist); diff --git a/gnu/usr.bin/binutils/gdb/breakpoint.h b/gnu/usr.bin/binutils/gdb/breakpoint.h index 41bcb0c3ce1..67a67e34054 100644 --- a/gnu/usr.bin/binutils/gdb/breakpoint.h +++ b/gnu/usr.bin/binutils/gdb/breakpoint.h @@ -414,7 +414,8 @@ extern void bpstat_clear (bpstat *); is part of the bpstat is copied as well. */ extern bpstat bpstat_copy (bpstat); -extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid); +extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid, + int stopped_by_watchpoint); /* This bpstat_what stuff tells wait_for_inferior what to do with a breakpoint (a challenging task). */ @@ -619,13 +620,6 @@ extern int breakpoint_inserted_here_p (CORE_ADDR); extern int software_breakpoint_inserted_here_p (CORE_ADDR); -/* FIXME: cagney/2002-11-10: The current [generic] dummy-frame code - implements a functional superset of this function. The only reason - it hasn't been removed is because some architectures still don't - use the new framework. Once they have been fixed, this can go. */ -struct frame_info; -extern int deprecated_frame_in_dummy (struct frame_info *); - extern int breakpoint_thread_match (CORE_ADDR, ptid_t); extern void until_break_command (char *, int, int); @@ -802,4 +796,13 @@ extern void delete_command (char *arg, int from_tty); remove fails. */ extern int remove_hw_watchpoints (void); + +/* Indicator of whether exception catchpoints should be nuked between + runs of a program. */ +extern int deprecated_exception_catchpoints_are_fragile; + +/* Indicator of when exception catchpoints set-up should be + reinitialized -- e.g. when program is re-run. */ +extern int deprecated_exception_support_initialized; + #endif /* !defined (BREAKPOINT_H) */ diff --git a/gnu/usr.bin/binutils/gdb/bsd-kvm.c b/gnu/usr.bin/binutils/gdb/bsd-kvm.c index 79ab09505f6..300379d954f 100644 --- a/gnu/usr.bin/binutils/gdb/bsd-kvm.c +++ b/gnu/usr.bin/binutils/gdb/bsd-kvm.c @@ -26,11 +26,14 @@ #include "regcache.h" #include "target.h" #include "value.h" +#include "gdbcore.h" /* for get_exec_file */ #include "gdb_assert.h" #include <fcntl.h> #include <kvm.h> +#ifdef HAVE_NLIST_H #include <nlist.h> +#endif #include "readline/readline.h" #include <sys/param.h> #include <sys/proc.h> @@ -73,6 +76,7 @@ bsd_kvm_open (char *filename, int from_tty) } } + execfile = get_exec_file (0); temp_kd = kvm_openfiles (execfile, filename, NULL, O_RDONLY, errbuf); if (temp_kd == NULL) error ("%s", errbuf); @@ -228,7 +232,11 @@ bsd_kvm_proc_cmd (char *arg, int fromtty) error ("No kernel memory image."); addr = parse_and_eval_address (arg); +#ifdef HAVE_STRUCT_LWP + addr += offsetof (struct lwp, l_addr); +#else addr += offsetof (struct proc, p_addr); +#endif if (kvm_read (core_kd, addr, &bsd_kvm_paddr, sizeof bsd_kvm_paddr) == -1) error ("%s", kvm_geterr (core_kd)); @@ -277,7 +285,7 @@ Optionally specify the filename of a core dump."; bsd_kvm_ops.to_open = bsd_kvm_open; bsd_kvm_ops.to_close = bsd_kvm_close; bsd_kvm_ops.to_fetch_registers = bsd_kvm_fetch_registers; - bsd_kvm_ops.to_xfer_memory = bsd_kvm_xfer_memory; + bsd_kvm_ops.deprecated_xfer_memory = bsd_kvm_xfer_memory; bsd_kvm_ops.to_stratum = process_stratum; bsd_kvm_ops.to_has_memory = 1; bsd_kvm_ops.to_has_stack = 1; diff --git a/gnu/usr.bin/binutils/gdb/buildsym.c b/gnu/usr.bin/binutils/gdb/buildsym.c index 4b362e08a2e..d1ec78ea6e4 100644 --- a/gnu/usr.bin/binutils/gdb/buildsym.c +++ b/gnu/usr.bin/binutils/gdb/buildsym.c @@ -38,7 +38,6 @@ #include "complaints.h" #include "gdb_string.h" #include "expression.h" /* For "enum exp_opcode" used by... */ -#include "language.h" /* For "local_hex_string" */ #include "bcache.h" #include "filenames.h" /* For DOSish file names */ #include "macrotab.h" @@ -521,7 +520,7 @@ make_blockvector (struct objfile *objfile) = BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)); complaint (&symfile_complaints, "block at %s out of order", - local_hex_string ((LONGEST) start)); + hex_string ((LONGEST) start)); } } } diff --git a/gnu/usr.bin/binutils/gdb/c-exp.y b/gnu/usr.bin/binutils/gdb/c-exp.y index f11b93e3a2b..27d18487766 100644 --- a/gnu/usr.bin/binutils/gdb/c-exp.y +++ b/gnu/usr.bin/binutils/gdb/c-exp.y @@ -53,9 +53,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "block.h" #include "cp-support.h" -/* Flag indicating we're dealing with HP-compiled objects */ -extern int hp_som_som_object_present; - /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple yacc generated parsers in gdb. Note that these are only the variables @@ -504,7 +501,7 @@ exp : VARIABLE exp : SIZEOF '(' type ')' %prec UNARY { write_exp_elt_opcode (OP_LONG); - write_exp_elt_type (builtin_type_int); + write_exp_elt_type (builtin_type (current_gdbarch)->builtin_int); CHECK_TYPEDEF ($3); write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3)); write_exp_elt_opcode (OP_LONG); } @@ -520,12 +517,12 @@ exp : STRING while (count-- > 0) { write_exp_elt_opcode (OP_LONG); - write_exp_elt_type (builtin_type_char); + write_exp_elt_type (builtin_type (current_gdbarch)->builtin_char); write_exp_elt_longcst ((LONGEST)(*sp++)); write_exp_elt_opcode (OP_LONG); } write_exp_elt_opcode (OP_LONG); - write_exp_elt_type (builtin_type_char); + write_exp_elt_type (builtin_type (current_gdbarch)->builtin_char); write_exp_elt_longcst ((LONGEST)'\0'); write_exp_elt_opcode (OP_LONG); write_exp_elt_opcode (OP_ARRAY); @@ -537,14 +534,14 @@ exp : STRING /* C++. */ exp : TRUEKEYWORD { write_exp_elt_opcode (OP_LONG); - write_exp_elt_type (builtin_type_bool); + write_exp_elt_type (builtin_type (current_gdbarch)->builtin_bool); write_exp_elt_longcst ((LONGEST) 1); write_exp_elt_opcode (OP_LONG); } ; exp : FALSEKEYWORD { write_exp_elt_opcode (OP_LONG); - write_exp_elt_type (builtin_type_bool); + write_exp_elt_type (builtin_type (current_gdbarch)->builtin_bool); write_exp_elt_longcst ((LONGEST) 0); write_exp_elt_opcode (OP_LONG); } ; @@ -655,8 +652,8 @@ variable: qualified_name if (msymbol != NULL) { write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); + lookup_function_type (builtin_type (current_gdbarch)->builtin_int), + builtin_type (current_gdbarch)->builtin_int); } else if (!have_full_symbols () && !have_partial_symbols ()) @@ -711,8 +708,8 @@ variable: name_not_typename if (msymbol != NULL) { write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); + lookup_function_type (builtin_type (current_gdbarch)->builtin_int), + builtin_type (current_gdbarch)->builtin_int); } else if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); @@ -798,68 +795,68 @@ func_mod: '(' ')' type : ptype | typebase COLONCOLON '*' - { $$ = lookup_member_type (builtin_type_int, $1); } + { $$ = lookup_member_type (builtin_type (current_gdbarch)->builtin_int, $1); } ; typebase /* Implements (approximately): (type-qualifier)* type-specifier */ : TYPENAME { $$ = $1.type; } | INT_KEYWORD - { $$ = builtin_type_int; } + { $$ = builtin_type (current_gdbarch)->builtin_int; } | LONG - { $$ = builtin_type_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long; } | SHORT - { $$ = builtin_type_short; } + { $$ = builtin_type (current_gdbarch)->builtin_short; } | LONG INT_KEYWORD - { $$ = builtin_type_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long; } | LONG SIGNED_KEYWORD INT_KEYWORD - { $$ = builtin_type_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long; } | LONG SIGNED_KEYWORD - { $$ = builtin_type_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long; } | SIGNED_KEYWORD LONG INT_KEYWORD - { $$ = builtin_type_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long; } | UNSIGNED LONG INT_KEYWORD - { $$ = builtin_type_unsigned_long; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long; } | LONG UNSIGNED INT_KEYWORD - { $$ = builtin_type_unsigned_long; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long; } | LONG UNSIGNED - { $$ = builtin_type_unsigned_long; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long; } | LONG LONG - { $$ = builtin_type_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long_long; } | LONG LONG INT_KEYWORD - { $$ = builtin_type_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long_long; } | LONG LONG SIGNED_KEYWORD INT_KEYWORD - { $$ = builtin_type_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long_long; } | LONG LONG SIGNED_KEYWORD - { $$ = builtin_type_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long_long; } | SIGNED_KEYWORD LONG LONG - { $$ = builtin_type_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long_long; } | SIGNED_KEYWORD LONG LONG INT_KEYWORD - { $$ = builtin_type_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_long_long; } | UNSIGNED LONG LONG - { $$ = builtin_type_unsigned_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; } | UNSIGNED LONG LONG INT_KEYWORD - { $$ = builtin_type_unsigned_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; } | LONG LONG UNSIGNED - { $$ = builtin_type_unsigned_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; } | LONG LONG UNSIGNED INT_KEYWORD - { $$ = builtin_type_unsigned_long_long; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_long_long; } | SHORT INT_KEYWORD - { $$ = builtin_type_short; } + { $$ = builtin_type (current_gdbarch)->builtin_short; } | SHORT SIGNED_KEYWORD INT_KEYWORD - { $$ = builtin_type_short; } + { $$ = builtin_type (current_gdbarch)->builtin_short; } | SHORT SIGNED_KEYWORD - { $$ = builtin_type_short; } + { $$ = builtin_type (current_gdbarch)->builtin_short; } | UNSIGNED SHORT INT_KEYWORD - { $$ = builtin_type_unsigned_short; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_short; } | SHORT UNSIGNED - { $$ = builtin_type_unsigned_short; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_short; } | SHORT UNSIGNED INT_KEYWORD - { $$ = builtin_type_unsigned_short; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_short; } | DOUBLE_KEYWORD - { $$ = builtin_type_double; } + { $$ = builtin_type (current_gdbarch)->builtin_double; } | LONG DOUBLE_KEYWORD - { $$ = builtin_type_long_double; } + { $$ = builtin_type (current_gdbarch)->builtin_long_double; } | STRUCT name { $$ = lookup_struct (copy_name ($2), expression_context_block); } @@ -875,11 +872,11 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ | UNSIGNED typename { $$ = lookup_unsigned_typename (TYPE_NAME($2.type)); } | UNSIGNED - { $$ = builtin_type_unsigned_int; } + { $$ = builtin_type (current_gdbarch)->builtin_unsigned_int; } | SIGNED_KEYWORD typename { $$ = lookup_signed_typename (TYPE_NAME($2.type)); } | SIGNED_KEYWORD - { $$ = builtin_type_int; } + { $$ = builtin_type (current_gdbarch)->builtin_int; } /* It appears that this rule for templates is never reduced; template recognition happens by lookahead in the token processing code in yylex. */ @@ -969,19 +966,19 @@ typename: TYPENAME { $$.stoken.ptr = "int"; $$.stoken.length = 3; - $$.type = builtin_type_int; + $$.type = builtin_type (current_gdbarch)->builtin_int; } | LONG { $$.stoken.ptr = "long"; $$.stoken.length = 4; - $$.type = builtin_type_long; + $$.type = builtin_type (current_gdbarch)->builtin_long; } | SHORT { $$.stoken.ptr = "short"; $$.stoken.length = 5; - $$.type = builtin_type_short; + $$.type = builtin_type (current_gdbarch)->builtin_short; } ; @@ -1103,11 +1100,11 @@ parse_number (p, len, parsed_float, putithere) c = tolower (p[len - 1]); if (c == 'f') - putithere->typed_val_float.type = builtin_type_float; + putithere->typed_val_float.type = builtin_type (current_gdbarch)->builtin_float; else if (c == 'l') - putithere->typed_val_float.type = builtin_type_long_double; + putithere->typed_val_float.type = builtin_type (current_gdbarch)->builtin_long_double; else if (isdigit (c) || c == '.') - putithere->typed_val_float.type = builtin_type_double; + putithere->typed_val_float.type = builtin_type (current_gdbarch)->builtin_double; else return ERROR; @@ -1223,15 +1220,15 @@ parse_number (p, len, parsed_float, putithere) int. This probably should be fixed. GCC gives a warning on such constants. */ - unsigned_type = builtin_type_unsigned_int; - signed_type = builtin_type_int; + unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_int; + signed_type = builtin_type (current_gdbarch)->builtin_int; } else if (long_p <= 1 && (un >> (TARGET_LONG_BIT - 2)) == 0) { high_bit = ((ULONGEST)1) << (TARGET_LONG_BIT-1); - unsigned_type = builtin_type_unsigned_long; - signed_type = builtin_type_long; + unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long; + signed_type = builtin_type (current_gdbarch)->builtin_long; } else { @@ -1242,8 +1239,8 @@ parse_number (p, len, parsed_float, putithere) else shift = (TARGET_LONG_LONG_BIT - 1); high_bit = (ULONGEST) 1 << shift; - unsigned_type = builtin_type_unsigned_long_long; - signed_type = builtin_type_long_long; + unsigned_type = builtin_type (current_gdbarch)->builtin_unsigned_long_long; + signed_type = builtin_type (current_gdbarch)->builtin_long_long; } putithere->typed_val_int.val = n; @@ -1395,7 +1392,7 @@ yylex () } yylval.typed_val_int.val = c; - yylval.typed_val_int.type = builtin_type_char; + yylval.typed_val_int.type = builtin_type (current_gdbarch)->builtin_char; c = *lexptr++; if (c != '\'') @@ -1773,7 +1770,10 @@ yylex () yylval.tsym.type = SYMBOL_TYPE (sym); return TYPENAME; } - if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0) + yylval.tsym.type + = language_lookup_primitive_type_by_name (current_language, + current_gdbarch, tmp); + if (yylval.tsym.type != NULL) return TYPENAME; /* Input names that aren't symbols but ARE valid hex numbers, diff --git a/gnu/usr.bin/binutils/gdb/c-lang.c b/gnu/usr.bin/binutils/gdb/c-lang.c index a95cec057a8..5c71c17c5a0 100644 --- a/gnu/usr.bin/binutils/gdb/c-lang.c +++ b/gnu/usr.bin/binutils/gdb/c-lang.c @@ -513,39 +513,68 @@ const struct op_print c_op_print_tab[] = {NULL, 0, 0, 0} }; -struct type **const (c_builtin_types[]) = +enum c_primitive_types { + c_primitive_type_int, + c_primitive_type_long, + c_primitive_type_short, + c_primitive_type_char, + c_primitive_type_float, + c_primitive_type_double, + c_primitive_type_void, + c_primitive_type_long_long, + c_primitive_type_signed_char, + c_primitive_type_unsigned_char, + c_primitive_type_unsigned_short, + c_primitive_type_unsigned_int, + c_primitive_type_unsigned_long, + c_primitive_type_unsigned_long_long, + c_primitive_type_long_double, + c_primitive_type_complex, + c_primitive_type_double_complex, + nr_c_primitive_types +}; + +void +c_language_arch_info (struct gdbarch *gdbarch, + struct language_arch_info *lai) { - &builtin_type_int, - &builtin_type_long, - &builtin_type_short, - &builtin_type_char, - &builtin_type_float, - &builtin_type_double, - &builtin_type_void, - &builtin_type_long_long, - &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 + const struct builtin_type *builtin = builtin_type (gdbarch); + lai->string_char_type = builtin->builtin_char; + lai->primitive_type_vector + = GDBARCH_OBSTACK_CALLOC (gdbarch, nr_c_primitive_types + 1, + struct type *); + lai->primitive_type_vector [c_primitive_type_int] = builtin->builtin_int; + lai->primitive_type_vector [c_primitive_type_long] = builtin->builtin_long; + lai->primitive_type_vector [c_primitive_type_short] = builtin->builtin_short; + lai->primitive_type_vector [c_primitive_type_char] = builtin->builtin_char; + lai->primitive_type_vector [c_primitive_type_float] = builtin->builtin_float; + lai->primitive_type_vector [c_primitive_type_double] = builtin->builtin_double; + lai->primitive_type_vector [c_primitive_type_void] = builtin->builtin_void; + lai->primitive_type_vector [c_primitive_type_long_long] = builtin->builtin_long_long; + lai->primitive_type_vector [c_primitive_type_signed_char] = builtin->builtin_signed_char; + lai->primitive_type_vector [c_primitive_type_unsigned_char] = builtin->builtin_unsigned_char; + lai->primitive_type_vector [c_primitive_type_unsigned_short] = builtin->builtin_unsigned_short; + lai->primitive_type_vector [c_primitive_type_unsigned_int] = builtin->builtin_unsigned_int; + lai->primitive_type_vector [c_primitive_type_unsigned_long] = builtin->builtin_unsigned_long; + lai->primitive_type_vector [c_primitive_type_unsigned_long_long] = builtin->builtin_unsigned_long_long; + lai->primitive_type_vector [c_primitive_type_long_double] = builtin->builtin_long_double; + lai->primitive_type_vector [c_primitive_type_complex] = builtin->builtin_complex; + lai->primitive_type_vector [c_primitive_type_double_complex] = builtin->builtin_double_complex; }; const struct language_defn c_language_defn = { "c", /* Language name */ language_c, - c_builtin_types, + NULL, range_check_off, type_check_off, case_sensitive_on, + array_row_major, &exp_descriptor_standard, c_preprocess_and_parse, c_error, + null_post_parser, c_printchar, /* Print a character constant */ c_printstr, /* Function to print string constant */ c_emit_char, /* Print a single char */ @@ -558,15 +587,13 @@ const struct language_defn c_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + NULL, /* Language specific class_name_from_physname */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, + c_language_arch_info, LANG_MAGIC }; @@ -611,9 +638,11 @@ const struct language_defn cplus_language_defn = range_check_off, type_check_off, case_sensitive_on, + array_row_major, &exp_descriptor_standard, c_preprocess_and_parse, c_error, + null_post_parser, c_printchar, /* Print a character constant */ c_printstr, /* Function to print string constant */ c_emit_char, /* Print a single char */ @@ -626,15 +655,13 @@ const struct language_defn cplus_language_defn = cp_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ cp_lookup_transparent_type, /* lookup_transparent_type */ call_cplus_demangle, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + cp_class_name_from_physname, /* Language specific class_name_from_physname */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ &builtin_type_char, /* Type of string elements */ default_word_break_characters, + NULL, /* FIXME: la_language_arch_info. */ LANG_MAGIC }; @@ -642,13 +669,15 @@ const struct language_defn asm_language_defn = { "asm", /* Language name */ language_asm, - c_builtin_types, + NULL, range_check_off, type_check_off, case_sensitive_on, + array_row_major, &exp_descriptor_standard, c_preprocess_and_parse, c_error, + null_post_parser, c_printchar, /* Print a character constant */ c_printstr, /* Function to print string constant */ c_emit_char, /* Print a single char */ @@ -661,15 +690,13 @@ const struct language_defn asm_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + NULL, /* Language specific class_name_from_physname */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, + c_language_arch_info, /* FIXME: la_language_arch_info. */ LANG_MAGIC }; @@ -682,13 +709,15 @@ const struct language_defn minimal_language_defn = { "minimal", /* Language name */ language_minimal, - c_builtin_types, + NULL, range_check_off, type_check_off, case_sensitive_on, + array_row_major, &exp_descriptor_standard, c_preprocess_and_parse, c_error, + null_post_parser, c_printchar, /* Print a character constant */ c_printstr, /* Function to print string constant */ c_emit_char, /* Print a single char */ @@ -701,15 +730,13 @@ const struct language_defn minimal_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + NULL, /* Language specific class_name_from_physname */ c_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, + c_language_arch_info, LANG_MAGIC }; diff --git a/gnu/usr.bin/binutils/gdb/c-lang.h b/gnu/usr.bin/binutils/gdb/c-lang.h index dd8f2311702..bce77496529 100644 --- a/gnu/usr.bin/binutils/gdb/c-lang.h +++ b/gnu/usr.bin/binutils/gdb/c-lang.h @@ -24,6 +24,7 @@ #define C_LANG_H 1 struct ui_file; +struct language_arch_info; #include "value.h" #include "macroexp.h" @@ -61,7 +62,8 @@ extern void *expression_macro_lookup_baton; extern struct type *c_create_fundamental_type (struct objfile *, int); -extern struct type **const (c_builtin_types[]); +extern void c_language_arch_info (struct gdbarch *gdbarch, + struct language_arch_info *lai); /* These are in c-typeprint.c: */ diff --git a/gnu/usr.bin/binutils/gdb/c-typeprint.c b/gnu/usr.bin/binutils/gdb/c-typeprint.c index 2d2ad850c3f..c9a644229bb 100644 --- a/gnu/usr.bin/binutils/gdb/c-typeprint.c +++ b/gnu/usr.bin/binutils/gdb/c-typeprint.c @@ -38,9 +38,6 @@ #include "gdb_string.h" #include <errno.h> -/* Flag indicating target was compiled by HP compiler */ -extern int hp_som_som_object_present; - static void cp_type_print_method_args (struct type *mtype, char *prefix, char *varstring, int staticp, struct ui_file *stream); @@ -1078,7 +1075,7 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show, case TYPE_CODE_ENUM: c_type_print_modifier (type, stream, 0, 1); /* HP C supports sized enums */ - if (hp_som_som_object_present) + if (deprecated_hp_som_som_object_present) switch (TYPE_LENGTH (type)) { case 1: diff --git a/gnu/usr.bin/binutils/gdb/coffread.c b/gnu/usr.bin/binutils/gdb/coffread.c index 056ba137471..2f6790e2f5f 100644 --- a/gnu/usr.bin/binutils/gdb/coffread.c +++ b/gnu/usr.bin/binutils/gdb/coffread.c @@ -385,13 +385,6 @@ complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size) last_source_file = savestring (name, strlen (name)); current_source_start_addr = start_addr; current_source_end_addr = start_addr + size; - - if (current_objfile->ei.entry_point >= current_source_start_addr && - current_objfile->ei.entry_point < current_source_end_addr) - { - current_objfile->ei.deprecated_entry_file_lowpc = current_source_start_addr; - current_objfile->ei.deprecated_entry_file_highpc = current_source_end_addr; - } } /* Finish the symbol definitions for one main source file, @@ -444,14 +437,13 @@ coff_symfile_init (struct objfile *objfile) { /* Allocate struct to keep track of stab reading. */ objfile->sym_stab_info = (struct dbx_symfile_info *) - xmmalloc (objfile->md, sizeof (struct dbx_symfile_info)); + xmalloc (sizeof (struct dbx_symfile_info)); memset (objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info)); /* Allocate struct to keep track of the symfile */ - objfile->sym_private = xmmalloc (objfile->md, - sizeof (struct coff_symfile_info)); + objfile->sym_private = xmalloc (sizeof (struct coff_symfile_info)); memset (objfile->sym_private, 0, sizeof (struct coff_symfile_info)); @@ -610,6 +602,15 @@ coff_symfile_read (struct objfile *objfile, int mainline) /* Free the installed minimal symbol data. */ do_cleanups (cleanup_minimal_symbols); + /* If we are reinitializing, or if we have not loaded syms yet, + empty the psymtab. "mainline" is cleared so the *_read_psymtab + functions do not all re-initialize it. */ + if (mainline) + { + init_psymbol_list (objfile, 0); + mainline = 0; + } + bfd_map_over_sections (abfd, coff_locate_sections, (void *) info); if (info->stabsects) @@ -634,12 +635,14 @@ coff_symfile_read (struct objfile *objfile, int mainline) info->stabsects, info->stabstrsect->filepos, stabstrsize); } - if (dwarf2_has_info (abfd)) + if (dwarf2_has_info (objfile)) { /* DWARF2 sections. */ dwarf2_build_psymtabs (objfile, mainline); } + dwarf2_build_frame_info (objfile); + do_cleanups (back_to); } @@ -658,7 +661,7 @@ coff_symfile_finish (struct objfile *objfile) { if (objfile->sym_private != NULL) { - xmfree (objfile->md, objfile->sym_private); + xfree (objfile->sym_private); } /* Let stabs reader clean up */ diff --git a/gnu/usr.bin/binutils/gdb/command.h b/gnu/usr.bin/binutils/gdb/command.h index c4a5f20edd3..8c0461377d1 100644 --- a/gnu/usr.bin/binutils/gdb/command.h +++ b/gnu/usr.bin/binutils/gdb/command.h @@ -1,7 +1,7 @@ /* Header file for command-reading library command.c. Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1999, - 2000, 2002 Free Software Foundation, Inc. + 2000, 2002, 2004 Free Software Foundation, Inc. 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 @@ -153,14 +153,15 @@ extern void execute_cmd_pre_hook (struct cmd_list_element *cmd); extern void execute_cmd_post_hook (struct cmd_list_element *cmd); /* Return the type of the command. */ -/* NOTE: cagney/2002-03-17: The add_show_from_set() function clones - the set command passed as a parameter. The clone operation will - include (BUG?) any ``set'' command callback, if present. Commands - like ``info set'' call all the ``show'' command callbacks. - Unfortunately, for ``show'' commands cloned from ``set'', this - includes callbacks belonging to ``set'' commands. Making this - worse, this only occures if add_show_from_set() is called after - add_cmd_sfunc() (BUG?). */ +/* NOTE: cagney/2002-03-17: The deprecated_add_show_from_set() + function clones the set command passed as a parameter. The clone + operation will include (BUG?) any ``set'' command callback, if + present. Commands like ``info set'' call all the ``show'' command + callbacks. Unfortunately, for ``show'' commands cloned from + ``set'', this includes callbacks belonging to ``set'' commands. + Making this worse, this only occures if + deprecated_add_show_from_set() is called after add_cmd_sfunc() + (BUG?). */ extern enum cmd_types cmd_type (struct cmd_list_element *cmd); @@ -210,26 +211,6 @@ extern void help_list (struct cmd_list_element *, char *, extern void help_cmd_list (struct cmd_list_element *, enum command_class, char *, int, struct ui_file *); -extern void add_setshow_cmd (char *name, - enum command_class class, - var_types var_type, void *var, - char *set_doc, char *show_doc, - cmd_sfunc_ftype *set_func, - cmd_sfunc_ftype *show_func, - struct cmd_list_element **set_list, - struct cmd_list_element **show_list); - -extern void add_setshow_cmd_full (char *name, - enum command_class class, - var_types var_type, void *var, - char *set_doc, char *show_doc, - cmd_sfunc_ftype *set_func, - cmd_sfunc_ftype *show_func, - struct cmd_list_element **set_list, - struct cmd_list_element **show_list, - struct cmd_list_element **set_result, - struct cmd_list_element **show_result); - extern struct cmd_list_element *add_set_cmd (char *name, enum command_class class, var_types var_type, void *var, @@ -246,7 +227,10 @@ extern struct cmd_list_element *add_set_enum_cmd (char *name, extern void add_setshow_auto_boolean_cmd (char *name, enum command_class class, enum auto_boolean *var, - char *set_doc, char *show_doc, + const char *set_doc, + const char *show_doc, + const char *help_doc, + const char *print, cmd_sfunc_ftype *set_func, cmd_sfunc_ftype *show_func, struct cmd_list_element **set_list, @@ -255,26 +239,63 @@ extern void add_setshow_auto_boolean_cmd (char *name, extern void add_setshow_boolean_cmd (char *name, enum command_class class, int *var, - char *set_doc, - char *show_doc, + const char *set_doc, const char *show_doc, + const char *help_doc, const char *print, cmd_sfunc_ftype *set_func, cmd_sfunc_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list); +extern void add_setshow_filename_cmd (char *name, + enum command_class class, + char **var, + const char *set_doc, + const char *show_doc, + const char *help_doc, + const char *print, + cmd_sfunc_ftype *set_func, + cmd_sfunc_ftype *show_func, + struct cmd_list_element **set_list, + struct cmd_list_element **show_list); + +extern void add_setshow_string_cmd (char *name, + enum command_class class, + char **var, + const char *set_doc, + const char *show_doc, + const char *help_doc, + const char *print, + cmd_sfunc_ftype *set_func, + cmd_sfunc_ftype *show_func, + struct cmd_list_element **set_list, + struct cmd_list_element **show_list); + extern void add_setshow_uinteger_cmd (char *name, enum command_class class, unsigned int *var, - char *set_doc, - char *show_doc, + const char *set_doc, + const char *show_doc, + const char *help_doc, + const char *print, + cmd_sfunc_ftype *set_func, + cmd_sfunc_ftype *show_func, + struct cmd_list_element **set_list, + struct cmd_list_element **show_list); + +extern void add_setshow_zinteger_cmd (char *name, + enum command_class class, + int *var, + const char *set_doc, + const char *show_doc, + const char *help_doc, + const char *print, cmd_sfunc_ftype *set_func, cmd_sfunc_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list); -extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *, - struct cmd_list_element - **); +extern struct cmd_list_element *deprecated_add_show_from_set (struct cmd_list_element *, + struct cmd_list_element **); /* Do a "show" command for each thing on a command list. */ diff --git a/gnu/usr.bin/binutils/gdb/complaints.c b/gnu/usr.bin/binutils/gdb/complaints.c index ed24f432406..8630fde85f7 100644 --- a/gnu/usr.bin/binutils/gdb/complaints.c +++ b/gnu/usr.bin/binutils/gdb/complaints.c @@ -1,7 +1,7 @@ /* Support for complaint handling during symbol reading in GDB. - Copyright 1990, 1991, 1992, 1993, 1995, 1998, 1999, 2000, 2002 Free - Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1995, 1998, 1999, 2000, 2002, + 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -186,8 +186,8 @@ vcomplaint (struct complaints **c, const char *file, int line, const char *fmt, if (complaint->file != NULL) internal_vwarning (complaint->file, complaint->line, complaint->fmt, args); - else if (warning_hook) - (*warning_hook) (complaint->fmt, args); + else if (deprecated_warning_hook) + (*deprecated_warning_hook) (complaint->fmt, args); else { if (complaints->explanation == NULL) @@ -197,7 +197,7 @@ vcomplaint (struct complaints **c, const char *file, int line, const char *fmt, { char *msg; struct cleanup *cleanups; - xvasprintf (&msg, complaint->fmt, args); + msg = xstrvprintf (complaint->fmt, args); cleanups = make_cleanup (xfree, msg); wrap_here (""); if (series != SUBSEQUENT_MESSAGE) @@ -311,11 +311,11 @@ clear_complaints (struct complaints **c, int less_verbose, int noisy) void _initialize_complaints (void) { - add_setshow_cmd ("complaints", class_support, var_zinteger, - &stop_whining, - "Set max number of complaints about incorrect symbols.", - "Show max number of complaints about incorrect symbols.", - NULL, NULL, - &setlist, &showlist); + add_setshow_zinteger_cmd ("complaints", class_support, &stop_whining, "\ +Set max number of complaints about incorrect symbols.", "\ +Show max number of complaints about incorrect symbols.", NULL, "\ +Max number of complaints about incorrect symbols is %s.", + NULL, NULL, + &setlist, &showlist); } diff --git a/gnu/usr.bin/binutils/gdb/config.in b/gnu/usr.bin/binutils/gdb/config.in index 69982fd6b9a..ed44c994b85 100644 --- a/gnu/usr.bin/binutils/gdb/config.in +++ b/gnu/usr.bin/binutils/gdb/config.in @@ -173,6 +173,12 @@ /* nativefile */ #undef GDB_NM_FILE +/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works + around a <sys/proc.h> problem on IRIX 5. */ +#ifndef _KMEMUSER +#undef _KMEMUSER +#endif + /* Define if you have the __argz_count function. */ #undef HAVE___ARGZ_COUNT @@ -254,6 +260,12 @@ /* Define if you have the syscall function. */ #undef HAVE_SYSCALL +/* Define if you have the ttrace function. */ +#undef HAVE_TTRACE + +/* Define if you have the wborder function. */ +#undef HAVE_WBORDER + /* Define if you have the <argz.h> header file. */ #undef HAVE_ARGZ_H @@ -263,9 +275,15 @@ /* Define if you have the <curses.h> header file. */ #undef HAVE_CURSES_H +/* Define if you have the <cursesX.h> header file. */ +#undef HAVE_CURSESX_H + /* Define if you have the <dirent.h> header file. */ #undef HAVE_DIRENT_H +/* Define if you have the <gnu/libc-version.h> header file. */ +#undef HAVE_GNU_LIBC_VERSION_H + /* Define if you have the <libunwind-ia64.h> header file. */ #undef HAVE_LIBUNWIND_IA64_H @@ -293,6 +311,9 @@ /* Define if you have the <ncurses.h> header file. */ #undef HAVE_NCURSES_H +/* Define if you have the <ncurses/ncurses.h> header file. */ +#undef HAVE_NCURSES_NCURSES_H + /* Define if you have the <ndir.h> header file. */ #undef HAVE_NDIR_H @@ -374,6 +395,9 @@ /* Define if you have the <sys/syscall.h> header file. */ #undef HAVE_SYS_SYSCALL_H +/* Define if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + /* Define if you have the <sys/user.h> header file. */ #undef HAVE_SYS_USER_H @@ -441,18 +465,36 @@ #undef HAVE__ETEXT /* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on - Solaris 2.[78] when using GCC. */ + Solaris 2.[789] when using GCC. */ #undef _MSE_INT_H /* Define to 1 if we found this declaration otherwise define to 0. */ #undef HAVE_DECL_GETOPT +/* Define to 1 if we found this declaration otherwise define to 0. */ +#undef HAVE_DECL_PTRACE + +/* Define as the return type of ptrace. */ +#undef PTRACE_TYPE_RET + +/* Define to the type of arg 3 for ptrace. */ +#undef PTRACE_TYPE_ARG3 + +/* Define to the type of arg 5 for ptrace. */ +#undef PTRACE_TYPE_ARG5 + /* Define if sigsetjmp is available. */ #undef HAVE_SIGSETJMP /* Define to 1 if the regex included in libiberty should be used. */ #undef USE_INCLUDED_REGEX +/* Define to 1 if your system has td_pcb in struct thread. */ +#undef HAVE_STRUCT_THREAD_TD_PCB + +/* Define to 1 if your system has struct lwp. */ +#undef HAVE_STRUCT_LWP + /* Define to 1 if your system has struct reg in <machine/reg.h>. */ #undef HAVE_STRUCT_REG @@ -528,6 +570,15 @@ /* Define if we can use the tkill syscall. */ #undef HAVE_TKILL_SYSCALL +/* Host float floatformat */ +#undef GDB_HOST_FLOAT_FORMAT + +/* Host double floatformat */ +#undef GDB_HOST_DOUBLE_FORMAT + +/* Host long double floatformat */ +#undef GDB_HOST_LONG_DOUBLE_FORMAT + /* Define to the default OS ABI for this configuration. */ #undef GDB_OSABI_DEFAULT diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mh b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mh index 418bc419f8a..49834411442 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mh +++ b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mh @@ -1,10 +1,11 @@ # Host: Little-endian Alpha running Linux -XM_FILE= xm-alphalinux.h NAT_FILE= nm-linux.h -NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o linux-proc.o \ - fork-child.o proc-service.o thread-db.o lin-lwp.o gcore.o \ +NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o \ + fork-child.o proc-service.o thread-db.o gcore.o \ linux-nat.o +# The dynamically loaded libthread_db needs access to symbols in the +# gdb executable. LOADLIBES = -ldl -rdynamic # doublest.c currently assumes some properties of FP arithmetic diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mt b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mt index 8fe98f264b7..d07dbee41f2 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mt +++ b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-linux.mt @@ -1,4 +1,4 @@ # Target: Little-endian Alpha TDEPFILES= alpha-tdep.o alpha-mdebug-tdep.o alpha-linux-tdep.o \ solib.o solib-svr4.o solib-legacy.o -TM_FILE= tm-alphalinux.h +DEPRECATED_TM_FILE= tm-alphalinux.h diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mh b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mh index 6d53b44505b..837f73ca227 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mh +++ b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mh @@ -1,5 +1,4 @@ # Host: Little-endian Alpha running OSF/1-1.x -XM_FILE= xm-alphaosf.h NAT_FILE= nm-osf.h NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \ solib-osf.o solib.o diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mt b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mt index 2a47bd41429..d8e227da6bf 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mt +++ b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf1.mt @@ -1,3 +1,3 @@ # Target: Little-endian Alpha TDEPFILES= alpha-tdep.o alpha-osf1-tdep.o alpha-mdebug-tdep.o -TM_FILE= tm-alpha.h +DEPRECATED_TM_FILE= tm-alpha.h diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf2.mh b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf2.mh index b853ebb30a9..d861037e60c 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf2.mh +++ b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf2.mh @@ -1,5 +1,4 @@ # Host: Little-endian Alpha running OSF/1-2.x using procfs -XM_FILE= xm-alphaosf.h NAT_FILE= nm-osf2.h NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \ solib-osf.o solib.o procfs.o proc-api.o proc-events.o proc-flags.o \ diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf3.mh b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf3.mh index f074444fae0..5a8f2aa04c8 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf3.mh +++ b/gnu/usr.bin/binutils/gdb/config/alpha/alpha-osf3.mh @@ -1,5 +1,4 @@ # Host: Little-endian Alpha running OSF/1-3.x and higher using procfs -XM_FILE= xm-alphaosf.h NAT_FILE= nm-osf3.h NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o fork-child.o \ solib-osf.o solib.o procfs.o proc-api.o proc-events.o proc-flags.o \ diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/nm-linux.h b/gnu/usr.bin/binutils/gdb/config/alpha/nm-linux.h index a6f9a49f9d6..19589584b20 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/nm-linux.h +++ b/gnu/usr.bin/binutils/gdb/config/alpha/nm-linux.h @@ -29,14 +29,6 @@ #define U_REGS_OFFSET 0 -/* FIXME: This is probably true, or should be, on all GNU/Linux ports. - IA64? Sparc64? */ -#define PTRACE_ARG3_TYPE long - -/* ptrace transfers longs, the ptrace man page is lying. */ - -#define PTRACE_XFER_TYPE long - /* The alpha does not step over a breakpoint, the manpage is lying again. */ #define CANNOT_STEP_BREAKPOINT 1 diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf.h b/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf.h index 326bb3005ca..288bc352dcb 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf.h +++ b/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf.h @@ -29,10 +29,6 @@ #define U_REGS_OFFSET 0 -/* FIXME: Shouldn't the default definition in inferior.h be int* ? */ - -#define PTRACE_ARG3_TYPE int* - /* ptrace transfers longs, the ptrace man page is lying. */ #define PTRACE_XFER_TYPE long diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf2.h b/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf2.h index 1f3932df59b..cbd232c0834 100644 --- a/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf2.h +++ b/gnu/usr.bin/binutils/gdb/config/alpha/nm-osf2.h @@ -35,7 +35,6 @@ #define PROCFS_DONT_TRACE_FAULTS /* Work around some peculiarities in the OSF/1 procfs implementation. */ -#define PROCFS_SIGPEND_OFFSET #define PROCFS_NEED_PIOCSSIG_FOR_KILL #define PROCFS_DONT_PIOCSSIG_CURSIG @@ -43,10 +42,3 @@ #define KERNEL_U_SIZE kernel_u_size() extern int kernel_u_size (void); - -/* poll() doesn't seem to work properly for /proc in this version of the OS. - If we only specify POLLPRI, things hang. It seems to get better when we set - POLLOUT, but that always returns POLLNVAL!!! Also, POLLOUT causes problems - on other OSes. */ - -#define LOSING_POLL diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/tm-fbsd.h b/gnu/usr.bin/binutils/gdb/config/alpha/tm-fbsd.h deleted file mode 100644 index c154366cc19..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/alpha/tm-fbsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Target-dependent definitions for FreeBSD/Alpha. - - Copyright 2000, 2001, 2002, 2004 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. */ - -#ifndef TM_FBSD_H -#define TM_FBSD_H - -#include "alpha/tm-alpha.h" - -#endif /* TM_FBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/xm-alphalinux.h b/gnu/usr.bin/binutils/gdb/config/alpha/xm-alphalinux.h deleted file mode 100644 index f1bc14da4bd..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/alpha/xm-alphalinux.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Host definitions for GDB running on an Alpha under GNU/Linux. - - Copyright 1996, 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. */ - -/* The alpha has no siginterrupt routine. */ -#define NO_SIGINTERRUPT - -#define HAVE_TERMIOS -#define USG diff --git a/gnu/usr.bin/binutils/gdb/config/alpha/xm-alphaosf.h b/gnu/usr.bin/binutils/gdb/config/alpha/xm-alphaosf.h deleted file mode 100644 index 67d3cc4af8a..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/alpha/xm-alphaosf.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Host definitions for GDB running on an alpha under OSF/1 - Copyright 1992, 1993, 1996 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. */ - -/* The alpha has no siginterrupt routine. */ -#define NO_SIGINTERRUPT - -#define HAVE_TERMIOS diff --git a/gnu/usr.bin/binutils/gdb/config/arm/nm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/arm/nm-nbsd.h deleted file mode 100644 index 63be920092f..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/arm/nm-nbsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Native-dependent definitions for ARM running NetBSD, for GDB. - Copyright 1986, 1987, 1989, 1992, 1994, 1999 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. */ - -#ifndef NM_NBSD_H -#define NM_NBSD_H - -/* Get generic NetBSD native definitions. */ -#include "config/nm-nbsd.h" - -#endif /* NM_NBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/arm/tm-arm.h b/gnu/usr.bin/binutils/gdb/config/arm/tm-arm.h index c62a75d6c39..afc06a8b530 100644 --- a/gnu/usr.bin/binutils/gdb/config/arm/tm-arm.h +++ b/gnu/usr.bin/binutils/gdb/config/arm/tm-arm.h @@ -22,8 +22,6 @@ #ifndef TM_ARM_H #define TM_ARM_H -#define GDB_MULTI_ARCH 1 - /* Specify that for the native compiler variables for a particular lexical context are listed after the beginning LBRAC instead of before in the executables list of symbols. */ diff --git a/gnu/usr.bin/binutils/gdb/config/arm/tm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/arm/tm-nbsd.h deleted file mode 100644 index 97bca68bc18..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/arm/tm-nbsd.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Macro definitions for ARM running under NetBSD. - Copyright 2003 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. */ - -#ifndef TM_NBSD_H -#define TM_NBSD_H - -#include "solib.h" - -#endif /* TM_NBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/arm/xm-linux.h b/gnu/usr.bin/binutils/gdb/config/arm/xm-linux.h deleted file mode 100644 index fa82a1e8f39..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/arm/xm-linux.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Host definitions for ARM GNU/Linux, for GDB, the GNU debugger. - Copyright 1999, 2001 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. */ - -#ifndef XM_ARMLINUX_H -#define XM_ARMLINUX_H - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ -#define KERNEL_U_ADDR 0x0 - -#endif /* XM_ARMLINUX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/arm/xm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/arm/xm-nbsd.h deleted file mode 100644 index d3f76a7dd01..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/arm/xm-nbsd.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Parameters for execution on an ARM running NetBSD, for GDB. - Copyright 1994 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. */ - -/* Get generic NetBSD host definitions. */ -#include "config/xm-nbsd.h" diff --git a/gnu/usr.bin/binutils/gdb/config/cris/tm-cris.h b/gnu/usr.bin/binutils/gdb/config/cris/tm-cris.h deleted file mode 100644 index fed260112c3..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/cris/tm-cris.h +++ /dev/null @@ -1,2 +0,0 @@ -#define GDB_MULTI_ARCH 1 -#include "solib.h" diff --git a/gnu/usr.bin/binutils/gdb/config/h8300/h8300.mt b/gnu/usr.bin/binutils/gdb/config/h8300/h8300.mt index c6e25ab8ced..4d27efcd2f5 100644 --- a/gnu/usr.bin/binutils/gdb/config/h8300/h8300.mt +++ b/gnu/usr.bin/binutils/gdb/config/h8300/h8300.mt @@ -1,6 +1,6 @@ # Target: H8300 with HMS monitor, E7000 ICE and H8 simulator TDEPFILES= h8300-tdep.o remote-e7000.o ser-e7kpc.o monitor.o remote-hms.o dsrec.o -TM_FILE= tm-h8300.h +DEPRECATED_TM_FILE= tm-h8300.h SIM_OBS = remote-sim.o SIM = ../sim/h8300/libsim.a diff --git a/gnu/usr.bin/binutils/gdb/config/i386/embed.mt b/gnu/usr.bin/binutils/gdb/config/i386/embed.mt deleted file mode 100644 index 6925a83501d..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/embed.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Embedded Intel 386 -TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mh b/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mh index 2d0500e565d..291e12150cf 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mh @@ -1,5 +1,7 @@ # Host: FreeBSD/i386 -NATDEPFILES= fork-child.o infptrace.o inftarg.o \ - i386-nat.o i386bsd-nat.o i386fbsd-nat.o gcore.o fbsd-proc.o +NATDEPFILES= fork-child.o inf-ptrace.o \ + fbsd-nat.o i386-nat.o i386bsd-nat.o i386fbsd-nat.o \ + gcore.o bsd-kvm.o NAT_FILE= nm-fbsd.h -XM_FILE= xm-i386.h + +LOADLIBES= -lkvm diff --git a/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mt b/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mt index be095e987a8..1a69e7fcd1b 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/fbsd.mt @@ -1,4 +1,4 @@ # Target: FreeBSD/i386 TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-fbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/go32.mt b/gnu/usr.bin/binutils/gdb/config/i386/go32.mt deleted file mode 100644 index 9b82c6426b4..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/go32.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Intel 386 running DJGPP -TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-go32.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386aout.mt b/gnu/usr.bin/binutils/gdb/config/i386/i386aout.mt deleted file mode 100644 index 2a33369b462..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386aout.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Intel 386 with a.out -TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mh index c2eb7af96ea..35b3947bff6 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mh @@ -4,7 +4,6 @@ NATDEPFILES= i386gnu-nat.o gnu-nat.o corelow.o core-regset.o \ notify_S.o process_reply_S.o msg_reply_S.o \ msg_U.o exc_request_U.o exc_request_S.o -XM_FILE= xm-i386.h NAT_FILE= nm-i386gnu.h MH_CFLAGS = -D_GNU_SOURCE diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mt b/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mt index 2029e99bbfc..220b64ab310 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386gnu.mt @@ -1,3 +1,2 @@ # Target: Intel 386 running the GNU Hurd TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o -TM_FILE= tm-i386.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mh index edfb1b0752b..2565057a5d7 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mh @@ -2,5 +2,5 @@ XM_CLIBS= -lbsd -NAT_FILE= nm-i386lynx.h +NAT_FILE= config/nm-lynx.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mt b/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mt index 6704b43e5b9..fe56c72b1fe 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386lynx.mt @@ -1,3 +1,3 @@ # Target: Intel 386 running LynxOS TDEPFILES= coff-solib.o i386-tdep.o i386ly-tdep.o -TM_FILE= tm-i386lynx.h +DEPRECATED_TM_FILE= config/tm-lynx.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386nw.mt b/gnu/usr.bin/binutils/gdb/config/i386/i386nw.mt deleted file mode 100644 index 9eafe7dcfd7..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386nw.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Intel 386 running NetWare -TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386sco.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386sco.mh index d03994486d0..d715439531b 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386sco.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386sco.mh @@ -1,12 +1,4 @@ # Host: Intel 386 running SCO Unix (pre-SVR4) -XM_FILE= xm-i386sco.h -XM_CLIBS= -lPW - NAT_FILE= nm-i386sco.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o i386v-nat.o - -#msg The SCO C compiler cannot parse symtab.h when value.h has been included. -#msg This is a bug in the compiler; the code is valid. -#msg Therefore, you must use GCC to compile GDB on SCO machines. -CC=gcc -D_POSIX_SOURCE=1 diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386sco4.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386sco4.mh index 2507e07ec28..219724820df 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386sco4.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386sco4.mh @@ -1,11 +1,4 @@ # Host: Intel 386 running SCO Unix 3.2v4 -XM_FILE= xm-i386sco.h -XM_CLIBS= -lPW - NAT_FILE= nm-i386sco4.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o i386v-nat.o - -# The cc compiler mishandles const in cases like -# struct type ** const (c_builtin_types[]) = -MH_CFLAGS=-Dconst= diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386sco5.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386sco5.mh index 7b8b8274250..1c3be9a758b 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386sco5.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386sco5.mh @@ -1,15 +1,6 @@ # Host: Intel 386 running SCO OpenServer 5 # Much like 3.2v4, except we don't have to avoid problems with const -XM_FILE= xm-i386sco.h - -# -# Not all configurations of SCO OpenServer 5 come with the TCP/IP -# runtime, but all come with the development system, so we always -# have socket(), gethostbyname(), and friends. -# -XM_CLIBS= -lPW -lsocket - NAT_FILE= nm-i386sco5.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corefile.o core-aout.o \ corelow.o i386v-nat.o solib.o solib-svr4.o solib-legacy.o diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mh index 1245ca7a4bd..c0477cfc55f 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mh @@ -1,8 +1,4 @@ -# Host: Intel 386 running Solaris 2 (SVR4) - -XM_FILE= xm-i386.h - -NAT_FILE= nm-i386sol2.h +# Host: Solaris x86 NATDEPFILES= fork-child.o i386v4-nat.o \ - procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gcore.o \ - solib.o solib-svr4.o solib-legacy.o + procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gcore.o +NAT_FILE= nm-i386sol2.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mt b/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mt index 863f61500d7..800ecbab322 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386sol2.mt @@ -1,3 +1,4 @@ -# Target: Intel 386 running Solaris 2 (SVR4) -TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o corelow.o -TM_FILE= tm-i386sol2.h +# Target: Solaris x86 +TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o \ + corelow.o solib.o solib-svr4.o +DEPRECATED_TM_FILE= tm-i386sol2.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386v.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386v.mh index 7f0ea6eae72..b1373a7d0be 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386v.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386v.mh @@ -1,7 +1,4 @@ # Host: Intel 386 running System V -XM_FILE= xm-i386v.h -XM_CLIBS= -lPW - NAT_FILE= nm-i386v.h NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o i386v-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386v.mt b/gnu/usr.bin/binutils/gdb/config/i386/i386v.mt deleted file mode 100644 index 1ee53057979..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386v.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Intel 386 running System V -TDEPFILES= i386-tdep.o i387-tdep.o -TM_FILE= tm-i386.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/i386v4.mh b/gnu/usr.bin/binutils/gdb/config/i386/i386v4.mh index a3952bc6213..a30c3bc1ad3 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/i386v4.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/i386v4.mh @@ -1,9 +1,5 @@ # Host: Intel 386 running SVR4 -XM_FILE= xm-i386v4.h -# for network communication -XM_CLIBS= -lsocket -lnsl - NAT_FILE= nm-i386v4.h NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o \ solib.o solib-svr4.o solib-legacy.o \ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/interix.mh b/gnu/usr.bin/binutils/gdb/config/i386/interix.mh deleted file mode 100644 index c294dd5e808..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/interix.mh +++ /dev/null @@ -1,6 +0,0 @@ -# Host: Intel 386 running Interix -XDEPFILES= -NATDEPFILES= corelow.o core-regset.o fork-child.o i386-interix-nat.o \ - procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o -NAT_FILE= nm-interix.h -XM_FILE= xm-interix.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/interix.mt b/gnu/usr.bin/binutils/gdb/config/i386/interix.mt deleted file mode 100644 index 8d609624757..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/interix.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Intel 386 running Interix -TDEPFILES= i386-tdep.o i387-tdep.o i386-interix-tdep.o solib.o solib-pei.o -TM_FILE= tm-i386.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/linux.mh b/gnu/usr.bin/binutils/gdb/config/i386/linux.mh index 2a20cdd9749..bfe29c123e2 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/linux.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/linux.mh @@ -1,11 +1,9 @@ # Host: Intel 386 running GNU/Linux. -XM_FILE= xm-i386.h - NAT_FILE= nm-linux.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \ +NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \ core-aout.o i386-nat.o i386-linux-nat.o \ - proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o \ + proc-service.o thread-db.o gcore.o \ linux-nat.o # The dynamically loaded libthread_db needs access to symbols in the diff --git a/gnu/usr.bin/binutils/gdb/config/i386/linux.mt b/gnu/usr.bin/binutils/gdb/config/i386/linux.mt index 9e068a47055..3fce56ae07f 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/linux.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/linux.mt @@ -1,4 +1,4 @@ # Target: Intel 386 running GNU/Linux TDEPFILES= i386-tdep.o i386-linux-tdep.o glibc-tdep.o i387-tdep.o \ - solib.o solib-svr4.o solib-legacy.o -TM_FILE= tm-linux.h + solib.o solib-svr4.o symfile-mem.o +DEPRECATED_TM_FILE= tm-linux.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nbsd.mt b/gnu/usr.bin/binutils/gdb/config/i386/nbsd.mt index d6699b54ec2..583ef67a07c 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nbsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/nbsd.mt @@ -1,4 +1,4 @@ # Target: NetBSD/i386 TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o nbsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mh b/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mh index 4e669ba4ad6..a2d8588c212 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mh @@ -1,16 +1,5 @@ # Host: NCR 3000 (Intel 386 running SVR4) -# The NCR 3000 ships with a MetaWare compiler installed as /bin/cc. -# This compiler not only emits obnoxious copyright messages every time -# you run it, but it chokes and dies on a whole bunch of GNU source -# files. Default to using the AT&T compiler installed in /usr/ccs/ATT/cc. -# Unfortunately though, the AT&T compiler sometimes generates code that -# the assembler barfs on if -g is used, so disable it by default as well. -CC = /usr/ccs/ATT/cc -CFLAGS = - -XM_FILE= xm-i386v4.h - NAT_FILE= nm-i386v4.h NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o procfs.o \ proc-api.o proc-events.o proc-flags.o proc-why.o diff --git a/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mt b/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mt index 4773daec1b6..20a072832f0 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/ncr3000.mt @@ -1,3 +1,2 @@ # Target: Intel 386 running SVR4 TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o -TM_FILE= tm-i386.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-fbsd.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-fbsd.h index 314e3a0f2f1..4c0aa36b13c 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-fbsd.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-fbsd.h @@ -52,20 +52,8 @@ extern void i386bsd_dr_reset_addr (int regnum); extern unsigned long i386bsd_dr_get_status (void); -/* Type of the third argument to the `ptrace' system call. */ -#define PTRACE_ARG3_TYPE caddr_t - -/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ -#define FETCH_INFERIOR_REGISTERS - -/* Override child_resume in `infptrace.c' to work around a kernel bug. */ -#define CHILD_RESUME - -/* Override child_pid_to_exec_file in 'inftarg.c'. */ -#define CHILD_PID_TO_EXEC_FILE - -/* We can attach and detach. */ -#define ATTACH_DETACH +/* Get generic BSD native definitions. */ +#include "config/nm-bsd.h" /* Support for the user struct. */ @@ -74,75 +62,10 @@ extern unsigned long i386bsd_dr_get_status (void); #define KERNEL_U_SIZE kernel_u_size () extern int kernel_u_size (void); - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ - -#include <machine/vmparam.h> -#define KERNEL_U_ADDR USRSTACK - -#define REGISTER_U_ADDR(addr, blockend, regno) \ - (addr) = register_u_addr ((blockend), (regno)) -extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno); /* Shared library support. */ #include "solib.h" -/* Make structure definitions match up with those expected in - `solib-sunos.c'. */ - -#define link_object sod -#define lo_name sod_name -#define lo_library sod_library -#define lo_unused sod_reserved -#define lo_major sod_major -#define lo_minor sod_minor -#define lo_next sod_next - -#define link_map so_map -#define lm_addr som_addr -#define lm_name som_path -#define lm_next som_next -#define lm_lop som_sod -#define lm_lob som_sodbase -#define lm_rwt som_write -#define lm_ld som_dynamic -#define lm_lpd som_spd - -#define link_dynamic_2 section_dispatch_table -#define ld_loaded sdt_loaded -#define ld_need sdt_sods -#define ld_rules sdt_filler1 -#define ld_got sdt_got -#define ld_plt sdt_plt -#define ld_rel sdt_rel -#define ld_hash sdt_hash -#define ld_stab sdt_nzlist -#define ld_stab_hash sdt_filler2 -#define ld_buckets sdt_buckets -#define ld_symbols sdt_strings -#define ld_symb_size sdt_str_sz -#define ld_text sdt_text_sz -#define ld_plt_sz sdt_plt_sz - -#define rtc_symb rt_symbol -#define rtc_sp rt_sp -#define rtc_next rt_next - -#define ld_debug so_debug -#define ldd_version dd_version -#define ldd_in_debugger dd_in_debugger -#define ldd_sym_loaded dd_sym_loaded -#define ldd_bp_addr dd_bpt_addr -#define ldd_bp_inst dd_bpt_shadow -#define ldd_cp dd_cc - -#define link_dynamic _dynamic -#define ld_version d_version -#define ldd d_debug -#define ld_un d_un -#define ld_2 d_sdt - #endif /* nm-fbsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-fbsd64.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-fbsd64.h deleted file mode 100644 index 4c27aff6d74..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-fbsd64.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Native-dependent definitions for FreeBSD/amd64. - - Copyright 2003, 2004 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. */ - -#ifndef NM_FBSD64_H -#define NM_FBSD64_H - -/* Type of the third argument to the `ptrace' system call. */ -#define PTRACE_ARG3_TYPE caddr_t - -/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ -#define FETCH_INFERIOR_REGISTERS - -/* Override child_pid_to_exec_file in 'inftarg.c'. */ -#define CHILD_PID_TO_EXEC_FILE - -/* We can attach and detach. */ -#define ATTACH_DETACH - -#endif /* nm-fbsd64.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386lynx.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386lynx.h deleted file mode 100644 index bc6a23410f2..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386lynx.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Native-dependent definitions for Intel 386 running LynxOS. - Copyright 1993 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. */ - -#ifndef NM_I386LYNX_H -#define NM_I386LYNX_H - -#include "config/nm-lynx.h" - -#endif /* NM_I386LYNX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco4.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco4.h index 6947f3febb1..39d7d50a1a8 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco4.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco4.h @@ -25,8 +25,6 @@ #include "i386/nm-i386sco.h" -#define ATTACH_DETACH - /* SCO, in its wisdom, does not provide <sys/ptrace.h>. infptrace.c does not have defaults for these values. */ #define PTRACE_ATTACH 10 diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco5.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco5.h index 65f317621e6..aa9a910c87e 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco5.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386sco5.h @@ -29,7 +29,6 @@ #include "i386/nm-i386sco.h" /* ... but it can do a lot of SVR4 type stuff too. */ -#define SVR4_SHARED_LIBS #include "solib.h" /* Pick up shared library support. */ /* SCO is unlike other SVR4 systems in that it has SVR4 style shared @@ -51,9 +50,6 @@ #define KERNEL_U_SIZE kernel_u_size () extern int kernel_u_size (void); -/* We can attach and detach. */ -#define ATTACH_DETACH - /* Hardware-assisted breakpoints and watchpoints. */ /* We can also do hardware watchpoints. */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v.h index f94c5bb8b35..2d4eb602206 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v.h @@ -32,7 +32,10 @@ #define REGISTER_U_ADDR(addr, blockend, regnum) \ (addr) = register_u_addr ((blockend), (regnum)) extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum); - + +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ +#define KERNEL_U_ADDR 0xe0000000 /* Number of traps that happen between exec'ing the shell to run an inferior, and when we finally get to the inferior code. This is 2 diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v4.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v4.h index 356d3cba0ca..821be55fc55 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v4.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-i386v4.h @@ -22,5 +22,6 @@ #include "config/nm-sysv4.h" -/* Poll causes GDB to hang, at least under Unixware 1.1.2. */ -#define LOSING_POLL +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ +#define KERNEL_U_ADDR 0xe0000000 diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-interix.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-interix.h deleted file mode 100644 index b8b003a58d7..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-interix.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Native-dependent definitions for Intel 386 running Interix, for GDB. - Copyright 1986, 1987, 1989, 1992, 1996 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. */ - -#ifndef NM_INTERIX_H -#define NM_INTERIX_H - -/* Be shared lib aware. */ -#include "solib.h" - -/* submodes of USE_PROC_FS. */ -#define UNIXWARE - -/* It's ALMOST coff; bfd does the same thing. Mostly used in coffread.c. */ -#define COFF_IMAGE_WITH_PE - -/* Turn on our own child_pid_to_exec_file. */ -#define CHILD_PID_TO_EXEC_FILE - -#endif /* NM_INTERIX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-linux.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-linux.h index 1df875fd57b..40c3e05ec0b 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-linux.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-linux.h @@ -80,7 +80,7 @@ extern int cannot_store_register (int regno); #endif /* Override child_resume in `infptrace.c'. */ -#define CHILD_RESUME +#define DEPRECATED_CHILD_RESUME /* `linux-nat.c' and `i386-nat.c' have their own versions of child_post_startup_inferior. Define this to use the copy in diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-nbsd.h deleted file mode 100644 index fef50f37bf5..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-nbsd.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Native-dependent definitions for NetBSD/i386. - - Copyright 1986, 1987, 1989, 1992, 1994, 2000, 2002, 2004 - 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. */ - -#ifndef NM_NBSD_H -#define NM_NBSD_H - -/* Get generic NetBSD native definitions. */ -#include "config/nm-nbsd.h" - -#endif /* nm-nbsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-nbsdaout.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-nbsdaout.h deleted file mode 100644 index 375a6a02d95..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-nbsdaout.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Native-dependent definitions for NetBSD/i386 a.out. - - Copyright 1986, 1987, 1989, 1992, 1994, 1996, 2000, 2004 - 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. */ - -#ifndef NM_NBSDAOUT_H -#define NM_NBSDAOUT_H - -#include "i386/nm-nbsd.h" - -/* Get generic NetBSD a.out native definitions. */ -#include "config/nm-nbsdaout.h" - -#endif /* nm-nbsdaout.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-nto.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-nto.h deleted file mode 100755 index 34d99033e70..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-nto.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _NM_NTO_H -#define _NM_NTO_H - -/* This file needed to build a native debugger. */ - -#endif diff --git a/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h b/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h index 4d10b539d86..571fb5984be 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/nm-obsd.h @@ -22,15 +22,8 @@ #ifndef NM_OBSD_H #define NM_OBSD_H -/* Type of the third argument to the `ptrace' system call. */ -#define PTRACE_ARG3_TYPE caddr_t - -/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ -#define FETCH_INFERIOR_REGISTERS - -/* We can attach and detach. */ -#define ATTACH_DETACH - +/* Get generic BSD native definitions. */ +#include "config/nm-bsd.h" /* Support for the user struct. */ @@ -38,75 +31,10 @@ #define KERNEL_U_SIZE kernel_u_size () extern int kernel_u_size (void); - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ - -#include <machine/vmparam.h> -#define KERNEL_U_ADDR USRSTACK - -#define REGISTER_U_ADDR(addr, blockend, regno) \ - (addr) = register_u_addr ((blockend), (regno)) -extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regno); /* Shared library support. */ #include "solib.h" -/* Make structure definitions match up with those expected in - `solib-sunos.c'. */ - -#define link_object sod -#define lo_name sod_name -#define lo_library sod_library -#define lo_unused sod_reserved -#define lo_major sod_major -#define lo_minor sod_minor -#define lo_next sod_next - -#define link_map so_map -#define lm_addr som_addr -#define lm_name som_path -#define lm_next som_next -#define lm_lop som_sod -#define lm_lob som_sodbase -#define lm_rwt som_write -#define lm_ld som_dynamic -#define lm_lpd som_spd - -#define link_dynamic_2 section_dispatch_table -#define ld_loaded sdt_loaded -#define ld_need sdt_sods -#define ld_rules sdt_filler1 -#define ld_got sdt_got -#define ld_plt sdt_plt -#define ld_rel sdt_rel -#define ld_hash sdt_hash -#define ld_stab sdt_nzlist -#define ld_stab_hash sdt_filler2 -#define ld_buckets sdt_buckets -#define ld_symbols sdt_strings -#define ld_symb_size sdt_str_sz -#define ld_text sdt_text_sz -#define ld_plt_sz sdt_plt_sz - -#define rtc_symb rt_symbol -#define rtc_sp rt_sp -#define rtc_next rt_next - -#define ld_debug so_debug -#define ldd_version dd_version -#define ldd_in_debugger dd_in_debugger -#define ldd_sym_loaded dd_sym_loaded -#define ldd_bp_addr dd_bpt_addr -#define ldd_bp_inst dd_bpt_shadow -#define ldd_cp dd_cc - -#define link_dynamic _dynamic -#define ld_version d_version -#define ldd d_debug -#define ld_un d_un -#define ld_2 d_sdt - #endif /* nm-obsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/obsd.mh b/gnu/usr.bin/binutils/gdb/config/i386/obsd.mh index c1f3c502abe..f5b4b2dffc7 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/obsd.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/obsd.mh @@ -1,8 +1,6 @@ # Host: OpenBSD/i386 ELF -NATDEPFILES= fork-child.o infptrace.o inftarg.o \ +NATDEPFILES= fork-child.o inf-ptrace.o \ i386bsd-nat.o i386obsd-nat.o i386nbsd-nat.o bsd-kvm.o NAT_FILE= nm-obsd.h -XM_FILE= xm-i386.h LOADLIBES= -lkvm - diff --git a/gnu/usr.bin/binutils/gdb/config/i386/obsd.mt b/gnu/usr.bin/binutils/gdb/config/i386/obsd.mt index 58e0fc0ebc8..b90fbf38c03 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/obsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/obsd.mt @@ -1,4 +1,4 @@ # Target: OpenBSD/i386 TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386obsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mh b/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mh index 3e0a0e70990..5c9899c4dfa 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mh +++ b/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mh @@ -1,7 +1,5 @@ # Host: OpenBSD/amd64 -NATDEPFILES= fork-child.o infptrace.o inftarg.o \ +NATDEPFILES= fork-child.o inf-ptrace.o \ amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o -NAT_FILE= nm-nbsd.h -XM_FILE= xm-i386.h LOADLIBES= -lkvm diff --git a/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mt b/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mt index e2bbf4151fc..4b1d144e1d6 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mt +++ b/gnu/usr.bin/binutils/gdb/config/i386/obsd64.mt @@ -2,4 +2,4 @@ TDEPFILES= amd64-tdep.o amd64obsd-tdep.o \ i386-tdep.o i387-tdep.o i386bsd-tdep.o i386obsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-fbsd.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-fbsd.h deleted file mode 100644 index 98a2702175c..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-fbsd.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Target-dependent definitions for FreeBSD/i386. - - Copyright 1997, 1999, 2000, 2001, 2004 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. */ - -#ifndef TM_FBSD_H -#define TM_FBSD_H - -#include "solib.h" - -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif - -#endif /* tm-fbsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-go32.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-go32.h deleted file mode 100644 index 85e0888ef80..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-go32.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Target-dependent definitions for Intel x86 running DJGPP. - Copyright 1995, 1996, 1997, 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef TM_GO32_H -#define TM_GO32_H - -#undef HAVE_SSE_REGS /* FIXME! go32-nat.c needs to support XMMi registers */ - -#include "i386/tm-i386.h" - -#endif /* TM_GO32_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-i386.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-i386.h deleted file mode 100644 index e2bd81fdaa8..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-i386.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Macro definitions for GDB on an Intel i[345]86. - Copyright 1995, 1996, 1998, 1999, 2000, 2001 - 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. */ - -#ifndef TM_I386_H -#define TM_I386_H 1 - -#endif /* ifndef TM_I386_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-i386lynx.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-i386lynx.h deleted file mode 100644 index 03fe4ff8bf7..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-i386lynx.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Macro definitions for Intel 386 running under LynxOS. - Copyright 1993, 1995, 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. */ - -#ifndef TM_I386LYNX_H -#define TM_I386LYNX_H - -#include "config/tm-lynx.h" - -/* Most definitions from sysv could be used. */ -#include "i386/tm-i386.h" - -#endif /* TM_I386LYNX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-linux.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-linux.h index 83440a8722f..1c8bbafdd05 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-linux.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/tm-linux.h @@ -1,7 +1,7 @@ /* Definitions to target GDB to GNU/Linux on 386. - Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free - Software Foundation, Inc. + Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2002, + 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -23,7 +23,6 @@ #ifndef TM_LINUX_H #define TM_LINUX_H -#include "i386/tm-i386.h" #include "config/tm-linux.h" /* The following works around a problem with /usr/include/sys/procfs.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-linux64.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-linux64.h deleted file mode 100644 index c3ff3521ea8..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-linux64.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Target-dependent definitions for GNU/Linux x86-64. - - Copyright 2002, 2003, 2004 Free Software Foundation, Inc. - - Contributed by Michal Ludvig, SuSE Labs. - - 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. */ - -#ifndef TM_LINUX64_H -#define TM_LINUX64_H - -/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that - link.h is available on all linux platforms. For I386 and SH3/4, we - hard-code the information rather than use link.h anyway (for the - benefit of cross-debugging). We may move to doing that for other - architectures as well. */ - -#define SVR4_SHARED_LIBS -#include "solib.h" /* Support for shared libraries. */ - -#endif /* tm-linux64.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-nbsd.h deleted file mode 100644 index 8fd41580765..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-nbsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Target-dependent definitions for NetBSD/i386. - - Copyright 1994, 1996, 2000, 2002, 2004 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. */ - -#ifndef TM_NBSD_H -#define TM_NBSD_H - -#include "solib.h" - -#endif /* tm-nbsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/tm-vxworks.h b/gnu/usr.bin/binutils/gdb/config/i386/tm-vxworks.h deleted file mode 100644 index f9b6be453cb..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/tm-vxworks.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Target machine description for VxWorks on the 80[3456]86, - for GDB, the GNU debugger. - Copyright 1999 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. */ - -#ifndef TM_VXWORKS_H -#define TM_VXWORKS_H - -#include "i386/tm-i386.h" -#include "config/tm-vxworks.h" - -#endif /* ifndef TM_VXWORKS_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/xm-go32.h b/gnu/usr.bin/binutils/gdb/config/i386/xm-go32.h index dead9f69e42..3b6b3b02b86 100644 --- a/gnu/usr.bin/binutils/gdb/config/i386/xm-go32.h +++ b/gnu/usr.bin/binutils/gdb/config/i386/xm-go32.h @@ -18,7 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "i386/xm-i386.h" #include "fopen-bin.h" #define GDBINIT_FILENAME "gdb.ini" diff --git a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386.h b/gnu/usr.bin/binutils/gdb/config/i386/xm-i386.h deleted file mode 100644 index de29b265998..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Host-dependent definitions for the i386. - - Copyright 2001, 2004 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. */ - -#ifndef XM_I386_H -#define XM_I386_H - -#include "floatformat.h" - -#define HOST_FLOAT_FORMAT &floatformat_ieee_single_little -#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little -#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext - -#endif /* xm-i386.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386sco.h b/gnu/usr.bin/binutils/gdb/config/i386/xm-i386sco.h deleted file mode 100644 index 18b64bf4207..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386sco.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Macro defintions for i386, running SCO Unix System V/386 3.2. - Copyright 1989, 1993, 1995 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. */ - -/* In 3.2v4 <sys/user.h> requires on <sys/dir.h>. */ -#include <sys/types.h> -#include <sys/dir.h> - -#include "i386/xm-i386v.h" - -/* SCO 3.2v2 and later have job control. */ -/* SCO 3.2v4 I know has termios; I'm not sure about earlier versions. - GDB does not currently support the termio/job control combination. */ -#undef HAVE_TERMIO -#define HAVE_TERMIOS diff --git a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386v.h b/gnu/usr.bin/binutils/gdb/config/i386/xm-i386v.h deleted file mode 100644 index 1c329054f22..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386v.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Host support for i386. - Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc. - Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988. - - 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. */ - -/* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's - Sys V/386 3.2. - - On some machines, gdb crashes when it's starting up while calling the - vendor's termio tgetent() routine. It always works when run under - itself (actually, under 3.2, it's not an infinitely recursive bug.) - After some poking around, it appears that depending on the environment - size, or whether you're running YP, or the phase of the moon or something, - the stack is not always long-aligned when main() is called, and tgetent() - takes strong offense at that. On some machines this bug never appears, but - on those where it does, it occurs quite reliably. */ -#define ALIGN_STACK_ON_STARTUP - -/* define USG if you are using sys5 /usr/include's */ -#define USG - -#define HAVE_TERMIO - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ - -#define KERNEL_U_ADDR 0xe0000000 diff --git a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386v4.h b/gnu/usr.bin/binutils/gdb/config/i386/xm-i386v4.h deleted file mode 100644 index 154986c1880..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/xm-i386v4.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Macro definitions for GDB on an Intel i386 running SVR4. - Copyright 1991, 1992, 1994, 1996 Free Software Foundation, Inc. - Written by Fred Fish at Cygnus Support (fnf@cygnus.com). - - 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. */ - -/* Pick up most of what we need from the generic i386 host include file. */ - -#include "i386/xm-i386v.h" - -/* Pick up more stuff from the generic SVR4 host include file. */ - -#include "config/xm-sysv4.h" diff --git a/gnu/usr.bin/binutils/gdb/config/i386/xm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/i386/xm-nbsd.h deleted file mode 100644 index 703c261ebe8..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/i386/xm-nbsd.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Host-dependent definitions for NetBSD/i386. - - Copyright 1994, 2000, 2004 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 "i386/xm-i386.h" - -/* Get generic NetBSD host definitions. */ -#include "config/xm-nbsd.h" diff --git a/gnu/usr.bin/binutils/gdb/config/ia64/xm-aix.h b/gnu/usr.bin/binutils/gdb/config/ia64/xm-aix.h deleted file mode 100644 index ad717d5c01c..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/ia64/xm-aix.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native support for AIX, for GDB, the GNU debugger. - Copyright 2000, 2001 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. */ - -#ifndef XM_AIX_H -#define XM_AIX_H - -/* Pick up more stuff from the generic SVR4 host include file. */ - -#include "config/xm-sysv4.h" - -#endif /* #ifndef XM_AIX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/ia64/xm-linux.h b/gnu/usr.bin/binutils/gdb/config/ia64/xm-linux.h deleted file mode 100644 index adf6b21b4cc..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/ia64/xm-linux.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native support for GNU/Linux, for GDB, the GNU debugger. - Copyright 1999, 2000, 2001 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. */ - -#ifndef XM_LINUX_H -#define XM_LINUX_H - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ -#define KERNEL_U_ADDR 0x0 - -#endif /* #ifndef XM_LINUX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/3b1.mh b/gnu/usr.bin/binutils/gdb/config/m68k/3b1.mh deleted file mode 100644 index 1ebba273f7f..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/3b1.mh +++ /dev/null @@ -1,12 +0,0 @@ -# OBSOLETE # Host: AT&T 3b1/Unix pc -# OBSOLETE # I don't think cc has been tried. -traditional for <sys/ioctl.h> -# OBSOLETE # (not sure whether necessary). -# OBSOLETE CC= gcc -traditional -# OBSOLETE # GCC runs out of virtual memory. -# OBSOLETE # A separate CC for pinsn routines is no longer supported, though. -# OBSOLETE # FIXME -- someone unlucky enough to have a 3B1, let bug-gcc@prep.ai.mit.edu -# OBSOLETE # know what works and what fails on the 3B1. -# OBSOLETE #PINSN_CC= cc -# OBSOLETE -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o -# OBSOLETE XM_FILE= xm-3b1.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/3b1.mt b/gnu/usr.bin/binutils/gdb/config/m68k/3b1.mt deleted file mode 100644 index 745918758b2..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/3b1.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: AT&T 3b1/Unix pc -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-3b1.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/cisco.mt b/gnu/usr.bin/binutils/gdb/config/m68k/cisco.mt index bc2e9214d7f..85b46331e48 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/cisco.mt +++ b/gnu/usr.bin/binutils/gdb/config/m68k/cisco.mt @@ -1,3 +1,3 @@ # Target: Cisco Router with 68K processor TDEPFILES= m68k-tdep.o corelow.o core-aout.o -TM_FILE= tm-cisco.h +DEPRECATED_TM_FILE= tm-cisco.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/delta68.mh b/gnu/usr.bin/binutils/gdb/config/m68k/delta68.mh deleted file mode 100644 index cfa14baca26..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/delta68.mh +++ /dev/null @@ -1,5 +0,0 @@ -# OBSOLETE # Host: Motorola Delta Series sysV68 R3V7.1 -# OBSOLETE -# OBSOLETE XM_FILE= xm-delta68.h -# OBSOLETE NAT_FILE= nm-delta68.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o delta68-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/delta68.mt b/gnu/usr.bin/binutils/gdb/config/m68k/delta68.mt deleted file mode 100644 index 743a92a3ae6..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/delta68.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Motorola Delta Series sysV68 R3V7.1 -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-delta68.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/dpx2.mh b/gnu/usr.bin/binutils/gdb/config/m68k/dpx2.mh deleted file mode 100644 index e9c5b68c58e..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/dpx2.mh +++ /dev/null @@ -1,6 +0,0 @@ -# OBSOLETE # Host: Bull DPX2 (68k, System V release 3) -# OBSOLETE -# OBSOLETE XM_FILE= xm-dpx2.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-dpx2.h -# OBSOLETE NATDEPFILES= infptrace.o corelow.o core-aout.o inftarg.o dpx2-nat.o fork-child.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/dpx2.mt b/gnu/usr.bin/binutils/gdb/config/m68k/dpx2.mt deleted file mode 100644 index 7cecda6af3d..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/dpx2.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Bull DPX2 (68k, System V release 3) -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-dpx2.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/m68klynx.mh b/gnu/usr.bin/binutils/gdb/config/m68k/m68klynx.mh deleted file mode 100644 index c76dccecfb1..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/m68klynx.mh +++ /dev/null @@ -1,6 +0,0 @@ -# OBSOLETE # Host: Motorola 680x0 running LynxOS -# OBSOLETE -# OBSOLETE XM_CLIBS= -lbsd -# OBSOLETE -# OBSOLETE NAT_FILE= nm-m68klynx.h -# OBSOLETE NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/m68klynx.mt b/gnu/usr.bin/binutils/gdb/config/m68k/m68klynx.mt deleted file mode 100644 index e3a3c797ece..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/m68klynx.mt +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Target: Motorola 680x0 running LynxOS -# OBSOLETE TDEPFILES= coff-solib.o m68k-tdep.o -# OBSOLETE # m68kly-tdep.o -# OBSOLETE TM_FILE= tm-m68klynx.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/m68kv4.mh b/gnu/usr.bin/binutils/gdb/config/m68k/m68kv4.mh deleted file mode 100644 index 23c64fab82d..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/m68kv4.mh +++ /dev/null @@ -1,7 +0,0 @@ -# OBSOLETE # Host: Motorola 680x0 running SVR4 (Commodore Amiga amix or Atari TT ASV) -# OBSOLETE -# OBSOLETE XM_FILE= xm-m68kv4.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-sysv4.h -# OBSOLETE NATDEPFILES= corelow.o core-regset.o solib.o solib-svr4.o solib-legacy.o \ -# OBSOLETE fork-child.o procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/m68kv4.mt b/gnu/usr.bin/binutils/gdb/config/m68k/m68kv4.mt deleted file mode 100644 index 0a9ad08d795..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/m68kv4.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Motorola 680x0 running SVR4 (Commodore Amiga amix or Atari TT ASV) -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-m68kv4.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/monitor.mt b/gnu/usr.bin/binutils/gdb/config/m68k/monitor.mt index 46b1c55ad63..0cae79681f8 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/monitor.mt +++ b/gnu/usr.bin/binutils/gdb/config/m68k/monitor.mt @@ -1,3 +1,3 @@ # Target: Motorola m68k embedded (EST emulator, rom68k and bug monitors) TDEPFILES= m68k-tdep.o monitor.o remote-est.o cpu32bug-rom.o rom68k-rom.o abug-rom.o dbug-rom.o dsrec.o -TM_FILE= tm-monitor.h +DEPRECATED_TM_FILE= tm-monitor.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nbsdaout.mt b/gnu/usr.bin/binutils/gdb/config/m68k/nbsdaout.mt deleted file mode 100644 index b6ac5a000e1..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nbsdaout.mt +++ /dev/null @@ -1,3 +0,0 @@ -# Target: Motorola m68k running NetBSD -TDEPFILES= m68k-tdep.o m68knbsd-tdep.o -TM_FILE= tm-nbsd.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nm-delta68.h b/gnu/usr.bin/binutils/gdb/config/m68k/nm-delta68.h deleted file mode 100644 index e27bb69a449..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nm-delta68.h +++ /dev/null @@ -1,22 +0,0 @@ -// OBSOLETE /* Macro definitions for a Motorola Delta Series sysV68 R3V7.1. -// OBSOLETE Copyright 1993, 1998 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE -// OBSOLETE #define KERNEL_U_SIZE kernel_u_size() diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nm-dpx2.h b/gnu/usr.bin/binutils/gdb/config/m68k/nm-dpx2.h deleted file mode 100644 index f6cce8a0412..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nm-dpx2.h +++ /dev/null @@ -1,29 +0,0 @@ -// OBSOLETE /* Native support for a Bull DPX2. -// OBSOLETE Copyright 1986, 1987, 1989, 1993, 2000 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* KERNEL_U_ADDR is determined upon startup in dpx2-xdep.c. */ -// OBSOLETE -// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ -// OBSOLETE (addr) = dpx2_register_u_addr ((blockend),(regno)); -// OBSOLETE -// OBSOLETE extern int dpx2_register_u_addr (int, int); -// OBSOLETE -// OBSOLETE /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ -// OBSOLETE #define ONE_PROCESS_WRITETEXT diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nm-m68klynx.h b/gnu/usr.bin/binutils/gdb/config/m68k/nm-m68klynx.h deleted file mode 100644 index 88b1260522b..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nm-m68klynx.h +++ /dev/null @@ -1,26 +0,0 @@ -// OBSOLETE /* Native-dependent definitions for Motorola 680x0 running LynxOS. -// OBSOLETE Copyright 1993 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #ifndef NM_M68KLYNX_H -// OBSOLETE #define NM_M68KLYNX_H -// OBSOLETE -// OBSOLETE #include "config/nm-lynx.h" -// OBSOLETE -// OBSOLETE #endif /* NM_M68KLYNX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/m68k/nm-nbsd.h deleted file mode 100644 index 72c98895a78..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nm-nbsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Native-dependent definitions for Motorola m68k running NetBSD, for GDB. - Copyright 1996 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. */ - -#ifndef NM_NBSD_H -#define NM_NBSD_H - -/* Get generic NetBSD native definitions. */ -#include "config/nm-nbsd.h" - -#endif /* NM_NBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nm-sun2.h b/gnu/usr.bin/binutils/gdb/config/m68k/nm-sun2.h deleted file mode 100644 index cce4a3e8ee0..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nm-sun2.h +++ /dev/null @@ -1,34 +0,0 @@ -// OBSOLETE /* Parameters for execution on a Sun2, for GDB, the GNU debugger. -// OBSOLETE Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Do implement the attach and detach commands. */ -// OBSOLETE -// OBSOLETE #define ATTACH_DETACH -// OBSOLETE -// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -// OBSOLETE #define FETCH_INFERIOR_REGISTERS -// OBSOLETE -// OBSOLETE /* This is a piece of magic that is given a register number REGNO -// OBSOLETE and as BLOCKEND the address in the system of the end of the user structure -// OBSOLETE and stores in ADDR the address in the kernel or core dump -// OBSOLETE of that register. */ -// OBSOLETE -// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ -// OBSOLETE { addr = blockend + regno * 4; } diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nm-sun3.h b/gnu/usr.bin/binutils/gdb/config/m68k/nm-sun3.h deleted file mode 100644 index 9e50707b9dc..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nm-sun3.h +++ /dev/null @@ -1,34 +0,0 @@ -// OBSOLETE /* Native-only definitions for Sun-3 for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1996 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE /* Do implement the attach and detach commands. */ -// OBSOLETE -// OBSOLETE #define ATTACH_DETACH -// OBSOLETE -// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -// OBSOLETE -// OBSOLETE #define FETCH_INFERIOR_REGISTERS -// OBSOLETE -// OBSOLETE /* We have to grab the regs since we store all regs at once. */ -// OBSOLETE -// OBSOLETE #define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/nm-sysv4.h b/gnu/usr.bin/binutils/gdb/config/m68k/nm-sysv4.h deleted file mode 100644 index 6e3a45205c7..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/nm-sysv4.h +++ /dev/null @@ -1,23 +0,0 @@ -// OBSOLETE /* Native-dependent definitions for Motorola 680x0 running SVR4. -// OBSOLETE Copyright 1994 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Include the generic SVR4 definitions. */ -// OBSOLETE -// OBSOLETE #include "config/nm-sysv4.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/obsd.mt b/gnu/usr.bin/binutils/gdb/config/m68k/obsd.mt index 7021c7f60ce..98531211fc2 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/obsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/m68k/obsd.mt @@ -1,3 +1,3 @@ # Target: OpenBSD/m68k TDEPFILES= m68k-tdep.o m68kbsd-tdep.o corelow.o solib.o solib-svr4.o -TM_FILE= tm-obsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/os68k.mt b/gnu/usr.bin/binutils/gdb/config/m68k/os68k.mt index 391dd894366..e1a4344b32b 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/os68k.mt +++ b/gnu/usr.bin/binutils/gdb/config/m68k/os68k.mt @@ -1,3 +1,3 @@ # Target: VxWorks running on a 68000 TDEPFILES= m68k-tdep.o -TM_FILE= tm-os68k.h +DEPRECATED_TM_FILE= tm-os68k.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/st2000.mt b/gnu/usr.bin/binutils/gdb/config/m68k/st2000.mt index 06dfe5cbc0d..8c503a45983 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/st2000.mt +++ b/gnu/usr.bin/binutils/gdb/config/m68k/st2000.mt @@ -1,3 +1,2 @@ # Target: Tandem ST-2000 phone switch TDEPFILES= m68k-tdep.o remote-st.o -TM_FILE= tm-st2000.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os3.mh b/gnu/usr.bin/binutils/gdb/config/m68k/sun2os3.mh deleted file mode 100644 index 2243a280e34..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os3.mh +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Host: Sun 2, running SunOS 3 -# OBSOLETE XM_FILE= xm-sun2.h -# OBSOLETE NAT_FILE= nm-sun2.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os3.mt b/gnu/usr.bin/binutils/gdb/config/m68k/sun2os3.mt deleted file mode 100644 index 343bccd16f0..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os3.mt +++ /dev/null @@ -1,7 +0,0 @@ -# OBSOLETE # Target: Sun 2, running SunOS 3 -# OBSOLETE # The system-supplied assembler re-orders the symbols so that gdb -# OBSOLETE # can't find "gcc_compiled.". -# OBSOLETE #msg If you compile your program with GCC, use the GNU assembler. -# OBSOLETE #msg -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-sun2.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os4.mh b/gnu/usr.bin/binutils/gdb/config/m68k/sun2os4.mh deleted file mode 100644 index ab9c7204938..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os4.mh +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Host: Sun 2, running SunOS 4 -# OBSOLETE XM_FILE= xm-sun2.h -# OBSOLETE NAT_FILE= nm-sun2.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os4.mt b/gnu/usr.bin/binutils/gdb/config/m68k/sun2os4.mt deleted file mode 100644 index 30ff4e3971a..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun2os4.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Sun 2, running SunOS 4 -# OBSOLETE TDEPFILES= solib.o solib-sunos.o m68k-tdep.o -# OBSOLETE TM_FILE= tm-sun2os4.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os3.mh b/gnu/usr.bin/binutils/gdb/config/m68k/sun3os3.mh deleted file mode 100644 index e7c820f43a0..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os3.mh +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Host: Sun 3, running SunOS 3 -# OBSOLETE XM_FILE= xm-sun3.h -# OBSOLETE NAT_FILE= nm-sun3.h -# OBSOLETE NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os3.mt b/gnu/usr.bin/binutils/gdb/config/m68k/sun3os3.mt deleted file mode 100644 index 4ea0d2741ae..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os3.mt +++ /dev/null @@ -1,8 +0,0 @@ -# OBSOLETE # Target: Sun 3, running SunOS 3 -# OBSOLETE # The system-supplied assembler re-orders the symbols so that gdb -# OBSOLETE # can't find "gcc_compiled.". -# OBSOLETE #msg If you compile your program with GCC, use the GNU assembler. -# OBSOLETE #msg -# OBSOLETE -# OBSOLETE TDEPFILES= m68k-tdep.o -# OBSOLETE TM_FILE= tm-sun3.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os4.mh b/gnu/usr.bin/binutils/gdb/config/m68k/sun3os4.mh deleted file mode 100644 index dc3f9afde76..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os4.mh +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Host: Sun 3, running SunOS 4 -# OBSOLETE XM_FILE= xm-sun3os4.h -# OBSOLETE NAT_FILE= nm-sun3.h -# OBSOLETE NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os4.mt b/gnu/usr.bin/binutils/gdb/config/m68k/sun3os4.mt deleted file mode 100644 index decf0b30d4d..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/sun3os4.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: Sun 3, running SunOS 4, as a target system -# OBSOLETE TDEPFILES= solib.o solib-sunos.o m68k-tdep.o -# OBSOLETE TM_FILE= tm-sun3os4.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-3b1.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-3b1.h deleted file mode 100644 index df845bd30ac..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-3b1.h +++ /dev/null @@ -1,33 +0,0 @@ -// OBSOLETE /* Parameters for targeting GDB to a 3b1. -// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* The child target can't deal with floating registers. */ -// OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM) -// OBSOLETE -// OBSOLETE /* Define BPT_VECTOR if it is different than the default. -// OBSOLETE This is the vector number used by traps to indicate a breakpoint. */ -// OBSOLETE -// OBSOLETE #define BPT_VECTOR 0x1 -// OBSOLETE -// OBSOLETE /* Address of end of stack space. */ -// OBSOLETE -// OBSOLETE #define STACK_END_ADDR 0x300000 -// OBSOLETE -// OBSOLETE #include "m68k/tm-m68k.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-cisco.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-cisco.h index 51e2cdc39a2..0b60444ddc8 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-cisco.h +++ b/gnu/usr.bin/binutils/gdb/config/m68k/tm-cisco.h @@ -22,8 +22,6 @@ #define DEFAULT_PROMPT "(cisco-68k-gdb) " /* Default prompt */ -#include "m68k/tm-m68k.h" - /* Offsets (in target ints) into jmp_buf. Defined in /csc/sys/sun/asm.S. */ #define JB_ELEMENT_SIZE 4 @@ -42,13 +40,6 @@ #define JB_A6 11 #define JB_SP 12 -/* Figure out where the longjmp will land. Slurp the args out of the stack. - We expect the first arg to be a pointer to the jmp_buf structure from which - we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. - This routine returns true on success */ - -#define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR) - /* BFD handles finding the registers in the core file, so they are at the start of the BFD .reg section. */ #define REGISTER_U_ADDR(addr,blockend,regno) (addr = DEPRECATED_REGISTER_BYTE (regno)) diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-delta68.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-delta68.h deleted file mode 100644 index c041060a8a6..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-delta68.h +++ /dev/null @@ -1,109 +0,0 @@ -// OBSOLETE /* Target definitions for delta68. -// OBSOLETE Copyright 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE struct frame_info; -// OBSOLETE -// OBSOLETE #include "regcache.h" -// OBSOLETE -// OBSOLETE /* Define BPT_VECTOR if it is different than the default. -// OBSOLETE This is the vector number used by traps to indicate a breakpoint. */ -// OBSOLETE -// OBSOLETE #define BPT_VECTOR 0x1 -// OBSOLETE -// OBSOLETE #define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled%" -// OBSOLETE #define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled%" -// OBSOLETE -// OBSOLETE /* Amount PC must be decremented by after a breakpoint. -// OBSOLETE On the Delta, the kernel decrements it for us. */ -// OBSOLETE -// OBSOLETE #define DECR_PC_AFTER_BREAK 0 -// OBSOLETE -// OBSOLETE /* Not sure what happens if we try to store this register, but -// OBSOLETE phdm@info.ucl.ac.be says we need this define. */ -// OBSOLETE -// OBSOLETE #define CANNOT_STORE_REGISTER(regno) (regno == FPI_REGNUM) -// OBSOLETE -// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state -// OBSOLETE a function return value of type TYPE, and copy that, in virtual format, -// OBSOLETE into VALBUF. */ -// OBSOLETE -// OBSOLETE /* When it returns a float/double value, use fp0 in sysV68. */ -// OBSOLETE /* When it returns a pointer value, use a0 in sysV68. */ -// OBSOLETE -// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ -// OBSOLETE if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ -// OBSOLETE DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \ -// OBSOLETE ®BUF[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], \ -// OBSOLETE VALBUF); \ -// OBSOLETE else \ -// OBSOLETE memcpy ((VALBUF), \ -// OBSOLETE (char *) ((REGBUF) + \ -// OBSOLETE (TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : \ -// OBSOLETE (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)))), \ -// OBSOLETE TYPE_LENGTH(TYPE)) -// OBSOLETE -// OBSOLETE /* Write into appropriate registers a function return value -// OBSOLETE of type TYPE, given in virtual format. */ -// OBSOLETE -// OBSOLETE /* When it returns a float/double value, use fp0 in sysV68. */ -// OBSOLETE /* When it returns a pointer value, use a0 in sysV68. */ -// OBSOLETE -// OBSOLETE #define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \ -// OBSOLETE if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \ -// OBSOLETE { \ -// OBSOLETE char raw_buf[DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM)]; \ -// OBSOLETE DEPRECATED_REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \ -// OBSOLETE deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM), \ -// OBSOLETE raw_buf, DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM)); \ -// OBSOLETE } \ -// OBSOLETE else \ -// OBSOLETE deprecated_write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \ -// OBSOLETE VALBUF, TYPE_LENGTH (TYPE)) -// OBSOLETE -// OBSOLETE /* Return number of args passed to a frame. -// OBSOLETE Can return -1, meaning no way to tell. */ -// OBSOLETE -// OBSOLETE extern int delta68_frame_num_args (struct frame_info *fi); -// OBSOLETE #define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi))) -// OBSOLETE -// OBSOLETE /* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear -// OBSOLETE the processor's instruction cache as it should. */ -// OBSOLETE #define CLEAR_INSN_CACHE() clear_insn_cache() -// OBSOLETE -// OBSOLETE #include "m68k/tm-m68k.h" -// OBSOLETE -// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state -// OBSOLETE the address in which a function should return its structure value, -// OBSOLETE as a CORE_ADDR (or an expression that can be used as one). */ -// OBSOLETE -// OBSOLETE #undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS -// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\ -// OBSOLETE (*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4)) -// OBSOLETE -// OBSOLETE extern int delta68_in_sigtramp (CORE_ADDR pc, char *name); -// OBSOLETE #define IN_SIGTRAMP(pc,name) delta68_in_sigtramp (pc, name) -// OBSOLETE -// OBSOLETE extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *fi); -// OBSOLETE #undef DEPRECATED_FRAME_SAVED_PC -// OBSOLETE #define DEPRECATED_FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi) -// OBSOLETE -// OBSOLETE extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi); -// OBSOLETE #undef DEPRECATED_FRAME_ARGS_ADDRESS -// OBSOLETE #define DEPRECATED_FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi) diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-dpx2.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-dpx2.h deleted file mode 100644 index f641ad3cad1..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-dpx2.h +++ /dev/null @@ -1,35 +0,0 @@ -// OBSOLETE /* Parameters for targeting to a Bull DPX2. -// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1993, 1994 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Define BPT_VECTOR if it is different than the default. -// OBSOLETE This is the vector number used by traps to indicate a breakpoint. */ -// OBSOLETE -// OBSOLETE #define BPT_VECTOR 0xe -// OBSOLETE -// OBSOLETE /* Need to get function ends by adding this to epilogue address from .bf -// OBSOLETE record, not using x_fsize field. */ -// OBSOLETE #define FUNCTION_EPILOGUE_SIZE 4 -// OBSOLETE -// OBSOLETE /* The child target can't deal with writing floating registers. */ -// OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM) -// OBSOLETE -// OBSOLETE #include <sys/types.h> -// OBSOLETE #include "m68k/tm-m68k.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-linux.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-linux.h deleted file mode 100644 index fc191b16404..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-linux.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Definitions to target GDB to GNU/Linux on m680x0. - - Copyright 1996, 1998, 1999, 2000, 2002, 2003 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. */ - -/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that - link.h is available on all linux platforms. For I386 and SH3/4, - we hard-code the information rather than use link.h anyway (for - the benefit of cross-debugging). We may move to doing that for - other architectures as well. */ - -#define SVR4_SHARED_LIBS -#include "solib.h" /* Support for shared libraries. */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68k.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68k.h deleted file mode 100644 index 17b31981f19..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68k.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Parameters for execution on a 68000 series machine. - Copyright 1986, 1987, 1989, 1990, 1992, 1993, 1994, 1995, 1996, 1998, - 1999, 2000, 2003 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. */ - -extern int m68k_get_longjmp_target (CORE_ADDR *); diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68klynx.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68klynx.h deleted file mode 100644 index e82fbee9e93..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68klynx.h +++ /dev/null @@ -1,39 +0,0 @@ -// OBSOLETE /* Macro definitions for Motorola 680x0 running under LynxOS. -// OBSOLETE Copyright 1993 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #ifndef TM_M68KLYNX_H -// OBSOLETE #define TM_M68KLYNX_H -// OBSOLETE -// OBSOLETE #include "config/tm-lynx.h" -// OBSOLETE -// OBSOLETE /* If PC-2 contains this instruction, then we know what we are in a system -// OBSOLETE call stub, and the return PC is is at SP+4, instead of SP. */ -// OBSOLETE -// OBSOLETE #define SYSCALL_TRAP 0x4e4a /* trap #10 */ -// OBSOLETE #define SYSCALL_TRAP_OFFSET 2 /* PC is after trap instruction */ -// OBSOLETE -// OBSOLETE /* Use the generic 68k definitions. */ -// OBSOLETE -// OBSOLETE #include "m68k/tm-m68k.h" -// OBSOLETE -// OBSOLETE /* Disable dumbshit alternate breakpoint mechanism needed by 68k stub. */ -// OBSOLETE #undef DEPRECATED_REMOTE_BREAKPOINT -// OBSOLETE -// OBSOLETE #endif /* TM_M68KLYNX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68kv4.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68kv4.h deleted file mode 100644 index 95696b60b49..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-m68kv4.h +++ /dev/null @@ -1,67 +0,0 @@ -// OBSOLETE /* Target definitions for GDB on a Motorola 680x0 running SVR4. -// OBSOLETE (Commodore Amiga with amix or Atari TT with ASV) -// OBSOLETE Copyright 1991, 1994, 1995, 1996, 1998, 1999, 2000, 2003 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE Written by Fred Fish at Cygnus Support (fnf@cygint) -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Define BPT_VECTOR if it is different than the default. -// OBSOLETE This is the vector number used by traps to indicate a breakpoint. */ -// OBSOLETE -// OBSOLETE #define BPT_VECTOR 0x1 -// OBSOLETE -// OBSOLETE /* How much to decrement the PC after a trap. Depends on kernel. */ -// OBSOLETE -// OBSOLETE #define DECR_PC_AFTER_BREAK 0 /* No decrement required */ -// OBSOLETE -// OBSOLETE #include "config/tm-sysv4.h" -// OBSOLETE #include "m68k/tm-m68k.h" -// OBSOLETE -// OBSOLETE /* Offsets (in target ints) into jmp_buf. Not defined in any system header -// OBSOLETE file, so we have to step through setjmp/longjmp with a debugger and figure -// OBSOLETE them out. As a double check, note that <setjmp> defines _JBLEN as 13, -// OBSOLETE which matches the number of elements we see saved by setjmp(). */ -// OBSOLETE -// OBSOLETE #define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */ -// OBSOLETE -// OBSOLETE #define JB_D2 0 -// OBSOLETE #define JB_D3 1 -// OBSOLETE #define JB_D4 2 -// OBSOLETE #define JB_D5 3 -// OBSOLETE #define JB_D6 4 -// OBSOLETE #define JB_D7 5 -// OBSOLETE #define JB_A1 6 -// OBSOLETE #define JB_A2 7 -// OBSOLETE #define JB_A3 8 -// OBSOLETE #define JB_A4 9 -// OBSOLETE #define JB_A5 10 -// OBSOLETE #define JB_A6 11 -// OBSOLETE #define JB_A7 12 -// OBSOLETE -// OBSOLETE #define JB_PC JB_A1 /* Setjmp()'s return PC saved in A1 */ -// OBSOLETE -// OBSOLETE /* Figure out where the longjmp will land. Slurp the args out of the stack. -// OBSOLETE We expect the first arg to be a pointer to the jmp_buf structure from which -// OBSOLETE we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. -// OBSOLETE This routine returns true on success */ -// OBSOLETE -// OBSOLETE #define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR) -// OBSOLETE -// OBSOLETE /* Convert a DWARF register number to a gdb REGNUM. */ -// OBSOLETE #define DWARF_REG_TO_REGNUM(num) ((num) < 16 ? (num) : (num)+FP0_REGNUM-16) diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-monitor.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-monitor.h index 1b00a8f05de..02d550d937a 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-monitor.h +++ b/gnu/usr.bin/binutils/gdb/config/m68k/tm-monitor.h @@ -36,6 +36,4 @@ /*#define NUM_REGS 18 */ -#include "m68k/tm-m68k.h" - /* FIXME, should do GET_LONGJMP_TARGET for newlib. */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-nbsd.h deleted file mode 100644 index 62f008c7249..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-nbsd.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Macro definitions for m68k running under NetBSD. - Copyright 1994, 1996, 2001 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. */ - -#ifndef TM_NBSD_H -#define TM_NBSD_H - -#include <sys/param.h> -#include <machine/vmparam.h> - -/* Define BPT_VECTOR if it is different than the default. - This is the vector number used by traps to indicate a breakpoint. */ -#define BPT_VECTOR 0xf -#define REMOTE_BPT_VECTOR 0xf - -/* Address of end of stack space. */ -#define STACK_END_ADDR USRSTACK - -/* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR. */ -#define SIGTRAMP_START(pc) (STACK_END_ADDR - 32) -#define SIGTRAMP_END(pc) (STACK_END_ADDR) - -#include "m68k/tm-m68k.h" - -/* Return non-zero if we are in a shared library trampoline code stub. */ -#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \ - (name && !strcmp(name, "_DYNAMIC")) - -extern use_struct_convention_fn m68knbsd_use_struct_convention; -#define USE_STRUCT_CONVENTION(gcc_p, type) \ - m68knbsd_use_struct_convention(gcc_p, type) - -#endif /* TM_NBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-obsd.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-obsd.h deleted file mode 100644 index 993b49ed69c..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-obsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Target-dependent definitions for OpenBSD/m68k. - - Copyright 2004 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. */ - -#ifndef TM_OBSD_H -#define TM_OBSD_H - -#include "solib.h" - -#endif /* tm-obsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-os68k.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-os68k.h index 815efff3b02..8787624ebe7 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-os68k.h +++ b/gnu/usr.bin/binutils/gdb/config/m68k/tm-os68k.h @@ -23,8 +23,6 @@ #define DEFAULT_PROMPT "(os68k) " -#include "m68k/tm-m68k.h" - /* We have more complex, useful breakpoints on the target. */ #undef DECR_PC_AFTER_BREAK #define DECR_PC_AFTER_BREAK 0 diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-st2000.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-st2000.h deleted file mode 100644 index 4d7a2b19bf9..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-st2000.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Parameters for a Tandem ST2000 phone switch. - Copyright (C) 1986, 1987, 1989, 199 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 "m68k/tm-m68k.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun2.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun2.h deleted file mode 100644 index 199530abe20..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun2.h +++ /dev/null @@ -1,24 +0,0 @@ -// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger. -// OBSOLETE Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* The child target can't deal with floating registers. */ -// OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM) -// OBSOLETE -// OBSOLETE #include "m68k/tm-m68k.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun2os4.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun2os4.h deleted file mode 100644 index 83beb6cf665..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun2os4.h +++ /dev/null @@ -1,21 +0,0 @@ -// OBSOLETE /* Copyright (C) 1990, Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "m68k/tm-sun2.h" -// OBSOLETE #include "config/tm-sunos.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun3.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun3.h deleted file mode 100644 index f51666dc044..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun3.h +++ /dev/null @@ -1,89 +0,0 @@ -// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1996, 2000 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #ifndef TM_SUN3_H -// OBSOLETE #define TM_SUN3_H -// OBSOLETE -// OBSOLETE /* Sun3 status includes fpflags, which shows whether the FPU has been used -// OBSOLETE by the process, and whether the FPU was done with an instruction or -// OBSOLETE was interrupted in the middle of a long instruction. See -// OBSOLETE <machine/reg.h>. */ -// OBSOLETE /* a&d, pc,sr, fp, fpstat, fpflags */ -// OBSOLETE -// OBSOLETE #define DEPRECATED_REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4) -// OBSOLETE -// OBSOLETE #define NUM_REGS 31 -// OBSOLETE -// OBSOLETE #define REGISTER_BYTES_OK(b) \ -// OBSOLETE ((b) == DEPRECATED_REGISTER_BYTES \ -// OBSOLETE || (b) == REGISTER_BYTES_FP \ -// OBSOLETE || (b) == REGISTER_BYTES_NOFP) -// OBSOLETE -// OBSOLETE /* If PC contains this instruction, then we know what we are in a system -// OBSOLETE call stub, and the return PC is is at SP+4, instead of SP. */ -// OBSOLETE -// OBSOLETE #define SYSCALL_TRAP 0x4e40 /* trap #0 */ -// OBSOLETE #define SYSCALL_TRAP_OFFSET 0 /* PC points at trap instruction */ -// OBSOLETE -// OBSOLETE #include "m68k/tm-m68k.h" -// OBSOLETE -// OBSOLETE /* Disable alternate breakpoint mechanism needed by 68k stub. */ -// OBSOLETE #undef DEPRECATED_REMOTE_BREAKPOINT -// OBSOLETE -// OBSOLETE /* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least -// OBSOLETE documented in a comment in <machine/setjmp.h>! */ -// OBSOLETE -// OBSOLETE #define JB_ELEMENT_SIZE 4 -// OBSOLETE -// OBSOLETE #define JB_ONSSTACK 0 -// OBSOLETE #define JB_SIGMASK 1 -// OBSOLETE #define JB_SP 2 -// OBSOLETE #define JB_PC 3 -// OBSOLETE #define JB_PSL 4 -// OBSOLETE #define JB_D2 5 -// OBSOLETE #define JB_D3 6 -// OBSOLETE #define JB_D4 7 -// OBSOLETE #define JB_D5 8 -// OBSOLETE #define JB_D6 9 -// OBSOLETE #define JB_D7 10 -// OBSOLETE #define JB_A2 11 -// OBSOLETE #define JB_A3 12 -// OBSOLETE #define JB_A4 13 -// OBSOLETE #define JB_A5 14 -// OBSOLETE #define JB_A6 15 -// OBSOLETE -// OBSOLETE /* Figure out where the longjmp will land. Slurp the args out of the stack. -// OBSOLETE We expect the first arg to be a pointer to the jmp_buf structure from which -// OBSOLETE we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. -// OBSOLETE This routine returns true on success */ -// OBSOLETE -// OBSOLETE #define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR) -// OBSOLETE -// OBSOLETE /* If sun3 pcc says that a parameter is a short, it's a short. */ -// OBSOLETE #define BELIEVE_PCC_PROMOTION_TYPE 1 -// OBSOLETE -// OBSOLETE /* Can't define BELIEVE_PCC_PROMOTION for SunOS /bin/cc of SunOS 4.1.1. -// OBSOLETE Apparently Sun fixed this for the sparc but not the sun3. */ -// OBSOLETE -// OBSOLETE /* The code which tries to deal with this bug is never harmful on a sun3. */ -// OBSOLETE #define SUN_FIXED_LBRAC_BUG (0) -// OBSOLETE -// OBSOLETE #endif /* TM_SUN3_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun3os4.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun3os4.h deleted file mode 100644 index 7e1ffb21fe2..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-sun3os4.h +++ /dev/null @@ -1,22 +0,0 @@ -// OBSOLETE /* Target machine parameters for Sun-3 under SunOS 4.x, for GDB. -// OBSOLETE Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "m68k/tm-sun3.h" -// OBSOLETE #include "config/tm-sunos.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/tm-vx68.h b/gnu/usr.bin/binutils/gdb/config/m68k/tm-vx68.h index 6eaf4189435..93d49544652 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/tm-vx68.h +++ b/gnu/usr.bin/binutils/gdb/config/m68k/tm-vx68.h @@ -30,7 +30,6 @@ /* We have more complex, useful breakpoints on the target. */ #define DECR_PC_AFTER_BREAK 0 -#include "m68k/tm-m68k.h" #include "config/tm-vxworks.h" /* Takes the current frame-struct pointer and returns the chain-pointer @@ -64,15 +63,3 @@ #define JB_A4 13 #define JB_A5 14 #define JB_A6 15 - -/* Figure out where the longjmp will land. Slurp the args out of the stack. - We expect the first arg to be a pointer to the jmp_buf structure from which - we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. - This routine returns true on success */ - -#define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR) - -/* Number of registers in a ptrace_getfpregs call. */ - -#define VX_SIZE_FPREGS (8 * DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) \ - + (3 * DEPRECATED_REGISTER_SIZE)) diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/vxworks68.mt b/gnu/usr.bin/binutils/gdb/config/m68k/vxworks68.mt index 8c9774496cb..e396f627528 100644 --- a/gnu/usr.bin/binutils/gdb/config/m68k/vxworks68.mt +++ b/gnu/usr.bin/binutils/gdb/config/m68k/vxworks68.mt @@ -1,3 +1,3 @@ # Target: Motorola m68k running VxWorks TDEPFILES= m68k-tdep.o remote-vx.o remote-vx68.o xdr_ld.o xdr_ptrace.o xdr_rdb.o -TM_FILE= tm-vx68.h +DEPRECATED_TM_FILE= tm-vx68.h diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-3b1.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-3b1.h deleted file mode 100644 index 7257b69dc9a..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-3b1.h +++ /dev/null @@ -1,82 +0,0 @@ -// OBSOLETE /* Parameters for execution on a 3b1. -// OBSOLETE Copyright 1986, 1987, 1989, 1999 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #define HAVE_TERMIO -// OBSOLETE #define USG -// OBSOLETE -// OBSOLETE /* This is the amount to subtract from u.u_ar0 -// OBSOLETE to get the offset in the core file of the register values. */ -// OBSOLETE -// OBSOLETE #define KERNEL_U_ADDR 0x70000 -// OBSOLETE -// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ -// OBSOLETE { addr = blockend + regno * 4; } -// OBSOLETE -// OBSOLETE /* Interface definitions for kernel debugger KDB. */ -// OBSOLETE -// OBSOLETE /* Map machine fault codes into signal numbers. -// OBSOLETE First subtract 0, divide by 4, then index in a table. -// OBSOLETE Faults for which the entry in this table is 0 -// OBSOLETE are not handled by KDB; the program's own trap handler -// OBSOLETE gets to handle then. */ -// OBSOLETE -// OBSOLETE #define FAULT_CODE_ORIGIN 0 -// OBSOLETE #define FAULT_CODE_UNITS 4 -// OBSOLETE #define FAULT_TABLE \ -// OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ -// OBSOLETE 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ -// OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0, \ -// OBSOLETE SIGILL } -// OBSOLETE -// OBSOLETE /* Start running with a stack stretching from BEG to END. -// OBSOLETE BEG and END should be symbols meaningful to the assembler. -// OBSOLETE This is used only for kdb. */ -// OBSOLETE -// OBSOLETE #define INIT_STACK(beg, end) \ -// OBSOLETE { asm (".globl end"); \ -// OBSOLETE asm ("movel $ end, sp"); \ -// OBSOLETE asm ("clrl fp"); } -// OBSOLETE -// OBSOLETE /* Push the frame pointer register on the stack. */ -// OBSOLETE #define PUSH_FRAME_PTR \ -// OBSOLETE asm ("movel fp, -(sp)"); -// OBSOLETE -// OBSOLETE /* Copy the top-of-stack to the frame pointer register. */ -// OBSOLETE #define POP_FRAME_PTR \ -// OBSOLETE asm ("movl (sp), fp"); -// OBSOLETE -// OBSOLETE /* After KDB is entered by a fault, push all registers -// OBSOLETE that GDB thinks about (all NUM_REGS of them), -// OBSOLETE so that they appear in order of ascending GDB register number. -// OBSOLETE The fault code will be on the stack beyond the last register. */ -// OBSOLETE -// OBSOLETE #define PUSH_REGISTERS \ -// OBSOLETE { asm ("clrw -(sp)"); \ -// OBSOLETE asm ("pea 10(sp)"); \ -// OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } -// OBSOLETE -// OBSOLETE /* Assuming the registers (including processor status) have been -// OBSOLETE pushed on the stack in order of ascending GDB register number, -// OBSOLETE restore them and return to the address in the saved PC register. */ -// OBSOLETE -// OBSOLETE #define POP_REGISTERS \ -// OBSOLETE { asm ("subil $8,28(sp)"); \ -// OBSOLETE asm ("movem (sp),$ 0xffff"); \ -// OBSOLETE asm ("rte"); } diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-delta68.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-delta68.h deleted file mode 100644 index 9b8f0af39ce..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-delta68.h +++ /dev/null @@ -1,35 +0,0 @@ -// OBSOLETE /* Macro definitions for a Delta. -// OBSOLETE Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* I'm running gdb 4.9 under sysV68 R3V7.1. -// OBSOLETE -// OBSOLETE On some machines, gdb crashes when it's starting up while calling the -// OBSOLETE vendor's termio tgetent() routine. It always works when run under -// OBSOLETE itself (actually, under 3.2, it's not an infinitely recursive bug.) -// OBSOLETE After some poking around, it appears that depending on the environment -// OBSOLETE size, or whether you're running YP, or the phase of the moon or something, -// OBSOLETE the stack is not always long-aligned when main() is called, and tgetent() -// OBSOLETE takes strong offense at that. On some machines this bug never appears, but -// OBSOLETE on those where it does, it occurs quite reliably. */ -// OBSOLETE #define ALIGN_STACK_ON_STARTUP -// OBSOLETE -// OBSOLETE #define USG -// OBSOLETE -// OBSOLETE #define HAVE_TERMIO diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-dpx2.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-dpx2.h deleted file mode 100644 index 0a42203ef67..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-dpx2.h +++ /dev/null @@ -1,22 +0,0 @@ -// OBSOLETE /* Parameters for execution on a Bull DPX2. -// OBSOLETE Copyright 1986, 1987, 1989, 1993 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #define HAVE_TERMIOS -// OBSOLETE #define USG diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-linux.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-linux.h deleted file mode 100644 index e5839b99bbf..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-linux.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Native support for linux, for GDB, the GNU debugger. - Copyright 1996, 1998, 2001 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. */ - -#ifndef XM_LINUX_H -#define XM_LINUX_H - -/* Pick up most of what we need from the generic m68k host include file. */ - -#include "m68k/xm-m68k.h" - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ -#define KERNEL_U_ADDR 0x0 - -#define HOST_LONG_DOUBLE_FORMAT &floatformat_m68881_ext - -#endif /* #ifndef XM_LINUX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-m68k.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-m68k.h deleted file mode 100644 index 5dc40ecb8f7..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-m68k.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Macro definitions for running gdb on host machines with m68k cpu's. - Copyright (C) 1991, Free Software Foundation, Inc. - Written by Fred Fish at Cygnus Support (fnf@cygint) - - 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. */ - diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-m68kv4.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-m68kv4.h deleted file mode 100644 index 044371cfa79..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-m68kv4.h +++ /dev/null @@ -1,29 +0,0 @@ -// OBSOLETE /* Host definitions for GDB on a Motorola 680x0 running SVR4. -// OBSOLETE (Commodore Amiga with amix or Atari TT with ASV) -// OBSOLETE Copyright 1991, 1992, 1994, 1996 Free Software Foundation, Inc. -// OBSOLETE Written by Fred Fish at Cygnus Support (fnf@cygnus.com) -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Pick up most of what we need from the generic m68k host include file. */ -// OBSOLETE -// OBSOLETE #include "m68k/xm-m68k.h" -// OBSOLETE -// OBSOLETE /* Pick up more stuff from the generic SVR4 host include file. */ -// OBSOLETE -// OBSOLETE #include "config/xm-sysv4.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-nbsd.h deleted file mode 100644 index 6c735fa1a8c..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-nbsd.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Parameters for execution on a Motorola m68k running NetBSD, for GDB. - Copyright 1996 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. */ - -/* Get generic NetBSD host definitions. */ -#include "config/xm-nbsd.h" diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun2.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun2.h deleted file mode 100644 index f17ad3cb6a1..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun2.h +++ /dev/null @@ -1,77 +0,0 @@ -// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1987, 1989, 1996 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* This is the amount to subtract from u.u_ar0 -// OBSOLETE to get the offset in the core file of the register values. */ -// OBSOLETE -// OBSOLETE #define KERNEL_U_ADDR 0x2800 -// OBSOLETE -// OBSOLETE -// OBSOLETE /* Interface definitions for kernel debugger KDB. */ -// OBSOLETE -// OBSOLETE /* Map machine fault codes into signal numbers. -// OBSOLETE First subtract 0, divide by 4, then index in a table. -// OBSOLETE Faults for which the entry in this table is 0 -// OBSOLETE are not handled by KDB; the program's own trap handler -// OBSOLETE gets to handle then. */ -// OBSOLETE -// OBSOLETE #define FAULT_CODE_ORIGIN 0 -// OBSOLETE #define FAULT_CODE_UNITS 4 -// OBSOLETE #define FAULT_TABLE \ -// OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ -// OBSOLETE 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ -// OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0, \ -// OBSOLETE SIGILL } -// OBSOLETE -// OBSOLETE /* Start running with a stack stretching from BEG to END. -// OBSOLETE BEG and END should be symbols meaningful to the assembler. -// OBSOLETE This is used only for kdb. */ -// OBSOLETE -// OBSOLETE #define INIT_STACK(beg, end) \ -// OBSOLETE { asm (".globl end"); \ -// OBSOLETE asm ("movel $ end, sp"); \ -// OBSOLETE asm ("clrl fp"); } -// OBSOLETE -// OBSOLETE /* Push the frame pointer register on the stack. */ -// OBSOLETE #define PUSH_FRAME_PTR \ -// OBSOLETE asm ("movel fp, -(sp)"); -// OBSOLETE -// OBSOLETE /* Copy the top-of-stack to the frame pointer register. */ -// OBSOLETE #define POP_FRAME_PTR \ -// OBSOLETE asm ("movl (sp), fp"); -// OBSOLETE -// OBSOLETE /* After KDB is entered by a fault, push all registers -// OBSOLETE that GDB thinks about (all NUM_REGS of them), -// OBSOLETE so that they appear in order of ascending GDB register number. -// OBSOLETE The fault code will be on the stack beyond the last register. */ -// OBSOLETE -// OBSOLETE #define PUSH_REGISTERS \ -// OBSOLETE { asm ("clrw -(sp)"); \ -// OBSOLETE asm ("pea 10(sp)"); \ -// OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } -// OBSOLETE -// OBSOLETE /* Assuming the registers (including processor status) have been -// OBSOLETE pushed on the stack in order of ascending GDB register number, -// OBSOLETE restore them and return to the address in the saved PC register. */ -// OBSOLETE -// OBSOLETE #define POP_REGISTERS \ -// OBSOLETE { asm ("subil $8,28(sp)"); \ -// OBSOLETE asm ("movem (sp),$ 0xffff"); \ -// OBSOLETE asm ("rte"); } diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun3.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun3.h deleted file mode 100644 index 5f04e024b07..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun3.h +++ /dev/null @@ -1,71 +0,0 @@ -// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger. -// OBSOLETE Copyright 1986, 1987, 1989, 1996 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Interface definitions for kernel debugger KDB. */ -// OBSOLETE -// OBSOLETE /* Map machine fault codes into signal numbers. -// OBSOLETE First subtract 0, divide by 4, then index in a table. -// OBSOLETE Faults for which the entry in this table is 0 -// OBSOLETE are not handled by KDB; the program's own trap handler -// OBSOLETE gets to handle then. */ -// OBSOLETE -// OBSOLETE #define FAULT_CODE_ORIGIN 0 -// OBSOLETE #define FAULT_CODE_UNITS 4 -// OBSOLETE #define FAULT_TABLE \ -// OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ -// OBSOLETE 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ -// OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0, \ -// OBSOLETE SIGILL } -// OBSOLETE -// OBSOLETE /* Start running with a stack stretching from BEG to END. -// OBSOLETE BEG and END should be symbols meaningful to the assembler. -// OBSOLETE This is used only for kdb. */ -// OBSOLETE -// OBSOLETE #define INIT_STACK(beg, end) \ -// OBSOLETE { asm (".globl end"); \ -// OBSOLETE asm ("movel #end, sp"); \ -// OBSOLETE asm ("movel #0,a6"); } -// OBSOLETE -// OBSOLETE /* Push the frame pointer register on the stack. */ -// OBSOLETE #define PUSH_FRAME_PTR \ -// OBSOLETE asm ("movel a6,sp@-"); -// OBSOLETE -// OBSOLETE /* Copy the top-of-stack to the frame pointer register. */ -// OBSOLETE #define POP_FRAME_PTR \ -// OBSOLETE asm ("movl sp@,a6"); -// OBSOLETE -// OBSOLETE /* After KDB is entered by a fault, push all registers -// OBSOLETE that GDB thinks about (all NUM_REGS of them), -// OBSOLETE so that they appear in order of ascending GDB register number. -// OBSOLETE The fault code will be on the stack beyond the last register. */ -// OBSOLETE -// OBSOLETE #define PUSH_REGISTERS \ -// OBSOLETE { asm ("clrw -(sp)"); \ -// OBSOLETE asm ("pea sp@(10)"); \ -// OBSOLETE asm ("movem #0xfffe,sp@-"); } -// OBSOLETE -// OBSOLETE /* Assuming the registers (including processor status) have been -// OBSOLETE pushed on the stack in order of ascending GDB register number, -// OBSOLETE restore them and return to the address in the saved PC register. */ -// OBSOLETE -// OBSOLETE #define POP_REGISTERS \ -// OBSOLETE { asm ("subil #8,sp@(28)"); \ -// OBSOLETE asm ("movem sp@,#0xffff"); \ -// OBSOLETE asm ("rte"); } diff --git a/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun3os4.h b/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun3os4.h deleted file mode 100644 index 5062071999a..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m68k/xm-sun3os4.h +++ /dev/null @@ -1,22 +0,0 @@ -// OBSOLETE /* Macro definitions for a sun 3 running os 4. -// OBSOLETE Copyright 1989, 1996, 1998 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "m68k/xm-sun3.h" -// OBSOLETE #define FPU diff --git a/gnu/usr.bin/binutils/gdb/config/m88k/nm-obsd.h b/gnu/usr.bin/binutils/gdb/config/m88k/nm-obsd.h deleted file mode 100644 index 6d81f58c9d9..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/m88k/nm-obsd.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native-dependent definitions for OpenBSD/m88k. - - Copyright 2004 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. */ - -#ifndef NM_OBSD_H -#define NM_OBSD_H - -/* Get generic BSD native definitions. */ -#include "config/nm-bsd.h" - -#endif /* nm-obsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/m88k/obsd.mh b/gnu/usr.bin/binutils/gdb/config/m88k/obsd.mh index de60ab49e6a..02ef16a2a3c 100644 --- a/gnu/usr.bin/binutils/gdb/config/m88k/obsd.mh +++ b/gnu/usr.bin/binutils/gdb/config/m88k/obsd.mh @@ -1,3 +1,2 @@ # Host: OpenBSD/m88k -NATDEPFILES= m88kbsd-nat.o fork-child.o infptrace.o inftarg.o -NAT_FILE= nm-obsd.h +NATDEPFILES= fork-child.o inf-child.o m88kbsd-nat.o diff --git a/gnu/usr.bin/binutils/gdb/config/mips/decstation.mh b/gnu/usr.bin/binutils/gdb/config/mips/decstation.mh deleted file mode 100644 index 63de3da10b5..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/decstation.mh +++ /dev/null @@ -1,4 +0,0 @@ -# OBSOLETE # Host: Little-endian MIPS machine such as DECstation. -# OBSOLETE XM_FILE= xm-mips.h -# OBSOLETE NAT_FILE= nm-mips.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o corelow.o mips-nat.o fork-child.o diff --git a/gnu/usr.bin/binutils/gdb/config/mips/embed.mt b/gnu/usr.bin/binutils/gdb/config/mips/embed.mt index 3dad52bd920..c1cabfe71a1 100644 --- a/gnu/usr.bin/binutils/gdb/config/mips/embed.mt +++ b/gnu/usr.bin/binutils/gdb/config/mips/embed.mt @@ -1,4 +1,4 @@ TDEPFILES= mips-tdep.o remote-mips.o -TM_FILE= tm-mips.h +DEPRECATED_TM_FILE= tm-mips.h SIM_OBS = remote-sim.o SIM = ../sim/mips/libsim.a diff --git a/gnu/usr.bin/binutils/gdb/config/mips/irix5.mh b/gnu/usr.bin/binutils/gdb/config/mips/irix5.mh index 12690b0bc8b..38c9b3045ed 100644 --- a/gnu/usr.bin/binutils/gdb/config/mips/irix5.mh +++ b/gnu/usr.bin/binutils/gdb/config/mips/irix5.mh @@ -1,7 +1,4 @@ # Host: SGI Iris running irix 5.x -XM_FILE= xm-irix5.h NAT_FILE= nm-irix5.h NATDEPFILES= fork-child.o irix5-nat.o corelow.o procfs.o \ proc-api.o proc-events.o proc-flags.o proc-why.o - -XM_CLIBS=-lbsd -lsun diff --git a/gnu/usr.bin/binutils/gdb/config/mips/irix5.mt b/gnu/usr.bin/binutils/gdb/config/mips/irix5.mt index 81e0f159eba..56995896648 100644 --- a/gnu/usr.bin/binutils/gdb/config/mips/irix5.mt +++ b/gnu/usr.bin/binutils/gdb/config/mips/irix5.mt @@ -1,3 +1,3 @@ # Target: MIPS SGI running Irix 5 TDEPFILES= mips-tdep.o mips-irix-tdep.o solib.o solib-irix.o -TM_FILE= tm-irix5.h +DEPRECATED_TM_FILE= tm-mips.h diff --git a/gnu/usr.bin/binutils/gdb/config/mips/littlemips.mh b/gnu/usr.bin/binutils/gdb/config/mips/littlemips.mh deleted file mode 100644 index 30c40ad847c..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/littlemips.mh +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Host: Little-endian MIPS machine such as DECstation. -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o -# OBSOLETE XM_FILE= xm-mips.h diff --git a/gnu/usr.bin/binutils/gdb/config/mips/mipsv4.mh b/gnu/usr.bin/binutils/gdb/config/mips/mipsv4.mh deleted file mode 100644 index 1a6104b3f94..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/mipsv4.mh +++ /dev/null @@ -1,6 +0,0 @@ -# Host: Mips running SVR4 -XM_FILE= xm-mipsv4.h -NAT_FILE= ../nm-sysv4.h -NATDEPFILES= fork-child.o mipsv4-nat.o corelow.o core-regset.o \ - solib.o solib-svr4.o solib-legacy.o \ - procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o diff --git a/gnu/usr.bin/binutils/gdb/config/mips/mipsv4.mt b/gnu/usr.bin/binutils/gdb/config/mips/mipsv4.mt deleted file mode 100644 index 13320c20ae6..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/mipsv4.mt +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Target: MIPS running SVR4 -# OBSOLETE TDEPFILES= mips-tdep.o -# OBSOLETE TM_FILE= tm-mipsv4.h diff --git a/gnu/usr.bin/binutils/gdb/config/mips/news-mips.mh b/gnu/usr.bin/binutils/gdb/config/mips/news-mips.mh deleted file mode 100644 index f2c7f89b3ed..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/news-mips.mh +++ /dev/null @@ -1,3 +0,0 @@ -# OBSOLETE # Host: Big-endian MIPS machine such as Sony News -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o mips-nat.o -# OBSOLETE NAT_FILE= nm-news-mips.h diff --git a/gnu/usr.bin/binutils/gdb/config/mips/nm-irix5.h b/gnu/usr.bin/binutils/gdb/config/mips/nm-irix5.h index 6bdab300b19..33a8a8ce924 100644 --- a/gnu/usr.bin/binutils/gdb/config/mips/nm-irix5.h +++ b/gnu/usr.bin/binutils/gdb/config/mips/nm-irix5.h @@ -45,3 +45,10 @@ extern int procfs_stopped_by_watchpoint (ptid_t); extern int procfs_set_watchpoint (ptid_t, CORE_ADDR, int, int, int); #define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1 + +/* Override register locations in upage for SGI machines */ +#define REGISTER_U_ADDR(addr, blockend, regno) \ + if (regno < PC_REGNUM) \ + addr = regno; \ + else \ + addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */ diff --git a/gnu/usr.bin/binutils/gdb/config/mips/nm-mips.h b/gnu/usr.bin/binutils/gdb/config/mips/nm-mips.h deleted file mode 100644 index f20ddf1d466..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/nm-mips.h +++ /dev/null @@ -1,34 +0,0 @@ -// OBSOLETE /* Native definitions for GDB on DECstations, Sony News. and MIPS Riscos systems -// OBSOLETE Copyright 1986, 1987, 1989, 1992, 1995, 1996, 2000 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin -// OBSOLETE and by Alessandro Forin(af@cs.cmu.edu) at CMU -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -// OBSOLETE #define FETCH_INFERIOR_REGISTERS -// OBSOLETE -// OBSOLETE /* Figure out where the longjmp will land. We expect that we have just entered -// OBSOLETE longjmp and haven't yet setup the stack frame, so the args are still in the -// OBSOLETE argument regs. a0 (CALL_ARG0) points at the jmp_buf structure from which we -// OBSOLETE extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. -// OBSOLETE This routine returns true on success */ -// OBSOLETE -// OBSOLETE #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) -// OBSOLETE extern int get_longjmp_target (CORE_ADDR *); diff --git a/gnu/usr.bin/binutils/gdb/config/mips/nm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/mips/nm-nbsd.h deleted file mode 100644 index 67628c2fa97..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/nm-nbsd.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native-dependent definitions for NetBSD/mips. - Copyright 2002 Free Software Foundation, Inc. - Contributed by Wasabi Systems, 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. */ - -#ifndef NM_NBSD_H -#define NM_NBSD_H - -/* Get generic NetBSD native definitions. */ -#include "config/nm-nbsd.h" - -#endif /* NM_NBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/mips/nm-news-mips.h b/gnu/usr.bin/binutils/gdb/config/mips/nm-news-mips.h deleted file mode 100644 index 15d9b7b2c36..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/nm-news-mips.h +++ /dev/null @@ -1,43 +0,0 @@ -// OBSOLETE /* Definitions to make GDB run on a mips box under 4.3bsd. -// OBSOLETE Copyright 1986, 1987, 1989, 1993, 1996 Free Software Foundation, Inc. -// OBSOLETE Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin -// OBSOLETE and by Alessandro Forin(af@cs.cmu.edu) at CMU -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #ifndef NM_NEWS_MIPS_H -// OBSOLETE #define NM_NEWS_MIPS_H 1 -// OBSOLETE -// OBSOLETE /* Needed for RISC NEWS core files. */ -// OBSOLETE #include <machine/machparam.h> -// OBSOLETE #include <sys/types.h> -// OBSOLETE #define KERNEL_U_ADDR UADDR -// OBSOLETE -// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ -// OBSOLETE if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\ -// OBSOLETE else addr = 0; /* ..somewhere in the pcb */ -// OBSOLETE -// OBSOLETE /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ -// OBSOLETE #define ONE_PROCESS_WRITETEXT -// OBSOLETE -// OBSOLETE #include "mips/nm-mips.h" -// OBSOLETE -// OBSOLETE /* Apparently not in <sys/types.h> */ -// OBSOLETE typedef int pid_t; -// OBSOLETE -// OBSOLETE #endif /* NM_NEWS_MIPS_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/mips/nm-riscos.h b/gnu/usr.bin/binutils/gdb/config/mips/nm-riscos.h deleted file mode 100644 index dba51b2775c..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/nm-riscos.h +++ /dev/null @@ -1,60 +0,0 @@ -// OBSOLETE /* This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE /* MIPS running RISC/os 4.52C. */ -// OBSOLETE -// OBSOLETE #define PCB_OFFSET(FIELD) ((int)&((struct user*)0)->u_pcb.FIELD) -// OBSOLETE -// OBSOLETE /* RISC/os 5.0 defines this in machparam.h. */ -// OBSOLETE #include <bsd43/machine/machparam.h> -// OBSOLETE #define NBPG BSD43_NBPG -// OBSOLETE #define UPAGES BSD43_UPAGES -// OBSOLETE -// OBSOLETE /* Where is this used? I don't see any uses in mips-nat.c, and I don't think -// OBSOLETE the uses in infptrace.c are used if FETCH_INFERIOR_REGISTERS is defined. -// OBSOLETE Does the compiler react badly to "extern CORE_ADDR kernel_u_addr" (even -// OBSOLETE if never referenced)? */ -// OBSOLETE #define KERNEL_U_ADDR BSD43_UADDR -// OBSOLETE -// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ -// OBSOLETE if (regno < FP0_REGNUM) \ -// OBSOLETE addr = UPAGES*NBPG-EF_SIZE+4*((regno)+EF_AT-1); \ -// OBSOLETE else if (regno < PC_REGNUM) \ -// OBSOLETE addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \ -// OBSOLETE else if (regno == PS_REGNUM) \ -// OBSOLETE addr = UPAGES*NBPG-EF_SIZE+4*EF_SR; \ -// OBSOLETE else if (regno == mips_regnum (current_gdbarch)->badvaddr) \ -// OBSOLETE addr = UPAGES*NBPG-EF_SIZE+4*EF_BADVADDR; \ -// OBSOLETE else if (regno == mips_regnum (current_gdbarch)->lo) \ -// OBSOLETE addr = UPAGES*NBPG-EF_SIZE+4*EF_MDLO; \ -// OBSOLETE else if (regno == mips_regnum (current_gdbarch)->hi) \ -// OBSOLETE addr = UPAGES*NBPG-EF_SIZE+4*EF_MDHI; \ -// OBSOLETE else if (regno == mips_regnum (current_gdbarch)->cause) \ -// OBSOLETE addr = UPAGES*NBPG-EF_SIZE+4*EF_CAUSE; \ -// OBSOLETE else if (regno == mips_regnum (current_gdbarch)->pc) \ -// OBSOLETE addr = UPAGES*NBPG-EF_SIZE+4*EF_EPC; \ -// OBSOLETE else if (regno < mips_regnum (current_gdbarch)->fp_control_status) \ -// OBSOLETE addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \ -// OBSOLETE else if (regno == mips_regnum (current_gdbarch)->fp_control_status) \ -// OBSOLETE addr = PCB_OFFSET(pcb_fpc_csr); \ -// OBSOLETE else if (regno == mips_regnum (current_gdbarch)->fp_implementation_revision) \ -// OBSOLETE addr = PCB_OFFSET(pcb_fpc_eir); \ -// OBSOLETE else \ -// OBSOLETE addr = 0; -// OBSOLETE -// OBSOLETE #include "mips/nm-mips.h" -// OBSOLETE -// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ -// OBSOLETE #define FETCH_INFERIOR_REGISTERS diff --git a/gnu/usr.bin/binutils/gdb/config/mips/riscos.mh b/gnu/usr.bin/binutils/gdb/config/mips/riscos.mh deleted file mode 100644 index 0a1c31c65f1..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/riscos.mh +++ /dev/null @@ -1,16 +0,0 @@ -# OBSOLETE # Host: MIPS running RISC/os -# OBSOLETE -# OBSOLETE XM_FILE= xm-riscos.h -# OBSOLETE -# OBSOLETE NAT_FILE= nm-riscos.h -# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o mips-nat.o -# OBSOLETE -# OBSOLETE MH_CFLAGS=-Wf,-XNh10000 -# OBSOLETE -# OBSOLETE # ptrace(2) apparently has problems in the BSD environment. No workaround is -# OBSOLETE # known except to select the sysv environment. Could we use /proc instead? -# OBSOLETE # These "sysv environments" and "bsd environments" often end up being a pain. -# OBSOLETE # -# OBSOLETE # This is not part of CFLAGS because perhaps not all C compilers have this -# OBSOLETE # option. -# OBSOLETE CC= cc -systype sysv diff --git a/gnu/usr.bin/binutils/gdb/config/mips/tm-irix5.h b/gnu/usr.bin/binutils/gdb/config/mips/tm-irix5.h deleted file mode 100644 index fdc17567af5..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/tm-irix5.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Target machine description for SGI Iris under Irix 5, for GDB. - - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2003 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 "mips/tm-mips.h" - -/* Offsets for register values in _sigtramp frame. - sigcontext is immediately above the _sigtramp frame on Irix. */ -#define SIGFRAME_BASE 0x0 -#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4) -#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 3 * 4) -#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 3 * 4 + 32 * 4 + 4) - -/* The signal handler trampoline is called _sigtramp. */ -#undef IN_SIGTRAMP -#define IN_SIGTRAMP(pc, name) ((name) && DEPRECATED_STREQ ("_sigtramp", name)) - -/* Irix 5 saves a full 64 bits for each register. We skip 2 * 4 to - get to the saved PC (the register mask and status register are both - 32 bits) and then another 4 to get to the lower 32 bits. We skip - the same 4 bytes, plus the 8 bytes for the PC to get to the - registers, and add another 4 to get to the lower 32 bits. We skip - 8 bytes per register. */ -#undef SIGFRAME_PC_OFF -#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4 + 4) -#undef SIGFRAME_REGSAVE_OFF -#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 4) -#undef SIGFRAME_FPREGSAVE_OFF -#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 32 * 8 + 4) diff --git a/gnu/usr.bin/binutils/gdb/config/mips/tm-irix6.h b/gnu/usr.bin/binutils/gdb/config/mips/tm-irix6.h deleted file mode 100644 index 272cafeac07..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/tm-irix6.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Target machine description for SGI Iris under Irix 6.x, for GDB. - - Copyright 2001, 2002, 2003 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 "mips/tm-mips.h" -#include "solib.h" - -/* The signal handler trampoline is called _sigtramp. */ -#undef IN_SIGTRAMP -#define IN_SIGTRAMP(pc, name) ((name) && DEPRECATED_STREQ ("_sigtramp", name)) - -/* Offsets for register values in _sigtramp frame. - sigcontext is immediately above the _sigtramp frame on Irix. */ -#undef SIGFRAME_BASE -#define SIGFRAME_BASE 0 - -/* Irix 5 saves a full 64 bits for each register. We skip 2 * 4 to - get to the saved PC (the register mask and status register are both - 32 bits) and then another 4 to get to the lower 32 bits. We skip - the same 4 bytes, plus the 8 bytes for the PC to get to the - registers, and add another 4 to get to the lower 32 bits. We skip - 8 bytes per register. */ -#undef SIGFRAME_PC_OFF -#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4 + 4) -#undef SIGFRAME_REGSAVE_OFF -#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 4) -#undef SIGFRAME_FPREGSAVE_OFF -#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 2 * 4 + 8 + 32 * 8 + 4) diff --git a/gnu/usr.bin/binutils/gdb/config/mips/tm-mips.h b/gnu/usr.bin/binutils/gdb/config/mips/tm-mips.h index be0d6b75eb1..040ab157059 100644 --- a/gnu/usr.bin/binutils/gdb/config/mips/tm-mips.h +++ b/gnu/usr.bin/binutils/gdb/config/mips/tm-mips.h @@ -26,8 +26,6 @@ #ifndef TM_MIPS_H #define TM_MIPS_H 1 -#define GDB_MULTI_ARCH 1 - #include "regcache.h" struct frame_info; @@ -56,7 +54,6 @@ extern int mips_step_skips_delay (CORE_ADDR); #define V0_REGNUM 2 /* Function integer return value */ #define A0_REGNUM 4 /* Loc of first arg during a subr call */ #define T9_REGNUM 25 /* Contains address of callee in PIC */ -#define SP_REGNUM 29 /* Contains address of top of stack */ #define RA_REGNUM 31 /* Contains return address value */ #define PS_REGNUM 32 /* Contains processor status */ #define UNUSED_REGNUM 73 /* Never used, FIXME */ @@ -99,12 +96,8 @@ typedef struct mips_extra_func_info #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); -/* These are defined in mdebugread.c and are used in mips-tdep.c */ -extern CORE_ADDR sigtramp_address, sigtramp_end; -extern void fixup_sigtramp (void); - /* Functions for dealing with MIPS16 call and return stubs. */ -#define IGNORE_HELPER_CALL(pc) mips_ignore_helper (pc) +#define DEPRECATED_IGNORE_HELPER_CALL(pc) mips_ignore_helper (pc) extern int mips_ignore_helper (CORE_ADDR pc); /* Definitions and declarations used by mips-tdep.c and remote-mips.c */ diff --git a/gnu/usr.bin/binutils/gdb/config/mips/tm-mipsv4.h b/gnu/usr.bin/binutils/gdb/config/mips/tm-mipsv4.h deleted file mode 100644 index 94607414f3b..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/tm-mipsv4.h +++ /dev/null @@ -1,37 +0,0 @@ -// OBSOLETE /* Target machine description for MIPS running SVR4, for GDB. -// OBSOLETE Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "mips/tm-mips.h" -// OBSOLETE #include "config/tm-sysv4.h" -// OBSOLETE -// OBSOLETE /* The signal handler trampoline is called _sigtramp. */ -// OBSOLETE #undef IN_SIGTRAMP -// OBSOLETE #define IN_SIGTRAMP(pc, name) ((name) && DEPRECATED_STREQ ("_sigtramp", name)) -// OBSOLETE -// OBSOLETE /* On entry to the signal handler trampoline, an ucontext is already -// OBSOLETE pushed on the stack. We can get at the saved registers via the -// OBSOLETE mcontext which is contained within the ucontext. */ -// OBSOLETE #define SIGFRAME_BASE 0 -// OBSOLETE #define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 40) -// OBSOLETE #define SIGFRAME_PC_OFF (SIGFRAME_BASE + 40 + 35 * 4) -// OBSOLETE #define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 40 + 36 * 4) -// OBSOLETE -// OBSOLETE /* Convert a DWARF register number to a gdb REGNUM. */ -// OBSOLETE #define DWARF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32) diff --git a/gnu/usr.bin/binutils/gdb/config/mips/vxmips.mt b/gnu/usr.bin/binutils/gdb/config/mips/vxmips.mt index a20cf96ab72..1fa433876eb 100644 --- a/gnu/usr.bin/binutils/gdb/config/mips/vxmips.mt +++ b/gnu/usr.bin/binutils/gdb/config/mips/vxmips.mt @@ -1,3 +1,3 @@ # Target: MIPS running VxWorks TDEPFILES= mips-tdep.o remote-vx.o remote-vxmips.o xdr_ld.o xdr_ptrace.o xdr_rdb.o -TM_FILE= tm-vxmips.h +DEPRECATED_TM_FILE= tm-vxmips.h diff --git a/gnu/usr.bin/binutils/gdb/config/mips/xm-irix5.h b/gnu/usr.bin/binutils/gdb/config/mips/xm-irix5.h deleted file mode 100644 index 7d61ff059cc..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/xm-irix5.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Definitions for irix5 hosting support. - - Copyright 1993, 1994, 1995, 1996 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 "config/xm-sysv4.h" - -/* Override register locations in upage for SGI machines */ -#undef REGISTER_U_ADDR -#define REGISTER_U_ADDR(addr, blockend, regno) \ - if (regno < PC_REGNUM) \ - addr = regno; \ - else \ - addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */ - -/* This enables reliable signals (and the associated setjmp/longjmp), and gives - bsdish prototypes for getpgrp/setpgrg/setgroups and initgroups. */ -#define _BSD_COMPAT diff --git a/gnu/usr.bin/binutils/gdb/config/mips/xm-mips.h b/gnu/usr.bin/binutils/gdb/config/mips/xm-mips.h deleted file mode 100644 index bc3aa6e40c4..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/xm-mips.h +++ /dev/null @@ -1,59 +0,0 @@ -// OBSOLETE /* Definitions to make GDB run on a mips box under 4.3bsd. -// OBSOLETE Copyright 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1998 -// OBSOLETE Free Software Foundation, Inc. -// OBSOLETE Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin -// OBSOLETE and by Alessandro Forin(af@cs.cmu.edu) at CMU -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #ifdef ultrix -// OBSOLETE /* Needed for DECstation core files. */ -// OBSOLETE #include <machine/param.h> -// OBSOLETE #define KERNEL_U_ADDR UADDR -// OBSOLETE -// OBSOLETE /* Native Ultrix cc has broken long long support. */ -// OBSOLETE #ifndef __GNUC__ -// OBSOLETE #undef CC_HAS_LONG_LONG -// OBSOLETE #endif -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE #if ! defined (__GNUC__) && ! defined (offsetof) -// OBSOLETE #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -// OBSOLETE #endif -// OBSOLETE -// OBSOLETE /* Only used for core files on DECstations. -// OBSOLETE First four registers at u.u_ar0 are saved arguments, and -// OBSOLETE there is no r0 saved. Float registers are saved -// OBSOLETE in u_pcb.pcb_fpregs, not relative to u.u_ar0. */ -// OBSOLETE -// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ -// OBSOLETE { \ -// OBSOLETE if (regno < FP0_REGNUM) \ -// OBSOLETE addr = blockend + sizeof(int) * (4 + regno - 1); \ -// OBSOLETE else \ -// OBSOLETE addr = offsetof (struct user, u_pcb.pcb_fpregs[0]) + \ -// OBSOLETE sizeof (int) * (regno - FP0_REGNUM); \ -// OBSOLETE } -// OBSOLETE -// OBSOLETE /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ -// OBSOLETE #define ONE_PROCESS_WRITETEXT -// OBSOLETE -// OBSOLETE /* HAVE_SGTTY also works, last we tried. -// OBSOLETE -// OBSOLETE But we have termios, at least as of Ultrix 4.2A, so use it. */ -// OBSOLETE #define HAVE_TERMIOS diff --git a/gnu/usr.bin/binutils/gdb/config/mips/xm-mipsv4.h b/gnu/usr.bin/binutils/gdb/config/mips/xm-mipsv4.h deleted file mode 100644 index 1f39e31ae1d..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/xm-mipsv4.h +++ /dev/null @@ -1,22 +0,0 @@ -// OBSOLETE /* Definitions for MIPS running SVR4 hosting support. -// OBSOLETE -// OBSOLETE Copyright 1994 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #include "config/xm-sysv4.h" diff --git a/gnu/usr.bin/binutils/gdb/config/mips/xm-riscos.h b/gnu/usr.bin/binutils/gdb/config/mips/xm-riscos.h deleted file mode 100644 index d8a65334a66..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/mips/xm-riscos.h +++ /dev/null @@ -1,25 +0,0 @@ -// OBSOLETE /* Copyright 1993, 1994, 1995 Free Software Foundation, Inc. -// OBSOLETE -// OBSOLETE This file is part of GDB. -// OBSOLETE -// OBSOLETE This program is free software; you can redistribute it and/or modify -// OBSOLETE it under the terms of the GNU General Public License as published by -// OBSOLETE the Free Software Foundation; either version 2 of the License, or -// OBSOLETE (at your option) any later version. -// OBSOLETE -// OBSOLETE This program is distributed in the hope that it will be useful, -// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of -// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// OBSOLETE GNU General Public License for more details. -// OBSOLETE -// OBSOLETE You should have received a copy of the GNU General Public License -// OBSOLETE along with this program; if not, write to the Free Software -// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, -// OBSOLETE Boston, MA 02111-1307, USA. */ -// OBSOLETE -// OBSOLETE #define HAVE_TERMIO -// OBSOLETE -// OBSOLETE #define USG 1 -// OBSOLETE -// OBSOLETE /* setjmp.h requires uid_t. */ -// OBSOLETE #include <sys/types.h> diff --git a/gnu/usr.bin/binutils/gdb/config/nm-bsd.h b/gnu/usr.bin/binutils/gdb/config/nm-bsd.h index b44dd5eff1d..6597d0edabe 100644 --- a/gnu/usr.bin/binutils/gdb/config/nm-bsd.h +++ b/gnu/usr.bin/binutils/gdb/config/nm-bsd.h @@ -19,11 +19,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Type of the third argument to the `ptrace' system call. */ -#define PTRACE_ARG3_TYPE caddr_t - /* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ #define FETCH_INFERIOR_REGISTERS - -/* We can attach and detach. */ -#define ATTACH_DETACH diff --git a/gnu/usr.bin/binutils/gdb/config/nm-gnu.h b/gnu/usr.bin/binutils/gdb/config/nm-gnu.h index 73a41803cf8..b64af737d10 100644 --- a/gnu/usr.bin/binutils/gdb/config/nm-gnu.h +++ b/gnu/usr.bin/binutils/gdb/config/nm-gnu.h @@ -30,14 +30,12 @@ extern char *gnu_target_pid_to_str (int pid); /* Before storing, we need to read all the registers. */ -#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) +#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, deprecated_register_bytes ()) /* Don't do wait_for_inferior on attach. */ #define ATTACH_NO_WAIT /* Use SVR4 style shared library support */ -#define SVR4_SHARED_LIBS #include "solib.h" -#define NO_CORE_OPS #endif /* __NM_GNU_H__ */ diff --git a/gnu/usr.bin/binutils/gdb/config/nm-lynx.h b/gnu/usr.bin/binutils/gdb/config/nm-lynx.h index 4a55a13c960..d4ff5a468e9 100644 --- a/gnu/usr.bin/binutils/gdb/config/nm-lynx.h +++ b/gnu/usr.bin/binutils/gdb/config/nm-lynx.h @@ -64,7 +64,7 @@ struct target_waitstatus; /* Override child_resume in infptrace.c */ -#define CHILD_RESUME +#define DEPRECATED_CHILD_RESUME /* Override child_thread_alive in intarg.c */ diff --git a/gnu/usr.bin/binutils/gdb/config/nm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/nm-nbsd.h index 5078c567968..72f49c971e9 100644 --- a/gnu/usr.bin/binutils/gdb/config/nm-nbsd.h +++ b/gnu/usr.bin/binutils/gdb/config/nm-nbsd.h @@ -1,5 +1,6 @@ /* Native-dependent definitions for NetBSD. - Copyright 1994, 1996, 1999 Free Software Foundation, Inc. + + Copyright 1994, 1996, 1999, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -18,10 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define PTRACE_ARG3_TYPE char* - #define FETCH_INFERIOR_REGISTERS -#define ATTACH_DETACH - #include "solib.h" /* Support for shared libraries. */ diff --git a/gnu/usr.bin/binutils/gdb/config/nm-sysv4.h b/gnu/usr.bin/binutils/gdb/config/nm-sysv4.h index 4b4f09897bc..ca281c92950 100644 --- a/gnu/usr.bin/binutils/gdb/config/nm-sysv4.h +++ b/gnu/usr.bin/binutils/gdb/config/nm-sysv4.h @@ -21,14 +21,8 @@ /* Use SVR4 style shared library support */ -#define SVR4_SHARED_LIBS #include "solib.h" /* SVR4 has /proc support, so use it instead of ptrace. */ #define USE_PROC_FS - -/* SVR4 machines can easily do attach and detach via /proc (procfs.c) - support */ - -#define ATTACH_DETACH diff --git a/gnu/usr.bin/binutils/gdb/config/ns32k/xm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/ns32k/xm-nbsd.h deleted file mode 100644 index 962664b70b9..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/ns32k/xm-nbsd.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Parameters for execution on a ns32k running NetBSD, for GDB. - Copyright 1994 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. */ - -/* Get generic NetBSD host definitions. */ -#include "config/xm-nbsd.h" diff --git a/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mh b/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mh index c0520576afb..b80a085c888 100644 --- a/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mh +++ b/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mh @@ -1,7 +1,5 @@ # Host: Hewlett-Packard PA-RISC machine, running HPUX -XM_FILE= xm-hppah.h - NAT_FILE= nm-hppah.h NATDEPFILES= hppah-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o diff --git a/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mt b/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mt index 806e91c7f4d..f997d89891b 100644 --- a/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mt +++ b/gnu/usr.bin/binutils/gdb/config/pa/hppahpux.mt @@ -1,3 +1,3 @@ # Target: HP PA-RISC running hpux TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o -TM_FILE= tm-hppah.h +DEPRECATED_TM_FILE= tm-hppah.h diff --git a/gnu/usr.bin/binutils/gdb/config/pa/nm-hppah.h b/gnu/usr.bin/binutils/gdb/config/pa/nm-hppah.h index bf4fd3c475f..24d02567136 100644 --- a/gnu/usr.bin/binutils/gdb/config/pa/nm-hppah.h +++ b/gnu/usr.bin/binutils/gdb/config/pa/nm-hppah.h @@ -41,10 +41,6 @@ struct target_ops; So I don't feel the least bit guilty about this. */ #define PTRACE_ARG3_TYPE CORE_ADDR -/* HPUX 8.0, in its infinite wisdom, has chosen to prototype ptrace - with five arguments, so programs written for normal ptrace lose. */ -#define FIVE_ARG_PTRACE - /* We need to figure out where the text region is so that we use the appropriate ptrace operator to manipulate text. Simply reading/writing user space will crap out HPUX. */ @@ -91,15 +87,6 @@ extern int hppa_require_detach (int, int); #define PT_WRITE_I PT_WIUSER #define PT_WRITE_D PT_WDUSER -/* attach/detach works to some extent under BSD and HPUX. So long - as the process you're attaching to isn't blocked waiting on io, - blocked waiting on a signal, or in a system call things work - fine. (The problems in those cases are related to the fact that - the kernel can't provide complete register information for the - target process... Which really pisses off GDB.) */ - -#define ATTACH_DETACH - /* In infptrace or infttrace.c: */ /* Starting with HP-UX 10.30, support is provided (in the form of @@ -111,8 +98,6 @@ extern int hppa_require_detach (int, int); 10.20 will at least link. However, the "can I use a fast watchpoint?" query will always return "No" for 10.20. */ -#define TARGET_HAS_HARDWARE_WATCHPOINTS - /* The PA can watch any number of locations (generic routines already check that all intermediates are in watchable memory locations). */ extern int hppa_can_use_hw_watchpoint (int type, int cnt, int ot); @@ -126,31 +111,6 @@ extern int hppa_can_use_hw_watchpoint (int type, int cnt, int ot); #define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(byte_count) \ (1) -/* However, some addresses may not be profitable to use hardware to watch, - or may be difficult to understand when the addressed object is out of - scope, and hence should be unwatched. On some targets, this may have - severe performance penalties, such that we might as well use regular - watchpoints, and save (possibly precious) hardware watchpoints for other - locations. - - On HP-UX, we choose not to watch stack-based addresses, because - - [1] Our implementation relies on page protection traps. The granularity - of these is large and so can generate many false hits, which are expensive - to respond to. - - [2] Watches of "*p" where we may not know the symbol that p points to, - make it difficult to know when the addressed object is out of scope, and - hence shouldn't be watched. Page protection that isn't removed when the - addressed object is out of scope will either degrade execution speed - (false hits) or give false triggers (when the address is recycled by - other calls). - - Since either of these points results in a slow-running inferior, we might - as well use normal watchpoints, aka single-step & test. */ -#define TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT(pid,start,len) \ - hppa_range_profitable_for_hw_watchpoint(pid, start, (LONGEST)(len)) - /* On HP-UX, we're using page-protection to implement hardware watchpoints. When an instruction attempts to write to a write-protected memory page, a SIGBUS is raised. At that point, the write has not actually occurred. @@ -258,10 +218,6 @@ extern int hppa_resume_execd_vforking_child_to_get_parent_vfork (void); #define HPUXHPPA -#define MAY_SWITCH_FROM_INFERIOR_PID (1) - #define MAY_FOLLOW_EXEC (1) -#define USE_THREAD_STEP_NEEDED (1) - #include "infttrace.h" /* For parent_attach_all. */ diff --git a/gnu/usr.bin/binutils/gdb/config/pa/nm-obsd.h b/gnu/usr.bin/binutils/gdb/config/pa/nm-obsd.h deleted file mode 100644 index ba91594fbb0..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/pa/nm-obsd.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native-dependent definitions for OpenBSD/hppa. - - Copyright 2004 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. */ - -#ifndef NM_OBSD_H -#define NM_OBSD_H - -/* Get generic BSD native definitions. */ -#include "config/nm-bsd.h" - -#endif /* nm-obsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh b/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh index bc94246841e..2c3dba97f59 100644 --- a/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh +++ b/gnu/usr.bin/binutils/gdb/config/pa/obsd.mh @@ -1,3 +1,3 @@ # Host: OpenBSD/hppa NATDEPFILES= fork-child.o infptrace.o inftarg.o hppabsd-nat.o -NAT_FILE= nm-obsd.h +NAT_FILE= config/nm-bsd.h diff --git a/gnu/usr.bin/binutils/gdb/config/pa/obsd.mt b/gnu/usr.bin/binutils/gdb/config/pa/obsd.mt index 1b1df18854a..b7a6888b4fc 100644 --- a/gnu/usr.bin/binutils/gdb/config/pa/obsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/pa/obsd.mt @@ -1,3 +1,3 @@ # Target: OpenBSD/hppa TDEPFILES= hppa-tdep.o hppabsd-tdep.o corelow.o solib.o solib-svr4.o -TM_FILE= tm-bsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/pa/tm-bsd.h b/gnu/usr.bin/binutils/gdb/config/pa/tm-bsd.h deleted file mode 100644 index ebd5e9f1d16..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/pa/tm-bsd.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Target-dependent definitions for HP PA-RISC BSD's. - - Copyright 2004 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. */ - -#ifndef TM_BSD_H -#define TM_BSD_H - -/* Shared library support. */ -#include "solib.h" - -#endif /* tm-bsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/pa/tm-hppa.h b/gnu/usr.bin/binutils/gdb/config/pa/tm-hppa.h index 9924ffa9678..efcf99764da 100644 --- a/gnu/usr.bin/binutils/gdb/config/pa/tm-hppa.h +++ b/gnu/usr.bin/binutils/gdb/config/pa/tm-hppa.h @@ -26,78 +26,8 @@ #include "regcache.h" -/* Wonder if this is correct? Should be using push_dummy_call(). */ -#define DEPRECATED_DUMMY_WRITE_SP(SP) deprecated_write_sp (SP) - -#define GDB_MULTI_ARCH 1 - -/* Hack, get around problem with including "arch-utils.h". */ -struct frame_info; - -/* Forward declarations of some types we use in prototypes */ - -struct frame_info; -struct frame_saved_regs; -struct value; -struct type; -struct inferior_status; - -/* Sequence of bytes for breakpoint instruction. */ - -const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr); -#define BREAKPOINT_FROM_PC(PCPTR,LENPTR) hppa_breakpoint_from_pc ((PCPTR), (LENPTR)) -#define BREAKPOINT32 0x10004 - extern int hppa_pc_requires_run_before_use (CORE_ADDR pc); -#define PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc) - -/* Register numbers of various important registers. - Note that some of these values are "real" register numbers, - and correspond to the general registers of the machine, - and some are "phony" register numbers which are too large - to be actual register numbers as far as the user is concerned - but do serve to get the desired values when passed to read_register. */ - -#define R0_REGNUM 0 /* Doesn't actually exist, used as base for - other r registers. */ -#define FLAGS_REGNUM 0 /* Various status flags */ -#define RP_REGNUM 2 /* return pointer */ -#define SAR_REGNUM 32 /* Shift Amount Register */ -#define IPSW_REGNUM 41 /* Interrupt Processor Status Word */ -#define PCOQ_HEAD_REGNUM 33 /* instruction offset queue head */ -#define PCSQ_HEAD_REGNUM 34 /* instruction space queue head */ -#define PCOQ_TAIL_REGNUM 35 /* instruction offset queue tail */ -#define PCSQ_TAIL_REGNUM 36 /* instruction space queue tail */ -#define EIEM_REGNUM 37 /* External Interrupt Enable Mask */ -#define IIR_REGNUM 38 /* Interrupt Instruction Register */ -#define IOR_REGNUM 40 /* Interrupt Offset Register */ -#define SR4_REGNUM 43 /* space register 4 */ -#define RCR_REGNUM 51 /* Recover Counter (also known as cr0) */ -#define CCR_REGNUM 54 /* Coprocessor Configuration Register */ -#define TR0_REGNUM 57 /* Temporary Registers (cr24 -> cr31) */ -#define CR27_REGNUM 60 /* Base register for thread-local storage, cr27 */ -#define FP4_REGNUM 72 - -#define ARG0_REGNUM 26 /* The first argument of a callee. */ -#define ARG1_REGNUM 25 /* The second argument of a callee. */ -#define ARG2_REGNUM 24 /* The third argument of a callee. */ -#define ARG3_REGNUM 23 /* The fourth argument of a callee. */ - -/* When fetching register values from an inferior or a core file, - clean them up using this macro. BUF is a char pointer to - the raw value of the register in the registers[] array. */ - -#define DEPRECATED_CLEAN_UP_REGISTER_VALUE(regno, buf) \ - do { \ - if ((regno) == PCOQ_HEAD_REGNUM || (regno) == PCOQ_TAIL_REGNUM) \ - (buf)[sizeof(CORE_ADDR) -1] &= ~0x3; \ - } while (0) - -/* Define DEPRECATED_DO_REGISTERS_INFO() to do machine-specific - formatting of register dumps. */ - -#define DEPRECATED_DO_REGISTERS_INFO(_regnum, fp) pa_do_registers_info (_regnum, fp) -extern void pa_do_registers_info (int, int); +#define DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc) /* PA specific macro to see if the current instruction is nullified. */ #ifndef INSTRUCTION_NULLIFIED @@ -105,211 +35,6 @@ extern int hppa_instruction_nullified (void); #define INSTRUCTION_NULLIFIED hppa_instruction_nullified () #endif -#define INSTRUCTION_SIZE 4 - -/* This sequence of words is the instructions - - ; Call stack frame has already been built by gdb. Since we could be calling - ; a varargs function, and we do not have the benefit of a stub to put things in - ; the right place, we load the first 4 word of arguments into both the general - ; and fp registers. - call_dummy - ldw -36(sp), arg0 - ldw -40(sp), arg1 - ldw -44(sp), arg2 - ldw -48(sp), arg3 - ldo -36(sp), r1 - fldws 0(0, r1), fr4 - fldds -4(0, r1), fr5 - fldws -8(0, r1), fr6 - fldds -12(0, r1), fr7 - ldil 0, r22 ; FUNC_LDIL_OFFSET must point here - ldo 0(r22), r22 ; FUNC_LDO_OFFSET must point here - ldsid (0,r22), r4 - ldil 0, r1 ; SR4EXPORT_LDIL_OFFSET must point here - ldo 0(r1), r1 ; SR4EXPORT_LDO_OFFSET must point here - ldsid (0,r1), r20 - combt,=,n r4, r20, text_space ; If target is in data space, do a - ble 0(sr5, r22) ; "normal" procedure call - copy r31, r2 - break 4, 8 - mtsp r21, sr0 - ble,n 0(sr0, r22) - text_space ; Otherwise, go through _sr4export, - ble (sr4, r1) ; which will return back here. - stw r31,-24(r30) - break 4, 8 - mtsp r21, sr0 - ble,n 0(sr0, r22) - nop ; To avoid kernel bugs - nop ; and keep the dummy 8 byte aligned - - The dummy decides if the target is in text space or data space. If - it's in data space, there's no problem because the target can - return back to the dummy. However, if the target is in text space, - the dummy calls the secret, undocumented routine _sr4export, which - calls a function in text space and can return to any space. Instead - of including fake instructions to represent saved registers, we - know that the frame is associated with the call dummy and treat it - specially. - - The trailing NOPs are needed to avoid a bug in HPUX, BSD and OSF1 - kernels. If the memory at the location pointed to by the PC is - 0xffffffff then a ptrace step call will fail (even if the instruction - is nullified). - - The code to pop a dummy frame single steps three instructions - starting with the last mtsp. This includes the nullified "instruction" - following the ble (which is uninitialized junk). If the - "instruction" following the last BLE is 0xffffffff, then the ptrace - will fail and the dummy frame is not correctly popped. - - By placing a NOP in the delay slot of the BLE instruction we can be - sure that we never try to execute a 0xffffffff instruction and - avoid the kernel bug. The second NOP is needed to keep the call - dummy 8 byte aligned. */ - -#define CALL_DUMMY {0x4BDA3FB9, 0x4BD93FB1, 0x4BD83FA9, 0x4BD73FA1,\ - 0x37C13FB9, 0x24201004, 0x2C391005, 0x24311006,\ - 0x2C291007, 0x22C00000, 0x36D60000, 0x02C010A4,\ - 0x20200000, 0x34210000, 0x002010b4, 0x82842022,\ - 0xe6c06000, 0x081f0242, 0x00010004, 0x00151820,\ - 0xe6c00002, 0xe4202000, 0x6bdf3fd1, 0x00010004,\ - 0x00151820, 0xe6c00002, 0x08000240, 0x08000240} - -#define REG_PARM_STACK_SPACE 16 - -/* If we've reached a trap instruction within the call dummy, then - we'll consider that to mean that we've reached the call dummy's - end after its successful completion. */ -#define DEPRECATED_CALL_DUMMY_HAS_COMPLETED(pc, sp, frame_address) \ - (DEPRECATED_PC_IN_CALL_DUMMY((pc), (sp), (frame_address)) && \ - (read_memory_integer((pc), 4) == BREAKPOINT32)) - -/* Insert the specified number of args and function address into a - call sequence of the above form stored at DUMMYNAME. - - On the hppa we need to call the stack dummy through $$dyncall. - Therefore our version of DEPRECATED_FIX_CALL_DUMMY takes an extra - argument, real_pc, which is the location where gdb should start up - the inferior to do the function call. */ - -/* FIXME: brobecker 2002-12-26. This macro is going to cause us some - problems before we can go to multiarch partial as it has been - diverted on HPUX to return the value of the PC! */ -/* NOTE: cagney/2003-05-03: This has been replaced by push_dummy_code. - Hopefully that has all the parameters HP/UX needs. */ -#define DEPRECATED_FIX_CALL_DUMMY hppa_fix_call_dummy -extern CORE_ADDR hppa_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int, - struct value **, struct type *, int); - -#define GDB_TARGET_IS_HPPA - -/* - * Unwind table and descriptor. - */ - -struct unwind_table_entry - { - CORE_ADDR region_start; - CORE_ADDR region_end; - - unsigned int Cannot_unwind:1; /* 0 */ - unsigned int Millicode:1; /* 1 */ - unsigned int Millicode_save_sr0:1; /* 2 */ - unsigned int Region_description:2; /* 3..4 */ - unsigned int reserved1:1; /* 5 */ - unsigned int Entry_SR:1; /* 6 */ - unsigned int Entry_FR:4; /* number saved *//* 7..10 */ - unsigned int Entry_GR:5; /* number saved *//* 11..15 */ - unsigned int Args_stored:1; /* 16 */ - unsigned int Variable_Frame:1; /* 17 */ - unsigned int Separate_Package_Body:1; /* 18 */ - unsigned int Frame_Extension_Millicode:1; /* 19 */ - unsigned int Stack_Overflow_Check:1; /* 20 */ - unsigned int Two_Instruction_SP_Increment:1; /* 21 */ - unsigned int Ada_Region:1; /* 22 */ - unsigned int cxx_info:1; /* 23 */ - unsigned int cxx_try_catch:1; /* 24 */ - unsigned int sched_entry_seq:1; /* 25 */ - unsigned int reserved2:1; /* 26 */ - unsigned int Save_SP:1; /* 27 */ - unsigned int Save_RP:1; /* 28 */ - unsigned int Save_MRP_in_frame:1; /* 29 */ - unsigned int extn_ptr_defined:1; /* 30 */ - unsigned int Cleanup_defined:1; /* 31 */ - - unsigned int MPE_XL_interrupt_marker:1; /* 0 */ - unsigned int HP_UX_interrupt_marker:1; /* 1 */ - unsigned int Large_frame:1; /* 2 */ - unsigned int Pseudo_SP_Set:1; /* 3 */ - unsigned int reserved4:1; /* 4 */ - unsigned int Total_frame_size:27; /* 5..31 */ - - /* This is *NOT* part of an actual unwind_descriptor in an object - file. It is *ONLY* part of the "internalized" descriptors that - we create from those in a file. - */ - struct - { - unsigned int stub_type:4; /* 0..3 */ - unsigned int padding:28; /* 4..31 */ - } - stub_unwind; - }; - -/* HP linkers also generate unwinds for various linker-generated stubs. - GDB reads in the stubs from the $UNWIND_END$ subspace, then - "converts" them into normal unwind entries using some of the reserved - fields to store the stub type. */ - -/* The gaps represent linker stubs used in MPE and space for future - expansion. */ -enum unwind_stub_types - { - LONG_BRANCH = 1, - PARAMETER_RELOCATION = 2, - EXPORT = 10, - IMPORT = 11, - IMPORT_SHLIB = 12, - }; - -/* We use the objfile->obj_private pointer for two things: - - * 1. An unwind table; - * - * 2. A pointer to any associated shared library object. - * - * #defines are used to help refer to these objects. - */ - -/* Info about the unwind table associated with an object file. - - * This is hung off of the "objfile->obj_private" pointer, and - * is allocated in the objfile's psymbol obstack. This allows - * us to have unique unwind info for each executable and shared - * library that we are debugging. - */ -struct obj_unwind_info - { - struct unwind_table_entry *table; /* Pointer to unwind info */ - struct unwind_table_entry *cache; /* Pointer to last entry we found */ - int last; /* Index of last entry */ - }; - -typedef struct obj_private_struct - { - struct obj_unwind_info *unwind_info; /* a pointer */ - struct so_list *so_info; /* a pointer */ - CORE_ADDR dp; - } -obj_private_data_t; - -/* For a number of horrible reasons we may have to adjust the location - of variables on the stack. Ugh. */ -#define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR) -extern int hpread_adjust_stack_address (CORE_ADDR); - /* Here's how to step off a permanent breakpoint. */ #define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint) extern void hppa_skip_permanent_breakpoint (void); diff --git a/gnu/usr.bin/binutils/gdb/config/pa/tm-hppah.h b/gnu/usr.bin/binutils/gdb/config/pa/tm-hppah.h index 0d0dde3b703..d330d46f1c3 100644 --- a/gnu/usr.bin/binutils/gdb/config/pa/tm-hppah.h +++ b/gnu/usr.bin/binutils/gdb/config/pa/tm-hppah.h @@ -36,21 +36,6 @@ struct frame_info; #include "somsolib.h" #endif -extern void hppa32_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi, - CORE_ADDR *tmp); -#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \ - hppa32_hpux_frame_saved_pc_in_sigtramp (FRAME, TMP) - -extern void hppa32_hpux_frame_base_before_sigtramp (struct frame_info *fi, - CORE_ADDR *tmp); -#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \ - hppa32_hpux_frame_base_before_sigtramp (FRAME, TMP) - -extern void hppa32_hpux_frame_find_saved_regs_in_sigtramp - (struct frame_info *fi, CORE_ADDR *fsr); -#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \ - hppa32_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR) - /* For HP-UX on PA-RISC we have an implementation for the exception handling target op (in hppa-tdep.c) */ #define CHILD_ENABLE_EXCEPTION_CALLBACK diff --git a/gnu/usr.bin/binutils/gdb/config/pa/xm-hppah.h b/gnu/usr.bin/binutils/gdb/config/pa/xm-hppah.h deleted file mode 100644 index a2ed9ba407f..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/pa/xm-hppah.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Parameters for hosting on an HPPA-RISC machine running HPUX, for GDB. - Copyright 1991, 1992, 1993, 1995, 1996, 2000 - Free Software Foundation, Inc. - - Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). - - 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. */ - -#define USG - -#define HAVE_TERMIOS diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mh b/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mh index d0913b70289..9ee2f2fb7bf 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mh +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mh @@ -1,16 +1,11 @@ # Host: IBM PowerPC running AIX -XM_FILE= xm-aix.h - NAT_FILE= nm-aix.h + +# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure. NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o rs6000-nat.o \ xcoffread.o xcoffsolib.o # When compiled with cc, for debugging, this argument should be passed. # We have no idea who our current compiler is though, so we skip it. # MH_CFLAGS = -bnodelcsect - -# gdb is too big for all of its external symbols to fit in a small TOC -# It looks like the GNU linker doesn't understand the -bbigtoc switch. -# This switch may be needed for some vendor compilers. -# MH_LDFLAGS = -Wl,-bbigtoc diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mt b/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mt index d7ba624da91..b736d5a4257 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mt +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/aix.mt @@ -1,3 +1,3 @@ # Target: PowerPC running AIX TDEPFILES= rs6000-tdep.o xcoffread.o ppc-sysv-tdep.o solib.o solib-svr4.o -TM_FILE= tm-ppc-aix.h +DEPRECATED_TM_FILE= config/rs6000/tm-rs6000.h diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/aix432.mh b/gnu/usr.bin/binutils/gdb/config/powerpc/aix432.mh deleted file mode 100644 index fc7a8b18e27..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/aix432.mh +++ /dev/null @@ -1,19 +0,0 @@ -# Host: IBM PowerPC running AIX 4.3.2+ - -XM_FILE= xm-aix.h - -NAT_FILE= nm-aix.h - -# aix-thread.o is not listed in NATDEPFILES as it is pulled in by configure. -NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o \ - rs6000-nat.o xcoffread.o xcoffsolib.o - -# When compiled with cc, for debugging, this argument should be passed. -# We have no idea who our current compiler is though, so we skip it. -# MH_CFLAGS = -bnodelcsect - -# gdb is too big for all of its external symbols to fit in a small TOC -# It looks like the GNU linker doesn't understand the -bbigtoc switch. -# This switch may be needed for some vendor compilers. -# MH_LDFLAGS = -Wl,-bbigtoc - diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/linux.mh b/gnu/usr.bin/binutils/gdb/config/powerpc/linux.mh index 925650dd272..a7be1992de5 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/linux.mh +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/linux.mh @@ -1,11 +1,10 @@ # Host: PowerPC, running Linux -XM_FILE= xm-linux.h XM_CLIBS= NAT_FILE= nm-linux.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o linux-proc.o \ - ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o \ +NATDEPFILES= infptrace.o inftarg.o fork-child.o \ + ppc-linux-nat.o proc-service.o thread-db.o \ gcore.o linux-nat.o LOADLIBES = -ldl -rdynamic diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/nm-aix.h b/gnu/usr.bin/binutils/gdb/config/powerpc/nm-aix.h index 8c8a939cca2..8dd21045e91 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/nm-aix.h +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/nm-aix.h @@ -20,4 +20,3 @@ #include "rs6000/nm-rs6000.h" -#define PTRACE_ARG3_TYPE int* diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/nm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/powerpc/nm-nbsd.h deleted file mode 100644 index 5de6c9a0d21..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/nm-nbsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Native-dependent definitions for PowerPC running NetBSD ELF, for GDB. - Copyright 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. */ - -#ifndef NM_NBSD_H -#define NM_NBSD_H - -/* Get generic NetBSD native definitions. */ -#include "config/nm-nbsd.h" - -#endif diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/nm-obsd.h b/gnu/usr.bin/binutils/gdb/config/powerpc/nm-obsd.h deleted file mode 100644 index e59834f39ab..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/nm-obsd.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native-dependent definitions for OpenBSD/powerpc. - - Copyright 2004 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. */ - -#ifndef NM_OBSD_H -#define NM_OBSD_H - -/* Get generic BSD native definitions. */ -#include "config/nm-bsd.h" - -#endif /* nm-obsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mh b/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mh index a20575a82ff..0482d3d3c67 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mh +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mh @@ -1,3 +1,3 @@ # Host: OpenBSD/powerpc NATDEPFILES= ppcobsd-nat.o fork-child.o infptrace.o inftarg.o -NAT_FILE= nm-obsd.h +NAT_FILE= config/nm-bsd.h diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mt b/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mt index 44418325270..fbe61d48f5f 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/obsd.mt @@ -1,4 +1,4 @@ # Target: OpenBSD/powerpc TDEPFILES= rs6000-tdep.o ppc-sysv-tdep.o ppcobsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= tm-ppc-eabi.h diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-eabi.mt b/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-eabi.mt index 5ef8cd9befb..eac4c14d023 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-eabi.mt +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-eabi.mt @@ -1,3 +1,3 @@ # Target: PowerPC running eabi TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o -TM_FILE= tm-ppc-eabi.h +DEPRECATED_TM_FILE= tm-ppc-eabi.h diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-sim.mt b/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-sim.mt index 187bf39e8d5..3fc6883e30f 100644 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-sim.mt +++ b/gnu/usr.bin/binutils/gdb/config/powerpc/ppc-sim.mt @@ -1,6 +1,6 @@ # Target: PowerPC running eabi and including the simulator TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o -TM_FILE= tm-ppc-eabi.h +DEPRECATED_TM_FILE= tm-ppc-eabi.h SIM_OBS = remote-sim.o SIM = ../sim/ppc/libsim.a diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/powerpc/tm-nbsd.h deleted file mode 100644 index d167830523c..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-nbsd.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Macro definitions for PowerPC running under NetBSD. - Copyright 2000, 2003 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. */ - -#ifndef TM_NBSD_H -#define TM_NBSD_H - -#include "powerpc/tm-ppc-eabi.h" - -#endif /* TM_NBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppc-aix.h b/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppc-aix.h deleted file mode 100644 index 03809c9e696..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppc-aix.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Macro definitions for Power PC running AIX. - Copyright 1995, 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef TM_PPC_AIX_H -#define TM_PPC_AIX_H - -/* Use generic RS6000 definitions. */ -#include "rs6000/tm-rs6000.h" - -#endif /* TM_PPC_AIX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppcle-eabi.h b/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppcle-eabi.h deleted file mode 100644 index cc4c752e396..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppcle-eabi.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Macro definitions for Power PC running embedded ABI - in little endian mode. - Copyright 1995, 1998 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. */ - -#ifndef TM_PPCLE_EABI_H -#define TM_PPCLE_EABI_H - -/* Use normal ppc-eabi definitions */ -#include "powerpc/tm-ppc-eabi.h" - -#endif /* TM_PPCLE_EABI_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppcle-sim.h b/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppcle-sim.h deleted file mode 100644 index 02707f40019..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/tm-ppcle-sim.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Macro definitions for Power PC running embedded ABI under the simulator. - Copyright 1995 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. */ - -#ifndef TM_PPCLE_SIM_H -#define TM_PPCLE_SIM_H - -#include "powerpc/tm-ppcle-eabi.h" - -#endif /* TM_PPCLE_SIM_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/xm-aix.h b/gnu/usr.bin/binutils/gdb/config/powerpc/xm-aix.h deleted file mode 100644 index e663453f40e..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/xm-aix.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Parameters for hosting on an PowerPC, for GDB, the GNU debugger. - Copyright 1995, 1996, 2000 Free Software Foundation, Inc. - Contributed by Cygnus Corporation. - - 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 "config/xm-aix4.h" - -/* This doesn't seem to be declared in any header file I can find. */ -char *termdef (int, int); - -/* UINT_MAX is defined in <sys/limits.h> as a decimal constant (4294967295) - which is too large to fit in a signed int when it is parsed by the - compiler, so it issues a diagnostic. Just undef it here so that we - use gdb's version in defs.h */ -#undef UINT_MAX diff --git a/gnu/usr.bin/binutils/gdb/config/powerpc/xm-linux.h b/gnu/usr.bin/binutils/gdb/config/powerpc/xm-linux.h deleted file mode 100644 index 73e7c406445..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/powerpc/xm-linux.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native support for linux, for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1992, 1996, 2000, 2001 - 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. */ - -#ifndef XM_LINUX_H -#define XM_LINUX_H - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ -#define KERNEL_U_ADDR 0x0 - -#endif /* #ifndef XM_LINUX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mh b/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mh index e6253be9a22..f3164224e42 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mh +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mh @@ -1,7 +1,5 @@ # Host: IBM RS/6000 running AIX4 -XM_FILE= xm-aix4.h - NAT_FILE= nm-rs6000.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o rs6000-nat.o \ xcoffsolib.o diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mt b/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mt index 388c4f237d8..0729ffab582 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mt +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/aix4.mt @@ -1,3 +1,3 @@ # Target: IBM RS/6000 running AIX4 TDEPFILES= rs6000-tdep.o xcoffread.o ppc-sysv-tdep.o solib.o solib-svr4.o -TM_FILE= tm-rs6000-aix4.h +DEPRECATED_TM_FILE= config/rs6000/tm-rs6000.h diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/nm-rs6000.h b/gnu/usr.bin/binutils/gdb/config/rs6000/nm-rs6000.h index 34bc0feebcd..ee5f918ca63 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/nm-rs6000.h +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/nm-rs6000.h @@ -19,10 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Do implement the attach and detach commands. */ - -#define ATTACH_DETACH - /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ #define FETCH_INFERIOR_REGISTERS diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/nm-rs6000ly.h b/gnu/usr.bin/binutils/gdb/config/rs6000/nm-rs6000ly.h deleted file mode 100644 index 51d12f8ac70..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/nm-rs6000ly.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Native-dependent definitions for RS6000 running LynxOS. - Copyright 1993 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. */ - -#ifndef NM_RS6000LYNX_H -#define NM_RS6000LYNX_H - -#include "config/nm-lynx.h" - -#endif /* NM_RS6000LYNX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mh b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mh index c57319be4fc..e518975a961 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mh +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mh @@ -1,7 +1,5 @@ # Host: IBM RS/6000 running AIX -XM_FILE= xm-rs6000.h - NAT_FILE= nm-rs6000.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o rs6000-nat.o \ xcoffsolib.o diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mt b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mt index 86b4c58b5e3..02c22304d53 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mt +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000.mt @@ -1,3 +1,3 @@ # Target: IBM RS/6000 running AIX TDEPFILES= rs6000-tdep.o xcoffread.o ppc-sysv-tdep.o solib.o solib-svr4.o -TM_FILE= tm-rs6000.h +DEPRECATED_TM_FILE= tm-rs6000.h diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mh b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mh index 096473f1a60..fbe4147f0a0 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mh +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mh @@ -2,5 +2,5 @@ XM_CLIBS= -lbsd -NAT_FILE= nm-rs6000ly.h +NAT_FILE= config/nm-lynx.h NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o xcoffread.o diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mt b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mt index 89ed7a288f8..200a64709d9 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mt +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/rs6000lynx.mt @@ -1,3 +1,3 @@ # Target: IBM RS6000 running LynxOS TDEPFILES= coff-solib.o rs6000-tdep.o ppc-sysv-tdep.o solib.o solib-svr4.o -TM_FILE= tm-rs6000ly.h +DEPRECATED_TM_FILE= tm-rs6000ly.h diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/tm-rs6000-aix4.h b/gnu/usr.bin/binutils/gdb/config/rs6000/tm-rs6000-aix4.h deleted file mode 100644 index 243befe7d6f..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/tm-rs6000-aix4.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Macro definitions for RS/6000 running AIX4. - Copyright 1995, 1997 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. */ - -#ifndef TM_RS6000_AIX4_H -#define TM_RS6000_AIX4_H - -/* Use generic RS6000 definitions. */ -#include "rs6000/tm-rs6000.h" - -#endif /* TM_RS6000_AIX4_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/tm-rs6000.h b/gnu/usr.bin/binutils/gdb/config/rs6000/tm-rs6000.h index 4b8a09dc3c2..8afd2cadc94 100644 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/tm-rs6000.h +++ b/gnu/usr.bin/binutils/gdb/config/rs6000/tm-rs6000.h @@ -24,8 +24,6 @@ struct frame_info; -#define GDB_MULTI_ARCH 1 - /* Minimum possible text address in AIX */ #define TEXT_SEGMENT_BASE 0x10000000 @@ -71,14 +69,11 @@ extern void aix_process_linenos (void); to be actual register numbers as far as the user is concerned but do serve to get the desired values when passed to read_register. */ +/* Don't use this in code specific to the RS6000 and its descendants; + use tdep->ppc_fp0_regnum instead. FP0_REGNUM will be deprecated + soon, but we still need to define it here for the uses in + architecture-independent code. */ #define FP0_REGNUM 32 /* Floating point register 0 */ -#define FPLAST_REGNUM 63 /* Last floating point register */ - -/* Define other aspects of the stack frame. */ - -#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) \ - (fromleaf ? DEPRECATED_SAVED_PC_AFTER_CALL (prev->next) : \ - prev->next ? DEPRECATED_FRAME_SAVED_PC (prev->next) : read_pc ()) /* Notice when a new child process is started. */ diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/xm-aix4.h b/gnu/usr.bin/binutils/gdb/config/rs6000/xm-aix4.h deleted file mode 100644 index 4ca0abb8cf1..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/xm-aix4.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Parameters for hosting on an RS6000, for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1996 - Free Software Foundation, Inc. - Contributed by IBM Corporation. - - 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 "config/xm-aix4.h" - -/* AIX 4.x uses nonstandard "int *" as type of third argument to ptrace() */ - -#define PTRACE_ARG3_TYPE int* diff --git a/gnu/usr.bin/binutils/gdb/config/rs6000/xm-rs6000.h b/gnu/usr.bin/binutils/gdb/config/rs6000/xm-rs6000.h deleted file mode 100644 index 51096e643b0..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/rs6000/xm-rs6000.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Parameters for hosting on an RS6000, for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, - 2000, 2001 Free Software Foundation, Inc. - Contributed by IBM Corporation. - - 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. */ - -/* The following text is taken from config/rs6000.mh: - * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says - * # `extern fd_set svc_fdset;' without ever defining the type fd_set. - * # Unfortunately this occurs in the vx-share code, which is not configured - * # like the rest of GDB (e.g. it doesn't include "defs.h"). - * # We circumvent this bug by #define-ing fd_set here, but undefining it in - * # the xm-rs6000.h file before ordinary modules try to use it. FIXME, IBM! - * MH_CFLAGS='-Dfd_set=int' - * So, here we do the undefine...which has to occur before we include - * <sys/select.h> below. - */ -#undef fd_set - -#include <sys/select.h> - -/* Big end is at the low address */ - -/* At least as of AIX 3.2, we have termios. */ -#define HAVE_TERMIOS 1 -/* #define HAVE_TERMIO 1 */ - -#define USG 1 - -#define FIVE_ARG_PTRACE - -/* This system requires that we open a terminal with O_NOCTTY for it to - not become our controlling terminal. */ - -#define USE_O_NOCTTY - -/* Brain death inherited from PC's pervades. */ -#undef NULL -#define NULL 0 - -/* The IBM compiler requires this in order to properly compile alloca(). */ -#pragma alloca - -/* There is no vfork. */ - -#define vfork fork - -/* Signal handler for SIGWINCH `window size changed'. */ - -#define SIGWINCH_HANDLER aix_resizewindow -extern void aix_resizewindow (int); - -/* This doesn't seem to be declared in any header file I can find. */ -char *termdef (int, int); - -/* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */ - -#define SIGWINCH_HANDLER_BODY \ - \ -/* Respond to SIGWINCH `window size changed' signal, and reset GDB's \ - window settings appropriately. */ \ - \ -void \ -aix_resizewindow (signo) \ - int signo; \ -{ \ - int fd = fileno (stdout); \ - if (isatty (fd)) { \ - int val; \ - \ - val = atoi (termdef (fd, 'l')); \ - if (val > 0) \ - lines_per_page = val; \ - val = atoi (termdef (fd, 'c')); \ - if (val > 0) \ - chars_per_line = val; \ - } \ -} diff --git a/gnu/usr.bin/binutils/gdb/config/s390/tm-linux.h b/gnu/usr.bin/binutils/gdb/config/s390/tm-linux.h deleted file mode 100644 index d13d06dc139..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/s390/tm-linux.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Target definitions for GDB for a s390 running GNU/Linux. - - Copyright 2001, 2002, 2003 Free Software Foundation, Inc. - - Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) - for IBM Deutschland Entwicklung GmbH, IBM Corporation. - - 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. */ - -#ifndef TM_LINUX_H -#define TM_LINUX_H - -#include "config/tm-linux.h" - -#endif /* TM_LINUX_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/sh/nm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/sh/nm-nbsd.h deleted file mode 100644 index eb38d6b49ea..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/sh/nm-nbsd.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native-dependent definitions for SuperH running NetBSD, for GDB. - Copyright 2002 Free Software Foundation, Inc. - Contributed by Wasabi Systems, 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. */ - -#ifndef NM_NBSD_H -#define NM_NBSD_H - -/* Get generic NetBSD native definitions. */ -#include "config/nm-nbsd.h" - -#endif /* NM_NBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/sh/tm-sh.h b/gnu/usr.bin/binutils/gdb/config/sh/tm-sh.h index 228e0bcc5f3..b6a4fb525b2 100644 --- a/gnu/usr.bin/binutils/gdb/config/sh/tm-sh.h +++ b/gnu/usr.bin/binutils/gdb/config/sh/tm-sh.h @@ -21,8 +21,6 @@ /* Contributed by Steve Chamberlain sac@cygnus.com */ -#define GDB_MULTI_ARCH 1 - #define NUM_REALREGS 59 /* used in remote-e7000.c which is not multiarched. */ #define DEPRECATED_BIG_REMOTE_BREAKPOINT { 0xc3, 0x20 } /* Used in remote.c */ diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/nbsd.mt b/gnu/usr.bin/binutils/gdb/config/sparc/nbsd.mt index 25dbefff703..7a5cf680576 100644 --- a/gnu/usr.bin/binutils/gdb/config/sparc/nbsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/sparc/nbsd.mt @@ -1,4 +1,4 @@ # Target: NetBSD/sparc TDEPFILES= sparc-tdep.o sparcnbsd-tdep.o nbsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/nbsd64.mh b/gnu/usr.bin/binutils/gdb/config/sparc/nbsd64.mh index 9ac8cf477d2..95d4166bc9f 100644 --- a/gnu/usr.bin/binutils/gdb/config/sparc/nbsd64.mh +++ b/gnu/usr.bin/binutils/gdb/config/sparc/nbsd64.mh @@ -1,6 +1,6 @@ # Host: NetBSD/sparc64 -NATDEPFILES= sparc64nbsd-nat.o sparc-nat.o bsd-kvm.o \ - fork-child.o infptrace.o inftarg.o +NATDEPFILES= fork-child.o inf-ptrace.o \ + sparc64nbsd-nat.o sparc-nat.o bsd-kvm.o NAT_FILE= nm-nbsd.h LOADLIBES= -lkvm diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/nbsdelf.mh b/gnu/usr.bin/binutils/gdb/config/sparc/nbsdelf.mh index 611a6a4d2ad..d258fccd514 100644 --- a/gnu/usr.bin/binutils/gdb/config/sparc/nbsdelf.mh +++ b/gnu/usr.bin/binutils/gdb/config/sparc/nbsdelf.mh @@ -1,6 +1,6 @@ # Host: NetBSD/sparc ELF -NATDEPFILES= sparc-nat.o sparcnbsd-nat.o bsd-kvm.o \ - fork-child.o infptrace.o inftarg.o +NATDEPFILES= fork-child.o inf-ptrace.o \ + sparc-nat.o sparcnbsd-nat.o bsd-kvm.o NAT_FILE= nm-nbsd.h LOADLIBES= -lkvm diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/obsd.mt b/gnu/usr.bin/binutils/gdb/config/sparc/obsd.mt index 800cb048eac..a24b7e9ad64 100644 --- a/gnu/usr.bin/binutils/gdb/config/sparc/obsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/sparc/obsd.mt @@ -1,4 +1,4 @@ # Target: OpenBSD/sparc TDEPFILES= sparc-tdep.o sparcnbsd-tdep.o sparcobsd-tdep.o nbsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/obsd64.mt b/gnu/usr.bin/binutils/gdb/config/sparc/obsd64.mt index 82587dfc84a..8514db18698 100644 --- a/gnu/usr.bin/binutils/gdb/config/sparc/obsd64.mt +++ b/gnu/usr.bin/binutils/gdb/config/sparc/obsd64.mt @@ -2,4 +2,4 @@ TDEPFILES= sparc64-tdep.o sparc64nbsd-tdep.o sparc64obsd-tdep.o \ sparc-tdep.o sparcnbsd-tdep.o sparcobsd-tdep.o nbsd-tdep.o \ corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/tm-fbsd.h b/gnu/usr.bin/binutils/gdb/config/sparc/tm-fbsd.h deleted file mode 100644 index f441937668a..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/sparc/tm-fbsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Target-dependent definitions for FreeBSD/sparc64. - - Copyright 2002, 2003 Free Software Foundation, Inc. - Contributed by David E. O'Brien <obrien@FreeBSD.org>. - - 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. */ - -#ifndef TM_FBSD_H -#define TM_FBSD_H - -#define GDB_MULTI_ARCH GDB_MULTI_ARCH_TM - -#endif /* tm-fbsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/tm-linux.h b/gnu/usr.bin/binutils/gdb/config/sparc/tm-linux.h deleted file mode 100644 index ae853ba0acb..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/sparc/tm-linux.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Target-dependent definitions for GNU/Linux SPARC. - - Copyright 2003 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. */ - -#ifndef TM_LINUX_H -#define TM_LINUX_H - -#define GDB_MULTI_ARCH GDB_MULTI_ARCH_TM - -/* Shared library support. */ -#include "solib.h" - -#endif /* tm-linux.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/tm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/sparc/tm-nbsd.h deleted file mode 100644 index 301136bbead..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/sparc/tm-nbsd.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Target-dependent definitions for NetBSD/sparc. - - Copyright 1994, 2002, 2003 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. */ - -#ifndef TM_NBSD_H -#define TM_NBSD_H - -#define GDB_MULTI_ARCH GDB_MULTI_ARCH_TM - -/* Shared library support. */ -#include "solib.h" - -#endif /* tm-nbsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/tm-nbsd64.h b/gnu/usr.bin/binutils/gdb/config/sparc/tm-nbsd64.h deleted file mode 100644 index cc1d6b32297..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/sparc/tm-nbsd64.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Macro definitions for UltraSPARC running under NetBSD. - Copyright 1994, 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. */ - -#ifndef TM_NBSD64_H -#define TM_NBSD64_H - -#include "sparc/tm-sp64.h" /* sets GDB_MULTI_ARCH */ -#include "solib.h" - -#endif /* TM_NBSD64_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/sparc/tm-vxworks.h b/gnu/usr.bin/binutils/gdb/config/sparc/tm-vxworks.h deleted file mode 100644 index 7b0474847c6..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/sparc/tm-vxworks.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Target-dependent defenitions for VxWorks SPARC. - - Copyright 1993, 1999, 2004 Free Software Foundation, Inc. - Contributed by Cygnus Support. - - 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. */ - -#ifndef TM_VXWORKS_H -#define TM_VXWORKS_H - -#define GDB_MULTI_ARCH GDB_MULTI_ARCH_TM - -/* Get generic VxWorks definitions. */ -#include "config/tm-vxworks.h" - -#endif /* tm-vxworks.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/tm-sunos.h b/gnu/usr.bin/binutils/gdb/config/tm-sunos.h deleted file mode 100644 index c8db07e865e..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/tm-sunos.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Target machine sub-description for SunOS version 4. - This is included by other tm-*.h files to specify SunOS-specific stuff. - Copyright 1990, 1991, 1992, 1993, 1994 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 "solib.h" /* Support for shared libraries. */ - -/* Return non-zero if we are in a shared library trampoline code stub. */ - -#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \ - lookup_solib_trampoline_symbol_by_pc (pc) - -/* If PC is in a shared library trampoline code, return the PC - where the function itself actually starts. If not, return 0. */ - -#define SKIP_TRAMPOLINE_CODE(pc) find_solib_trampoline_target (pc) diff --git a/gnu/usr.bin/binutils/gdb/config/vax/nbsd.mt b/gnu/usr.bin/binutils/gdb/config/vax/nbsd.mt index fb7f8ef2705..dfe746fd520 100644 --- a/gnu/usr.bin/binutils/gdb/config/vax/nbsd.mt +++ b/gnu/usr.bin/binutils/gdb/config/vax/nbsd.mt @@ -1,3 +1,3 @@ # Target: NetBSD/vax TDEPFILES= vax-tdep.o vaxnbsd-tdep.o corelow.o solib.o solib-svr4.o -TM_FILE= tm-nbsd.h +DEPRECATED_TM_FILE= solib.h diff --git a/gnu/usr.bin/binutils/gdb/config/vax/nm-obsd.h b/gnu/usr.bin/binutils/gdb/config/vax/nm-obsd.h deleted file mode 100644 index ac44636408e..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/nm-obsd.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Native-dependent definitions for OpenBSD/vax. - - Copyright 2004 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. */ - -#ifndef NM_OBSD_H -#define NM_OBSD_H - -/* Get generic BSD native definitions. */ -#include "config/nm-bsd.h" - -#endif /* nm-obsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/vax/nm-vax.h b/gnu/usr.bin/binutils/gdb/config/vax/nm-vax.h index 2518047290f..78313cacaf8 100644 --- a/gnu/usr.bin/binutils/gdb/config/vax/nm-vax.h +++ b/gnu/usr.bin/binutils/gdb/config/vax/nm-vax.h @@ -1,5 +1,6 @@ -/* Common definitions for GDB native support on Vaxen under 4.2bsd and Ultrix. - Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc. +/* Native-dependent definitions for VAXen under 4.2 BSD and ULTRIX. + + Copyright 1986, 1987, 1989, 1992, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -18,12 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define AP_REGNUM 12 /* XXXJRT */ +#ifndef NM_VAX_H +#define NM_VAX_H + +extern CORE_ADDR vax_kernel_u_addr; +#define KERNEL_U_ADDR vax_kernel_u_addr + +extern CORE_ADDR vax_register_u_addr (CORE_ADDR u_ar0, int regnum); +#define REGISTER_U_ADDR(addr, u_ar0, regnum) \ + (addr) = vax_register_u_addr (u_ar0, regnum) -#define REGISTER_U_ADDR(addr, blockend, regno) \ -{ addr = blockend - 0110 + regno * 4; \ - if (regno == PC_REGNUM) addr = blockend - 8; \ - if (regno == PS_REGNUM) addr = blockend - 4; \ - if (regno == DEPRECATED_FP_REGNUM) addr = blockend - 0120; \ - if (regno == AP_REGNUM) addr = blockend - 0124; \ - if (regno == SP_REGNUM) addr = blockend - 20; } +#endif /* nm-vax.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/vax/obsd.mh b/gnu/usr.bin/binutils/gdb/config/vax/obsd.mh index 299a38fd330..d4d444f7939 100644 --- a/gnu/usr.bin/binutils/gdb/config/vax/obsd.mh +++ b/gnu/usr.bin/binutils/gdb/config/vax/obsd.mh @@ -1,5 +1,5 @@ # Host: OpenBSD/vax -NATDEPFILES= vaxbsd-nat.o bsd-kvm.o fork-child.o infptrace.o inftarg.o -NAT_FILE= nm-obsd.h +NATDEPFILES= fork-child.o inf-ptrace.o \ + vaxbsd-nat.o bsd-kvm.o LOADLIBES= -lkvm diff --git a/gnu/usr.bin/binutils/gdb/config/vax/tm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/vax/tm-nbsd.h deleted file mode 100644 index f840c797b44..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/tm-nbsd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Target-dependent definitions for NetBSD/vax. - - Copyright 2004 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. */ - -#ifndef TM_NBSD_H -#define TM_NBSD_H - -#include "solib.h" - -#endif /* tm-nbsd.h */ diff --git a/gnu/usr.bin/binutils/gdb/config/vax/tm-vaxbsd.h b/gnu/usr.bin/binutils/gdb/config/vax/tm-vaxbsd.h deleted file mode 100644 index aa34107e02d..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/tm-vaxbsd.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Definitions to make GDB run on a vax under 4.2bsd. - Copyright 1986, 1987, 1989, 1991, 1993, 1994, 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. */ - -#ifndef TM_VAXBSD_H -#define TM_VAXBSD_H - -#define TARGET_UPAGES 14 -#define TARGET_NBPG 512 -#define STACK_END_ADDR (0x80000000 - (TARGET_UPAGES * TARGET_NBPG)) - -/* On the VAX, sigtramp is in the u area. Can't check the exact - addresses because for cross-debugging we don't have VAX include - files around. This should be close enough. */ -#define SIGTRAMP_START(pc) STACK_END_ADDR -#define SIGTRAMP_END(pc) 0x80000000 - -#endif /* TM_VAXBSD_H */ diff --git a/gnu/usr.bin/binutils/gdb/config/vax/vax.mt b/gnu/usr.bin/binutils/gdb/config/vax/vax.mt index 06ab9b2b821..4d7af45813b 100644 --- a/gnu/usr.bin/binutils/gdb/config/vax/vax.mt +++ b/gnu/usr.bin/binutils/gdb/config/vax/vax.mt @@ -1,3 +1,2 @@ -# Target: DEC VAX running BSD or Ultrix +# Target: VAX running 4.2BSD or Ultrix TDEPFILES= vax-tdep.o -TM_FILE= tm-vaxbsd.h diff --git a/gnu/usr.bin/binutils/gdb/config/vax/vaxbsd.mh b/gnu/usr.bin/binutils/gdb/config/vax/vaxbsd.mh deleted file mode 100644 index db1e1d4371d..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/vaxbsd.mh +++ /dev/null @@ -1,13 +0,0 @@ -# Host: DEC VAX running BSD - -# The following types of /bin/cc failures have been observed: -# 1. Something in readline.c which I have never seen -# 2. ``"values.c", line 816: compiler error: schain botch'' -#msg /bin/cc has been known to fail on VAXen running BSD4.3 -#msg If this occurs, use gcc -#msg (but see comments in Makefile.dist about compiling with gcc). - -XM_FILE= xm-vaxbsd.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o - -NAT_FILE= nm-vax.h diff --git a/gnu/usr.bin/binutils/gdb/config/vax/vaxult.mh b/gnu/usr.bin/binutils/gdb/config/vax/vaxult.mh deleted file mode 100644 index f05a33fa198..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/vaxult.mh +++ /dev/null @@ -1,6 +0,0 @@ -# Host: DEC VAX running Ultrix - -XM_FILE= xm-vaxult.h - -NAT_FILE= nm-vax.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o diff --git a/gnu/usr.bin/binutils/gdb/config/vax/vaxult2.mh b/gnu/usr.bin/binutils/gdb/config/vax/vaxult2.mh deleted file mode 100644 index 4170a841257..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/vaxult2.mh +++ /dev/null @@ -1,6 +0,0 @@ -# Host: DEC VAX running Ultrix - -XM_FILE= xm-vaxult2.h - -NAT_FILE= nm-vax.h -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o diff --git a/gnu/usr.bin/binutils/gdb/config/vax/xm-vax.h b/gnu/usr.bin/binutils/gdb/config/vax/xm-vax.h deleted file mode 100644 index 9924f260140..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/xm-vax.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Common definitions to make GDB run on Vaxen under 4.2bsd and Ultrix. - Copyright (C) 1986, 1987, 1989, 1992 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. */ - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ - -#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG)) - -/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ -#define ONE_PROCESS_WRITETEXT - -/* Interface definitions for kernel debugger KDB. */ - -/* Map machine fault codes into signal numbers. - First subtract 0, divide by 4, then index in a table. - Faults for which the entry in this table is 0 - are not handled by KDB; the program's own trap handler - gets to handle then. */ - -#define FAULT_CODE_ORIGIN 0 -#define FAULT_CODE_UNITS 4 -#define FAULT_TABLE \ -{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \ - 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0} - -/* Start running with a stack stretching from BEG to END. - BEG and END should be symbols meaningful to the assembler. - This is used only for kdb. */ - -#define INIT_STACK(beg, end) \ -{ asm (".globl end"); \ - asm ("movl $ end, sp"); \ - asm ("clrl fp"); } - -/* Push the frame pointer register on the stack. */ -#define PUSH_FRAME_PTR \ - asm ("pushl fp"); - -/* Copy the top-of-stack to the frame pointer register. */ -#define POP_FRAME_PTR \ - asm ("movl (sp), fp"); - -/* After KDB is entered by a fault, push all registers - that GDB thinks about (all NUM_REGS of them), - so that they appear in order of ascending GDB register number. - The fault code will be on the stack beyond the last register. */ - -#define PUSH_REGISTERS \ -{ asm ("pushl 8(sp)"); \ - asm ("pushl 8(sp)"); \ - asm ("pushal 0x14(sp)"); \ - asm ("pushr $037777"); } - -/* Assuming the registers (including processor status) have been - pushed on the stack in order of ascending GDB register number, - restore them and return to the address in the saved PC register. */ - -#define POP_REGISTERS \ -{ asm ("popr $037777"); \ - asm ("subl2 $8,(sp)"); \ - asm ("movl (sp),sp"); \ - asm ("rei"); } diff --git a/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxbsd.h b/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxbsd.h deleted file mode 100644 index 6defcc6e079..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxbsd.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Definitions to make GDB run on a vax under BSD, 4.3 or 4.4. */ - -/* This should exist on either 4.3 or 4.4. 4.3 doesn't have limits.h - or machine/limits.h. */ -#include <sys/param.h> - -#include "vax/xm-vax.h" diff --git a/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxult.h b/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxult.h deleted file mode 100644 index 576a44fde57..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxult.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Definitions to make GDB run on a vax under Ultrix. */ - -#include "vax/xm-vax.h" -/* This is required for Ultrix 3.1b, not for later versions. Ultrix - 3.1b can't just use xm-vaxult2.h because Ultrix 3.1b does define - FD_SET. Sure, we could have separate configurations for vaxult2, - vaxult3, and vaxult, but why bother? Defining the ptrace constants - in infptrace.c isn't going to do any harm; it's not like they are - going to change. */ -#define NO_PTRACE_H diff --git a/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxult2.h b/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxult2.h deleted file mode 100644 index a46669830cd..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/vax/xm-vaxult2.h +++ /dev/null @@ -1,9 +0,0 @@ -/* Definitions to make GDB run on a vax under Ultrix. */ - -#include "vax/xm-vax.h" -#define NO_PTRACE_H - -/* Old versions of ultrix have fd_set but not the FD_* macros. */ - -#define FD_SET(bit,fdsetp) ((fdsetp)->fds_bits[(n) / 32] |= (1 << ((n) % 32))) -#define FD_ZERO(fdsetp) memset (fdsetp, 0, sizeof (*fdsetp)) diff --git a/gnu/usr.bin/binutils/gdb/config/xm-aix4.h b/gnu/usr.bin/binutils/gdb/config/xm-aix4.h deleted file mode 100644 index bea086a371b..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/xm-aix4.h +++ /dev/null @@ -1,91 +0,0 @@ -/* Parameters for hosting on an PowerPC, for GDB, the GNU debugger. - Copyright 1995, 1996, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. - Contributed by Cygnus Corporation. - - 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. */ - -/* The following text is taken from config/rs6000.mh: - * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says - * # `extern fd_set svc_fdset;' without ever defining the type fd_set. - * # Unfortunately this occurs in the vx-share code, which is not configured - * # like the rest of GDB (e.g. it doesn't include "defs.h"). - * # We circumvent this bug by #define-ing fd_set here, but undefining it in - * # the xm-rs6000.h file before ordinary modules try to use it. FIXME, IBM! - * MH_CFLAGS='-Dfd_set=int' - * So, here we do the undefine...which has to occur before we include - * <sys/select.h> below. - */ -#undef fd_set - -#include <sys/select.h> - -/* At least as of AIX 3.2, we have termios. */ -#define HAVE_TERMIOS 1 -/* #define HAVE_TERMIO 1 */ - -#define USG 1 - -#define FIVE_ARG_PTRACE - -/* This system requires that we open a terminal with O_NOCTTY for it to - not become our controlling terminal. */ - -#define USE_O_NOCTTY - -/* Brain death inherited from PC's pervades. */ -#undef NULL -#define NULL 0 - -/* The IBM compiler requires this in order to properly compile alloca(). */ -#pragma alloca - -/* There is no vfork. */ - -#define vfork fork - -char *termdef (); - -/* Signal handler for SIGWINCH `window size changed'. */ - -#define SIGWINCH_HANDLER aix_resizewindow -extern void aix_resizewindow (int); - -/* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */ - -#define SIGWINCH_HANDLER_BODY \ - \ -/* Respond to SIGWINCH `window size changed' signal, and reset GDB's \ - window settings appropriately. */ \ - \ -void \ -aix_resizewindow (signo) \ - int signo; \ -{ \ - int fd = fileno (stdout); \ - if (isatty (fd)) { \ - int val; \ - \ - val = atoi (termdef (fd, 'l')); \ - if (val > 0) \ - lines_per_page = val; \ - val = atoi (termdef (fd, 'c')); \ - if (val > 0) \ - chars_per_line = val; \ - } \ -} diff --git a/gnu/usr.bin/binutils/gdb/config/xm-nbsd.h b/gnu/usr.bin/binutils/gdb/config/xm-nbsd.h deleted file mode 100644 index c8d00f6dd63..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/xm-nbsd.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Host-dependent definitions for any CPU running NetBSD. - Copyright 1993, 1994, 1995, 1996, 1999 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 this to get things like NGROUPS which <limits.h> doesn't - define on some systems. */ -#include <sys/param.h> - -/* NetBSD has termios facilities. */ -#define HAVE_TERMIOS diff --git a/gnu/usr.bin/binutils/gdb/config/xm-sysv4.h b/gnu/usr.bin/binutils/gdb/config/xm-sysv4.h deleted file mode 100644 index 614d4032772..00000000000 --- a/gnu/usr.bin/binutils/gdb/config/xm-sysv4.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Definitions for running gdb on a host machine running any flavor of SVR4. - Copyright 1991, 1992, 1993, 1995, 1998 Free Software Foundation, Inc. - Written by Fred Fish at Cygnus Support (fnf@cygnus.com). - - 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. */ - -/* SVR4 has termios facilities. */ - -#undef HAVE_TERMIO -#define HAVE_TERMIOS - -/* SVR4 is a derivative of System V Release 3 (USG) */ - -#define USG diff --git a/gnu/usr.bin/binutils/gdb/configure b/gnu/usr.bin/binutils/gdb/configure index e4de4c94085..be9c1059416 100644 --- a/gnu/usr.bin/binutils/gdb/configure +++ b/gnu/usr.bin/binutils/gdb/configure @@ -1231,9 +1231,20 @@ fi fi -ALL_LINGUAS= + +CONFIG_OBS= +CONFIG_DEPS= +CONFIG_SRCS= +ENABLE_CFLAGS= + +CONFIG_ALL= +CONFIG_CLEAN= +CONFIG_INSTALL= +CONFIG_UNINSTALL= + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1237: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1248: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1262,7 +1273,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1266: checking for $ac_word" >&5 +echo "configure:1277: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1290,12 +1301,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1294: checking for ANSI C header files" >&5 +echo "configure:1305: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1299 "configure" +#line 1310 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1303,7 +1314,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1320,7 +1331,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1324 "configure" +#line 1335 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1338,7 +1349,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1342 "configure" +#line 1353 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1359,7 +1370,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1363 "configure" +#line 1374 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1370,7 +1381,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1394,12 +1405,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1398: checking for working const" >&5 +echo "configure:1409: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1403 "configure" +#line 1414 "configure" #include "confdefs.h" int main() { @@ -1448,7 +1459,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1469,21 +1480,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1473: checking for inline" >&5 +echo "configure:1484: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 1480 "configure" +#line 1491 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:1487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1509,12 +1520,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1513: checking for off_t" >&5 +echo "configure:1524: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1518 "configure" +#line 1529 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1542,12 +1553,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1546: checking for size_t" >&5 +echo "configure:1557: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1551 "configure" +#line 1562 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1577,19 +1588,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1581: checking for working alloca.h" >&5 +echo "configure:1592: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1586 "configure" +#line 1597 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1610,12 +1621,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1614: checking for alloca" >&5 +echo "configure:1625: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1619 "configure" +#line 1630 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -1643,7 +1654,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:1647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1675,12 +1686,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1679: checking whether alloca needs Cray hooks" >&5 +echo "configure:1690: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1684 "configure" +#line 1695 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -1705,12 +1716,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1709: checking for $ac_func" >&5 +echo "configure:1720: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1714 "configure" +#line 1725 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1733,7 +1744,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1760,7 +1771,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1764: checking stack direction for C alloca" >&5 +echo "configure:1775: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1768,7 +1779,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 1772 "configure" +#line 1783 "configure" #include "confdefs.h" find_stack_direction () { @@ -1787,7 +1798,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1812,17 +1823,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1816: checking for $ac_hdr" >&5 +echo "configure:1827: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1821 "configure" +#line 1832 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1851,12 +1862,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1855: checking for $ac_func" >&5 +echo "configure:1866: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1860 "configure" +#line 1871 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1879,7 +1890,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1904,7 +1915,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1908: checking for working mmap" >&5 +echo "configure:1919: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1912,7 +1923,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 1916 "configure" +#line 1927 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -2052,7 +2063,7 @@ main() } EOF -if { (eval echo configure:2056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2080,17 +2091,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2084: checking for $ac_hdr" >&5 +echo "configure:2095: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2089 "configure" +#line 2100 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2120,12 +2131,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2124: checking for $ac_func" >&5 +echo "configure:2135: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2129 "configure" +#line 2140 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2148,7 +2159,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2177,12 +2188,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2181: checking for $ac_func" >&5 +echo "configure:2192: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2186 "configure" +#line 2197 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2205,7 +2216,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2239,19 +2250,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2243: checking for LC_MESSAGES" >&5 +echo "configure:2254: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2248 "configure" +#line 2259 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2272,7 +2283,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2276: checking whether NLS is requested" >&5 +echo "configure:2287: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2292,7 +2303,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2296: checking whether included gettext is requested" >&5 +echo "configure:2307: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2311,17 +2322,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2315: checking for libintl.h" >&5 +echo "configure:2326: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2320 "configure" +#line 2331 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2338,19 +2349,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2342: checking for gettext in libc" >&5 +echo "configure:2353: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2347 "configure" +#line 2358 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -2366,7 +2377,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:2370: checking for bindtextdomain in -lintl" >&5 +echo "configure:2381: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2374,7 +2385,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 2378 "configure" +#line 2389 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -2385,7 +2396,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:2389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2401,19 +2412,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:2405: checking for gettext in libintl" >&5 +echo "configure:2416: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2410 "configure" +#line 2421 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -2441,7 +2452,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2445: checking for $ac_word" >&5 +echo "configure:2456: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2475,12 +2486,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2479: checking for $ac_func" >&5 +echo "configure:2490: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2484 "configure" +#line 2495 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2503,7 +2514,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2530,7 +2541,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2534: checking for $ac_word" >&5 +echo "configure:2545: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2566,7 +2577,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2570: checking for $ac_word" >&5 +echo "configure:2581: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2598,7 +2609,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 2602 "configure" +#line 2613 "configure" #include "confdefs.h" int main() { @@ -2606,7 +2617,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:2610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2638,7 +2649,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2642: checking for $ac_word" >&5 +echo "configure:2653: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2672,7 +2683,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2676: checking for $ac_word" >&5 +echo "configure:2687: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2708,7 +2719,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2712: checking for $ac_word" >&5 +echo "configure:2723: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2798,7 +2809,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2802: checking for catalogs to be installed" >&5 +echo "configure:2813: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2826,17 +2837,17 @@ echo "configure:2802: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:2830: checking for linux/version.h" >&5 +echo "configure:2841: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2835 "configure" +#line 2846 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2897,11 +2908,59 @@ fi < $srcdir/po/POTFILES.in > po/POTFILES fi -cat >> confdefs.h <<\EOF -#define PACKAGE "gdb" + +localedir='${datadir}/locale' + + +if test "x$POSUB" != x; then + + echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 +echo "configure:2919: checking for catalogs to be installed" >&5 + # Look for .po and .gmo files in the source directory. + CATALOGS= + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac + fi + done + LINGUAS="$XLINGUAS" + echo "$ac_t""$LINGUAS" 1>&6 + + CONFIG_ALL="$CONFIG_ALL all-po" + CONFIG_CLEAN="$CONFIG_CLEAN clean-po" + CONFIG_INSTALL="$CONFIG_INSTALL install-po" + CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-po" +fi + +PACKAGE=gdb +cat >> confdefs.h <<EOF +#define PACKAGE "$PACKAGE" EOF + debugdir=${libdir}/debug # Check whether --with-separate-debug-dir or --without-separate-debug-dir was given. @@ -2923,16 +2982,6 @@ EOF #AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"), - -CONFIG_OBS= -CONFIG_DEPS= -CONFIG_SRCS= -ENABLE_CFLAGS= -CONFIG_ALL= -CONFIG_CLEAN= -CONFIG_INSTALL= -CONFIG_UNINSTALL= - subdirs="doc testsuite" configdirs= @@ -3031,146 +3080,6 @@ if test x"$enable_gdbmi" = xyes; then fi fi -# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over -# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host -# Makefile fragments. That's why we need to have `Hcurses' before -# `curses'. I don't see why we should use HP curses if a more -# standard curses is available, except that according to HP's -# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on -# HP-UX 10.10 and 10.20. - - -echo $ac_n "checking for library containing initscr""... $ac_c" 1>&6 -echo "configure:3045: checking for library containing initscr" >&5 -if eval "test \"`echo '$''{'ac_cv_search_initscr'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_func_search_save_LIBS="$LIBS" -ac_cv_search_initscr="no" -cat > conftest.$ac_ext <<EOF -#line 3052 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char initscr(); - -int main() { -initscr() -; return 0; } -EOF -if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_initscr="none required" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -test "$ac_cv_search_initscr" = "no" && for i in ncurses Hcurses curses pdcurses; do -LIBS="-l$i $ac_func_search_save_LIBS" -cat > conftest.$ac_ext <<EOF -#line 3074 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char initscr(); - -int main() { -initscr() -; return 0; } -EOF -if { (eval echo configure:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_initscr="-l$i" -break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done -LIBS="$ac_func_search_save_LIBS" -fi - -echo "$ac_t""$ac_cv_search_initscr" 1>&6 -if test "$ac_cv_search_initscr" != "no"; then - test "$ac_cv_search_initscr" = "none required" || LIBS="$ac_cv_search_initscr $LIBS" - -else : - echo "configure: warning: no curses library found" 1>&2 -fi - -# Check whether the wborder function is provided by the curses -# library detected above. In certain implementations such as -# the HP/UX Hcurses for instance, this function is provided by an -# additional library. So if we did not find this function inside -# the curses library, try some alternate libraries we know might -# provide it. - -echo $ac_n "checking for library containing wborder""... $ac_c" 1>&6 -echo "configure:3114: checking for library containing wborder" >&5 -if eval "test \"`echo '$''{'ac_cv_search_wborder'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_func_search_save_LIBS="$LIBS" -ac_cv_search_wborder="no" -cat > conftest.$ac_ext <<EOF -#line 3121 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char wborder(); - -int main() { -wborder() -; return 0; } -EOF -if { (eval echo configure:3132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_wborder="none required" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -test "$ac_cv_search_wborder" = "no" && for i in cur_colr; do -LIBS="-l$i $ac_func_search_save_LIBS" -cat > conftest.$ac_ext <<EOF -#line 3143 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char wborder(); - -int main() { -wborder() -; return 0; } -EOF -if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_wborder="-l$i" -break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done -LIBS="$ac_func_search_save_LIBS" -fi - -echo "$ac_t""$ac_cv_search_wborder" 1>&6 -if test "$ac_cv_search_wborder" != "no"; then - test "$ac_cv_search_wborder" = "none required" || LIBS="$ac_cv_search_wborder $LIBS" - -else : - echo "configure: warning: wborder function not found, tui will be disabled" 1>&2 -fi - # Enable TUI. # Check whether --enable-tui or --disable-tui was given. if test "${enable_tui+set}" = set; then @@ -3185,21 +3094,6 @@ else enable_tui=yes fi -if test x"$enable_tui" = xyes; then - if test -d $srcdir/tui; then - if test "$ac_cv_search_initscr" != no -a "$ac_cv_search_wborder" != no; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" - CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)" - CONFIG_ALL="${CONFIG_ALL} all-tui" - CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui" - CONFIG_INSTALL="${CONFIG_INSTALL} install-tui" - CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui" - fi - fi -fi # Enable gdbtk. # Check whether --enable-gdbtk or --disable-gdbtk was given. @@ -3241,17 +3135,17 @@ else do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3245: checking for $ac_hdr" >&5 +echo "configure:3139: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3250 "configure" +#line 3144 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3281,17 +3175,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3285: checking for $ac_hdr" >&5 +echo "configure:3179: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3290 "configure" +#line 3184 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3329,17 +3223,17 @@ if test x"$enable_libunwind" = xyes; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3333: checking for $ac_hdr" >&5 +echo "configure:3227: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3338 "configure" +#line 3232 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3369,17 +3263,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3373: checking for $ac_hdr" >&5 +echo "configure:3267: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3378 "configure" +#line 3272 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3432,12 +3326,12 @@ fi for ac_func in monstartup _mcleanup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3436: checking for $ac_func" >&5 +echo "configure:3330: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3441 "configure" +#line 3335 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3460,7 +3354,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3485,12 +3379,12 @@ fi done echo $ac_n "checking for _etext""... $ac_c" 1>&6 -echo "configure:3489: checking for _etext" >&5 +echo "configure:3383: checking for _etext" >&5 if eval "test \"`echo '$''{'ac_cv_var__etext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3494 "configure" +#line 3388 "configure" #include "confdefs.h" #include <stdlib.h> extern char _etext; @@ -3499,7 +3393,7 @@ int main() { free (&_etext); ; return 0; } EOF -if { (eval echo configure:3503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var__etext=yes else @@ -3527,19 +3421,19 @@ if test "$enable_profiling" = yes ; then CFLAGS="$CFLAGS $PROFILE_CFLAGS" echo $ac_n "checking whether $CC supports -pg""... $ac_c" 1>&6 -echo "configure:3531: checking whether $CC supports -pg" >&5 +echo "configure:3425: checking whether $CC supports -pg" >&5 if eval "test \"`echo '$''{'ac_cv_cc_supports_pg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3536 "configure" +#line 3430 "configure" #include "confdefs.h" int main() { int x; ; return 0; } EOF -if { (eval echo configure:3543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cc_supports_pg=yes else @@ -3569,7 +3463,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3573: checking for $ac_word" >&5 +echo "configure:3467: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3610,7 +3504,7 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:3614: checking for a BSD compatible install" >&5 +echo "configure:3508: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3663,7 +3557,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3667: checking whether ln -s works" >&5 +echo "configure:3561: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3686,7 +3580,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3690: checking for $ac_word" >&5 +echo "configure:3584: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3718,7 +3612,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3722: checking for $ac_word" >&5 +echo "configure:3616: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3752,7 +3646,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3756: checking for $ac_word" >&5 +echo "configure:3650: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3784,7 +3678,7 @@ fi # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3788: checking for $ac_word" >&5 +echo "configure:3682: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3816,7 +3710,7 @@ fi # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3820: checking for $ac_word" >&5 +echo "configure:3714: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3850,7 +3744,7 @@ fi # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3854: checking for $ac_word" >&5 +echo "configure:3748: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3886,7 +3780,7 @@ fi # We might need to link with -lm; most simulators need it. echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:3890: checking for main in -lm" >&5 +echo "configure:3784: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3894,14 +3788,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 3898 "configure" +#line 3792 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3934,12 +3828,12 @@ fi # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 # is known to have this problem). Therefore we avoid libw if we can. echo $ac_n "checking for wctype""... $ac_c" 1>&6 -echo "configure:3938: checking for wctype" >&5 +echo "configure:3832: checking for wctype" >&5 if eval "test \"`echo '$''{'ac_cv_func_wctype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3943 "configure" +#line 3837 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char wctype(); below. */ @@ -3962,7 +3856,7 @@ wctype(); ; return 0; } EOF -if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_wctype=yes" else @@ -3980,7 +3874,7 @@ if eval "test \"`echo '$ac_cv_func_'wctype`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:3984: checking for wctype in -lw" >&5 +echo "configure:3878: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3988,7 +3882,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <<EOF -#line 3992 "configure" +#line 3886 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3999,7 +3893,7 @@ int main() { wctype() ; return 0; } EOF -if { (eval echo configure:4003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4032,14 +3926,14 @@ fi # Some systems (e.g. Solaris) have `gethostbyname' in libnsl. echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6 -echo "configure:4036: checking for library containing gethostbyname" >&5 +echo "configure:3930: checking for library containing gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_search_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_gethostbyname="no" cat > conftest.$ac_ext <<EOF -#line 4043 "configure" +#line 3937 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4050,7 +3944,7 @@ int main() { gethostbyname() ; return 0; } EOF -if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_gethostbyname="none required" else @@ -4061,7 +3955,7 @@ rm -f conftest* test "$ac_cv_search_gethostbyname" = "no" && for i in nsl; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 4065 "configure" +#line 3959 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4072,7 +3966,7 @@ int main() { gethostbyname() ; return 0; } EOF -if { (eval echo configure:4076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_gethostbyname="-l$i" break @@ -4096,14 +3990,14 @@ fi # Some systems (e.g. Solaris) have `socketpair' in libsocket. echo $ac_n "checking for library containing socketpair""... $ac_c" 1>&6 -echo "configure:4100: checking for library containing socketpair" >&5 +echo "configure:3994: checking for library containing socketpair" >&5 if eval "test \"`echo '$''{'ac_cv_search_socketpair'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_socketpair="no" cat > conftest.$ac_ext <<EOF -#line 4107 "configure" +#line 4001 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4114,7 +4008,7 @@ int main() { socketpair() ; return 0; } EOF -if { (eval echo configure:4118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socketpair="none required" else @@ -4125,7 +4019,7 @@ rm -f conftest* test "$ac_cv_search_socketpair" = "no" && for i in socket; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 4129 "configure" +#line 4023 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4136,7 +4030,7 @@ int main() { socketpair() ; return 0; } EOF -if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_socketpair="-l$i" break @@ -4157,67 +4051,60 @@ else : fi -# Since GDB uses Readline, we need termcap functionality, so we need -# to find a library that provides that. When GDB is configured with -# the TUI, we need full curses functionality. +# For the TUI, we need enhanced curses functionality. +# +# FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied +# curses library because the latter might not provide all the +# functionality we need. However, this leads to problems on systems +# where the linker searches /usr/local/lib, but the compiler doesn't +# search /usr/local/include, if ncurses is installed in /usr/local. A +# default installation of ncurses on alpha*-dec-osf* will lead to such +# a situation. -case $host_os in - cygwin*) - if test -d $srcdir/libtermcap; then - LIBS="../libtermcap/libtermcap.a $LIBS" - ac_cv_search_tgetent="../libtermcap/libtermcap.a" - fi ;; - go32* | *djgpp*) - ac_cv_search_tgetent="none required" - ;; - aix*) - # Readline prefers curses over termcap on AIX. - # ??? Why? - -echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:4179: checking for library containing tgetent" >&5 -if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then +echo $ac_n "checking for library containing waddstr""... $ac_c" 1>&6 +echo "configure:4066: checking for library containing waddstr" >&5 +if eval "test \"`echo '$''{'ac_cv_search_waddstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" -ac_cv_search_tgetent="no" +ac_cv_search_waddstr="no" cat > conftest.$ac_ext <<EOF -#line 4186 "configure" +#line 4073 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char tgetent(); +char waddstr(); int main() { -tgetent() +waddstr() ; return 0; } EOF -if { (eval echo configure:4197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - ac_cv_search_tgetent="none required" + ac_cv_search_waddstr="none required" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* -test "$ac_cv_search_tgetent" = "no" && for i in tinfo ncurses curses termcap; do +test "$ac_cv_search_waddstr" = "no" && for i in ncurses cursesX curses; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 4208 "configure" +#line 4095 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char tgetent(); +char waddstr(); int main() { -tgetent() +waddstr() ; return 0; } EOF -if { (eval echo configure:4219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - ac_cv_search_tgetent="-l$i" + ac_cv_search_waddstr="-l$i" break else echo "configure: failed program was:" >&5 @@ -4228,28 +4115,40 @@ done LIBS="$ac_func_search_save_LIBS" fi -echo "$ac_t""$ac_cv_search_tgetent" 1>&6 -if test "$ac_cv_search_tgetent" != "no"; then - test "$ac_cv_search_tgetent" = "none required" || LIBS="$ac_cv_search_tgetent $LIBS" +echo "$ac_t""$ac_cv_search_waddstr" 1>&6 +if test "$ac_cv_search_waddstr" != "no"; then + test "$ac_cv_search_waddstr" = "none required" || LIBS="$ac_cv_search_waddstr $LIBS" else : fi + +# Since GDB uses Readline, we need termcap functionality. In many +# cases this will be provided by the curses library, but some systems +# have a seperate termcap library, or no curses library at all. + +case $host_os in + cygwin*) + if test -d $srcdir/libtermcap; then + LIBS="../libtermcap/libtermcap.a $LIBS" + ac_cv_search_tgetent="../libtermcap/libtermcap.a" + fi ;; + go32* | *djgpp*) + ac_cv_search_tgetent="none required" ;; esac -# Note: We used to check for libtermlib and libterminfo too, but -# Readline doesn't, so I think we're safe with leaving them out. +# These are the libraries checked by Readline. echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:4246: checking for library containing tgetent" >&5 +echo "configure:4145: checking for library containing tgetent" >&5 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_tgetent="no" cat > conftest.$ac_ext <<EOF -#line 4253 "configure" +#line 4152 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4260,7 +4159,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="none required" else @@ -4268,10 +4167,10 @@ else cat conftest.$ac_ext >&5 fi rm -f conftest* -test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo ncurses Hcurses curses; do +test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo curses ncurses; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <<EOF -#line 4275 "configure" +#line 4174 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4282,7 +4181,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:4286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="-l$i" break @@ -4316,12 +4215,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4320: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4219: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4325 "configure" +#line 4224 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -4329,7 +4228,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4354,7 +4253,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4358: checking for opendir in -ldir" >&5 +echo "configure:4257: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4362,7 +4261,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 4366 "configure" +#line 4265 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4373,7 +4272,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4395,7 +4294,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4399: checking for opendir in -lx" >&5 +echo "configure:4298: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4403,7 +4302,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 4407 "configure" +#line 4306 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4414,7 +4313,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4437,12 +4336,12 @@ fi fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:4441: checking whether stat file-mode macros are broken" >&5 +echo "configure:4340: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4446 "configure" +#line 4345 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -4493,12 +4392,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4497: checking for ANSI C header files" >&5 +echo "configure:4396: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4502 "configure" +#line 4401 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -4506,7 +4405,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4523,7 +4422,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 4527 "configure" +#line 4426 "configure" #include "confdefs.h" #include <string.h> EOF @@ -4541,7 +4440,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 4545 "configure" +#line 4444 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -4562,7 +4461,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 4566 "configure" +#line 4465 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4573,7 +4472,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4600,17 +4499,17 @@ for ac_hdr in link.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4604: checking for $ac_hdr" >&5 +echo "configure:4503: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4609 "configure" +#line 4508 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4513: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4640,17 +4539,17 @@ for ac_hdr in machine/reg.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4644: checking for $ac_hdr" >&5 +echo "configure:4543: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4649 "configure" +#line 4548 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4680,17 +4579,17 @@ for ac_hdr in nlist.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4684: checking for $ac_hdr" >&5 +echo "configure:4583: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4689 "configure" +#line 4588 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4720,17 +4619,17 @@ for ac_hdr in poll.h sys/poll.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4724: checking for $ac_hdr" >&5 +echo "configure:4623: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4729 "configure" +#line 4628 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4756,21 +4655,21 @@ else fi done -for ac_hdr in proc_service.h thread_db.h +for ac_hdr in proc_service.h thread_db.h gnu/libc-version.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4764: checking for $ac_hdr" >&5 +echo "configure:4663: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4769 "configure" +#line 4668 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4800,17 +4699,17 @@ for ac_hdr in stddef.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4804: checking for $ac_hdr" >&5 +echo "configure:4703: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4809 "configure" +#line 4708 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4840,17 +4739,17 @@ for ac_hdr in stdlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4844: checking for $ac_hdr" >&5 +echo "configure:4743: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4849 "configure" +#line 4748 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4880,17 +4779,17 @@ for ac_hdr in stdint.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4884: checking for $ac_hdr" >&5 +echo "configure:4783: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4889 "configure" +#line 4788 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4920,17 +4819,17 @@ for ac_hdr in string.h memory.h strings.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4924: checking for $ac_hdr" >&5 +echo "configure:4823: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4929 "configure" +#line 4828 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4960,17 +4859,17 @@ for ac_hdr in sys/fault.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4964: checking for $ac_hdr" >&5 +echo "configure:4863: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4969 "configure" +#line 4868 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5000,17 +4899,17 @@ for ac_hdr in sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5004: checking for $ac_hdr" >&5 +echo "configure:4903: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5009 "configure" +#line 4908 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5040,17 +4939,17 @@ for ac_hdr in sys/filio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5044: checking for $ac_hdr" >&5 +echo "configure:4943: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5049 "configure" +#line 4948 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5080,17 +4979,17 @@ for ac_hdr in sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5084: checking for $ac_hdr" >&5 +echo "configure:4983: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5089 "configure" +#line 4988 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5120,17 +5019,17 @@ for ac_hdr in sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5124: checking for $ac_hdr" >&5 +echo "configure:5023: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5129 "configure" +#line 5028 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5160,17 +5059,17 @@ for ac_hdr in sys/proc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5164: checking for $ac_hdr" >&5 +echo "configure:5063: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5169 "configure" +#line 5068 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5200,17 +5099,17 @@ for ac_hdr in sys/procfs.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5204: checking for $ac_hdr" >&5 +echo "configure:5103: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5209 "configure" +#line 5108 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5240,17 +5139,17 @@ for ac_hdr in sys/ptrace.h ptrace.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5244: checking for $ac_hdr" >&5 +echo "configure:5143: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5249 "configure" +#line 5148 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5280,17 +5179,17 @@ for ac_hdr in sys/reg.h sys/debugreg.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5284: checking for $ac_hdr" >&5 +echo "configure:5183: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5289 "configure" +#line 5188 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5320,17 +5219,17 @@ for ac_hdr in sys/select.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5324: checking for $ac_hdr" >&5 +echo "configure:5223: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5329 "configure" +#line 5228 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5360,17 +5259,57 @@ for ac_hdr in sys/syscall.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5364: checking for $ac_hdr" >&5 +echo "configure:5263: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 5268 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +for ac_hdr in sys/types.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:5303: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5369 "configure" +#line 5308 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5400,17 +5339,17 @@ for ac_hdr in sys/user.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5404: checking for $ac_hdr" >&5 +echo "configure:5343: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5409 "configure" +#line 5348 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5440,17 +5379,17 @@ for ac_hdr in sys/wait.h wait.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5444: checking for $ac_hdr" >&5 +echo "configure:5383: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5449 "configure" +#line 5388 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5480,17 +5419,17 @@ for ac_hdr in termios.h termio.h sgtty.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5484: checking for $ac_hdr" >&5 +echo "configure:5423: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5489 "configure" +#line 5428 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5520,17 +5459,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5524: checking for $ac_hdr" >&5 +echo "configure:5463: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5529 "configure" +#line 5468 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5557,11 +5496,11 @@ fi done -# On Solaris 2.[78], we need to define _MSE_INT_H to avoid a clash +# On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash # between <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to # think that we don't have <curses.h> if we're using GCC. case $host_os in - solaris2.[78]) + solaris2.[789]) if test "$GCC" = yes; then cat >> confdefs.h <<\EOF #define _MSE_INT_H 1 @@ -5569,21 +5508,21 @@ EOF fi ;; esac -for ac_hdr in curses.h ncurses.h term.h +for ac_hdr in curses.h cursesX.h ncurses.h ncurses/ncurses.h term.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5577: checking for $ac_hdr" >&5 +echo "configure:5516: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5582 "configure" +#line 5521 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5616,17 +5555,17 @@ for ac_hdr in ctype.h time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5620: checking for $ac_hdr" >&5 +echo "configure:5559: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5625 "configure" +#line 5564 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5654,12 +5593,12 @@ done echo $ac_n "checking for member st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:5658: checking for member st_blocks in struct stat" >&5 +echo "configure:5597: checking for member st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_stat_with_st_blocks_member'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5663 "configure" +#line 5602 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -5667,7 +5606,7 @@ int main() { struct stat st; (void) st.st_blocks; ; return 0; } EOF -if { (eval echo configure:5671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_stat_with_st_blocks_member=yes else @@ -5686,6 +5625,7 @@ if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then EOF fi + # ------------------------- # # Checks for declarations. # # ------------------------- # @@ -5694,12 +5634,12 @@ for ac_func in getopt do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 -echo "configure:5698: checking whether $ac_func is declared" >&5 +echo "configure:5638: checking whether $ac_func is declared" >&5 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5703 "configure" +#line 5643 "configure" #include "confdefs.h" #undef $ac_tr_decl #define $ac_tr_decl 1 @@ -5711,7 +5651,7 @@ char *(*pfn) = (char *(*)) $ac_func ; #endif ; return 0; } EOF -if { (eval echo configure:5715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_have_decl_$ac_func=yes" else @@ -5748,12 +5688,12 @@ fi # ------------------ # echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5752: checking return type of signal handlers" >&5 +echo "configure:5692: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5757 "configure" +#line 5697 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -5770,7 +5710,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5794,12 +5734,12 @@ EOF # ------------------------------------- # echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5798: checking for working const" >&5 +echo "configure:5738: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5803 "configure" +#line 5743 "configure" #include "confdefs.h" int main() { @@ -5848,7 +5788,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:5852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5869,21 +5809,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5873: checking for inline" >&5 +echo "configure:5813: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 5880 "configure" +#line 5820 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:5887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -5916,19 +5856,19 @@ esac # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5920: checking for working alloca.h" >&5 +echo "configure:5860: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5925 "configure" +#line 5865 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:5932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -5949,12 +5889,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5953: checking for alloca" >&5 +echo "configure:5893: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5958 "configure" +#line 5898 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -5982,7 +5922,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:5986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -6014,12 +5954,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:6018: checking whether alloca needs Cray hooks" >&5 +echo "configure:5958: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6023 "configure" +#line 5963 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -6044,12 +5984,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6048: checking for $ac_func" >&5 +echo "configure:5988: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6053 "configure" +#line 5993 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6072,7 +6012,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6099,7 +6039,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:6103: checking stack direction for C alloca" >&5 +echo "configure:6043: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6107,7 +6047,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 6111 "configure" +#line 6051 "configure" #include "confdefs.h" find_stack_direction () { @@ -6126,7 +6066,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:6130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -6151,17 +6091,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6155: checking for $ac_hdr" >&5 +echo "configure:6095: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6160 "configure" +#line 6100 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6190,12 +6130,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6194: checking for $ac_func" >&5 +echo "configure:6134: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6199 "configure" +#line 6139 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6218,7 +6158,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6243,7 +6183,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6247: checking for working mmap" >&5 +echo "configure:6187: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6251,7 +6191,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 6255 "configure" +#line 6195 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -6391,7 +6331,7 @@ main() } EOF -if { (eval echo configure:6395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6414,12 +6354,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:6418: checking for pid_t" >&5 +echo "configure:6358: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6423 "configure" +#line 6363 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -6448,17 +6388,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:6452: checking for vfork.h" >&5 +echo "configure:6392: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6457 "configure" +#line 6397 "configure" #include "confdefs.h" #include <vfork.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6483,18 +6423,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:6487: checking for working vfork" >&5 +echo "configure:6427: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:6493: checking for vfork" >&5 +echo "configure:6433: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6498 "configure" +#line 6438 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char vfork(); below. */ @@ -6517,7 +6457,7 @@ vfork(); ; return 0; } EOF -if { (eval echo configure:6521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -6539,7 +6479,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext <<EOF -#line 6543 "configure" +#line 6483 "configure" #include "confdefs.h" /* Thanks to Paul Eggert for this test. */ #include <stdio.h> @@ -6634,7 +6574,7 @@ main() { } } EOF -if { (eval echo configure:6638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -6659,12 +6599,12 @@ fi for ac_func in canonicalize_file_name realpath do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6663: checking for $ac_func" >&5 +echo "configure:6603: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6668 "configure" +#line 6608 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6687,7 +6627,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6714,12 +6654,12 @@ done for ac_func in poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6718: checking for $ac_func" >&5 +echo "configure:6658: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6723 "configure" +#line 6663 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6742,7 +6682,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6769,12 +6709,12 @@ done for ac_func in pread64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6773: checking for $ac_func" >&5 +echo "configure:6713: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6778 "configure" +#line 6718 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6797,7 +6737,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6824,12 +6764,12 @@ done for ac_func in sbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6828: checking for $ac_func" >&5 +echo "configure:6768: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6833 "configure" +#line 6773 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6852,7 +6792,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6879,12 +6819,12 @@ done for ac_func in setpgid setpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6883: checking for $ac_func" >&5 +echo "configure:6823: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6888 "configure" +#line 6828 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6907,7 +6847,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6934,12 +6874,12 @@ done for ac_func in sigaction sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6938: checking for $ac_func" >&5 +echo "configure:6878: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6943 "configure" +#line 6883 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -6962,7 +6902,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:6966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6989,12 +6929,12 @@ done for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6993: checking for $ac_func" >&5 +echo "configure:6933: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 6998 "configure" +#line 6938 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7017,7 +6957,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7044,12 +6984,67 @@ done for ac_func in syscall do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7048: checking for $ac_func" >&5 +echo "configure:6988: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 6993 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:7016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +for ac_func in ttrace +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:7043: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7053 "configure" +#line 7048 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7072,7 +7067,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:7076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7096,10 +7091,244 @@ else fi done +for ac_func in wborder +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:7098: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 7103 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:7126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + +# Check the return and argument types of ptrace. No canned test for +# this, so roll our own. +gdb_ptrace_headers=' +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#if HAVE_SYS_PTRACE_H +# include <sys/ptrace.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +' +# There is no point in checking if we don't have a prototype. +for ac_func in ptrace +do + ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` +echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 +echo "configure:7169: checking whether $ac_func is declared" >&5 +if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 7174 "configure" +#include "confdefs.h" +#undef $ac_tr_decl +#define $ac_tr_decl 1 + $gdb_ptrace_headers + +int main() { +#ifndef $ac_func +char *(*pfn) = (char *(*)) $ac_func ; +#endif +; return 0; } +EOF +if { (eval echo configure:7186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "gcc_cv_have_decl_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "gcc_cv_have_decl_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF +#define $ac_tr_decl 1 +EOF + +else + echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF +#define $ac_tr_decl 0 +EOF + + : ${gdb_cv_func_ptrace_ret='int'} + : ${gdb_cv_func_ptrace_args='int,int,long,long'} + +fi + +done +if test x = y ; then + cat >> confdefs.h <<\EOF +#define HAVE_DECL_PTRACE 1 +EOF +fi + +# Check return type. +echo $ac_n "checking return type of ptrace""... $ac_c" 1>&6 +echo "configure:7222: checking return type of ptrace" >&5 +if eval "test \"`echo '$''{'gdb_cv_func_ptrace_ret'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 7227 "configure" +#include "confdefs.h" +$gdb_ptrace_headers +int main() { +extern int ptrace (); +; return 0; } +EOF +if { (eval echo configure:7234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_func_ptrace_ret='int' +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_func_ptrace_ret='long' +fi +rm -f conftest* +fi + +echo "$ac_t""$gdb_cv_func_ptrace_ret" 1>&6 +cat >> confdefs.h <<EOF +#define PTRACE_TYPE_RET $gdb_cv_func_ptrace_ret +EOF + +# Check argument types. +echo $ac_n "checking types of arguments for ptrace""... $ac_c" 1>&6 +echo "configure:7253: checking types of arguments for ptrace" >&5 +if eval "test \"`echo '$''{'gdb_cv_func_ptrace_args'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +for gdb_arg1 in 'int' 'long'; do + for gdb_arg2 in 'pid_t' 'int' 'long'; do + for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long'; do + for gdb_arg4 in 'int' 'long'; do + cat > conftest.$ac_ext <<EOF +#line 7263 "configure" +#include "confdefs.h" +$gdb_ptrace_headers +int main() { + +extern $gdb_cv_func_ptrace_ret + ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4); + +; return 0; } +EOF +if { (eval echo configure:7273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4"; + break 4; +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + for gdb_arg5 in 'int *' 'int' 'long'; do + cat > conftest.$ac_ext <<EOF +#line 7284 "configure" +#include "confdefs.h" +$gdb_ptrace_headers +int main() { + +extern $gdb_cv_func_ptrace_ret + ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5); + +; return 0; } +EOF +if { (eval echo configure:7294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + +gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5"; + break 5; +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + done + done + done + done +done +# Provide a safe default value. +: ${gdb_cv_func_ptrace_args='int,int,long,long'} + +fi + +echo "$ac_t""$gdb_cv_func_ptrace_args" 1>&6 +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift +cat >> confdefs.h <<EOF +#define PTRACE_TYPE_ARG3 $3 +EOF + +if test -n "$5"; then + cat >> confdefs.h <<EOF +#define PTRACE_TYPE_ARG5 $5 +EOF + +fi if test "$cross_compiling" = no; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:7103: checking whether setpgrp takes no argument" >&5 +echo "configure:7332: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7107,7 +7336,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 7111 "configure" +#line 7340 "configure" #include "confdefs.h" #ifdef HAVE_UNISTD_H @@ -7127,7 +7356,7 @@ main() } EOF -if { (eval echo configure:7131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -7152,12 +7381,12 @@ fi else echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:7156: checking whether setpgrp takes no argument" >&5 +echo "configure:7385: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7161 "configure" +#line 7390 "configure" #include "confdefs.h" #include <unistd.h> @@ -7171,7 +7400,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:7175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_setpgrp_void=no else @@ -7195,12 +7424,12 @@ fi # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do # since sigsetjmp might only be defined as a macro. echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:7199: checking for sigsetjmp" >&5 +echo "configure:7428: checking for sigsetjmp" >&5 if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7204 "configure" +#line 7433 "configure" #include "confdefs.h" #include <setjmp.h> @@ -7209,7 +7438,7 @@ int main() { sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:7213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_func_sigsetjmp=yes else @@ -7235,12 +7464,12 @@ gdb_use_included_regex=yes # However, if the system regex is GNU regex, then default to *not* # using the included regex. echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:7239: checking for GNU regex" >&5 +echo "configure:7468: checking for GNU regex" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7244 "configure" +#line 7473 "configure" #include "confdefs.h" #include <gnu-versions.h> int main() { @@ -7250,7 +7479,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:7254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -7282,14 +7511,84 @@ EOF fi +# See if <sys/proc.h> defines `struct thread' with a td_pcb member. +echo $ac_n "checking for td_pcb in struct thread""... $ac_c" 1>&6 +echo "configure:7517: checking for td_pcb in struct thread" >&5 +if eval "test \"`echo '$''{'gdb_cv_struct_thread_td_pcb'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 7522 "configure" +#include "confdefs.h" +#include <sys/param.h> +#include <sys/proc.h> +int main() { +struct thread td; td.td_pcb; +; return 0; } +EOF +if { (eval echo configure:7530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_struct_thread_td_pcb=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_struct_thread_td_pcb=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gdb_cv_struct_thread_td_pcb" 1>&6 +if test $gdb_cv_struct_thread_td_pcb = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_THREAD_TD_PCB 1 +EOF + +fi + +# See if <sys/lwp.h> defines `struct lwp`. +echo $ac_n "checking for struct lwp""... $ac_c" 1>&6 +echo "configure:7552: checking for struct lwp" >&5 +if eval "test \"`echo '$''{'gdb_cv_struct_lwp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 7557 "configure" +#include "confdefs.h" +#include <sys/param.h> +#include <sys/lwp.h> +int main() { +struct lwp l; +; return 0; } +EOF +if { (eval echo configure:7565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_struct_lwp=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_struct_lwp=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gdb_cv_struct_lwp" 1>&6 +if test $gdb_cv_struct_lwp = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_LWP 1 +EOF + +fi + # See if <machine/reg.h> degines `struct reg'. echo $ac_n "checking for struct reg in machine/reg.h""... $ac_c" 1>&6 -echo "configure:7288: checking for struct reg in machine/reg.h" >&5 +echo "configure:7587: checking for struct reg in machine/reg.h" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7293 "configure" +#line 7592 "configure" #include "confdefs.h" #include <sys/types.h> #include <machine/reg.h> @@ -7297,7 +7596,7 @@ int main() { struct reg r; ; return 0; } EOF -if { (eval echo configure:7301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg=yes else @@ -7320,19 +7619,19 @@ fi # See if <machine/reg.h> supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6 -echo "configure:7324: checking for r_fs in struct reg" >&5 +echo "configure:7623: checking for r_fs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7329 "configure" +#line 7628 "configure" #include "confdefs.h" #include <machine/reg.h> int main() { struct reg r; r.r_fs; ; return 0; } EOF -if { (eval echo configure:7336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -7352,19 +7651,19 @@ EOF fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:7356: checking for r_gs in struct reg" >&5 +echo "configure:7655: checking for r_gs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7361 "configure" +#line 7660 "configure" #include "confdefs.h" #include <machine/reg.h> int main() { struct reg r; r.r_gs; ; return 0; } EOF -if { (eval echo configure:7368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -7386,19 +7685,19 @@ fi # See if <sys/ptrace.h> provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:7390: checking for PTRACE_GETREGS" >&5 +echo "configure:7689: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7395 "configure" +#line 7694 "configure" #include "confdefs.h" #include <sys/ptrace.h> int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:7402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -7420,19 +7719,19 @@ fi # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:7424: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:7723: checking for PTRACE_GETFPXREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7429 "configure" +#line 7728 "configure" #include "confdefs.h" #include <sys/ptrace.h> int main() { PTRACE_GETFPXREGS; ; return 0; } EOF -if { (eval echo configure:7436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -7454,12 +7753,12 @@ fi # See if <sys/ptrace.h> provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:7458: checking for PT_GETDBREGS" >&5 +echo "configure:7757: checking for PT_GETDBREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7463 "configure" +#line 7762 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/ptrace.h> @@ -7467,7 +7766,7 @@ int main() { PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:7471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -7489,12 +7788,12 @@ fi # See if <sys/ptrace.h> provides the PT_GETXMMREGS request. echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6 -echo "configure:7493: checking for PT_GETXMMREGS" >&5 +echo "configure:7792: checking for PT_GETXMMREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7498 "configure" +#line 7797 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/ptrace.h> @@ -7502,7 +7801,7 @@ int main() { PT_GETXMMREGS; ; return 0; } EOF -if { (eval echo configure:7506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getxmmregs=yes else @@ -7525,19 +7824,19 @@ fi # See if stdint.h provides the uintptr_t type. # Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this. echo $ac_n "checking for uintptr_t in stdint.h""... $ac_c" 1>&6 -echo "configure:7529: checking for uintptr_t in stdint.h" >&5 +echo "configure:7828: checking for uintptr_t in stdint.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_uintptr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7534 "configure" +#line 7833 "configure" #include "confdefs.h" #include <stdint.h> int main() { uintptr_t foo = 0; ; return 0; } EOF -if { (eval echo configure:7541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_uintptr_t=yes else @@ -7558,12 +7857,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:7562: checking whether malloc must be declared" >&5 +echo "configure:7861: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7567 "configure" +#line 7866 "configure" #include "confdefs.h" #include <stdio.h> @@ -7584,7 +7883,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:7588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -7605,12 +7904,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:7609: checking whether realloc must be declared" >&5 +echo "configure:7908: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7614 "configure" +#line 7913 "configure" #include "confdefs.h" #include <stdio.h> @@ -7631,7 +7930,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:7635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -7652,12 +7951,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:7656: checking whether free must be declared" >&5 +echo "configure:7955: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7661 "configure" +#line 7960 "configure" #include "confdefs.h" #include <stdio.h> @@ -7678,7 +7977,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:7682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -7699,12 +7998,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:7703: checking whether strerror must be declared" >&5 +echo "configure:8002: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7708 "configure" +#line 8007 "configure" #include "confdefs.h" #include <stdio.h> @@ -7725,7 +8024,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:7729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -7746,12 +8045,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:7750: checking whether strdup must be declared" >&5 +echo "configure:8049: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7755 "configure" +#line 8054 "configure" #include "confdefs.h" #include <stdio.h> @@ -7772,7 +8071,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:7776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -7793,12 +8092,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:7797: checking whether strstr must be declared" >&5 +echo "configure:8096: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7802 "configure" +#line 8101 "configure" #include "confdefs.h" #include <stdio.h> @@ -7819,7 +8118,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:7823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -7840,12 +8139,12 @@ EOF fi echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:7844: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:8143: checking whether canonicalize_file_name must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7849 "configure" +#line 8148 "configure" #include "confdefs.h" #include <stdio.h> @@ -7866,7 +8165,7 @@ int main() { char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:7870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_canonicalize_file_name=no else @@ -7892,9 +8191,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:7896: checking for HPUX save_state structure" >&5 +echo "configure:8195: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext <<EOF -#line 7898 "configure" +#line 8197 "configure" #include "confdefs.h" #include <machine/save_state.h> EOF @@ -7909,7 +8208,7 @@ fi rm -f conftest* cat > conftest.$ac_ext <<EOF -#line 7913 "configure" +#line 8212 "configure" #include "confdefs.h" #include <machine/save_state.h> EOF @@ -7974,17 +8273,24 @@ EOF EOF ;; + mips-sgi-irix5*) + # Work around <sys/proc.h> needing _KMEMUSER problem on IRIX 5. + cat >> confdefs.h <<\EOF +#define _KMEMUSER 1 +EOF + + ;; esac fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:7983: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:8289: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7988 "configure" +#line 8294 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -7993,7 +8299,7 @@ int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:7997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -8015,12 +8321,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8019: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:8325: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8024 "configure" +#line 8330 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8029,7 +8335,7 @@ int main() { prrun_t avar ; return 0; } EOF -if { (eval echo configure:8033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -8051,12 +8357,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8055: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:8361: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8060 "configure" +#line 8366 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8065,7 +8371,7 @@ int main() { gregset_t avar ; return 0; } EOF -if { (eval echo configure:8069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -8087,12 +8393,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8091: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:8397: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8096 "configure" +#line 8402 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8101,7 +8407,7 @@ int main() { fpregset_t avar ; return 0; } EOF -if { (eval echo configure:8105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -8123,12 +8429,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8127: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:8433: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8132 "configure" +#line 8438 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8137,7 +8443,7 @@ int main() { prgregset_t avar ; return 0; } EOF -if { (eval echo configure:8141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -8159,12 +8465,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8163: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:8469: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8168 "configure" +#line 8474 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8173,7 +8479,7 @@ int main() { prfpregset_t avar ; return 0; } EOF -if { (eval echo configure:8177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -8195,12 +8501,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8199: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:8505: checking for prgregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8204 "configure" +#line 8510 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8209,7 +8515,7 @@ int main() { prgregset32_t avar ; return 0; } EOF -if { (eval echo configure:8213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -8231,12 +8537,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6 echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8235: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:8541: checking for prfpregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8240 "configure" +#line 8546 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8245,7 +8551,7 @@ int main() { prfpregset32_t avar ; return 0; } EOF -if { (eval echo configure:8249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -8267,12 +8573,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8271: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:8577: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8276 "configure" +#line 8582 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8281,7 +8587,7 @@ int main() { lwpid_t avar ; return 0; } EOF -if { (eval echo configure:8285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -8303,12 +8609,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8307: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:8613: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8312 "configure" +#line 8618 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8317,7 +8623,7 @@ int main() { psaddr_t avar ; return 0; } EOF -if { (eval echo configure:8321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -8339,12 +8645,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6 echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8343: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:8649: checking for prsysent_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8348 "configure" +#line 8654 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8353,7 +8659,7 @@ int main() { prsysent_t avar ; return 0; } EOF -if { (eval echo configure:8357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -8375,12 +8681,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6 echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8379: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:8685: checking for pr_sigset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8384 "configure" +#line 8690 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8389,7 +8695,7 @@ int main() { pr_sigset_t avar ; return 0; } EOF -if { (eval echo configure:8393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -8411,12 +8717,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6 echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8415: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:8721: checking for pr_sigaction64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8420 "configure" +#line 8726 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8425,7 +8731,7 @@ int main() { pr_sigaction64_t avar ; return 0; } EOF -if { (eval echo configure:8429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -8447,12 +8753,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6 echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8451: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:8757: checking for pr_siginfo64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8456 "configure" +#line 8762 "configure" #include "confdefs.h" #define _SYSCALL32 @@ -8461,7 +8767,7 @@ int main() { pr_siginfo64_t avar ; return 0; } EOF -if { (eval echo configure:8465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -8488,7 +8794,7 @@ EOF if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 -echo "configure:8492: checking whether prfpregset_t type is broken" >&5 +echo "configure:8798: checking whether prfpregset_t type is broken" >&5 if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8496,7 +8802,7 @@ else gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext <<EOF -#line 8500 "configure" +#line 8806 "configure" #include "confdefs.h" #include <sys/procfs.h> int main () @@ -8506,7 +8812,7 @@ else return 0; } EOF -if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_prfpregset_t_broken=no else @@ -8531,12 +8837,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:8535: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:8841: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8540 "configure" +#line 8846 "configure" #include "confdefs.h" #include <unistd.h> #include <sys/types.h> @@ -8549,7 +8855,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -8573,19 +8879,19 @@ fi if test ${host} = ${target} ; then echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:8577: checking for member l_addr in struct link_map" >&5 +echo "configure:8883: checking for member l_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8582 "configure" +#line 8888 "configure" #include "confdefs.h" #include <link.h> int main() { struct link_map lm; (void) lm.l_addr; ; return 0; } EOF -if { (eval echo configure:8589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -8607,12 +8913,12 @@ EOF echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:8611: checking for member lm_addr in struct link_map" >&5 +echo "configure:8917: checking for member lm_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8616 "configure" +#line 8922 "configure" #include "confdefs.h" #include <sys/types.h> #include <link.h> @@ -8620,7 +8926,7 @@ int main() { struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:8624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -8642,12 +8948,12 @@ EOF echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:8646: checking for member som_addr in struct so_map" >&5 +echo "configure:8952: checking for member som_addr in struct so_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8651 "configure" +#line 8957 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_NLIST_H @@ -8658,7 +8964,7 @@ int main() { struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:8662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -8680,12 +8986,12 @@ EOF echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:8684: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:8990: checking for struct link_map32 in sys/link.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8689 "configure" +#line 8995 "configure" #include "confdefs.h" #define _SYSCALL32 #include <sys/link.h> @@ -8693,7 +8999,7 @@ int main() { struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:8697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -8720,12 +9026,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:8724: checking for long long support in compiler" >&5 +echo "configure:9030: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8729 "configure" +#line 9035 "configure" #include "confdefs.h" int main() { @@ -8735,7 +9041,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -8757,7 +9063,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:8761: checking for long long support in printf" >&5 +echo "configure:9067: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8765,7 +9071,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <<EOF -#line 8769 "configure" +#line 9075 "configure" #include "confdefs.h" int main () { @@ -8779,7 +9085,7 @@ int main () { return (strcmp ("0x0123456789abcdef", buf)); } EOF -if { (eval echo configure:8783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -8803,19 +9109,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:8807: checking for long double support in compiler" >&5 +echo "configure:9113: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8812 "configure" +#line 9118 "configure" #include "confdefs.h" int main() { long double foo; ; return 0; } EOF -if { (eval echo configure:8819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -8837,7 +9143,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:8841: checking for long double support in printf" >&5 +echo "configure:9147: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8845,7 +9151,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <<EOF -#line 8849 "configure" +#line 9155 "configure" #include "confdefs.h" int main () { @@ -8855,7 +9161,7 @@ int main () { return (strncmp ("3.14159", buf, 7)); } EOF -if { (eval echo configure:8859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -8879,7 +9185,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:8883: checking for long double support in scanf" >&5 +echo "configure:9189: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8887,7 +9193,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext <<EOF -#line 8891 "configure" +#line 9197 "configure" #include "confdefs.h" int main () { @@ -8897,7 +9203,7 @@ int main () { return !(f > 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:8901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -8922,7 +9228,7 @@ echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6 case ${host_os} in aix*) echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6 -echo "configure:8926: checking for -bbigtoc option" >&5 +echo "configure:9232: checking for -bbigtoc option" >&5 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8936,14 +9242,14 @@ else LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc cat > conftest.$ac_ext <<EOF -#line 8940 "configure" +#line 9246 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:8947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -8952,6 +9258,7 @@ else gdb_cv_bigtoc= fi rm -f conftest* + LDFLAGS="${SAVE_LDFLAGS}" fi @@ -8966,7 +9273,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:8970: checking for HPUX/OSF thread support" >&5 +echo "configure:9277: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -8989,7 +9296,7 @@ EOF # because version 0 (present on Solaris 2.4 or earlier) doesn't have # the same API. echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:8993: checking for Solaris thread debugging library" >&5 +echo "configure:9300: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -8999,7 +9306,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:9003: checking for dlopen in -ldl" >&5 +echo "configure:9310: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9007,7 +9314,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 9011 "configure" +#line 9318 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -9018,7 +9325,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:9022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9050,17 +9357,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:9054: checking for the ld -export-dynamic flag" >&5 +echo "configure:9361: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <<EOF -#line 9057 "configure" +#line 9364 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:9064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -9079,13 +9386,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in <proc_service.h> # at one point. echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6 -echo "configure:9083: checking if <proc_service.h> is old" >&5 +echo "configure:9390: checking if <proc_service.h> is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9089 "configure" +#line 9396 "configure" #include "confdefs.h" #include <proc_service.h> @@ -9096,7 +9403,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:9100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -9122,12 +9429,12 @@ EOF ;; aix*) echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6 -echo "configure:9126: checking for AiX thread debugging library" >&5 +echo "configure:9433: checking for AiX thread debugging library" >&5 if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9131 "configure" +#line 9438 "configure" #include "confdefs.h" #include <sys/pthdebug.h> int main() { @@ -9136,7 +9443,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:9140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_aix_thread_debug=yes else @@ -9161,19 +9468,19 @@ fi if test "x$ac_cv_header_thread_db_h" = "xyes"; then echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6 -echo "configure:9165: checking whether <thread_db.h> has TD_NOTALLOC" >&5 +echo "configure:9472: checking whether <thread_db.h> has TD_NOTALLOC" >&5 if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9170 "configure" +#line 9477 "configure" #include "confdefs.h" #include <thread_db.h> int main() { int i = TD_NOTALLOC; ; return 0; } EOF -if { (eval echo configure:9177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_thread_db_h_has_td_notalloc=yes else @@ -9198,19 +9505,19 @@ fi if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then echo $ac_n "checking whether <sys/syscall.h> has __NR_tkill""... $ac_c" 1>&6 -echo "configure:9202: checking whether <sys/syscall.h> has __NR_tkill" >&5 +echo "configure:9509: checking whether <sys/syscall.h> has __NR_tkill" >&5 if eval "test \"`echo '$''{'gdb_cv_sys_syscall_h_has_tkill'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9207 "configure" +#line 9514 "configure" #include "confdefs.h" #include <sys/syscall.h> int main() { int i = __NR_tkill; ; return 0; } EOF -if { (eval echo configure:9214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_sys_syscall_h_has_tkill=yes else @@ -9322,7 +9629,7 @@ WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6 -echo "configure:9326: checking compiler warning flags" >&5 +echo "configure:9633: checking compiler warning flags" >&5 # Separate out the -Werror flag as some files just cannot be # compiled with it enabled. for w in ${build_warnings}; do @@ -9332,14 +9639,14 @@ echo "configure:9326: checking compiler warning flags" >&5 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $w" cat > conftest.$ac_ext <<EOF -#line 9336 "configure" +#line 9643 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:9343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* WARN_CFLAGS="${WARN_CFLAGS} $w" else @@ -9357,12 +9664,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:9361: checking for cygwin" >&5 +echo "configure:9668: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9366 "configure" +#line 9673 "configure" #include "confdefs.h" #if defined (__CYGWIN__) || defined (__CYGWIN32__) @@ -9411,7 +9718,14 @@ WIN32LDAPP= -configdir="unix" +case "${host}" in +*-*-cygwin*) + configdir="win" + ;; +*) + configdir="unix" + ;; +esac GDBTKLIBS= if test "${enable_gdbtk}" = "yes"; then @@ -9440,7 +9754,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:9444: checking for Tcl configuration" >&5 +echo "configure:9758: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9549,7 +9863,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:9553: checking for Tk configuration" >&5 +echo "configure:9867: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9616,14 +9930,7 @@ fi # now look for Tcl library stuff - case "${host}" in - *-*-cygwin*) - tcldir=../tcl/win/ - ;; - *) - tcldir=../tcl/unix/ - ;; - esac + tcldir="../tcl/${configdir}/" TCL_DEPS="${tcldir}${TCL_LIB_FILE}" @@ -9658,7 +9965,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:9662: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:9969: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -9724,17 +10031,17 @@ fi if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:9728: checking for tclInt.h" >&5 +echo "configure:10035: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9733 "configure" +#line 10040 "configure" #include "confdefs.h" #include <tclInt.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9794,7 +10101,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:9798: checking for Tk private headers" >&5 +echo "configure:10105: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -9860,17 +10167,17 @@ fi if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:9864: checking for tk.h" >&5 +echo "configure:10171: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 9869 "configure" +#line 10176 "configure" #include "confdefs.h" #include <tk.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9916,7 +10223,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9920: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:10227: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -9939,7 +10246,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:9943: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:10250: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -9964,14 +10271,7 @@ fi # now look for Tk library stuff - case "${host}" in - *-*-cygwin*) - tkdir=../tk/win/ - ;; - *) - tkdir=../tk/unix/ - ;; - esac + tkdir="../tk/${configdir}/" TK_DEPS="${tkdir}${TK_LIB_FILE}" @@ -9994,7 +10294,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:9998: checking for Itcl configuration" >&5 +echo "configure:10298: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10097,7 +10397,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:10101: checking for Itk configuration" >&5 +echo "configure:10401: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10239,7 +10539,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:10243: checking for X" >&5 +echo "configure:10543: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -10301,12 +10601,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 10305 "configure" +#line 10605 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:10310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -10375,14 +10675,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 10379 "configure" +#line 10679 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:10386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -10469,7 +10769,26 @@ else fi - +# Check whether we should enable the TUI, but only do so if we really +# can. +if test x"$enable_tui" = xyes; then + if test -d $srcdir/tui; then + if test "$ac_cv_search_waddstr" != no; then + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" + CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" + CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)" + ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)" + CONFIG_ALL="${CONFIG_ALL} all-tui" + CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui" + CONFIG_INSTALL="${CONFIG_INSTALL} install-tui" + CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui" + else + echo "configure: warning: no enhanced curses library found; disabling TUI" 1>&2 + fi + fi +fi + # Unlike the sim directory, whether a simulator is linked is controlled by # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file. # This code just checks for a few cases where we'd like to ignore those @@ -10521,6 +10840,20 @@ fi +# List of host floatformats. +cat >> confdefs.h <<EOF +#define GDB_HOST_FLOAT_FORMAT $gdb_host_float_format +EOF + +cat >> confdefs.h <<EOF +#define GDB_HOST_DOUBLE_FORMAT $gdb_host_double_format +EOF + +cat >> confdefs.h <<EOF +#define GDB_HOST_LONG_DOUBLE_FORMAT $gdb_host_long_double_format +EOF + + # target_subdir is used by the testsuite to find the target libraries. target_subdir= if test "${host}" != "${target}"; then @@ -10529,22 +10862,19 @@ fi frags= -host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh -if test ! -f ${host_makefile_frag}; then - # When building a native debuger the .mh file containing things - # like NATDEPFILES is needed. Cross debuggers don't need .mh - # since it no longer contains anything useful. - if test "${target}" = "${host}"; then - { echo "configure: error: "*** Gdb does not support native target ${host}"" 1>&2; exit 1; } - else - host_makefile_frag=/dev/null - fi +if test "${target}" = "${host}"; then + host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh + if test ! -f ${host_makefile_frag}; then + { echo "configure: error: "*** Gdb does not support native target ${host}"" 1>&2; exit 1; } + fi + frags="$frags $host_makefile_frag" +else + host_makefile_frag=/dev/null fi -frags="$frags $host_makefile_frag" target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt if test ! -f ${target_makefile_frag}; then -{ echo "configure: error: "*** Gdb does not support target ${target}"" 1>&2; exit 1; } + { echo "configure: error: "*** Gdb does not support target ${target}"" 1>&2; exit 1; } fi frags="$frags $target_makefile_frag" @@ -10557,7 +10887,7 @@ s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p ' ${host_makefile_frag}` targetfile=`sed -n ' -s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p +s/DEPRECATED_TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p ' ${target_makefile_frag}` if test "${target}" = "${host}"; then @@ -10594,7 +10924,7 @@ fi # We only build gdbserver automatically if host and target are the same. if test "x$target" = "x$host"; then echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6 -echo "configure:10598: checking whether gdbserver is supported on this host" >&5 +echo "configure:10928: checking whether gdbserver is supported on this host" >&5 if test "x$build_gdbserver" = xyes; then configdirs="$configdirs gdbserver" echo "$ac_t""yes" 1>&6 @@ -10606,9 +10936,9 @@ fi subdirs="doc testsuite $configdirs" -# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile -# (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty -# version. +# If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or +# nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link +# to an empty version. files= links= @@ -10617,11 +10947,14 @@ rm -f xm.h xm_h="" if test "${hostfile}" != ""; then xm_h=xm.h - GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}" + case "${hostfile}" in + xm-*.h ) GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}" ;; + * ) GDB_XM_FILE="${hostfile}" + esac files="${files} ${GDB_XM_FILE}" links="${links} xm.h" cat >> confdefs.h <<EOF -#define GDB_XM_FILE ${GDB_XM_FILE} +#define GDB_XM_FILE "${GDB_XM_FILE}" EOF fi @@ -10631,11 +10964,14 @@ rm -f tm.h tm_h="" if test "${targetfile}" != ""; then tm_h=tm.h - GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}" + case "${targetfile}" in + tm-*.h ) GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}" ;; + * ) GDB_TM_FILE="${targetfile}" + esac files="${files} ${GDB_TM_FILE}" links="${links} tm.h" cat >> confdefs.h <<EOF -#define GDB_TM_FILE ${GDB_TM_FILE} +#define GDB_TM_FILE "${GDB_TM_FILE}" EOF fi @@ -10645,11 +10981,14 @@ rm -f nm.h nm_h="" if test "${nativefile}" != ""; then nm_h=nm.h - GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" + case "${nativefile}" in + nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;; + * ) GDB_NM_FILE="${nativefile}" + esac files="${files} ${GDB_NM_FILE}" links="${links} nm.h" cat >> confdefs.h <<EOF -#define GDB_NM_FILE ${GDB_NM_FILE} +#define GDB_NM_FILE "${GDB_NM_FILE}" EOF fi @@ -10658,12 +10997,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:10662: checking for Cygwin environment" >&5 +echo "configure:11001: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 10667 "configure" +#line 11006 "configure" #include "confdefs.h" int main() { @@ -10674,7 +11013,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:10678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -10691,19 +11030,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:10695: checking for mingw32 environment" >&5 +echo "configure:11034: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 10700 "configure" +#line 11039 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:10707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -10722,7 +11061,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:10726: checking for executable suffix" >&5 +echo "configure:11065: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10732,10 +11071,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:11075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -10774,7 +11113,7 @@ fi echo $ac_n "checking for iconv""... $ac_c" 1>&6 -echo "configure:10778: checking for iconv" >&5 +echo "configure:11117: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10782,7 +11121,7 @@ else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext <<EOF -#line 10786 "configure" +#line 11125 "configure" #include "confdefs.h" #include <stdlib.h> #include <iconv.h> @@ -10792,7 +11131,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else @@ -10804,7 +11143,7 @@ rm -f conftest* am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat > conftest.$ac_ext <<EOF -#line 10808 "configure" +#line 11147 "configure" #include "confdefs.h" #include <stdlib.h> #include <iconv.h> @@ -10814,7 +11153,7 @@ iconv_t cd = iconv_open("",""); iconv_close(cd); ; return 0; } EOF -if { (eval echo configure:10818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes @@ -10835,13 +11174,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6 EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 -echo "configure:10839: checking for iconv declaration" >&5 +echo "configure:11178: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 10845 "configure" +#line 11184 "configure" #include "confdefs.h" #include <stdlib.h> @@ -10860,7 +11199,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:10864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else @@ -11064,6 +11403,8 @@ s%@GT_NO@%$GT_NO%g s%@GT_YES@%$GT_YES%g s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g s%@l@%$l%g +s%@localedir@%$localedir%g +s%@PACKAGE@%$PACKAGE%g s%@subdirs@%$subdirs%g s%@AWK@%$AWK%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g @@ -11420,16 +11761,8 @@ nativefile=$nativefile EOF cat >> $CONFIG_STATUS <<\EOF -if test "${nativefile}" = ""; then - < Makefile \ - sed -e '/^NATDEPFILES[ ]*=.*\\$/,/[^\\]$/s/^/# /' \ - -e '/^NATDEPFILES[ ]*=/s/^/# /' \ - | sed -e '/^\(NATDEPFILES[ ]*[+]=[ ]*\)/s//# \1/' \ - > Makefile.tem -mv -f Makefile.tem Makefile -fi -sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/, +sed -e '/^DEPRECATED_TM_FILE[ ]*=/s,^DEPRECATED_TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/, /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/, /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp mv -f Makefile.tmp Makefile diff --git a/gnu/usr.bin/binutils/gdb/configure.host b/gnu/usr.bin/binutils/gdb/configure.host index ea13dfa2996..dc27841aeaa 100644 --- a/gnu/usr.bin/binutils/gdb/configure.host +++ b/gnu/usr.bin/binutils/gdb/configure.host @@ -2,8 +2,11 @@ # invoked from the autoconf generated configure script. # This file sets the following shell variables: -# gdb_host_cpu generic name of host's CPU -# gdb_host name of GDB host definition to use +# gdb_host_cpu generic name of host's CPU +# gdb_host name of GDB host definition to use +# gdb_host_float_format host's float floatformat, or 0 +# gdb_host_double_format host's double floatformat, or 0 +# gdb_host_long_double_format host's long double floatformat, or 0 # Map host cpu into the config cpu subdirectory name. # The default is $host_cpu. @@ -36,12 +39,15 @@ alpha*-*-osf1*) gdb_host=alpha-osf1 ;; alpha*-*-osf2*) gdb_host=alpha-osf2 ;; alpha*-*-osf[3456789]*) gdb_host=alpha-osf3 ;; alpha*-*-linux*) gdb_host=alpha-linux ;; -alpha*-*-freebsd*) gdb_host=fbsd ;; -alpha*-*-netbsd*) gdb_host=nbsd ;; +alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + gdb_host=fbsd ;; +alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu) + gdb_host=nbsd ;; alpha*-*-openbsd*) gdb_host=nbsd ;; arm*-*-linux*) gdb_host=linux ;; -arm*-*-netbsdelf*) gdb_host=nbsdelf ;; +arm*-*-netbsdelf* | arm*-*-knetbsd*-gnu) + gdb_host=nbsdelf ;; arm*-*-netbsd*) gdb_host=nbsdaout ;; arm*-*-openbsd*) gdb_host=nbsdelf ;; @@ -50,6 +56,7 @@ hppa*-*-hpux10.20) gdb_host=hpux1020 ;; hppa*64*-*-hpux11*) gdb_host=hpux11w ;; hppa*-*-hpux11*) gdb_host=hpux11 ;; hppa*-*-hpux*) gdb_host=hppahpux ;; +hppa*-*-linux*) gdb_host=linux ;; hppa*-*-openbsd*) gdb_host=obsd ;; i[34567]86-ncr-*) gdb_host=ncr3000 ;; @@ -58,7 +65,6 @@ i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu) gdb_host=fbsd ;; i[34567]86-*-netbsdelf* | i[34567]86-*-knetbsd*-gnu) gdb_host=nbsdelf ;; -i[34567]86-*-freebsd*) gdb_host=fbsd ;; i[34567]86-*-netbsd*) gdb_host=nbsdaout ;; i[34567]86-*-go32*) gdb_host=go32 ;; i[34567]86-*-msdosdjgpp*) gdb_host=go32 ;; @@ -85,43 +91,26 @@ i[34567]86-*-cygwin*) gdb_host=cygwin ;; ia64-*-aix*) gdb_host=aix ;; ia64-*-linux*) gdb_host=linux ;; -# OBSOLETE m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;; -# OBSOLETE m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;; - -# OBSOLETE m68*-att-*) gdb_host=3b1 ;; -# OBSOLETE m68*-bull*-sysv*) gdb_host=dpx2 ;; m68*-*-linux*) gdb_host=linux ;; -# OBSOLETE m68*-*-lynxos*) gdb_host=m68klynx ;; +m68*-*-netbsdelf* | m68*-*-knetbsd*-gnu) + gdb_host=nbsdelf ;; m68*-*-netbsd*) gdb_host=nbsdaout ;; m68*-*-openbsd*) gdb_host=obsd ;; -# OBSOLETE m68*-*-sysv4*) gdb_host=m68kv4 ;; -# OBSOLETE m68*-motorola-*) gdb_host=delta68 ;; -# OBSOLETE m68*-sun-sunos3*) gdb_host=sun3os3 ;; -# OBSOLETE m68*-sun-sunos4*) gdb_host=sun3os4 ;; -# OBSOLETE m68*-sun-*) gdb_host=sun3os4 ;; m88*-*-openbsd*) gdb_host=obsd ;; -# OBSOLETE mips-dec-*) gdb_host=decstation ;; -# OBSOLETE mips-little-*) gdb_host=littlemips ;; mips-sgi-irix5*) gdb_host=irix5 ;; mips-sgi-irix6*) gdb_host=irix6 ;; -# OBSOLETE mips-sony-*) gdb_host=news-mips ;; mips*-*-linux*) gdb_host=linux ;; -mips*-*-netbsd*) gdb_host=nbsd ;; -# OBSOLETE mips-*-mach3*) gdb_host=mipsm3 ;; -# OBSOLETE mips-*-sysv4*) gdb_host=mipsv4 ;; -# OBSOLETE mips-*-sysv*) gdb_host=riscos ;; -# OBSOLETE mips-*-riscos*) gdb_host=riscos ;; +mips*-*-netbsd* | mips*-*-knetbsd*-gnu) + gdb_host=nbsd ;; ns32k-*-netbsd*) gdb_host=nbsdaout ;; -powerpc-*-aix3*) gdb_host=aix ;; -powerpc-*-aix4.[0-2]*) gdb_host=aix ;; -powerpc-*-aix4.3.[0-1]*) gdb_host=aix ;; -powerpc-*-aix*) gdb_host=aix432 ;; +powerpc-*-aix*) gdb_host=aix ;; powerpc-*-linux*) gdb_host=linux ;; -powerpc-*-netbsd*) gdb_host=nbsd ;; +powerpc-*-netbsd* | powerpc-*-knetbsd*-gnu) + gdb_host=nbsd ;; powerpc-*-openbsd*) gdb_host=obsd ;; powerpc64-*-linux*) gdb_host=ppc64-linux ;; @@ -132,31 +121,62 @@ rs6000-*-*) gdb_host=rs6000 ;; s390*-*-*) gdb_host=s390 ;; -sh*-*-netbsdelf*) gdb_host=nbsd ;; +sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu) + gdb_host=nbsd ;; -sparc64-*-freebsd*) gdb_host=fbsd ;; +sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu) + gdb_host=fbsd ;; sparc-*-linux*) gdb_host=linux ;; sparc64-*-linux*) gdb_host=linux64 ;; -sparc-*-netbsdelf*) gdb_host=nbsdelf ;; +sparc-*-netbsdelf* | sparc-*-knetbsd*-gnu) + gdb_host=nbsdelf ;; sparc-*-netbsdaout*) gdb_host=nbsdaout ;; sparc-*-netbsd*) gdb_host=nbsdaout ;; -sparc64-*-netbsd*) gdb_host=nbsd64 ;; +sparc64-*-netbsd* | sparc64-*-knetbsd*-gnu) + gdb_host=nbsd64 ;; sparc-*-openbsd*) gdb_host=nbsdelf ;; sparc64-*-openbsd*) gdb_host=nbsd64 ;; sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*) gdb_host=sol2 ;; +vax-*-bsd*) gdb_host=vax ;; +vax-*-netbsdelf* | vax-*-knetbsd*-gnu) + gdb_host=nbsdelf ;; +vax-*-netbsd*) gdb_host=nbsdaout ;; vax-*-openbsd*) gdb_host=obsd ;; -vax-*-bsd*) gdb_host=vaxbsd ;; -vax-*-ultrix2*) gdb_host=vaxult2 ;; -vax-*-ultrix*) gdb_host=vaxult ;; +vax-*-ultrix*) gdb_host=vax ;; x86_64-*-linux*) gdb_host=linux64 ;; -x86_64-*-freebsd*) gdb_host=fbsd64 ;; -x86_64-*-netbsd*) gdb_host=nbsd64 ;; +x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) + gdb_host=fbsd64 ;; +x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu) + gdb_host=nbsd64 ;; x86_64-*-openbsd*) gdb_host=obsd64 ;; m32r*-*-linux*) gdb_host=linux ;; esac + + + +# Map the host/cpu onto the floatformat correspondong to C's "float", +# "double" and "long double" types. + +case "${host}" in +i[34567]86-*-*) + gdb_host_float_format="&floatformat_ieee_single_little" + gdb_host_double_format="&floatformat_ieee_double_little" + gdb_host_long_double_format="&floatformat_i387_ext" + ;; +hppa*-*-linux*) + gdb_host_float_format="&floatformat_ieee_single_big" + gdb_host_double_format="&floatformat_ieee_double_big" + gdb_host_long_double_format="&floatformat_ieee_double_big" + ;; +*) + gdb_host_float_format=0 + gdb_host_double_format=0 + gdb_host_long_double_format=0 + ;; +esac diff --git a/gnu/usr.bin/binutils/gdb/configure.in b/gnu/usr.bin/binutils/gdb/configure.in index 07a289fb00f..fad4362ed4a 100644 --- a/gnu/usr.bin/binutils/gdb/configure.in +++ b/gnu/usr.bin/binutils/gdb/configure.in @@ -42,10 +42,70 @@ AC_CANONICAL_SYSTEM # 2.5x. AC_CHECK_TOOL(RANLIB, ranlib, :) +dnl List of object files and targets accumulated by configure. + +CONFIG_OBS= +CONFIG_DEPS= +CONFIG_SRCS= +ENABLE_CFLAGS= + +CONFIG_ALL= +CONFIG_CLEAN= +CONFIG_INSTALL= +CONFIG_UNINSTALL= + dnl Set up for gettext. PACKAGE is used when we call bindtextdomain. -ALL_LINGUAS= + CY_GNU_GETTEXT -AC_DEFINE(PACKAGE, "gdb", [Name of this package. ]) + +localedir='${datadir}/locale' +AC_SUBST(localedir) + +if test "x$POSUB" != x; then + + dnl Lifted from GCC's config/gettext.m4. + AC_MSG_CHECKING(for catalogs to be installed) + # Look for .po and .gmo files in the source directory. + CATALOGS= AC_SUBST(CATALOGS) + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac + fi + done + LINGUAS="$XLINGUAS" + AC_MSG_RESULT($LINGUAS) + + CONFIG_ALL="$CONFIG_ALL all-po" + CONFIG_CLEAN="$CONFIG_CLEAN clean-po" + CONFIG_INSTALL="$CONFIG_INSTALL install-po" + CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-po" +fi + +PACKAGE=gdb +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ]) +AC_SUBST(PACKAGE) debugdir=${libdir}/debug @@ -57,17 +117,6 @@ AC_DEFINE_DIR(DEBUGDIR, debugdir, [Global directory for separate debug files. ]) #AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"), -dnl List of object files added by configure. - -CONFIG_OBS= -CONFIG_DEPS= -CONFIG_SRCS= -ENABLE_CFLAGS= -CONFIG_ALL= -CONFIG_CLEAN= -CONFIG_INSTALL= -CONFIG_UNINSTALL= - AC_CONFIG_SUBDIRS(doc testsuite) configdirs= @@ -135,26 +184,6 @@ if test x"$enable_gdbmi" = xyes; then fi fi -# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over -# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host -# Makefile fragments. That's why we need to have `Hcurses' before -# `curses'. I don't see why we should use HP curses if a more -# standard curses is available, except that according to HP's -# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on -# HP-UX 10.10 and 10.20. - -AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses pdcurses], [], - [AC_MSG_WARN([no curses library found])]) - -# Check whether the wborder function is provided by the curses -# library detected above. In certain implementations such as -# the HP/UX Hcurses for instance, this function is provided by an -# additional library. So if we did not find this function inside -# the curses library, try some alternate libraries we know might -# provide it. -AC_SEARCH_LIBS(wborder, [cur_colr], [], - [AC_MSG_WARN([wborder function not found, tui will be disabled])]) - # Enable TUI. AC_ARG_ENABLE(tui, [ --enable-tui enable full-screen terminal user interface (TUI)], @@ -164,21 +193,6 @@ AC_ARG_ENABLE(tui, *) AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;; esac],enable_tui=yes) -if test x"$enable_tui" = xyes; then - if test -d $srcdir/tui; then - if test "$ac_cv_search_initscr" != no -a "$ac_cv_search_wborder" != no; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" - CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)" - CONFIG_ALL="${CONFIG_ALL} all-tui" - CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui" - CONFIG_INSTALL="${CONFIG_INSTALL} install-tui" - CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui" - fi - fi -fi # Enable gdbtk. AC_ARG_ENABLE(gdbtk, @@ -303,9 +317,20 @@ AC_SEARCH_LIBS(gethostbyname, nsl) # Some systems (e.g. Solaris) have `socketpair' in libsocket. AC_SEARCH_LIBS(socketpair, socket) -# Since GDB uses Readline, we need termcap functionality, so we need -# to find a library that provides that. When GDB is configured with -# the TUI, we need full curses functionality. +# For the TUI, we need enhanced curses functionality. +# +# FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied +# curses library because the latter might not provide all the +# functionality we need. However, this leads to problems on systems +# where the linker searches /usr/local/lib, but the compiler doesn't +# search /usr/local/include, if ncurses is installed in /usr/local. A +# default installation of ncurses on alpha*-dec-osf* will lead to such +# a situation. +AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses]) + +# Since GDB uses Readline, we need termcap functionality. In many +# cases this will be provided by the curses library, but some systems +# have a seperate termcap library, or no curses library at all. case $host_os in cygwin*) @@ -316,16 +341,10 @@ case $host_os in go32* | *djgpp*) ac_cv_search_tgetent="none required" ;; - aix*) - # Readline prefers curses over termcap on AIX. - # ??? Why? - AC_SEARCH_LIBS(tgetent, [tinfo ncurses curses termcap]) - ;; esac -# Note: We used to check for libtermlib and libterminfo too, but -# Readline doesn't, so I think we're safe with leaving them out. -AC_SEARCH_LIBS(tgetent, [termcap tinfo ncurses Hcurses curses]) +# These are the libraries checked by Readline. +AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses]) if test "$ac_cv_search_tgetent" = no; then AC_MSG_ERROR([no termcap library found]) @@ -342,7 +361,7 @@ AC_CHECK_HEADERS(link.h) AC_CHECK_HEADERS(machine/reg.h) AC_CHECK_HEADERS(nlist.h) AC_CHECK_HEADERS(poll.h sys/poll.h) -AC_CHECK_HEADERS(proc_service.h thread_db.h) +AC_CHECK_HEADERS(proc_service.h thread_db.h gnu/libc-version.h) AC_CHECK_HEADERS(stddef.h) AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(stdint.h) @@ -358,23 +377,24 @@ AC_CHECK_HEADERS(sys/ptrace.h ptrace.h) AC_CHECK_HEADERS(sys/reg.h sys/debugreg.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/syscall.h) +AC_CHECK_HEADERS(sys/types.h) AC_CHECK_HEADERS(sys/user.h) AC_CHECK_HEADERS(sys/wait.h wait.h) AC_CHECK_HEADERS(termios.h termio.h sgtty.h) AC_CHECK_HEADERS(unistd.h) -# On Solaris 2.[78], we need to define _MSE_INT_H to avoid a clash +# On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash # between <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to # think that we don't have <curses.h> if we're using GCC. case $host_os in - solaris2.[[78]]) + solaris2.[[789]]) if test "$GCC" = yes; then AC_DEFINE(_MSE_INT_H, 1, [[Define to 1 to avoid a clash between <widec.h> and <wchar.h> on - Solaris 2.[78] when using GCC. ]]) + Solaris 2.[789] when using GCC. ]]) fi ;; esac -AC_CHECK_HEADERS(curses.h ncurses.h term.h) +AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h term.h) # FIXME: kettenis/20030102: In most cases we include these # unconditionally, so what's the point in checking these? @@ -392,6 +412,7 @@ AC_MSG_RESULT($gdb_cv_have_struct_stat_with_st_blocks_member) if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS) fi + # ------------------------- # # Checks for declarations. # # ------------------------- # @@ -426,6 +447,71 @@ AC_CHECK_FUNCS(setpgid setpgrp) AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask) AC_CHECK_FUNCS(socketpair) AC_CHECK_FUNCS(syscall) +AC_CHECK_FUNCS(ttrace) +AC_CHECK_FUNCS(wborder) + +# Check the return and argument types of ptrace. No canned test for +# this, so roll our own. +gdb_ptrace_headers=' +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#if HAVE_SYS_PTRACE_H +# include <sys/ptrace.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +' +# There is no point in checking if we don't have a prototype. +gcc_AC_CHECK_DECLS(ptrace, , [ + : ${gdb_cv_func_ptrace_ret='int'} + : ${gdb_cv_func_ptrace_args='int,int,long,long'} +], $gdb_ptrace_headers) +# Check return type. +AC_CACHE_CHECK([return type of ptrace], gdb_cv_func_ptrace_ret, + AC_TRY_COMPILE($gdb_ptrace_headers, + [extern int ptrace ();], + gdb_cv_func_ptrace_ret='int', + gdb_cv_func_ptrace_ret='long')) +AC_DEFINE_UNQUOTED(PTRACE_TYPE_RET, $gdb_cv_func_ptrace_ret, + [Define as the return type of ptrace.]) +# Check argument types. +AC_CACHE_CHECK([types of arguments for ptrace], gdb_cv_func_ptrace_args, [ +for gdb_arg1 in 'int' 'long'; do + for gdb_arg2 in 'pid_t' 'int' 'long'; do + for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long'; do + for gdb_arg4 in 'int' 'long'; do + AC_TRY_COMPILE($gdb_ptrace_headers, [ +extern $gdb_cv_func_ptrace_ret + ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4); +], [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4"; + break 4;]) + for gdb_arg5 in 'int *' 'int' 'long'; do + AC_TRY_COMPILE($gdb_ptrace_headers, [ +extern $gdb_cv_func_ptrace_ret + ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5); +], [ +gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5"; + break 5;]) + done + done + done + done +done +# Provide a safe default value. +: ${gdb_cv_func_ptrace_args='int,int,long,long'} +]) +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift +AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG3, $[3], + [Define to the type of arg 3 for ptrace.]) +if test -n "$[5]"; then + AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG5, $[5], + [Define to the type of arg 5 for ptrace.]) +fi dnl AC_FUNC_SETPGRP does not work when cross compiling dnl Instead, assume we will have a prototype for setpgrp if cross compiling. @@ -488,6 +574,26 @@ if test "$gdb_with_regex" = yes; then [Define to 1 if the regex included in libiberty should be used.]) fi +# See if <sys/proc.h> defines `struct thread' with a td_pcb member. +AC_CACHE_CHECK([for td_pcb in struct thread], gdb_cv_struct_thread_td_pcb, +[AC_TRY_COMPILE([#include <sys/param.h> +#include <sys/proc.h>], [struct thread td; td.td_pcb;], +gdb_cv_struct_thread_td_pcb=yes, gdb_cv_struct_thread_td_pcb=no)]) +if test $gdb_cv_struct_thread_td_pcb = yes; then + AC_DEFINE(HAVE_STRUCT_THREAD_TD_PCB, 1, + [Define to 1 if your system has td_pcb in struct thread.]) +fi + +# See if <sys/lwp.h> defines `struct lwp`. +AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp, +[AC_TRY_COMPILE([#include <sys/param.h> +#include <sys/lwp.h>], [struct lwp l;], +gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)]) +if test $gdb_cv_struct_lwp = yes; then + AC_DEFINE(HAVE_STRUCT_LWP, 1, + [Define to 1 if your system has struct lwp.]) +fi + # See if <machine/reg.h> degines `struct reg'. AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg, [AC_TRY_COMPILE([#include <sys/types.h> @@ -622,6 +728,10 @@ if test "${target}" = "${host}"; then *-*-solaris2.[[6789]]) AC_DEFINE(NEW_PROC_API) ;; + mips-sgi-irix5*) + # Work around <sys/proc.h> needing _KMEMUSER problem on IRIX 5. + AC_DEFINE([_KMEMUSER], 1) + ;; esac fi @@ -852,6 +962,7 @@ aix*) LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=]) + LDFLAGS="${SAVE_LDFLAGS}" ]) CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}" ;; @@ -1114,7 +1225,14 @@ WIN32LDAPP= AC_SUBST(WIN32LIBS) AC_SUBST(WIN32LDAPP) -configdir="unix" +case "${host}" in +*-*-cygwin*) + configdir="win" + ;; +*) + configdir="unix" + ;; +esac GDBTKLIBS= if test "${enable_gdbtk}" = "yes"; then @@ -1133,14 +1251,7 @@ if test "${enable_gdbtk}" = "yes"; then # now look for Tcl library stuff - case "${host}" in - *-*-cygwin*) - tcldir=../tcl/win/ - ;; - *) - tcldir=../tcl/unix/ - ;; - esac + tcldir="../tcl/${configdir}/" TCL_DEPS="${tcldir}${TCL_LIB_FILE}" @@ -1156,14 +1267,7 @@ if test "${enable_gdbtk}" = "yes"; then # now look for Tk library stuff - case "${host}" in - *-*-cygwin*) - tkdir=../tk/win/ - ;; - *) - tkdir=../tk/unix/ - ;; - esac + tkdir="../tk/${configdir}/" TK_DEPS="${tkdir}${TK_LIB_FILE}" @@ -1241,7 +1345,26 @@ AC_SUBST(GDBTK_SRC_DIR) AC_PATH_X - +# Check whether we should enable the TUI, but only do so if we really +# can. +if test x"$enable_tui" = xyes; then + if test -d $srcdir/tui; then + if test "$ac_cv_search_waddstr" != no; then + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" + CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" + CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)" + ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)" + CONFIG_ALL="${CONFIG_ALL} all-tui" + CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui" + CONFIG_INSTALL="${CONFIG_INSTALL} install-tui" + CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui" + else + AC_MSG_WARN([no enhanced curses library found; disabling TUI]) + fi + fi +fi + # Unlike the sim directory, whether a simulator is linked is controlled by # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file. # This code just checks for a few cases where we'd like to ignore those @@ -1286,6 +1409,11 @@ AC_SUBST(CONFIG_CLEAN) AC_SUBST(CONFIG_INSTALL) AC_SUBST(CONFIG_UNINSTALL) +# List of host floatformats. +AC_DEFINE_UNQUOTED(GDB_HOST_FLOAT_FORMAT,$gdb_host_float_format,[Host float floatformat]) +AC_DEFINE_UNQUOTED(GDB_HOST_DOUBLE_FORMAT,$gdb_host_double_format,[Host double floatformat]) +AC_DEFINE_UNQUOTED(GDB_HOST_LONG_DOUBLE_FORMAT,$gdb_host_long_double_format,[Host long double floatformat]) + # target_subdir is used by the testsuite to find the target libraries. target_subdir= if test "${host}" != "${target}"; then @@ -1294,22 +1422,19 @@ fi AC_SUBST(target_subdir) frags= -host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh -if test ! -f ${host_makefile_frag}; then - # When building a native debuger the .mh file containing things - # like NATDEPFILES is needed. Cross debuggers don't need .mh - # since it no longer contains anything useful. - if test "${target}" = "${host}"; then - AC_MSG_ERROR("*** Gdb does not support native target ${host}") - else - host_makefile_frag=/dev/null - fi +if test "${target}" = "${host}"; then + host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh + if test ! -f ${host_makefile_frag}; then + AC_MSG_ERROR("*** Gdb does not support native target ${host}") + fi + frags="$frags $host_makefile_frag" +else + host_makefile_frag=/dev/null fi -frags="$frags $host_makefile_frag" target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt if test ! -f ${target_makefile_frag}; then -AC_MSG_ERROR("*** Gdb does not support target ${target}") + AC_MSG_ERROR("*** Gdb does not support target ${target}") fi frags="$frags $target_makefile_frag" @@ -1323,7 +1448,7 @@ s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p ' ${host_makefile_frag}` targetfile=`sed -n ' -s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p +s/DEPRECATED_TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p ' ${target_makefile_frag}` if test "${target}" = "${host}"; then @@ -1365,9 +1490,9 @@ fi AC_CONFIG_SUBDIRS($configdirs) -# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile -# (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty -# version. +# If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or +# nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link +# to an empty version. files= links= @@ -1376,10 +1501,13 @@ rm -f xm.h xm_h="" if test "${hostfile}" != ""; then xm_h=xm.h - GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}" + case "${hostfile}" in + xm-*.h ) GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}" ;; + * ) GDB_XM_FILE="${hostfile}" + esac files="${files} ${GDB_XM_FILE}" links="${links} xm.h" - AC_DEFINE_UNQUOTED(GDB_XM_FILE, ${GDB_XM_FILE}) + AC_DEFINE_UNQUOTED(GDB_XM_FILE, "${GDB_XM_FILE}") fi AC_SUBST(xm_h) @@ -1387,10 +1515,13 @@ rm -f tm.h tm_h="" if test "${targetfile}" != ""; then tm_h=tm.h - GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}" + case "${targetfile}" in + tm-*.h ) GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}" ;; + * ) GDB_TM_FILE="${targetfile}" + esac files="${files} ${GDB_TM_FILE}" links="${links} tm.h" - AC_DEFINE_UNQUOTED(GDB_TM_FILE, ${GDB_TM_FILE}) + AC_DEFINE_UNQUOTED(GDB_TM_FILE, "${GDB_TM_FILE}") fi AC_SUBST(tm_h) @@ -1398,10 +1529,13 @@ rm -f nm.h nm_h="" if test "${nativefile}" != ""; then nm_h=nm.h - GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" + case "${nativefile}" in + nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;; + * ) GDB_NM_FILE="${nativefile}" + esac files="${files} ${GDB_NM_FILE}" links="${links} nm.h" - AC_DEFINE_UNQUOTED(GDB_NM_FILE, ${GDB_NM_FILE}) + AC_DEFINE_UNQUOTED(GDB_NM_FILE, "${GDB_NM_FILE}") fi AC_SUBST(nm_h) @@ -1427,17 +1561,9 @@ AC_OUTPUT(Makefile .gdbinit:gdbinit.in, dnl Autoconf doesn't provide a mechanism for modifying definitions dnl provided by makefile fragments. dnl -if test "${nativefile}" = ""; then - < Makefile \ - sed -e '/^NATDEPFILES[[ ]]*=.*\\$/,/[[^\\]]$/s/^/# /' \ - -e '/^NATDEPFILES[[ ]]*=/s/^/# /' \ - | sed -e '/^\(NATDEPFILES[[ ]]*[[+]]=[[ ]]*\)/s//# \1/' \ - > Makefile.tem -mv -f Makefile.tem Makefile -fi changequote(,)dnl -sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/, +sed -e '/^DEPRECATED_TM_FILE[ ]*=/s,^DEPRECATED_TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/, /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/, /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp mv -f Makefile.tmp Makefile diff --git a/gnu/usr.bin/binutils/gdb/configure.tgt b/gnu/usr.bin/binutils/gdb/configure.tgt index 6767ed8e4a2..bc70fbe0a6b 100644 --- a/gnu/usr.bin/binutils/gdb/configure.tgt +++ b/gnu/usr.bin/binutils/gdb/configure.tgt @@ -38,12 +38,15 @@ esac case "${target}" in -x86_64-*-freebsd*) gdb_target=fbsd64 ;; -*-*-freebsd*) gdb_target=fbsd ;; +x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) + gdb_target=fbsd64 ;; +*-*-freebsd* | *-*-kfreebsd*-gnu) + gdb_target=fbsd ;; alpha*-*-osf*) gdb_target=alpha-osf1 ;; alpha*-*-linux*) gdb_target=alpha-linux ;; -alpha*-*-netbsd*) gdb_target=nbsd ;; +alpha*-*-netbsd* | alpha*-*-knetbsd*-gnu) + gdb_target=nbsd ;; alpha*-*-openbsd*) gdb_target=nbsd ;; alpha*-*-*) gdb_target=alpha ;; @@ -51,7 +54,8 @@ arm*-wince-pe) gdb_target=wince ;; arm*-*-linux*) gdb_target=linux build_gdbserver=yes ;; -arm*-*-netbsd*) gdb_target=nbsd ;; +arm*-*-netbsd* | arm*-*-knetbsd*-gnu) + gdb_target=nbsd ;; arm*-*-openbsd*) gdb_target=nbsd ;; arm-*-nto*) gdb_target=nto ;; arm*-*-* | thumb*-*-* | strongarm*-*-*) @@ -76,30 +80,26 @@ frv-*-*) gdb_target=frv ;; hppa*64*-*-hpux11*) gdb_target=hppa64 ;; hppa*-*-hpux*) gdb_target=hppahpux ;; hppa*-*-hiux*) gdb_target=hppahpux ;; -hppa*-*-*) gdb_target=obsd ;; +hppa*-*-linux*) gdb_target=linux ;; +hppa*-*-openbsd*) gdb_target=obsd ;; hppa*-*-*) gdb_target=hppa ;; i[34567]86-ncr-*) gdb_target=ncr3000 ;; i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu) gdb_target=nbsd ;; i[34567]86-*-openbsd*) gdb_target=obsd ;; -i[34567]86-*-go32*) gdb_target=i386aout ;; -i[34567]86-*-msdosdjgpp*) gdb_target=go32 ;; i[34567]86-*-nto*) gdb_target=nto ;; i[34567]86-*-lynxos*) gdb_target=i386lynx ;; i[34567]86-*-solaris*) gdb_target=i386sol2 ;; -i[34567]86-*-sco*) gdb_target=i386v ;; -i[34567]86-*-sysv*) gdb_target=i386v ;; i[34567]86-*-linux*) gdb_target=linux build_gdbserver=yes ;; -i[34567]86-*-isc*) gdb_target=i386v ;; i[34567]86-*-gnu*) gdb_target=i386gnu ;; -i[34567]86-*-netware*) gdb_target=i386nw - configdirs="${configdirs} nlm" ;; +i[34567]86-*-netware*) gdb_target=i386 + configdirs="${configdirs} nlm" ;; i[34567]86-*-cygwin*) gdb_target=cygwin ;; i[34567]86-*-vxworks*) gdb_target=vxworks ;; -i[34567]86-*-*) gdb_target=embed ;; +i[34567]86-*-*) gdb_target=i386 ;; ia64-*-aix*) gdb_target=aix ;; ia64-*-linux*) gdb_target=linux @@ -107,17 +107,12 @@ ia64-*-linux*) gdb_target=linux ;; ia64*-*-*) gdb_target=ia64 ;; -m32r-*-*) gdb_target=m32r ;; +m32r*-*-linux*) gdb_target=linux ;; +m32r*-*-*) gdb_target=m32r ;; m68hc11*-*-*|m6811*-*-*) gdb_target=m68hc11 ;; -# OBSOLETE m68000-*-sunos3*) gdb_target=sun2os3 ;; -# OBSOLETE m68000-*-sunos4*) gdb_target=sun2os4 ;; - -# OBSOLETE m68*-bull-sysv*) gdb_target=dpx2 ;; -# OBSOLETE m68*-att-*) gdb_target=3b1 ;; m68*-cisco*-*) gdb_target=cisco ;; -# OBSOLETE m68*-motorola-*) gdb_target=delta68 ;; m68*-netx-*) gdb_target=vxworks68 ;; m68*-tandem-*) gdb_target=st2000 ;; m68*-*-aout*) gdb_target=monitor ;; @@ -126,13 +121,10 @@ m68*-*-elf*) gdb_target=monitor ;; m68*-*-linux*) gdb_target=linux build_gdbserver=yes ;; -# OBSOLETE m68*-*-lynxos*) gdb_target=m68klynx ;; -m68*-*-netbsd*) gdb_target=nbsdaout ;; +m68*-*-netbsd* | m68*-*-knetbsd*-gnu) + gdb_target=nbsd ;; m68*-*-openbsd*) gdb_target=obsd ;; m68*-*-os68k*) gdb_target=os68k ;; -# OBSOLETE m68*-*-sunos3*) gdb_target=sun3os3 ;; -# OBSOLETE m68*-*-sunos4*) gdb_target=sun3os4 ;; -# OBSOLETE m68*-*-sysv4*) gdb_target=m68kv4 ;; m68*-*-uclinux*) gdb_target=monitor ;; m68*-*-vxworks*) gdb_target=vxworks68 ;; @@ -146,8 +138,8 @@ mips*-sgi-irix6*) gdb_target=irix6 ;; mips*-*-linux*) gdb_target=linux build_gdbserver=yes ;; -mips*-*-netbsd*) gdb_target=nbsd ;; -# OBSOLETE mips*-*-sysv4*) gdb_target=mipsv4 ;; +mips*-*-netbsd* | mips*-*-knetbsd*-gnu) + gdb_target=nbsd ;; mips*-*-vxworks*) gdb_target=vxmips ;; mips*-*-*) gdb_target=embed ;; @@ -155,7 +147,8 @@ mn10300-*-*) gdb_target=mn10300 ;; ns32k-*-netbsd*) gdb_target=nbsdaout ;; -powerpc-*-netbsd*) gdb_target=nbsd ;; +powerpc-*-netbsd* | powerpc-*-knetbsd*-gnu) + gdb_target=nbsd ;; powerpc-*-openbsd*) gdb_target=obsd ;; powerpc-*-aix*) gdb_target=aix ;; powerpc-*-linux*) gdb_target=linux @@ -184,14 +177,17 @@ sh-*-elf*) gdb_target=embed ;; sh-*-linux*) gdb_target=linux build_gdbserver=yes ;; -sh*-*-netbsdelf*) gdb_target=nbsd ;; +sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu) + gdb_target=nbsd ;; sh-*-nto*) gdb_target=nto ;; sh*) gdb_target=embed ;; sparc-*-linux*) gdb_target=linux ;; sparc64-*-linux*) gdb_target=linux64 ;; -sparc-*-netbsd*) gdb_target=nbsd ;; -sparc64-*-netbsd*) gdb_target=nbsd64 ;; +sparc-*-netbsd* | sparc-*-knetbsd*-gnu) + gdb_target=nbsd ;; +sparc64-*-netbsd* | sparc64-*-knetbsd*-gnu) + gdb_target=nbsd64 ;; sparc-*-openbsd*) gdb_target=obsd ;; sparc64-*-openbsd*) gdb_target=obsd64 ;; sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) @@ -206,6 +202,8 @@ sparc64-*-*) gdb_target=sparc64 ;; xstormy16-*-*) gdb_target=xstormy16 ;; +vax-*-netbsd* | vax-*-knetbsd*-gnu) + gdb_target=nbsd ;; vax-*-openbsd*) gdb_target=nbsd ;; vax-*-*) gdb_target=vax ;; @@ -220,7 +218,8 @@ v850*-*-*) gdb_target=v850 x86_64-*-linux*) gdb_target=linux64 build_gdbserver=yes ;; -x86_64-*-netbsd*) gdb_target=nbsd64 ;; +x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu) + gdb_target=nbsd64 ;; x86_64-*-openbsd*) gdb_target=obsd64 ;; esac @@ -229,9 +228,10 @@ esac case "${target}" in *-*-linux*) gdb_osabi=GDB_OSABI_LINUX ;; -*-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;; *-*-nto*) gdb_osabi=GDB_OSABI_QNXNTO ;; m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;; *-*-openbsd*) gdb_osabi=GDB_OSABI_OPENBSD_ELF ;; *-*-solaris*) gdb_osabi=GDB_OSABI_SOLARIS ;; +*-*-*-gnu*) ;; # prevent non-GNU kernels to match the Hurd rule below +*-*-gnu*) gdb_osabi=GDB_OSABI_HURD ;; esac diff --git a/gnu/usr.bin/binutils/gdb/core-aout.c b/gnu/usr.bin/binutils/gdb/core-aout.c index 0329302dc1e..659c8180f19 100644 --- a/gnu/usr.bin/binutils/gdb/core-aout.c +++ b/gnu/usr.bin/binutils/gdb/core-aout.c @@ -37,16 +37,14 @@ #include <sys/types.h> #include <sys/param.h> #include "gdbcore.h" -#include "value.h" /* For supply_register. */ +#include "value.h" #include "regcache.h" /* These are needed on various systems to expand REGISTER_U_ADDR. */ -#ifndef USG #include "gdb_dirent.h" #include <sys/file.h> #include "gdb_stat.h" #include <sys/user.h> -#endif #ifndef CORE_REGISTER_ADDR #define CORE_REGISTER_ADDR(regno, regptr) register_addr(regno, regptr) @@ -99,7 +97,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, && bad_reg < 0) bad_reg = regno; else - supply_register (regno, core_reg_sect + addr); + regcache_raw_supply (current_regcache, regno, core_reg_sect + addr); } if (bad_reg >= 0) @@ -142,5 +140,5 @@ static struct core_fns aout_core_fns = void _initialize_core_aout (void) { - add_core_fns (&aout_core_fns); + deprecated_add_core_fns (&aout_core_fns); } diff --git a/gnu/usr.bin/binutils/gdb/core-regset.c b/gnu/usr.bin/binutils/gdb/core-regset.c index 0600837e1a0..529c51f7c21 100644 --- a/gnu/usr.bin/binutils/gdb/core-regset.c +++ b/gnu/usr.bin/binutils/gdb/core-regset.c @@ -115,5 +115,5 @@ extern void _initialize_core_regset (void); void _initialize_core_regset (void) { - add_core_fns (®set_core_fns); + deprecated_add_core_fns (®set_core_fns); } diff --git a/gnu/usr.bin/binutils/gdb/corefile.c b/gnu/usr.bin/binutils/gdb/corefile.c index 572b4486cd4..91519b97f63 100644 --- a/gnu/usr.bin/binutils/gdb/corefile.c +++ b/gnu/usr.bin/binutils/gdb/corefile.c @@ -41,17 +41,18 @@ extern void _initialize_core (void); static void call_extra_exec_file_hooks (char *filename); -/* You can have any number of hooks for `exec_file_command' command to call. - If there's only one hook, it is set in exec_file_display hook. - If there are two or more hooks, they are set in exec_file_extra_hooks[], - and exec_file_display_hook is set to a function that calls all of them. - This extra complexity is needed to preserve compatibility with - old code that assumed that only one hook could be set, and which called - exec_file_display_hook directly. */ +/* You can have any number of hooks for `exec_file_command' command to + call. If there's only one hook, it is set in exec_file_display + hook. If there are two or more hooks, they are set in + exec_file_extra_hooks[], and deprecated_exec_file_display_hook is + set to a function that calls all of them. This extra complexity is + needed to preserve compatibility with old code that assumed that + only one hook could be set, and which called + deprecated_exec_file_display_hook directly. */ typedef void (*hook_type) (char *); -hook_type exec_file_display_hook; /* the original hook */ +hook_type deprecated_exec_file_display_hook; /* the original hook */ static hook_type *exec_file_extra_hooks; /* array of additional hooks */ static int exec_file_hook_count = 0; /* size of array */ @@ -100,7 +101,7 @@ specify_exec_file_hook (void (*hook) (char *)) { hook_type *new_array; - if (exec_file_display_hook != NULL) + if (deprecated_exec_file_display_hook != NULL) { /* There's already a hook installed. Arrange to have both it * and the subsequent hooks called. */ @@ -108,8 +109,8 @@ specify_exec_file_hook (void (*hook) (char *)) { /* If this is the first extra hook, initialize the hook array. */ exec_file_extra_hooks = (hook_type *) xmalloc (sizeof (hook_type)); - exec_file_extra_hooks[0] = exec_file_display_hook; - exec_file_display_hook = call_extra_exec_file_hooks; + exec_file_extra_hooks[0] = deprecated_exec_file_display_hook; + deprecated_exec_file_display_hook = call_extra_exec_file_hooks; exec_file_hook_count = 1; } @@ -124,7 +125,7 @@ specify_exec_file_hook (void (*hook) (char *)) exec_file_extra_hooks[exec_file_hook_count - 1] = hook; } else - exec_file_display_hook = hook; + deprecated_exec_file_display_hook = hook; } /* The exec file must be closed before running an inferior. @@ -449,7 +450,7 @@ No arg means have no core file. This command has been superseded by the\n\ Use `set gnutarget auto' to specify automatic detection.", &setlist); set_cmd_sfunc (c, set_gnutarget_command); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); if (getenv ("GNUTARGET")) set_gnutarget (getenv ("GNUTARGET")); diff --git a/gnu/usr.bin/binutils/gdb/corelow.c b/gnu/usr.bin/binutils/gdb/corelow.c index 94b91ccdd61..f91ec590ad0 100644 --- a/gnu/usr.bin/binutils/gdb/corelow.c +++ b/gnu/usr.bin/binutils/gdb/corelow.c @@ -43,16 +43,20 @@ #include "symfile.h" #include "exec.h" #include "readline/readline.h" - +#include "observer.h" #include "gdb_assert.h" #ifndef O_BINARY #define O_BINARY 0 #endif -/* List of all available core_fns. On gdb startup, each core file register - reader calls add_core_fns() to register information on each core format it - is prepared to read. */ +#ifndef O_LARGEFILE +#define O_LARGEFILE 0 +#endif + +/* List of all available core_fns. On gdb startup, each core file + register reader calls deprecated_add_core_fns() to register + information on each core format it is prepared to read. */ static struct core_fns *core_file_fns = NULL; @@ -104,7 +108,7 @@ struct target_ops core_ops; handle. */ void -add_core_fns (struct core_fns *cf) +deprecated_add_core_fns (struct core_fns *cf) { cf->next = core_file_fns; core_file_fns = cf; @@ -280,6 +284,7 @@ core_open (char *filename, int from_tty) bfd *temp_bfd; int ontop; int scratch_chan; + int flags; target_preopen (from_tty); if (!filename) @@ -299,7 +304,12 @@ core_open (char *filename, int from_tty) old_chain = make_cleanup (xfree, filename); - scratch_chan = open (filename, O_BINARY | ( write_files ? O_RDWR : O_RDONLY ), 0); + flags = O_BINARY | O_LARGEFILE; + if (write_files) + flags |= O_RDWR; + else + flags |= O_RDONLY; + scratch_chan = open (filename, flags, 0); if (scratch_chan < 0) perror_with_name (filename); @@ -355,6 +365,10 @@ core_open (char *filename, int from_tty) ontop = !push_target (&core_ops); discard_cleanups (old_chain); + /* This is done first, before anything has a chance to query the + inferior for information such as symbols. */ + observer_notify_inferior_created (&core_ops, from_tty); + p = bfd_core_file_failing_command (core_bfd); if (p) printf_filtered ("Core was generated by `%s'.\n", p); @@ -388,8 +402,7 @@ core_open (char *filename, int from_tty) /* Now, set up the frame cache, and print the top of stack. */ flush_cached_frames (); select_frame (get_current_frame ()); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); } else { @@ -525,11 +538,11 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, { case TARGET_OBJECT_MEMORY: if (readbuf) - return (*ops->to_xfer_memory) (offset, readbuf, len, 0/*write*/, - NULL, ops); + return (*ops->deprecated_xfer_memory) (offset, readbuf, len, + 0/*write*/, NULL, ops); if (writebuf) - return (*ops->to_xfer_memory) (offset, readbuf, len, 1/*write*/, - NULL, ops); + return (*ops->deprecated_xfer_memory) (offset, readbuf, len, + 1/*write*/, NULL, ops); return -1; case TARGET_OBJECT_AUXV: @@ -552,9 +565,9 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, size -= offset; if (size > len) size = len; - if (size > 0 && - ! bfd_get_section_contents (core_bfd, section, readbuf, - (file_ptr) offset, size)) + if (size > 0 + && !bfd_get_section_contents (core_bfd, section, readbuf, + (file_ptr) offset, size)) { warning ("Couldn't read NT_AUXV note in core file."); return -1; @@ -566,34 +579,34 @@ core_xfer_partial (struct target_ops *ops, enum target_object object, case TARGET_OBJECT_WCOOKIE: if (readbuf) - { - /* When the StackGhost cookie is stored in core file, BFD - represents this with a fake section called ".wcookie". */ - - struct bfd_section *section; - bfd_size_type size; - char *contents; - - section = bfd_get_section_by_name (core_bfd, ".wcookie"); - if (section == NULL) - return -1; - - size = bfd_section_size (core_bfd, section); - if (offset >= size) - return 0; - size -= offset; - if (size > len) - size = len; - if (size > 0 - && !bfd_get_section_contents (core_bfd, section, readbuf, - (file_ptr) offset, size)) - { - warning ("Couldn't read StackGhost cookie in core file."); - return -1; - } - - return size; - } + { + /* When the StackGhost cookie is stored in core file, BFD + represents this with a fake section called ".wcookie". */ + + struct bfd_section *section; + bfd_size_type size; + char *contents; + + section = bfd_get_section_by_name (core_bfd, ".wcookie"); + if (section == NULL) + return -1; + + size = bfd_section_size (core_bfd, section); + if (offset >= size) + return 0; + size -= offset; + if (size > len) + size = len; + if (size > 0 + && !bfd_get_section_contents (core_bfd, section, readbuf, + (file_ptr) offset, size)) + { + warning ("Couldn't read StackGhost cookie in core file."); + return -1; + } + + return size; + } return -1; default: @@ -642,7 +655,7 @@ init_core_ops (void) core_ops.to_detach = core_detach; core_ops.to_fetch_registers = get_core_registers; core_ops.to_xfer_partial = core_xfer_partial; - core_ops.to_xfer_memory = xfer_memory; + core_ops.deprecated_xfer_memory = xfer_memory; core_ops.to_files_info = core_files_info; core_ops.to_insert_breakpoint = ignore; core_ops.to_remove_breakpoint = ignore; diff --git a/gnu/usr.bin/binutils/gdb/cp-valprint.c b/gnu/usr.bin/binutils/gdb/cp-valprint.c index 42a48f55676..6f9bb353f5f 100644 --- a/gnu/usr.bin/binutils/gdb/cp-valprint.c +++ b/gnu/usr.bin/binutils/gdb/cp-valprint.c @@ -36,10 +36,6 @@ #include "cp-abi.h" #include "valprint.h" -/* Indication of presence of HP-compiled object files */ -extern int hp_som_som_object_present; /* defined in symtab.c */ - - int vtblprint; /* Controls printing of vtbl's */ int objectprint; /* Controls looking up an object's derived type using what we find in its vtables. */ @@ -115,7 +111,7 @@ cp_print_class_method (char *valaddr, if (sym == 0) { /* 1997-08-01 Currently unsupported with HP aCC */ - if (hp_som_som_object_present) + if (deprecated_hp_som_som_object_present) { fputs_filtered ("?? <not supported with HP aCC>", stream); return; @@ -808,7 +804,7 @@ cp_print_hpacc_virtual_table_entries (struct type *type, int *vfuncs, void _initialize_cp_valprint (void) { - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("static-members", class_support, var_boolean, (char *) &static_field_print, "Set printing of C++ static members.", @@ -817,13 +813,13 @@ _initialize_cp_valprint (void) /* Turn on printing of static fields. */ static_field_print = 1; - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("vtbl", class_support, var_boolean, (char *) &vtblprint, "Set printing of C++ virtual function tables.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("object", class_support, var_boolean, (char *) &objectprint, "Set printing of object's derived type based on vtable info.", &setprintlist), diff --git a/gnu/usr.bin/binutils/gdb/cpu32bug-rom.c b/gnu/usr.bin/binutils/gdb/cpu32bug-rom.c index 03b31321577..1d1f8500c51 100644 --- a/gnu/usr.bin/binutils/gdb/cpu32bug-rom.c +++ b/gnu/usr.bin/binutils/gdb/cpu32bug-rom.c @@ -142,7 +142,7 @@ init_cpu32bug_cmds (void) cpu32bug_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ cpu32bug_cmds.dump_registers = "rd\r"; /* dump_registers */ cpu32bug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ - cpu32bug_cmds.supply_register = cpu32bug_supply_register; /* supply_register */ + cpu32bug_cmds.supply_register = cpu32bug_supply_register; cpu32bug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ cpu32bug_cmds.load = "lo\r"; /* download command */ cpu32bug_cmds.loadresp = "\n"; /* load response */ diff --git a/gnu/usr.bin/binutils/gdb/dbug-rom.c b/gnu/usr.bin/binutils/gdb/dbug-rom.c index a592334ea05..075f01a58f4 100644 --- a/gnu/usr.bin/binutils/gdb/dbug-rom.c +++ b/gnu/usr.bin/binutils/gdb/dbug-rom.c @@ -140,7 +140,7 @@ init_dbug_cmds (void) dbug_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ dbug_cmds.dump_registers = "rd\r"; /* dump_registers */ dbug_cmds.register_pattern = "\\(\\w+\\) +:\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ - dbug_cmds.supply_register = dbug_supply_register; /* supply_register */ + dbug_cmds.supply_register = dbug_supply_register; dbug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ dbug_cmds.load = "dl\r"; /* download command */ dbug_cmds.loadresp = "\n"; /* load response */ diff --git a/gnu/usr.bin/binutils/gdb/dbxread.c b/gnu/usr.bin/binutils/gdb/dbxread.c index efbbf2ac695..32db167c375 100644 --- a/gnu/usr.bin/binutils/gdb/dbxread.c +++ b/gnu/usr.bin/binutils/gdb/dbxread.c @@ -37,7 +37,7 @@ #include "defs.h" #include "gdb_string.h" -#if defined(USG) || defined(__CYGNUSCLIB__) +#if defined(__CYGNUSCLIB__) #include <sys/types.h> #include <fcntl.h> #endif @@ -54,7 +54,6 @@ #include "stabsread.h" #include "gdb-stabs.h" #include "demangle.h" -#include "language.h" /* Needed for local_hex_string */ #include "complaints.h" #include "cp-abi.h" #include "gdb_assert.h" @@ -625,7 +624,7 @@ dbx_symfile_init (struct objfile *objfile) /* Allocate struct to keep track of the symfile */ objfile->sym_stab_info = (struct dbx_symfile_info *) - xmmalloc (objfile->md, sizeof (struct dbx_symfile_info)); + xmalloc (sizeof (struct dbx_symfile_info)); memset (objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info)); DBX_TEXT_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".text"); @@ -748,7 +747,7 @@ dbx_symfile_finish (struct objfile *objfile) } xfree (hfiles); } - xmfree (objfile->md, objfile->sym_stab_info); + xfree (objfile->sym_stab_info); } free_header_files (); } @@ -892,7 +891,7 @@ init_bincl_list (int number, struct objfile *objfile) { bincls_allocated = number; next_bincl = bincl_list = (struct header_file_location *) - xmmalloc (objfile->md, bincls_allocated * sizeof (struct header_file_location)); + xmalloc (bincls_allocated * sizeof (struct header_file_location)); } /* Add a bincl to the list. */ @@ -905,8 +904,8 @@ add_bincl_to_list (struct partial_symtab *pst, char *name, int instance) int offset = next_bincl - bincl_list; bincls_allocated *= 2; bincl_list = (struct header_file_location *) - xmrealloc (pst->objfile->md, (char *) bincl_list, - bincls_allocated * sizeof (struct header_file_location)); + xrealloc ((char *) bincl_list, + bincls_allocated * sizeof (struct header_file_location)); next_bincl = bincl_list + offset; } next_bincl->pst = pst; @@ -937,7 +936,7 @@ find_corresponding_bincl_psymtab (char *name, int instance) static void free_bincl_list (struct objfile *objfile) { - xmfree (objfile->md, bincl_list); + xfree (bincl_list); bincls_allocated = 0; } @@ -1358,12 +1357,6 @@ read_dbx_symtab (struct objfile *objfile) || (namestring[(nsl = strlen (namestring)) - 1] == 'o' && namestring[nsl - 2] == '.')) { - if (objfile->ei.entry_point < nlist.n_value && - objfile->ei.entry_point >= last_o_file_start) - { - objfile->ei.deprecated_entry_file_lowpc = last_o_file_start; - objfile->ei.deprecated_entry_file_highpc = nlist.n_value; - } if (past_first_source_file && pst /* The gould NP1 uses low values for .o and -l symbols which are not the address. */ @@ -1463,6 +1456,7 @@ read_dbx_symtab (struct objfile *objfile) static int prev_so_symnum = -10; static int first_so_symnum; char *p; + static char *dirname_nso; int prev_textlow_not_set; valu = nlist.n_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -1520,18 +1514,27 @@ read_dbx_symtab (struct objfile *objfile) p = strrchr (namestring, '/'); if (p && *(p + 1) == '\000') - continue; /* Simply ignore directory name SOs */ + { + /* Save the directory name SOs locally, then save it into + the psymtab when it's created below. */ + dirname_nso = namestring; + continue; + } /* Some other compilers (C++ ones in particular) emit useless SOs for non-existant .c files. We ignore all subsequent SOs that immediately follow the first. */ if (!pst) + { pst = start_psymtab (objfile, namestring, valu, first_so_symnum * symbol_size, objfile->global_psymbols.next, objfile->static_psymbols.next); + pst->dirname = dirname_nso; + dirname_nso = NULL; + } continue; } @@ -2093,22 +2096,12 @@ read_dbx_symtab (struct objfile *objfile) default: /* If we haven't found it yet, ignore it. It's probably some new type we don't know about yet. */ - unknown_symtype_complaint (local_hex_string (nlist.n_type)); + unknown_symtype_complaint (hex_string (nlist.n_type)); continue; } } /* If there's stuff to be cleaned up, clean it up. */ - if (DBX_SYMCOUNT (objfile) > 0 /* We have some syms */ - /*FIXME, does this have a bug at start address 0? */ - && last_o_file_start - && objfile->ei.entry_point < nlist.n_value - && objfile->ei.entry_point >= last_o_file_start) - { - objfile->ei.deprecated_entry_file_lowpc = last_o_file_start; - objfile->ei.deprecated_entry_file_highpc = nlist.n_value; - } - if (pst) { /* Don't set pst->texthigh lower than it already is. */ @@ -2654,17 +2647,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, struct section_offsets *section_offsets, struct objfile *objfile) { -#ifdef SUN_FIXED_LBRAC_BUG - /* If SUN_FIXED_LBRAC_BUG is defined, then it tells us whether we need - to correct the address of N_LBRAC's. If it is not defined, then - we never need to correct the addresses. */ - - /* This records the last pc address we've seen. We depend on there being - an SLINE or FUN or SO before the first LBRAC, since the variable does - not get reset in between reads of different symbol files. */ - static CORE_ADDR last_pc_address; -#endif - struct context_stack *new; /* This remembers the address of the start of a function. It is used because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries are @@ -2772,14 +2754,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, N_SO, the linker did not relocate them (sigh). */ valu += last_source_start_addr; -#ifdef SUN_FIXED_LBRAC_BUG - if (!SUN_FIXED_LBRAC_BUG && valu < last_pc_address) - { - /* Patch current LBRAC pc value to match last handy pc value */ - complaint (&symfile_complaints, "bad block start address patched"); - valu = last_pc_address; - } -#endif new = push_context (desc, valu); break; @@ -2893,18 +2867,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, n_opt_found = 0; -#ifdef SUN_FIXED_LBRAC_BUG - last_pc_address = valu; /* Save for SunOS bug circumcision */ -#endif - -#ifdef PCC_SOL_BROKEN - /* pcc bug, occasionally puts out SO for SOL. */ - if (context_stack_depth > 0) - { - start_subfile (name, NULL); - break; - } -#endif if (last_source_file) { /* Check if previous symbol was also an N_SO (with some @@ -2965,9 +2927,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, /* Relocate for dynamic loading and for ELF acc fn-relative syms. */ valu += function_start_offset; -#ifdef SUN_FIXED_LBRAC_BUG - last_pc_address = valu; /* Save for SunOS bug circumcision */ -#endif /* If this is the first SLINE note in the function, record it at the start of the function instead of at the listed location. */ if (within_function && sline_found_in_function == 0) @@ -3078,7 +3037,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, case N_NBBSS: case N_NBSTS: case N_NBLCS: - unknown_symtype_complaint (local_hex_string (type)); + unknown_symtype_complaint (hex_string (type)); /* FALLTHROUGH */ /* The following symbol types don't need the address field relocated, @@ -3127,56 +3086,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, } #endif -#ifdef SUN_FIXED_LBRAC_BUG - /* The Sun acc compiler, under SunOS4, puts out - functions with N_GSYM or N_STSYM. The problem is - that the address of the symbol is no good (for N_GSYM - it doesn't even attept an address; for N_STSYM it - puts out an address but then it gets relocated - relative to the data segment, not the text segment). - Currently we can't fix this up later as we do for - some types of symbol in scan_file_globals. - Fortunately we do have a way of finding the address - - we know that the value in last_pc_address is either - the one we want (if we're dealing with the first - function in an object file), or somewhere in the - previous function. This means that we can use the - minimal symbol table to get the address. */ - - /* Starting with release 3.0, the Sun acc compiler, - under SunOS4, puts out functions with N_FUN and a value - of zero. This gets relocated to the start of the text - segment of the module, which is no good either. - Under SunOS4 we can deal with this as N_SLINE and N_SO - entries contain valid absolute addresses. - Release 3.0 acc also puts out N_OPT entries, which makes - it possible to discern acc from cc or gcc. */ - - if (type == N_GSYM || type == N_STSYM - || (type == N_FUN - && n_opt_found && !block_address_function_relative)) - { - struct minimal_symbol *m; - int l = colon_pos - name; - - m = lookup_minimal_symbol_by_pc (last_pc_address); - if (m && strncmp (DEPRECATED_SYMBOL_NAME (m), name, l) == 0 - && DEPRECATED_SYMBOL_NAME (m)[l] == '\0') - /* last_pc_address was in this function */ - valu = SYMBOL_VALUE (m); - else if (m && DEPRECATED_SYMBOL_NAME (m + 1) - && strncmp (DEPRECATED_SYMBOL_NAME (m + 1), name, l) == 0 - && DEPRECATED_SYMBOL_NAME (m + 1)[l] == '\0') - /* last_pc_address was in last function */ - valu = SYMBOL_VALUE (m + 1); - else - /* Not found - use last_pc_address (for finish_block) */ - valu = last_pc_address; - } - - last_pc_address = valu; /* Save for SunOS bug circumcision */ -#endif - if (block_address_function_relative) /* For Solaris 2.0 compilers, the block addresses and N_SLINE's are relative to the start of the @@ -3392,8 +3301,7 @@ coffstab_build_psymtabs (struct objfile *objfile, int mainline, } /* Scan and build partial symbols for an ELF symbol file. - This ELF file has already been processed to get its minimal symbols, - and any DWARF symbols that were in it. + This ELF file has already been processed to get its minimal symbols. This routine is the equivalent of dbx_symfile_init and dbx_symfile_read rolled into one. diff --git a/gnu/usr.bin/binutils/gdb/dcache.c b/gnu/usr.bin/binutils/gdb/dcache.c index ee690948fdc..e3ffa4a9d18 100644 --- a/gnu/usr.bin/binutils/gdb/dcache.c +++ b/gnu/usr.bin/binutils/gdb/dcache.c @@ -585,7 +585,7 @@ dcache_info (char *exp, int tty) void _initialize_dcache (void) { - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("remotecache", class_support, var_boolean, (char *) &dcache_enabled_p, "\ diff --git a/gnu/usr.bin/binutils/gdb/defs.h b/gnu/usr.bin/binutils/gdb/defs.h index e49f9e0e5ba..fd96665d44b 100644 --- a/gnu/usr.bin/binutils/gdb/defs.h +++ b/gnu/usr.bin/binutils/gdb/defs.h @@ -66,29 +66,6 @@ /* For BFD64 and bfd_vma. */ #include "bfd.h" - -/* The target is partially multi-arched. Both "tm.h" and the - multi-arch vector provide definitions. "tm.h" normally overrides - the multi-arch vector (but there are a few exceptions). */ - -#define GDB_MULTI_ARCH_PARTIAL 1 - -/* The target is partially multi-arched. Both the multi-arch vector - and "tm.h" provide definitions. "tm.h" cannot override a definition - provided by the multi-arch vector. It is detected as a compilation - error. - - This setting is only useful during a multi-arch conversion. */ - -#define GDB_MULTI_ARCH_TM 2 - -/* The target is pure multi-arch. The MULTI-ARCH vector provides all - definitions. "tm.h" is linked to an empty file. */ - -#define GDB_MULTI_ARCH_PURE 3 - - - /* An address in the program being debugged. Host byte order. Rather than duplicate all the logic in BFD which figures out what type this is (long, long long, etc.) and whether it needs to be 64 @@ -198,7 +175,7 @@ extern void quit (void); #else #define QUIT { \ if (quit_flag) quit (); \ - if (interactive_hook) interactive_hook (); \ + if (deprecated_interactive_hook) deprecated_interactive_hook (); \ } #endif @@ -220,7 +197,9 @@ enum language language_asm, /* Assembly language */ language_scm, /* Scheme / Guile */ language_pascal, /* Pascal */ - language_minimal /* All other languages, minimal support only */ + language_ada, /* Ada */ + language_minimal, /* All other languages, minimal support only */ + nr_languages }; enum precision_type @@ -250,7 +229,19 @@ enum return_value_convention should be stored. While typically, and historically, used for large structs, this is convention is applied to values of many different types. */ - RETURN_VALUE_STRUCT_CONVENTION + RETURN_VALUE_STRUCT_CONVENTION, + /* Like the "struct return convention" above, but where the ABI + guarantees that the called function stores the address at which + the value being returned is stored in a well-defined location, + such as a register or memory slot in the stack frame. Don't use + this if the ABI doesn't explicitly guarantees this. */ + RETURN_VALUE_ABI_RETURNS_ADDRESS, + /* Like the "struct return convention" above, but where the ABI + guarantees that the address at which the value being returned is + stored will be available in a well-defined location, such as a + register or memory slot in the stack frame. Don't use this if + the ABI doesn't explicitly guarantees this. */ + RETURN_VALUE_ABI_PRESERVES_ADDRESS, }; /* the cleanup list records things that have to be undone @@ -327,10 +318,6 @@ struct frame_info; extern int inside_entry_func (struct frame_info *this_frame); -extern int deprecated_inside_entry_file (CORE_ADDR addr); - -extern int inside_main_func (CORE_ADDR pc); - /* From utils.c */ extern void initialize_utils (void); @@ -347,8 +334,6 @@ extern int subset_compare (char *, char *); extern char *safe_strerror (int); -extern void init_malloc (void *); - extern void request_quit (int); extern void do_cleanups (struct cleanup *); @@ -376,6 +361,10 @@ extern struct cleanup *make_cleanup_freeargv (char **); struct ui_file; extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *); +struct section_addr_info; +extern struct cleanup *(make_cleanup_free_section_addr_info + (struct section_addr_info *)); + extern struct cleanup *make_cleanup_close (int fd); extern struct cleanup *make_cleanup_bfd_close (bfd *abfd); @@ -527,6 +516,7 @@ extern char *paddr_d (LONGEST addr); extern char *phex (ULONGEST l, int sizeof_l); extern char *phex_nz (ULONGEST l, int sizeof_l); +extern char *int_string (LONGEST, int, int, int, int); /* Like paddr() only print/scan raw CORE_ADDR. The output from core_addr_to_string() can be passed direct to @@ -535,6 +525,11 @@ extern const char *core_addr_to_string (const CORE_ADDR addr); extern const char *core_addr_to_string_nz (const CORE_ADDR addr); extern CORE_ADDR string_to_core_addr (const char *my_string); +/* Return a string that contains a number formatted as a hex + string. */ +extern char *hex_string (LONGEST); +extern char *hex_string_custom (LONGEST, int); + extern void fprintf_symbol_filtered (struct ui_file *, char *, enum language, int); @@ -600,6 +595,9 @@ extern void print_address (CORE_ADDR, struct ui_file *); /* From source.c */ +#define OPF_TRY_CWD_FIRST 0x01 +#define OPF_SEARCH_IN_PATH 0x02 + extern int openp (const char *, int, const char *, int, int, char **); extern int source_full_path_of (char *, char **); @@ -616,8 +614,6 @@ extern void init_source_path (void); extern void init_last_source_visited (void); -extern char *symtab_to_filename (struct symtab *); - /* From exec.c */ extern void exec_set_section_offsets (bfd_signed_vma text_off, @@ -808,11 +804,16 @@ typedef struct ptid ptid_t; #include "tm.h" #endif -/* If the xm.h file did not define the mode string used to open the - files, assume that binary files are opened the same way as text - files */ +/* Assume that fopen accepts the letter "b" in the mode string. + Support for is demanded by ISO C90, and should be supported on all + platforms that claim to have a standards conforming C library. On + true POSIX systems it will be ignored and have no effect. There + may still be systems without a standards conforming C library where + an ISO C90 compiler (GCC) is available. Known examples are SunOS + 4.x and 4.3BSD. This assumption means these systems are no longer + supported. */ #ifndef FOPEN_RB -#include "fopen-same.h" +# include "fopen-bin.h" #endif /* Defaults for system-wide constants (if not defined by xm.h, we fake it). @@ -857,17 +858,6 @@ extern int longest_to_int (LONGEST); extern char *savestring (const char *, size_t); -extern char *msavestring (void *, const char *, size_t); - -extern char *mstrsave (void *, const char *); - -/* Robust versions of same. Throw an internal error when no memory, - guard against stray NULL arguments. */ -extern void *xmmalloc (void *md, size_t size); -extern void *xmrealloc (void *md, void *ptr, size_t size); -extern void *xmcalloc (void *md, size_t number, size_t size); -extern void xmfree (void *md, void *ptr); - /* xmalloc(), xrealloc() and xcalloc() have already been declared in "libiberty.h". */ extern void xfree (void *); @@ -884,8 +874,10 @@ extern void xfree (void *); extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3); extern void xvasprintf (char **ret, const char *format, va_list ap); -/* Like asprintf, but return the string, throw an error if no memory. */ +/* Like asprintf and vasprintf, but return the string, throw an error + if no memory. */ extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2); +extern char *xstrvprintf (const char *format, va_list ap); extern int parse_escape (char **); @@ -1067,10 +1059,6 @@ enum gdb_osabi Libiberty thingies are no longer declared here. We include libiberty.h above, instead. */ -#ifndef GETENV_PROVIDED -extern char *getenv (const char *); -#endif - /* From other system libraries */ #ifdef HAVE_STDDEF_H @@ -1088,15 +1076,6 @@ extern char *getenv (const char *); #endif -/* We take the address of fclose later, but some stdio's forget - to declare this. We can't always declare it since there's - no way to declare the parameters without upsetting some compiler - somewhere. */ - -#ifndef FCLOSE_PROVIDED -extern int fclose (FILE *); -#endif - #ifndef atof extern double atof (const char *); /* X3.159-1989 4.10.1.1 */ #endif @@ -1122,15 +1101,6 @@ extern void *alloca (); #endif /* Not GNU C */ #endif /* alloca not defined */ -/* Is GDB multi-arch? If there's a "tm.h" file, it is not. */ -#ifndef GDB_MULTI_ARCH -#ifdef GDB_TM_FILE -#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL -#else -#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PURE -#endif -#endif - /* Dynamic target-system-dependent parameters for GDB. */ #include "gdbarch.h" @@ -1197,57 +1167,59 @@ extern int watchdog; extern char *interpreter_p; /* If a given interpreter matches INTERPRETER_P then it should update - command_loop_hook and init_ui_hook with the per-interpreter - implementation. */ -/* FIXME: command_loop_hook and init_ui_hook should be moved here. */ + deprecated_command_loop_hook and deprecated_init_ui_hook with the + per-interpreter implementation. */ +/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook + should be moved here. */ struct target_waitstatus; struct cmd_list_element; -/* Should the asynchronous variant of the interpreter (using the - event-loop) be enabled? */ -extern int event_loop_p; - -extern void (*init_ui_hook) (char *argv0); -extern void (*command_loop_hook) (void); -extern void (*show_load_progress) (const char *section, - unsigned long section_sent, - unsigned long section_size, - unsigned long total_sent, - unsigned long total_size); -extern void (*print_frame_info_listing_hook) (struct symtab * s, - int line, int stopline, - int noerror); +extern void (*deprecated_pre_add_symbol_hook) (const char *); +extern void (*deprecated_post_add_symbol_hook) (void); +extern void (*selected_frame_level_changed_hook) (int); +extern int (*deprecated_ui_loop_hook) (int signo); +extern void (*deprecated_init_ui_hook) (char *argv0); +extern void (*deprecated_command_loop_hook) (void); +extern void (*deprecated_show_load_progress) (const char *section, + unsigned long section_sent, + unsigned long section_size, + unsigned long total_sent, + unsigned long total_size); +extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, + int line, int stopline, + int noerror); extern struct frame_info *parse_frame_specification (char *frame_exp); -extern int (*query_hook) (const char *, va_list); -extern void (*warning_hook) (const char *, va_list); -extern void (*flush_hook) (struct ui_file * stream); -extern void (*create_breakpoint_hook) (struct breakpoint * b); -extern void (*delete_breakpoint_hook) (struct breakpoint * bpt); -extern void (*modify_breakpoint_hook) (struct breakpoint * bpt); -extern void (*interactive_hook) (void); -extern void (*registers_changed_hook) (void); -extern void (*readline_begin_hook) (char *,...); -extern char *(*readline_hook) (char *); -extern void (*readline_end_hook) (void); -extern void (*register_changed_hook) (int regno); -extern void (*memory_changed_hook) (CORE_ADDR addr, int len); -extern void (*context_hook) (int); -extern ptid_t (*target_wait_hook) (ptid_t ptid, +extern int (*deprecated_query_hook) (const char *, va_list); +extern void (*deprecated_warning_hook) (const char *, va_list); +extern void (*deprecated_flush_hook) (struct ui_file * stream); +extern void (*deprecated_create_breakpoint_hook) (struct breakpoint * b); +extern void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt); +extern void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt); +extern void (*deprecated_interactive_hook) (void); +extern void (*deprecated_registers_changed_hook) (void); +extern void (*deprecated_readline_begin_hook) (char *,...); +extern char *(*deprecated_readline_hook) (char *); +extern void (*deprecated_readline_end_hook) (void); +extern void (*deprecated_register_changed_hook) (int regno); +extern void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len); +extern void (*deprecated_context_hook) (int); +extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid, struct target_waitstatus * status); -extern void (*attach_hook) (void); -extern void (*detach_hook) (void); -extern void (*call_command_hook) (struct cmd_list_element * c, - char *cmd, int from_tty); +extern void (*deprecated_attach_hook) (void); +extern void (*deprecated_detach_hook) (void); +extern void (*deprecated_call_command_hook) (struct cmd_list_element * c, + char *cmd, int from_tty); -extern void (*set_hook) (struct cmd_list_element * c); +extern void (*deprecated_set_hook) (struct cmd_list_element * c); -extern NORETURN void (*error_hook) (void) ATTR_NORETURN; +extern void (*deprecated_error_hook) (void); -extern void (*error_begin_hook) (void); +extern void (*deprecated_error_begin_hook) (void); -extern int (*ui_load_progress_hook) (const char *section, unsigned long num); +extern int (*deprecated_ui_load_progress_hook) (const char *section, + unsigned long num); /* Inhibit window interface if non-zero. */ diff --git a/gnu/usr.bin/binutils/gdb/delta68-nat.c b/gnu/usr.bin/binutils/gdb/delta68-nat.c deleted file mode 100644 index e74a51bf048..00000000000 --- a/gnu/usr.bin/binutils/gdb/delta68-nat.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Functions specific to running gdb native on a Motorola Delta Series sysV68. - Copyright 1993, 1996, 1998, 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "defs.h" -#include <sys/signal.h> /* for MAXSIG in sys/user.h */ -#include <sys/types.h> /* for ushort in sys/dir.h */ -#include <sys/dir.h> /* for struct direct in sys/user.h */ -#include <sys/user.h> - -#include <nlist.h> - -#if !defined (offsetof) -#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) -#endif - -/* Return the address in the core dump or inferior of register REGNO. - BLOCKEND is the address of the end of the user structure. */ - -CORE_ADDR -register_addr (int regno, CORE_ADDR blockend) -{ - static int sysv68reg[] = - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16}; - - if (regno >= 0 && regno < sizeof (sysv68reg) / sizeof (sysv68reg[0])) - return blockend + sysv68reg[regno] * 4; - else if (regno < FPC_REGNUM) - return offsetof (struct user, u_fpu.regs.reg[regno - FP0_REGNUM][0]); - else if (regno == FPC_REGNUM) - return offsetof (struct user, u_fpu.regs.control); - else if (regno == FPS_REGNUM) - return offsetof (struct user, u_fpu.regs.status); - else if (regno == FPI_REGNUM) - return offsetof (struct user, u_fpu.regs.iaddr); - else - { - fprintf_unfiltered (gdb_stderr, "\ -Internal error: invalid register number %d in REGISTER_U_ADDR\n", - regno); - return blockend; - } -} - -CORE_ADDR kernel_u_addr; - -/* Read the value of the u area from the kernel. */ -void -_initialize_delta68_nat (void) -{ - struct nlist nl[2]; - - nl[0].n_name = "u"; - nl[1].n_name = NULL; - if (nlist ("/sysV68", nl) == 0 && nl[0].n_scnum != 0) - kernel_u_addr = nl[0].n_value; - else - { - perror ("Cannot get kernel u area address"); - exit (1); - } -} - -clear_insn_cache (void) -{ -#ifdef MCT_TEXT /* in sys/signal.h on sysV68 R3V7.1 */ - memctl (0, 4096, MCT_TEXT); -#endif -} - -kernel_u_size (void) -{ - return sizeof (struct user); -} diff --git a/gnu/usr.bin/binutils/gdb/demangle.c b/gnu/usr.bin/binutils/gdb/demangle.c index bcf9b77de51..423ae7c7e8c 100644 --- a/gnu/usr.bin/binutils/gdb/demangle.c +++ b/gnu/usr.bin/binutils/gdb/demangle.c @@ -195,7 +195,7 @@ _initialize_demangler (void) "Set the current C++ demangling style.\n\ Use `set demangle-style' without arguments for a list of demangling styles.", &setlist); - show = add_show_from_set (set, &showlist); + show = deprecated_add_show_from_set (set, &showlist); set_cmd_sfunc (set, set_demangling_command); /* Set the default demangling style chosen at compilation time. */ diff --git a/gnu/usr.bin/binutils/gdb/doc/ChangeLog b/gnu/usr.bin/binutils/gdb/doc/ChangeLog index b5834f430f4..c46594bddb9 100644 --- a/gnu/usr.bin/binutils/gdb/doc/ChangeLog +++ b/gnu/usr.bin/binutils/gdb/doc/ChangeLog @@ -1,3 +1,259 @@ +2004-10-12 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Versions and Branches): New chapter. + (Releasing GDB): Delete "Versions and Branches" section. + (Top): Add "Versions and Branches". + +2004-10-08 Eli Zaretskii <eliz@gnu.org> + + * gdb.texinfo (Editing, History): Add cross-references to the + included Readline and History user documentation. Remove + references to the symbol have-readline-appendices which is unused + and undefined. + (History): Fix indexing. + +2004-10-08 Jeff Johnston <jjohnstn@redhat.com> + + * gdbint.texinfo (target_stopped_data_address): Update to + new prototype. + (i386_stopped_data_address): Update prototype and description. + (i386_stopped_by_watchpoint): New function and description. + +2004-10-03 Paul N. Hilfinger <hilfinger@gnat.com> + + * gdb.texinfo (Filenames): Add Ada suffixes. + (Ada) New section. + +2004-09-27 Andrew Cagney <cagney@gnu.org> + Robert Picco <Robert.Picco@hp.com> + + * gdb.texinfo (Packets): Document the "p" packet. + +2004-09-21 Jason Molenda (jmolenda@apple.com) + + * gdb.texinfo (Paths and Names of the Source Files): Document the + meaning of values in the 'desc' field of a SO stab. + +2004-09-20 Daniel Jacobowitz <dan@debian.org> + + * gdb.texinfo (Maintenance Commands): Document "maint set dwarf2 + max-cache-age" and "maint show dwarf2 max-cache-age". + +2004-09-16 Eli Zaretskii <eliz@gnu.org> + + * gdb.texinfo (Set Breaks): Add index entry for setting + breakpoints on overloaded C++ functions that are not members of + any classes. Add an example and an index entry for setting + breakpoints on all program functions. + (Character Sets, Macros, Overlay Commands) + (Non-debug DLL symbols, GDB/MI Output Syntax) + (Annotations Overview, Maintenance Commands, File-I/O Overview): + Use "(@value{GDBP})" instead of a literal "(gdb)". + +2004-09-12 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Native Debugging): Delete description of + FILES_INFO_HOOK. + +2004-09-11 Paul Hilfinger <hilfinger@gnat.com> + + * gdbint.texinfo (User Interface): Change local_hex_string_custom + to hex_string_custom (not historically correct, but more + understandable, given the current code). + +2004-09-03 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Native Debugging): Delete SVR4_SHARED_LIBS. + +2004-09-01 Jeff Johnston <jjohnstn@redhat.com> + + * observer.texi (solib_unloaded): New observer. + +2004-08-24 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Add missing + comma. + +2004-08-20 Michael Chastain <mec.gnu@mindspring.com> + + * (Using the Testsuite): build != host is supported, + but some test scripts do not support build != host. + +2004-08-14 Mark Kettenis <kettenis@gnu.org> + + * gdbint.texinfo (Host Definition): Delete description of + FCLOSE_PROVIDED and GETENV_PROVIDED. + +2004-08-05 Mark Kettenis <kettenis@chello.nl> + + * gdbint.texinfo (Host Definition): Delete description of + NO_SYS_FILE. + (Native Debugging): Delete description of KERNEL_U_ADDR_BSD and + PTRACE_FP_BUG. + +2004-08-05 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Delete + reference to deprecated_read_fp. + +2004-08-02 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Delete + description of DEPRECATED_REGISTER_BYTES. + +2004-07-30 Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> + + * gdb.texinfo (Source Path): Document the new behavior of + searching for the source files. + +2004-07-17 Eli Zaretskii <eliz@gnu.org> + + * gdb.texinfo (Edit): Fix markup of EDITOR and improve wording. + (Search, Expressions, Arrays, Variables, Data, Machine Code) + (Auto Display): Improve indexing. + +2004-07-16 Andrew Cagney <cagney@gnu.org> + + * gdb.texinfo (Mode Options): Delete documentation on "-async" and + "-noasync". + +2004-07-09 Eli Zaretskii <eliz@gnu.org> + + * gdb.texinfo: Fix @kindex entries so that multiple commands that + have the same prefix have only their prefix in the index. + +2004-07-03 Mark Kettenis <kettenis@gnu.org> + + * gdb.texinfo (BSD libkvm Interface): New node (section) + (Native): Add it to the menu. + +2004-07-01 Mark Kettenis <kettenis@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Remove + PCC_SOL_BROKEN. + +2004-06-24 Mark Kettenis <kettenis@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Remove + SUN_FIXED_LBRAC_BUG. + +2004-06-26 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Coding): Replace xasprintf with xstrprintf. + +2004-06-20 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Deprecate + USE_STRUCT_CONVENTION. + +2004-06-19 Michael Chastain <mec.gnu@mindspring.com> + + gdb.texinfo (Bug Reporting): Mention session recording, + with the script command or Emacs. + +2004-06-18 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Deprecate + FUNCTION_START_OFFSET. + +2004-06-14 Andrew Cagney <cagney@gnu.org> + + Based on changes from Karl Berry. + * gdb.texinfo: Do not use @sc in a direntry. + * stabs.texinfo: Change @dircateogry to "Software development". + * gdbint.texinfo, gdb.texinfo, annotate.texinfo: Ditto. + +2004-06-13 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Target Architecture Definition): Delete + description of RETURN_VALUE_ON_STACK. + +2004-06-09 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Native Debugging): Restore "@table @code" + deleted by previous patch. + +2004-06-08 Andrew Cagney <cagney@gnu.org> + + * gdbint.texinfo (Native Debugging): Delete documentation on + ATTACH_DETACH. + +2004-06-06 Randolph Chung <tausq@debian.org> + + * gdb.texinfo (push_dummy_call): Use @code{struct value}. + +2004-06-06 Randolph Chung <tausq@debian.org> + + * gdb.texinfo (push_dummy_call): Update argument list to match + the new push_dummy_call method signature. Describe the function + argument. + +2004-05-24 Joel Brobecker <brobecker@gnat.com> + + * gdb.texinfo (Starting): Document new start command. + +2004-05-21 Andrew Cagney <cagney@redhat.com> + + * observer.texi (GDB Observers): Document "inferior_created". + +2004-05-08 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Delete + description of DO_DEFERRED_STORES. + + * gdbint.texinfo (Target Architecture Definition): Delete + references to DEPRECATED_FIX_CALL_DUMMY. + + * gdbint.texinfo (Target Architecture Definition): Delete + description of DEPRECATED_CALL_DUMMY_WORDS, + DEPRECATED_SIZEOF_CALL_DUMMY_WORDS, and CALL_DUMMY. + + * gdbint.texinfo (Target Architecture Definition): Delete + description of DEPRECATED_PUSH_DUMMY_FRAME. + + * gdbint.texinfo (Target Architecture Definition): Delete + reference to DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. + +2004-05-07 Andrew Cagney <cagney@redhat.com> + + * observer.texi (GDB Observers): Add "Debugging" section. Include + cross reference to "set/show debug observer". + * gdb.texinfo (Debugging Output): Document "set/show debug + observer". + +2004-05-01 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Delete + description of DEPRECATED_PC_IN_SIGTRAMP. + +2004-04-30 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Delete + documentation for BELIEVE_PCC_PROMOTION_TYPE, no longer defined. + +2004-04-30 Orjan Friberg <orjanf@axis.com> + + * observer.texi (GDB Observers): Correct spelling. + +2004-04-26 Orjan Friberg <orjanf@axis.com> + + * observer.texi (GDB Observers): Add target_changed event. + +2004-04-08 Andrew Cagney <cagney@redhat.com> + + * observer.texi (GDB Observers): Rework, provide generic observer + definitions and then a list of observable events. + +2004-04-04 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Host Definition): Delete reference to + NO_SIGINTERRUPT. + +2004-04-02 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Delete + reference to DEPRECATED_CALL_DUMMY_LENGTH. + 2004-03-28 Stephane Carrez <stcarrez@nerim.fr> * gdb.texinfo (TUI Commands): Document tui reg commands. @@ -9,6 +265,31 @@ (Mode Options): Mention "gdbtui". Use "Text" not "Terminal". (Contributors): Mention both Text and Terminal User Interface. +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Deprecate + references to SIGTRAMP_START and SIGTRAMP_END. + +2004-03-23 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Deprecate + references to PC_IN_SIGTRAMP. + +2004-03-19 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Target Architecture Definition): Delete + reference to GDB_TARGET_IS_HPPA. + +2004-03-18 Andrew Cagney <cagney@redhat.com> + + * gdbint.texinfo (Coding): Update section on gdbarch_data, + describe pre_init and post_init. + +2004-03-09 Daniel Jacobowitz <drow@mvista.com> + + * gdb.texinfo (Debugging Output): Document values for "set debug + target". + 2004-02-28 Andrew Cagney <cagney@redhat.com> * gdb.texinfo (Contributors): Mention GDB 6.1 release engineer. @@ -130,7 +411,7 @@ (Coding): Add -Wunused-label to list of -Werror warnings. 2004-01-08 Jason Molenda <jmolenda@apple.com> - Eli Zaretskii <eliz@is.elta.co.il> + Eli Zaretskii <eliz@gnu.org> * gdb.texinfo: Update copyright. (Objective-C): "methodName" typeo fixed. Add @code/@var markup @@ -888,7 +1169,7 @@ 2002-09-20 Kevin Buettner <kevinb@redhat.com> - From Eli Zaretskii <eliz@is.elta.co.il>: + From Eli Zaretskii <eliz@gnu.org>: * gdb.texinfo (Character Sets): Use @smallexample instead of @example. Use GNU/Linux instead of Linux. @@ -1159,14 +1440,14 @@ * gdbint.texinfo (Target Architecture Definition): Delete definition of HAVE_REGISTER_WINDOWS. -2002-04-19 Eli Zaretskii <eliz@is.elta.co.il> +2002-04-19 Eli Zaretskii <eliz@gnu.org> * gdbint.texinfo (Releasing GDB, Coding): Fix typos. Reported by "Theodore A. Roth" <troth@verinet.com>. 2002-04-15 Don Howard <dhoward@redhat.com> - From Eli Zaretskii <eliz@is.elta.co.il> + From Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (show max-user-call-depth): Correct formatting. Provide a better explaination of this feature. @@ -1270,7 +1551,7 @@ '_ovly_debug_event', which allows GDB to keep better track of overlays. -2002-02-03 Eli Zaretskii <eliz@is.elta.co.il> +2002-02-03 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Memory Region Attributes): Fix the wording. Suggested by Dmitry Sivachenko. @@ -1295,7 +1576,7 @@ * gdbint.texinfo (Target Architecture Definition): Delete description of TARGET_BYTE_ORDER_DEFAULT. -2002-01-27 Eli Zaretskii <eliz@is.elta.co.il> +2002-01-27 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo: Fix typos and markup. From Dmitry Sivachenko <mitya@cavia.pp.ru>. @@ -1353,7 +1634,7 @@ Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Remove definition of IEEE_FLOAT. -2002-01-20 Eli Zaretskii <eliz@is.elta.co.il> +2002-01-20 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo: Beautify copyright years; fix a typo. (DJGPP Native): Fix overfull hboxes in examples. From Brian Youmans @@ -1379,7 +1660,7 @@ Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com> * fdl.texi: Remove next/prev from @node. -2002-01-17 Eli Zaretskii <eliz@is.elta.co.il> +2002-01-17 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo: @include fdl.texi. Fixes for overfull hboxes and for monstrous @multitable (from Brian Youmans). @@ -1411,7 +1692,7 @@ Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com> * gdb.texinfo (--pid): Document new command line option (attach). -2002-01-07 Eli Zaretskii <eliz@is.elta.co.il> +2002-01-07 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Tracepoints): Clarify that tracepoints need support in the stub. @@ -1435,7 +1716,7 @@ Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com> * gdb.texinfo (Free Software): New section ``Free Software Needs Free Documentation''. -2001-12-30 Eli Zaretskii <eliz@is.elta.co.il> +2001-12-30 Eli Zaretskii <eliz@gnu.org> * stabs.texinfo: * gdb.texinfo: @@ -1482,7 +1763,7 @@ Tue Jan 22 11:57:38 2002 Andrew Cagney <cagney@redhat.com> * gdb.texinfo (Options): Eliminate attempt to explain .gdbinit/gdb.ini use since it is described in the referenced section. - From Eli Zaretskii <eliz@is.elta.co.il> + From Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Command Files): Reword to make gdb.ini requirement clearer when using DJGPP. @@ -1596,7 +1877,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> * gdbint.texinfo (libgdb): Rewrite. -2001-07-26 Eli Zaretskii <eliz@is.elta.co.il> +2001-07-26 Eli Zaretskii <eliz@gnu.org> * Makefile.in (gdbgui.dvi, gdb-gui, gdbgui.info): Targets deleted. @@ -1610,7 +1891,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> * gdbint.texinfo (Host Definition): Remove description of NEED_POSIX_SETPGID. -2001-07-23 Eli Zaretskii <eliz@is.elta.co.il> +2001-07-23 Eli Zaretskii <eliz@gnu.org> * gdb.tex (DJGPP Native): New node, with descriptions of DJGPP-specific commands. @@ -1649,7 +1930,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> EXTRACT_STRUCT_VALUE_ADDRESS and EXTRACT_STRUCT_VALUE_ADDRESS_P. The latter has been changed to a true predicate. -2001-06-17 Eli Zaretskii <eliz@is.elta.co.il> +2001-06-17 Eli Zaretskii <eliz@gnu.org> * annotate.texi: Add @noindent where needed. From Dmitry Sivachenko <dima@Chg.RU>. @@ -1668,7 +1949,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> * gdb.texinfo (Protocol): Add doc for new packet "qSymbol:". -2001-06-13 Eli Zaretskii <eliz@is.elta.co.il> +2001-06-13 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Signals): Clarify the default setting of signal handling. @@ -1682,20 +1963,20 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> * Makefile.in (GDBvn.texi): Set GDBVN from ../version.in. -2001-05-10 Eli Zaretskii <eliz@is.elta.co.il> +2001-05-10 Eli Zaretskii <eliz@gnu.org> * gdbint.texinfo (Clean Design and Portable Implementation): Renamed from "Clean Design". (Clean Design and Portable Implementation): Document portable methods of handling file names, and the associated macros. -2001-04-02 Eli Zaretskii <eliz@is.elta.co.il> +2001-04-02 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Tracepoint Actions): Mention the "info scope" command and provide a cross-reference to its description. (Symbols): Note that "info scope" is useful for trace experiments. -2001-04-01 Eli Zaretskii <eliz@is.elta.co.il> +2001-04-01 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Symbols): Document "info scope". (Tracepoints): New chapter. @@ -1707,7 +1988,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> * stabs.texinfo: Change Permissions to GFDL. Update Copyright. -2001-03-26 Eli Zaretskii <eliz@is.elta.co.il> +2001-03-26 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo: Change Permissions to GFDL. Update Copyright. @@ -1722,7 +2003,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> a cross-reference to its description. (Symbols): Document "info symbol". -2001-03-21 Eli Zaretskii <eliz@is.elta.co.il> +2001-03-21 Eli Zaretskii <eliz@gnu.org> * gdbint.texinfo (Algorithms): New section "Watchpoints" and new subsection "x86 Watchpoints". @@ -1741,11 +2022,11 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> * Makefile.in, all-cfg.texi, annotate.texi, gdb.texinfo, gdbint.texinfo, refcard.tex: Update/correct copyright notices. -2001-02-21 Eli Zaretskii <eliz@is.elta.co.il> +2001-02-21 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Signals): Document "ignore", "noignore", and "all". -2001-02-11 Eli Zaretskii <eliz@is.elta.co.il> +2001-02-11 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Environment): Document that `path' does not change the value of PATH in GDB's own environment (it did in the past, @@ -1764,7 +2045,7 @@ Wed Aug 15 10:47:28 2001 Christopher Faylor <cgf@cygnus.com> * gdbint.texinfo (POP_FRAME): Document use by return_command. -2000-12-25 Eli Zaretskii <eliz@is.elta.co.il> +2000-12-25 Eli Zaretskii <eliz@gnu.org> * refcard.tex: Version and copyright fixed. From Phil Edwards <pedwards@disaster.jaj.com>. @@ -1779,7 +2060,7 @@ Mon Nov 20 21:29:35 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdbint.texinfo (Coding): Update current value of --enable-build-warnings. Mention --enable-gdb-build-warnings. -2000-11-19 Eli Zaretskii <eliz@is.elta.co.il> +2000-11-19 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Continuing and Stepping): Fixed markup and typos, as suggested by Dmitry Sivachenko <dima@Chg.RU>. @@ -1788,12 +2069,12 @@ Mon Nov 20 21:29:35 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdb.texinfo: Document new 'set step-mode' command. -2000-10-16 Eli Zaretskii <eliz@is.elta.co.il> +2000-10-16 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Contributors, MIPS Embedded): Minor spelling changes from Dmitry Sivachenko <dima@Chg.RU>. -2000-09-26 Eli Zaretskii <eliz@is.elta.co.il> +2000-09-26 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Hooks): Document the new post-hook functionality. From Steven Johnson <sbjohnson@ozemail.com.au>. @@ -1802,7 +2083,7 @@ Mon Nov 20 21:29:35 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdbint.texinfo (Overall Structure): Spelling fix. -2000-08-10 Eli Zaretskii <eliz@is.elta.co.il> +2000-08-10 Eli Zaretskii <eliz@gnu.org> * gdbint.texinfo (Target Architecture Definition): Document that REGISTER_CONVERT_TO_VIRTUAL should only be called on a register @@ -1818,12 +2099,12 @@ Mon Nov 20 21:29:35 2000 Andrew Cagney <cagney@b1.cygnus.com> * stabs.texinfo: Fix spelling errors. (String Field): FILE-NUMBER starts from 0, not 1. -2000-07-05 Eli Zaretskii <eliz@is.elta.co.il> +2000-07-05 Eli Zaretskii <eliz@gnu.org> * refcard.tex: Remove \centerline from the blurb. Patch from Brian Youmans. -2000-06-25 Eli Zaretskii <eliz@is.elta.co.il> +2000-06-25 Eli Zaretskii <eliz@gnu.org> * Makefile.in (install-info): Support installation from outside of the source directory. Reported by Mark Harig @@ -1842,7 +2123,7 @@ Fri May 26 15:55:33 2000 Andrew Cagney <cagney@b1.cygnus.com> (gdb.texinfo, gdbint.texinfo, stabs.texinfo): When TeX insert the @contents at the start. -2000-05-24 Eli Zaretskii <eliz@is.elta.co.il> +2000-05-24 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo: Remove duplicate @syncodeindex. From Brian Youmans. @@ -1861,7 +2142,7 @@ Tue May 23 22:57:41 2000 Andrew Cagney <cagney@b1.cygnus.com> * configure: Regenerate. -2000-05-17 Eli Zaretskii <eliz@is.elta.co.il> +2000-05-17 Eli Zaretskii <eliz@gnu.org> * Makefile.in (install-info): Run install-info on installed Info files. @@ -1871,7 +2152,7 @@ Fri May 12 20:18:04 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdb.texinfo: Add Stan Shebs, et.al. as authors. Mention Andrew Cagney. -2000-05-09 Eli Zaretskii <eliz@is.elta.co.il> +2000-05-09 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo: Proofreading changes from Brian Youmans. @@ -1880,7 +2161,7 @@ Fri May 12 20:18:04 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdb.texinfo (Command Files): Mention -x, use @enumerate for startup sequence, minor edits. -2000-05-01 Eli Zaretskii <eliz@is.elta.co.il> +2000-05-01 Eli Zaretskii <eliz@gnu.org> * annotate.texi: Remove "@syncodeindex fn cp", it causes grief in TeX. @@ -1894,7 +2175,7 @@ Sat Apr 29 17:01:04 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdbint.texinfo (Hints): Do not use @value{GDBN in @nodes. -2000-04-23 Eli Zaretskii <eliz@is.elta.co.il> +2000-04-23 Eli Zaretskii <eliz@gnu.org> * Makefile.in (GDBMI_DIR): New variable. (SET_TEXINPUTS): Add $(GDBMI_DIR). @@ -1913,19 +2194,19 @@ Sat Apr 29 17:01:04 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdb.texinfo (Files): Update description of add-symbol-file command. -2000-04-17 Eli Zaretskii <eliz@is.elta.co.il> +2000-04-17 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Porting GDB): Don't use @value in the node name, it prevents the build (and is generally a Bad Idea). -2000-04-17 Eli Zaretskii <eliz@is.elta.co.il> +2000-04-17 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Protocol): Prevent makeinfo from complaining about a comma inside @var. (Command Files): Index markup changes from Dmitry Sivachenko <dima@Chg.RU>. -2000-04-16 Eli Zaretskii <eliz@is.elta.co.il> +2000-04-16 Eli Zaretskii <eliz@gnu.org> * Makefile.in (LN_S): Define. (gdb-cfg.texi, gdb.dvi, links2roff, inc-hist.texinfo): Don't @@ -2037,7 +2318,7 @@ Fri Mar 24 17:56:48 2000 Andrew Cagney <cagney@b1.cygnus.com> <dima@Chg.RU>, also clarification of allowed content for string constants. -2000-03-16 Eli Zaretskii <eliz@is.elta.co.il> +2000-03-16 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (main menu): Add Annotations. (File Options): Add @cindex entries for each command-line option. @@ -2126,7 +2407,7 @@ Thu Oct 14 21:17:17 1999 Andrew Cagney <cagney@b1.cygnus.com> * gdb.texinfo: Fix uses of @multitable. - From Eli Zaretskii <eliz@is.elta.co.il>: + From Eli Zaretskii <eliz@gnu.org>: * gdb.texinfo: Include details specific to DOS host, clarify some confusing language, fix @ref/@xref/@pxref usages, add comments about using with optimization, add more indexing, @@ -2183,7 +2464,7 @@ Wed Aug 25 10:47:03 1999 Andrew Cagney <cagney@b1.cygnus.com> * gdbint.texinfo (Breakpoint Handling): Add missing words. -1999-08-10 Eli Zaretskii <eliz@is.elta.co.il> +1999-08-10 Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Set Watchpoints): Explain some subtleties about watch, awatch, and rwatch. Explain why the latter two cannot be diff --git a/gnu/usr.bin/binutils/gdb/doc/agentexpr.texi b/gnu/usr.bin/binutils/gdb/doc/agentexpr.texi index 6dbbdf483ab..152f148fa84 100644 --- a/gnu/usr.bin/binutils/gdb/doc/agentexpr.texi +++ b/gnu/usr.bin/binutils/gdb/doc/agentexpr.texi @@ -5,7 +5,7 @@ @c @setchapternewpage off @c %**end of header -@c Revision: $Id: agentexpr.texi,v 1.2 2004/05/21 20:23:27 kettenis Exp $ +@c Revision: $Id: agentexpr.texi,v 1.3 2004/12/27 14:00:51 kettenis Exp $ @node Agent Expressions @appendix The GDB Agent Expression Mechanism diff --git a/gnu/usr.bin/binutils/gdb/doc/gdb.texinfo b/gnu/usr.bin/binutils/gdb/doc/gdb.texinfo index 8e131520d68..6af8d37896b 100644 --- a/gnu/usr.bin/binutils/gdb/doc/gdb.texinfo +++ b/gnu/usr.bin/binutils/gdb/doc/gdb.texinfo @@ -38,9 +38,9 @@ @c This is a dir.info fragment to support semi-automated addition of @c manuals to an info tree. -@dircategory Programming & development tools. +@dircategory Software development @direntry -* Gdb: (gdb). The @sc{gnu} debugger. +* Gdb: (gdb). The GNU debugger. @end direntry @ifinfo @@ -1065,30 +1065,6 @@ that control @value{GDBN}, and level 2 has been deprecated. The annotation mechanism has largely been superseeded by @sc{gdb/mi} (@pxref{GDB/MI}). -@item -async -@cindex @code{--async} -Use the asynchronous event loop for the command-line interface. -@value{GDBN} processes all events, such as user keyboard input, via a -special event loop. This allows @value{GDBN} to accept and process user -commands in parallel with the debugged process being -run@footnote{@value{GDBN} built with @sc{djgpp} tools for -MS-DOS/MS-Windows supports this mode of operation, but the event loop is -suspended when the debuggee runs.}, so you don't need to wait for -control to return to @value{GDBN} before you type the next command. -(@emph{Note:} as of version 5.1, the target side of the asynchronous -operation is not yet in place, so @samp{-async} does not work fully -yet.) -@c FIXME: when the target side of the event loop is done, the above NOTE -@c should be removed. - -When the standard input is connected to a terminal device, @value{GDBN} -uses the asynchronous event loop by default, unless disabled by the -@samp{-noasync} option. - -@item -noasync -@cindex @code{--noasync} -Disable the asynchronous event loop for the command-line interface. - @item --args @cindex @code{--args} Change interpretation of command line so that arguments following the @@ -1685,6 +1661,7 @@ Some things do not work as well with @samp{-g -O} as with just @samp{-g}, particularly on machines with instruction scheduling. If in doubt, recompile with @samp{-g} alone, and if this fixes the problem, please report it to us as a bug (including a test case!). +@xref{Variables}, for more information about debugging optimized code. Older versions of the @sc{gnu} C compiler permitted a variant option @w{@samp{-gg}} for debugging information. @value{GDBN} no longer supports this @@ -1768,6 +1745,42 @@ time @value{GDBN} read its symbols, @value{GDBN} discards its symbol table, and reads it again. When it does this, @value{GDBN} tries to retain your current breakpoints. +@table @code +@kindex start +@item start +@cindex run to main procedure +The name of the main procedure can vary from language to language. +With C or C@t{++}, the main procedure name is always @code{main}, but +other languages such as Ada do not require a specific name for their +main procedure. The debugger provides a convenient way to start the +execution of the program and to stop at the beginning of the main +procedure, depending on the language used. + +The @samp{start} command does the equivalent of setting a temporary +breakpoint at the beginning of the main procedure and then invoking +the @samp{run} command. + +Some programs contain an elaboration phase where some startup code is +executed before the main program is called. This depends on the +languages used to write your program. In C@t{++} for instance, +constructors for static and global objects are executed before +@code{main} is called. It is therefore possible that the debugger stops +before reaching the main procedure. However, the temporary breakpoint +will remain to halt execution. + +Specify the arguments to give to your program as arguments to the +@samp{start} command. These arguments will be given verbatim to the +underlying @samp{run} command. Note that the same arguments will be +reused if no argument is provided during subsequent calls to +@samp{start} or @samp{run}. + +It is sometimes necessary to debug the program during elaboration. In +these cases, using the @code{start} command would stop the execution of +your program too late, as the program would have already completed the +elaboration phase. Under these circumstances, insert breakpoints in your +elaboration code before running your program. +@end table + @node Arguments @section Your program's arguments @@ -2162,8 +2175,8 @@ For example, On HP-UX systems: -@cindex thread number -@cindex thread identifier (GDB) +@cindex debugging multithreaded programs (on HP-UX) +@cindex thread identifier (GDB), on HP-UX For debugging purposes, @value{GDBN} associates its own thread number---a small integer assigned in thread-creation order---with each thread in your program. @@ -2187,7 +2200,7 @@ HP-UX, you see when @value{GDBN} notices a new thread. @table @code -@kindex info threads +@kindex info threads (HP-UX) @item info threads Display a summary of all threads currently in your program. @value{GDBN} displays for each thread (in this order): @@ -2239,7 +2252,6 @@ As with the @samp{[New @dots{}]} message, the form of the text after @samp{Switching to} depends on your system's conventions for identifying threads. -@kindex thread apply @item thread apply [@var{threadno}] [@var{all}] @var{args} The @code{thread apply} command allows you to apply a command to one or more threads. Specify the numbers of the threads that you want affected @@ -2578,10 +2590,19 @@ an @code{fo} followed by zero or more @code{o}s. There is an implicit @code{.*} leading and trailing the regular expression you supply, so to match only functions that begin with @code{foo}, use @code{^foo}. +@cindex non-member C@t{++} functions, set breakpoint in When debugging C@t{++} programs, @code{rbreak} is useful for setting breakpoints on overloaded functions that are not members of any special classes. +@cindex set breakpoints on all functions +The @code{rbreak} command can be used to set breakpoints in +@strong{all} the functions in a program, like this: + +@smallexample +(@value{GDBP}) rbreak . +@end smallexample + @kindex info breakpoints @cindex @code{$_} and @code{info breakpoints} @item info breakpoints @r{[}@var{n}@r{]} @@ -2862,34 +2883,30 @@ shared library. Use the @code{catch} command to set a catchpoint. Stop when @var{event} occurs. @var{event} can be any of the following: @table @code @item throw -@kindex catch throw +@cindex stop on C@t{++} exceptions The throwing of a C@t{++} exception. @item catch -@kindex catch catch The catching of a C@t{++} exception. @item exec -@kindex catch exec +@cindex break on fork/exec A call to @code{exec}. This is currently only available for HP-UX. @item fork -@kindex catch fork A call to @code{fork}. This is currently only available for HP-UX. @item vfork -@kindex catch vfork A call to @code{vfork}. This is currently only available for HP-UX. @item load @itemx load @var{libname} -@kindex catch load +@cindex break on load/unload of shared library The dynamic loading of any shared library, or the loading of the library @var{libname}. This is currently only available for HP-UX. @item unload @itemx unload @var{libname} -@kindex catch unload The unloading of any dynamically loaded shared library, or the unloading of the library @var{libname}. This is currently only available for HP-UX. @end table @@ -3002,8 +3019,7 @@ confirm off}). You can abbreviate this command as @code{d}. @node Disabling @subsection Disabling breakpoints -@kindex disable breakpoints -@kindex enable breakpoints +@cindex enable/disable a breakpoint Rather than deleting a breakpoint, watchpoint, or catchpoint, you might prefer to @dfn{disable} it. This makes the breakpoint inoperative as if it had been deleted, but remembers the information on the breakpoint so @@ -3037,7 +3053,6 @@ You can use the following commands to enable or disable breakpoints, watchpoints, and catchpoints: @table @code -@kindex disable breakpoints @kindex disable @kindex dis @r{(@code{disable})} @item disable @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]} @@ -3047,7 +3062,6 @@ options such as ignore-counts, conditions and commands are remembered in case the breakpoint is enabled again later. You may abbreviate @code{disable} as @code{dis}. -@kindex enable breakpoints @kindex enable @item enable @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]} Enable the specified breakpoints (or all defined breakpoints). They @@ -4046,7 +4060,6 @@ Similar, but print only the outermost @var{n} frames. @kindex where @kindex info stack -@kindex info s @r{(@code{info stack})} The names @code{where} and @code{info stack} (abbreviated @code{info s}) are additional aliases for @code{backtrace}. @@ -4076,11 +4089,6 @@ The display for frame zero does not begin with a program counter value, indicating that your program has stopped at the beginning of the code for line @code{993} of @code{builtin.c}. -@kindex set backtrace past-main -@kindex show backtrace past-main -@kindex set backtrace limit -@kindex show backtrace limit - Most programs have a standard user entry point---a place where system libraries and startup code transition into user code. For C this is @code{main}. When @value{GDBN} finds the entry function in a backtrace @@ -4093,6 +4101,7 @@ in a backtrace, you can change this behavior: @table @code @item set backtrace past-main @itemx set backtrace past-main on +@kindex set backtrace Backtraces will continue past the user entry point. @item set backtrace past-main off @@ -4100,6 +4109,7 @@ Backtraces will stop when they encounter the user entry point. This is the default. @item show backtrace past-main +@kindex show backtrace Display the current user entry point backtrace policy. @item set backtrace limit @var{n} @@ -4464,25 +4474,26 @@ following command-line syntax: @smallexample ex +@var{number} file @end smallexample -The optional numeric value +@var{number} designates the active line in -the file.}. By default, it is @value{EDITOR}, but you can change this +The optional numeric value +@var{number} specifies the number of the line in +the file where to start editing.}. +By default, it is @file{@value{EDITOR}}, but you can change this by setting the environment variable @code{EDITOR} before using @value{GDBN}. For example, to configure @value{GDBN} to use the @code{vi} editor, you could use these commands with the @code{sh} shell: @smallexample EDITOR=/usr/bin/vi export EDITOR -gdb ... +gdb @dots{} @end smallexample or in the @code{csh} shell, @smallexample setenv EDITOR /usr/bin/vi -gdb ... +gdb @dots{} @end smallexample @node Search @section Searching source files -@cindex searching +@cindex searching source files @kindex reverse-search There are two commands for searching through the current source file for a @@ -4517,16 +4528,30 @@ the directories could be moved between the compilation and your debugging session. @value{GDBN} has a list of directories to search for source files; this is called the @dfn{source path}. Each time @value{GDBN} wants a source file, it tries all the directories in the list, in the order they are present -in the list, until it finds a file with the desired name. Note that -the executable search path is @emph{not} used for this purpose. Neither is -the current working directory, unless it happens to be in the source -path. - -If @value{GDBN} cannot find a source file in the source path, and the -object program records a directory, @value{GDBN} tries that directory -too. If the source path is empty, and there is no record of the -compilation directory, @value{GDBN} looks in the current directory as a -last resort. +in the list, until it finds a file with the desired name. + +For example, suppose an executable references the file +@file{/usr/src/foo-1.0/lib/foo.c}, and our source path is +@file{/mnt/cross}. The file is first looked up literally; if this +fails, @file{/mnt/cross/usr/src/foo-1.0/lib/foo.c} is tried; if this +fails, @file{/mnt/cross/foo.c} is opened; if this fails, an error +message is printed. @value{GDBN} does not look up the parts of the +source file name, such as @file{/mnt/cross/src/foo-1.0/lib/foo.c}. +Likewise, the subdirectories of the source path are not searched: if +the source path is @file{/mnt/cross}, and the binary refers to +@file{foo.c}, @value{GDBN} would not find it under +@file{/mnt/cross/usr/src/foo-1.0/lib}. + +Plain file names, relative file names with leading directories, file +names containing dots, etc.@: are all treated as described above; for +instance, if the source path is @file{/mnt/cross}, and the source file +is recorded as @file{../lib/foo.c}, @value{GDBN} would first try +@file{../lib/foo.c}, then @file{/mnt/cross/../lib/foo.c}, and after +that---@file{/mnt/cross/foo.c}. + +Note that the executable search path is @emph{not} used to locate the +source files. Neither is the current working directory, unless it +happens to be in the source path. Whenever you reset or rearrange the source path, @value{GDBN} clears out any information it has cached about where source files are found and where @@ -4591,6 +4616,7 @@ directories in one command. @node Machine Code @section Source and machine code +@cindex source line and its code address You can use the command @code{info line} to map source lines to program addresses (and vice versa), and the command @code{disassemble} to display @@ -4620,6 +4646,7 @@ Line 895 of "builtin.c" starts at pc 0x634c and ends at 0x6350. @end smallexample @noindent +@cindex code address and its source line We can also inquire (using @code{*@var{addr}} as the form for @var{linespec}) what source line covers a particular address: @smallexample @@ -4628,6 +4655,7 @@ Line 926 of "builtin.c" starts at pc 0x63e4 and ends at 0x6404. @end smallexample @cindex @code{$_} and @code{info line} +@cindex @code{x} command, default address @kindex x@r{(examine), and} info line After @code{info line}, the default address for the @code{x} command is changed to the starting address of the line, so that @samp{x/i} is @@ -4673,10 +4701,6 @@ mnemonics or other syntax. @table @code @kindex set disassembly-flavor -@cindex assembly instructions -@cindex instructions, assembly -@cindex machine instructions -@cindex listing machine instructions @cindex Intel disassembly flavor @cindex AT&T disassembly flavor @item set disassembly-flavor @var{instruction-set} @@ -4717,6 +4741,7 @@ formats}. @item print @itemx print /@var{f} +@cindex reprint the last value If you omit @var{expr}, @value{GDBN} displays the last value again (from the @dfn{value history}; @pxref{Value History, ,Value history}). This allows you to conveniently inspect the same value in an alternative format. @@ -4763,6 +4788,7 @@ casts, and string constants. It also includes preprocessor macros, if you compiled your program to include this information; see @ref{Compilation}. +@cindex arrays in expressions @value{GDBN} supports array constants in expressions input by the user. The syntax is @{@var{element}, @var{element}@dots{}@}. For example, you can use the command @code{print @{1, 2, 3@}} to build up an array in @@ -4776,6 +4802,7 @@ languages. In this section, we discuss operators that you can use in @value{GDBN} expressions regardless of your programming language. +@cindex casts, in expressions Casts are supported in all languages, not just in C, because it is so useful to cast a number into a pointer in order to examine a structure at that address in memory. @@ -4854,7 +4881,7 @@ in this file. But it is possible to have more than one such variable or function with the same name (in different source files). If that happens, referring to that name has unpredictable effects. If you wish, you can specify a static variable in a particular function or file, -using the colon-colon notation: +using the colon-colon (@code{::}) notation: @cindex colon-colon, context for variables/functions @iftex @@ -4885,6 +4912,8 @@ scope resolution operator in @value{GDBN} expressions. @cindex wrong values @cindex variable values, wrong +@cindex function entry/exit, wrong values of variables +@cindex optimized code, wrong values of variables @quotation @emph{Warning:} Occasionally, a local variable may appear to have the wrong value at certain points in a function---just after entry to a new @@ -4917,18 +4946,20 @@ No symbol "foo" in current context. To solve such problems, either recompile without optimizations, or use a different debug info format, if the compiler supports several such -formats. For example, @value{NGCC}, the @sc{gnu} C/C@t{++} compiler +formats. For example, @value{NGCC}, the @sc{gnu} C/C@t{++} compiler, usually supports the @option{-gstabs+} option. @option{-gstabs+} produces debug info in a format that is superior to formats such as COFF. You may be able to use DWARF 2 (@option{-gdwarf-2}), which is also an effective form for debug info. @xref{Debugging Options,,Options for Debugging Your Program or @sc{gnu} CC, gcc.info, Using @sc{gnu} CC}. - +@xref{C, , Debugging C++}, for more info about debug info formats +that are best suited to C@t{++} programs. @node Arrays @section Artificial arrays @cindex artificial array +@cindex arrays @kindex @@@r{, referencing memory as an array} It is often useful to print out several successive objects of the same type in memory; a section of an array, or an array of @@ -5261,6 +5292,7 @@ It also includes expressions which would not be displayed right now because they refer to automatic variables not currently available. @end table +@cindex display disabled out of scope If a display expression refers to local variables, then it does not make sense outside the lexical context for which it was set up. Such an expression is disabled when execution enters a context where one of its @@ -5284,9 +5316,10 @@ and symbols are printed. These settings are useful for debugging programs in any language: @table @code -@kindex set print address +@kindex set print @item set print address @itemx set print address on +@cindex print/don't print memory addresses @value{GDBN} prints memory addresses showing the location of stack traces, structure values, pointer values, breakpoints, and so forth, even when it also displays the contents of those addresses. The default @@ -5320,7 +5353,7 @@ dependent displays from the @value{GDBN} interface. For example, with @code{print address off}, you should get the same text for backtraces on all machines---whether or not they involve pointer arguments. -@kindex show print address +@kindex show print @item show print address Show whether or not addresses are to be printed. @end table @@ -5334,8 +5367,8 @@ you can set @value{GDBN} to print the source file and line number when it prints a symbolic address: @table @code -@kindex set print symbol-filename @item set print symbol-filename on +@cindex closest symbol and offset for an address Tell @value{GDBN} to print the source file name and line number of a symbol in the symbolic form of an address. @@ -5343,7 +5376,6 @@ symbol in the symbolic form of an address. Do not print source file name and line number of a symbol. This is the default. -@kindex show print symbol-filename @item show print symbol-filename Show whether or not @value{GDBN} will print the source file name and line number of a symbol in the symbolic form of an address. @@ -5357,14 +5389,13 @@ Also, you may wish to see the symbolic form only if the address being printed is reasonably close to the closest earlier symbol: @table @code -@kindex set print max-symbolic-offset @item set print max-symbolic-offset @var{max-offset} +@cindex maximum value for offset of closest symbol Tell @value{GDBN} to only display the symbolic form of an address if the offset between the closest earlier symbol and the address is less than @var{max-offset}. The default is 0, which tells @value{GDBN} to always print the symbolic form of an address if any symbol precedes it. -@kindex show print max-symbolic-offset @item show print max-symbolic-offset Ask how large the maximum offset is that @value{GDBN} prints in a symbolic address. @@ -5394,22 +5425,21 @@ the appropriate @code{set print} options turned on. Other settings control how different kinds of objects are printed: @table @code -@kindex set print array @item set print array @itemx set print array on +@cindex pretty print arrays Pretty print arrays. This format is more convenient to read, but uses more space. The default is off. @item set print array off Return to compressed format for arrays. -@kindex show print array @item show print array Show whether compressed or pretty format is selected for displaying arrays. -@kindex set print elements @item set print elements @var{number-of-elements} +@cindex number of array elements to print Set a limit on how many elements of an array @value{GDBN} will print. If @value{GDBN} is printing a large array, it stops printing after it has printed the number of elements set by the @code{set print elements} command. @@ -5417,19 +5447,17 @@ This limit also applies to the display of strings. When @value{GDBN} starts, this limit is set to 200. Setting @var{number-of-elements} to zero means that the printing is unlimited. -@kindex show print elements @item show print elements Display the number of elements of a large array that @value{GDBN} will print. If the number is 0, then the printing is unlimited. -@kindex set print null-stop @item set print null-stop +@cindex @sc{null} elements in arrays Cause @value{GDBN} to stop printing the characters of an array when the first @sc{null} is encountered. This is useful when large arrays actually contain only short strings. The default is off. -@kindex set print pretty @item set print pretty on Cause @value{GDBN} to print structures in an indented format with one member per line, like this: @@ -5460,12 +5488,12 @@ meat = 0x54 "Pork"@} @noindent This is the default format. -@kindex show print pretty @item show print pretty Show which format @value{GDBN} is using to print structures. -@kindex set print sevenbit-strings @item set print sevenbit-strings on +@cindex eight-bit characters in strings +@cindex octal escapes in strings Print using only seven-bit characters; if this option is set, @value{GDBN} displays any eight-bit characters (in strings or character values) using the notation @code{\}@var{nnn}. This setting is @@ -5476,19 +5504,17 @@ high-order bit of characters as a marker or ``meta'' bit. Print full eight-bit characters. This allows the use of more international character sets, and is the default. -@kindex show print sevenbit-strings @item show print sevenbit-strings Show whether or not @value{GDBN} is printing only seven-bit characters. -@kindex set print union @item set print union on +@cindex unions in structures, printing Tell @value{GDBN} to print unions which are contained in structures. This is the default setting. @item set print union off Tell @value{GDBN} not to print unions which are contained in structures. -@kindex show print union @item show print union Ask @value{GDBN} whether or not it will print unions which are contained in structures. @@ -5532,31 +5558,26 @@ $1 = @{it = Tree, form = @{...@}@} These settings are of interest when debugging C@t{++} programs: @table @code -@cindex demangling -@kindex set print demangle +@cindex demangling C@t{++} names @item set print demangle @itemx set print demangle on Print C@t{++} names in their source form rather than in the encoded (``mangled'') form passed to the assembler and linker for type-safe linkage. The default is on. -@kindex show print demangle @item show print demangle Show whether C@t{++} names are printed in mangled or demangled form. -@kindex set print asm-demangle @item set print asm-demangle @itemx set print asm-demangle on Print C@t{++} names in their source form rather than their mangled form, even in assembler code printouts such as instruction disassemblies. The default is off. -@kindex show print asm-demangle @item show print asm-demangle Show whether C@t{++} names in assembly listings are printed in mangled or demangled form. -@kindex set demangle-style @cindex C@t{++} symbol decoding style @cindex symbol decoding style, C@t{++} @item set demangle-style @var{style} @@ -5586,13 +5607,12 @@ require further enhancement to permit that. @end table If you omit @var{style}, you will see a list of possible formats. -@kindex show demangle-style @item show demangle-style Display the encoding style currently in use for decoding C@t{++} symbols. -@kindex set print object @item set print object @itemx set print object on +@cindex derived type of an object, printing When displaying a pointer to an object, identify the @emph{actual} (derived) type of the object rather than the @emph{declared} type, using the virtual function table. @@ -5601,26 +5621,24 @@ the virtual function table. Display only the declared type of objects, without reference to the virtual function table. This is the default setting. -@kindex show print object @item show print object Show whether actual, or declared, object types are displayed. -@kindex set print static-members @item set print static-members @itemx set print static-members on +@cindex static members of C@t{++} objects Print static members when displaying a C@t{++} object. The default is on. @item set print static-members off Do not print static members when displaying a C@t{++} object. -@kindex show print static-members @item show print static-members Show whether C@t{++} static members are printed, or not. @c These don't work with HP ANSI C++ yet. -@kindex set print vtbl @item set print vtbl @itemx set print vtbl on +@cindex pretty print C@t{++} virtual function tables Pretty print C@t{++} virtual function tables. The default is off. (The @code{vtbl} commands do not work on programs compiled with the HP ANSI C@t{++} compiler (@code{aCC}).) @@ -5628,7 +5646,6 @@ ANSI C@t{++} compiler (@code{aCC}).) @item set print vtbl off Do not pretty print C@t{++} virtual function tables. -@kindex show print vtbl @item show print vtbl Show whether C@t{++} virtual function tables are pretty printed, or not. @end table @@ -6292,7 +6309,7 @@ $ gdb -nw charset-test GNU gdb 2001-12-19-cvs Copyright 2001 Free Software Foundation, Inc. @dots{} -(gdb) +(@value{GDBP}) @end smallexample We can use the @code{show charset} command to see what character sets @@ -6300,18 +6317,18 @@ We can use the @code{show charset} command to see what character sets strings: @smallexample -(gdb) show charset +(@value{GDBP}) show charset The current host and target character set is `ISO-8859-1'. -(gdb) +(@value{GDBP}) @end smallexample For the sake of printing this manual, let's use @sc{ascii} as our initial character set: @smallexample -(gdb) set charset ASCII -(gdb) show charset +(@value{GDBP}) set charset ASCII +(@value{GDBP}) show charset The current host and target character set is `ASCII'. -(gdb) +(@value{GDBP}) @end smallexample Let's assume that @sc{ascii} is indeed the correct character set for our @@ -6321,20 +6338,20 @@ them properly. Since our current target character set is also @sc{ascii}, the contents of @code{ascii_hello} print legibly: @smallexample -(gdb) print ascii_hello +(@value{GDBP}) print ascii_hello $1 = 0x401698 "Hello, world!\n" -(gdb) print ascii_hello[0] +(@value{GDBP}) print ascii_hello[0] $2 = 72 'H' -(gdb) +(@value{GDBP}) @end smallexample @value{GDBN} uses the target character set for character and string literals you use in expressions: @smallexample -(gdb) print '+' +(@value{GDBP}) print '+' $3 = 43 '+' -(gdb) +(@value{GDBP}) @end smallexample The @sc{ascii} character set uses the number 43 to encode the @samp{+} @@ -6345,20 +6362,20 @@ target program uses. If we print @code{ibm1047_hello} while our target character set is still @sc{ascii}, we get jibberish: @smallexample -(gdb) print ibm1047_hello +(@value{GDBP}) print ibm1047_hello $4 = 0x4016a8 "\310\205\223\223\226k@@\246\226\231\223\204Z%" -(gdb) print ibm1047_hello[0] +(@value{GDBP}) print ibm1047_hello[0] $5 = 200 '\310' -(gdb) +(@value{GDBP}) @end smallexample If we invoke the @code{set target-charset} followed by @key{TAB}@key{TAB}, @value{GDBN} tells us the character sets it supports: @smallexample -(gdb) set target-charset +(@value{GDBP}) set target-charset ASCII EBCDIC-US IBM1047 ISO-8859-1 -(gdb) set target-charset +(@value{GDBP}) set target-charset @end smallexample We can select @sc{ibm1047} as our target character set, and examine the @@ -6368,28 +6385,28 @@ target character set, @sc{ibm1047}, to the host character set, @sc{ascii}, and they display correctly: @smallexample -(gdb) set target-charset IBM1047 -(gdb) show charset +(@value{GDBP}) set target-charset IBM1047 +(@value{GDBP}) show charset The current host character set is `ASCII'. The current target character set is `IBM1047'. -(gdb) print ascii_hello +(@value{GDBP}) print ascii_hello $6 = 0x401698 "\110\145%%?\054\040\167?\162%\144\041\012" -(gdb) print ascii_hello[0] +(@value{GDBP}) print ascii_hello[0] $7 = 72 '\110' -(gdb) print ibm1047_hello +(@value{GDBP}) print ibm1047_hello $8 = 0x4016a8 "Hello, world!\n" -(gdb) print ibm1047_hello[0] +(@value{GDBP}) print ibm1047_hello[0] $9 = 200 'H' -(gdb) +(@value{GDBP}) @end smallexample As above, @value{GDBN} uses the target character set for character and string literals you use in expressions: @smallexample -(gdb) print '+' +(@value{GDBP}) print '+' $10 = 78 '+' -(gdb) +(@value{GDBP}) @end smallexample The @sc{ibm1047} character set uses the number 78 to encode the @samp{+} @@ -6439,9 +6456,9 @@ Show the results of expanding all preprocessor macro invocations in not parse the result, @var{expression} need not be a valid expression; it can be any string of tokens. -@kindex macro expand-once @item macro expand-once @var{expression} @itemx macro exp1 @var{expression} +@cindex expand macro once @i{(This command is not yet implemented.)} Show the results of expanding those preprocessor macro invocations that appear explicitly in @var{expression}. Macro invocations appearing in that expansion are @@ -6530,7 +6547,7 @@ $ gdb -nw sample GNU gdb 2002-05-06-cvs Copyright 2002 Free Software Foundation, Inc. GDB is free software, @dots{} -(gdb) +(@value{GDBP}) @end smallexample We can expand macros and examine their definitions, even when the @@ -6538,7 +6555,7 @@ program is not running. @value{GDBN} uses the current listing position to decide which macro definitions are in scope: @smallexample -(gdb) list main +(@value{GDBP}) list main 3 4 #define M 42 5 #define ADD(x) (M + x) @@ -6549,18 +6566,18 @@ to decide which macro definitions are in scope: 10 printf ("Hello, world!\n"); 11 #undef N 12 printf ("We're so creative.\n"); -(gdb) info macro ADD +(@value{GDBP}) info macro ADD Defined at /home/jimb/gdb/macros/play/sample.c:5 #define ADD(x) (M + x) -(gdb) info macro Q +(@value{GDBP}) info macro Q Defined at /home/jimb/gdb/macros/play/sample.h:1 included at /home/jimb/gdb/macros/play/sample.c:2 #define Q < -(gdb) macro expand ADD(1) +(@value{GDBP}) macro expand ADD(1) expands to: (42 + 1) -(gdb) macro expand-once ADD(1) +(@value{GDBP}) macro expand-once ADD(1) expands to: once (M + 1) -(gdb) +(@value{GDBP}) @end smallexample In the example above, note that @command{macro expand-once} expands only @@ -6572,27 +6589,27 @@ Once the program is running, GDB uses the macro definitions in force at the source line of the current stack frame: @smallexample -(gdb) break main +(@value{GDBP}) break main Breakpoint 1 at 0x8048370: file sample.c, line 10. -(gdb) run +(@value{GDBP}) run Starting program: /home/jimb/gdb/macros/play/sample Breakpoint 1, main () at sample.c:10 10 printf ("Hello, world!\n"); -(gdb) +(@value{GDBP}) @end smallexample At line 10, the definition of the macro @code{N} at line 9 is in force: @smallexample -(gdb) info macro N +(@value{GDBP}) info macro N Defined at /home/jimb/gdb/macros/play/sample.c:9 #define N 28 -(gdb) macro expand N Q M +(@value{GDBP}) macro expand N Q M expands to: 28 < 42 -(gdb) print N Q M +(@value{GDBP}) print N Q M $1 = 1 -(gdb) +(@value{GDBP}) @end smallexample As we step over directives that remove @code{N}'s definition, and then @@ -6600,23 +6617,23 @@ give it a new definition, @value{GDBN} finds the definition (or lack thereof) in force at each point: @smallexample -(gdb) next +(@value{GDBP}) next Hello, world! 12 printf ("We're so creative.\n"); -(gdb) info macro N +(@value{GDBP}) info macro N The symbol `N' has no definition as a C/C++ preprocessor macro at /home/jimb/gdb/macros/play/sample.c:12 -(gdb) next +(@value{GDBP}) next We're so creative. 14 printf ("Goodbye, world!\n"); -(gdb) info macro N +(@value{GDBP}) info macro N Defined at /home/jimb/gdb/macros/play/sample.c:13 #define N 1729 -(gdb) macro expand N Q M +(@value{GDBP}) macro expand N Q M expands to: 1729 < 42 -(gdb) print N Q M +(@value{GDBP}) print N Q M $2 = 0 -(gdb) +(@value{GDBP}) @end smallexample @@ -7414,14 +7431,13 @@ you can abbreviate this as @code{ov} or @code{ovly}. The commands are: @table @code @item overlay off -@kindex overlay off +@kindex overlay Disable @value{GDBN}'s overlay support. When overlay support is disabled, @value{GDBN} assumes that all functions and variables are always present at their mapped addresses. By default, @value{GDBN}'s overlay support is disabled. @item overlay manual -@kindex overlay manual @cindex manual overlay debugging Enable @dfn{manual} overlay debugging. In this mode, @value{GDBN} relies on you to tell it which overlays are mapped, and which are not, @@ -7430,7 +7446,6 @@ commands described below. @item overlay map-overlay @var{overlay} @itemx overlay map @var{overlay} -@kindex overlay map-overlay @cindex map an overlay Tell @value{GDBN} that @var{overlay} is now mapped; @var{overlay} must be the name of the object file section containing the overlay. When an @@ -7441,7 +7456,6 @@ that any other overlays whose mapped ranges overlap that of @item overlay unmap-overlay @var{overlay} @itemx overlay unmap @var{overlay} -@kindex overlay unmap-overlay @cindex unmap an overlay Tell @value{GDBN} that @var{overlay} is no longer mapped; @var{overlay} must be the name of the object file section containing the overlay. @@ -7449,7 +7463,6 @@ When an overlay is unmapped, @value{GDBN} assumes it can find the overlay's functions and variables at their load addresses. @item overlay auto -@kindex overlay auto Enable @dfn{automatic} overlay debugging. In this mode, @value{GDBN} consults a data structure the overlay manager maintains in the inferior to see which overlays are mapped. For details, see @ref{Automatic @@ -7457,7 +7470,6 @@ Overlay Debugging}. @item overlay load-target @itemx overlay load -@kindex overlay load-target @cindex reloading the overlay table Re-read the overlay table from the inferior. Normally, @value{GDBN} re-reads the table @value{GDBN} automatically each time the inferior @@ -7477,7 +7489,7 @@ Normally, when @value{GDBN} prints a code address, it includes the name of the function the address falls in: @smallexample -(gdb) print main +(@value{GDBP}) print main $3 = @{int ()@} 0x11a0 <main> @end smallexample @noindent @@ -7487,9 +7499,9 @@ asterisks around them. For example, if @code{foo} is a function in an unmapped overlay, @value{GDBN} prints it this way: @smallexample -(gdb) overlay list +(@value{GDBP}) overlay list No sections are mapped. -(gdb) print foo +(@value{GDBP}) print foo $5 = @{int (int)@} 0x100000 <*foo*> @end smallexample @noindent @@ -7497,10 +7509,10 @@ When @code{foo}'s overlay is mapped, @value{GDBN} prints the function's name normally: @smallexample -(gdb) overlay list +(@value{GDBP}) overlay list Section .ov.foo.text, loaded at 0x100000 - 0x100034, mapped at 0x1016 - 0x104a -(gdb) print foo +(@value{GDBP}) print foo $6 = @{int (int)@} 0x1016 <foo> @end smallexample @@ -7705,6 +7717,11 @@ If a source file name ends in one of the following extensions, then @value{GDBN} infers that its language is the one indicated. @table @file +@item .ada +@itemx .ads +@itemx .adb +@itemx .a +Ada source file. @item .c C source file @@ -7794,8 +7811,6 @@ The following commands help you find out which language is the working language, and also what language source files were written in. @kindex show language -@kindex info frame@r{, show the source language} -@kindex info source@r{, show the source language} @table @code @item show language Display the current working language. This is the @@ -7803,12 +7818,14 @@ language you can use with commands such as @code{print} to build and compute expressions that may involve variables in your program. @item info frame +@kindex info frame@r{, show the source language} Display the source language for this frame. This language becomes the working language if you use an identifier from this frame. @xref{Frame Info, ,Information about a frame}, to identify the other information listed here. @item info source +@kindex info source@r{, show the source language} Display the source language of this source file. @xref{Symbols, ,Examining the Symbol Table}, to identify the other information listed here. @@ -7903,7 +7920,6 @@ details on specific languages. @value{GDBN} provides some additional commands for controlling the type checker: -@kindex set check@r{, type} @kindex set check type @kindex show check type @table @code @@ -7964,7 +7980,6 @@ Supported languages}, for further details on specific languages. @value{GDBN} provides some additional commands for controlling the range checker: -@kindex set check@r{, range} @kindex set check range @kindex show check range @table @code @@ -7995,7 +8010,7 @@ being set automatically by @value{GDBN}. @node Support @section Supported languages -@value{GDBN} supports C, C@t{++}, Objective-C, Fortran, Java, assembly, and Modula-2. +@value{GDBN} supports C, C@t{++}, Objective-C, Fortran, Java, assembly, Modula-2, and Ada. @c This is false ... Some @value{GDBN} features may be used in expressions regardless of the language you use: the @value{GDBN} @code{@@} and @code{::} operators, @@ -8015,6 +8030,7 @@ language reference or tutorial. * C:: C and C@t{++} * Objective-C:: Objective-C * Modula-2:: Modula-2 +* Ada:: Ada @end menu @node C @@ -8630,7 +8646,7 @@ the description of an object. However, this command may only work with certain Objective-C libraries that have a particular hook function, @code{_NSPrintForDebugger}, defined. -@node Modula-2, , Objective-C, Support +@node Modula-2, Ada, Objective-C, Support @subsection Modula-2 @cindex Modula-2, @value{GDBN} support @@ -9073,6 +9089,341 @@ address can be specified by an integral constant, the construct In @value{GDBN} scripts, the Modula-2 inequality operator @code{#} is interpreted as the beginning of a comment. Use @code{<>} instead. +@node Ada +@subsection Ada +@cindex Ada + +The extensions made to @value{GDBN} for Ada only support +output from the @sc{gnu} Ada (GNAT) compiler. +Other Ada compilers are not currently supported, and +attempting to debug executables produced by them is most likely +to be difficult. + + +@cindex expressions in Ada +@menu +* Ada Mode Intro:: General remarks on the Ada syntax + and semantics supported by Ada mode + in @value{GDBN}. +* Omissions from Ada:: Restrictions on the Ada expression syntax. +* Additions to Ada:: Extensions of the Ada expression syntax. +* Stopping Before Main Program:: Debugging the program during elaboration. +* Ada Glitches:: Known peculiarities of Ada mode. +@end menu + +@node Ada Mode Intro +@subsubsection Introduction +@cindex Ada mode, general + +The Ada mode of @value{GDBN} supports a fairly large subset of Ada expression +syntax, with some extensions. +The philosophy behind the design of this subset is + +@itemize @bullet +@item +That @value{GDBN} should provide basic literals and access to operations for +arithmetic, dereferencing, field selection, indexing, and subprogram calls, +leaving more sophisticated computations to subprograms written into the +program (which therefore may be called from @value{GDBN}). + +@item +That type safety and strict adherence to Ada language restrictions +are not particularly important to the @value{GDBN} user. + +@item +That brevity is important to the @value{GDBN} user. +@end itemize + +Thus, for brevity, the debugger acts as if there were +implicit @code{with} and @code{use} clauses in effect for all user-written +packages, making it unnecessary to fully qualify most names with +their packages, regardless of context. Where this causes ambiguity, +@value{GDBN} asks the user's intent. + +The debugger will start in Ada mode if it detects an Ada main program. +As for other languages, it will enter Ada mode when stopped in a program that +was translated from an Ada source file. + +While in Ada mode, you may use `@t{--}' for comments. This is useful +mostly for documenting command files. The standard @value{GDBN} comment +(@samp{#}) still works at the beginning of a line in Ada mode, but not in the +middle (to allow based literals). + +The debugger supports limited overloading. Given a subprogram call in which +the function symbol has multiple definitions, it will use the number of +actual parameters and some information about their types to attempt to narrow +the set of definitions. It also makes very limited use of context, preferring +procedures to functions in the context of the @code{call} command, and +functions to procedures elsewhere. + +@node Omissions from Ada +@subsubsection Omissions from Ada +@cindex Ada, omissions from + +Here are the notable omissions from the subset: + +@itemize @bullet +@item +Only a subset of the attributes are supported: + +@itemize @minus +@item +@t{'First}, @t{'Last}, and @t{'Length} + on array objects (not on types and subtypes). + +@item +@t{'Min} and @t{'Max}. + +@item +@t{'Pos} and @t{'Val}. + +@item +@t{'Tag}. + +@item +@t{'Range} on array objects (not subtypes), but only as the right +operand of the membership (@code{in}) operator. + +@item +@t{'Access}, @t{'Unchecked_Access}, and +@t{'Unrestricted_Access} (a GNAT extension). + +@item +@t{'Address}. +@end itemize + +@item +The names in +@code{Characters.Latin_1} are not available and +concatenation is not implemented. Thus, escape characters in strings are +not currently available. + +@item +Equality tests (@samp{=} and @samp{/=}) on arrays test for bitwise +equality of representations. They will generally work correctly +for strings and arrays whose elements have integer or enumeration types. +They may not work correctly for arrays whose element +types have user-defined equality, for arrays of real values +(in particular, IEEE-conformant floating point, because of negative +zeroes and NaNs), and for arrays whose elements contain unused bits with +indeterminate values. + +@item +The other component-by-component array operations (@code{and}, @code{or}, +@code{xor}, @code{not}, and relational tests other than equality) +are not implemented. + +@item +There are no record or array aggregates. + +@item +Calls to dispatching subprograms are not implemented. + +@item +The overloading algorithm is much more limited (i.e., less selective) +than that of real Ada. It makes only limited use of the context in which a subexpression +appears to resolve its meaning, and it is much looser in its rules for allowing +type matches. As a result, some function calls will be ambiguous, and the user +will be asked to choose the proper resolution. + +@item +The @code{new} operator is not implemented. + +@item +Entry calls are not implemented. + +@item +Aside from printing, arithmetic operations on the native VAX floating-point +formats are not supported. + +@item +It is not possible to slice a packed array. +@end itemize + +@node Additions to Ada +@subsubsection Additions to Ada +@cindex Ada, deviations from + +As it does for other languages, @value{GDBN} makes certain generic +extensions to Ada (@pxref{Expressions}): + +@itemize @bullet +@item +If the expression @var{E} is a variable residing in memory +(typically a local variable or array element) and @var{N} is +a positive integer, then @code{@var{E}@@@var{N}} displays the values of +@var{E} and the @var{N}-1 adjacent variables following it in memory as an array. +In Ada, this operator is generally not necessary, since its prime use +is in displaying parts of an array, and slicing will usually do this in Ada. +However, there are occasional uses when debugging programs +in which certain debugging information has been optimized away. + +@item +@code{@var{B}::@var{var}} means ``the variable named @var{var} that appears +in function or file @var{B}.'' When @var{B} is a file name, you must typically +surround it in single quotes. + +@item +The expression @code{@{@var{type}@} @var{addr}} means ``the variable of type +@var{type} that appears at address @var{addr}.'' + +@item +A name starting with @samp{$} is a convenience variable +(@pxref{Convenience Vars}) or a machine register (@pxref{Registers}). +@end itemize + +In addition, @value{GDBN} provides a few other shortcuts and outright additions specific +to Ada: + +@itemize @bullet +@item +The assignment statement is allowed as an expression, returning +its right-hand operand as its value. Thus, you may enter + +@smallexample +set x := y + 3 +print A(tmp := y + 1) +@end smallexample + +@item +The semicolon is allowed as an ``operator,'' returning as its value +the value of its right-hand operand. +This allows, for example, +complex conditional breaks: + +@smallexample +break f +condition 1 (report(i); k += 1; A(k) > 100) +@end smallexample + +@item +Rather than use catenation and symbolic character names to introduce special +characters into strings, one may instead use a special bracket notation, +which is also used to print strings. A sequence of characters of the form +@samp{["@var{XX}"]} within a string or character literal denotes the +(single) character whose numeric encoding is @var{XX} in hexadecimal. The +sequence of characters @samp{["""]} also denotes a single quotation mark +in strings. For example, +@smallexample + "One line.["0a"]Next line.["0a"]" +@end smallexample +@noindent +contains an ASCII newline character (@code{Ada.Characters.Latin_1.LF}) after each +period. + +@item +The subtype used as a prefix for the attributes @t{'Pos}, @t{'Min}, and +@t{'Max} is optional (and is ignored in any case). For example, it is valid +to write + +@smallexample +print 'max(x, y) +@end smallexample + +@item +When printing arrays, @value{GDBN} uses positional notation when the +array has a lower bound of 1, and uses a modified named notation otherwise. +For example, a one-dimensional array of three integers with a lower bound of 3 might print as + +@smallexample +(3 => 10, 17, 1) +@end smallexample + +@noindent +That is, in contrast to valid Ada, only the first component has a @code{=>} +clause. + +@item +You may abbreviate attributes in expressions with any unique, +multi-character subsequence of +their names (an exact match gets preference). +For example, you may use @t{a'len}, @t{a'gth}, or @t{a'lh} +in place of @t{a'length}. + +@item +@cindex quoting Ada internal identifiers +Since Ada is case-insensitive, the debugger normally maps identifiers you type +to lower case. The GNAT compiler uses upper-case characters for +some of its internal identifiers, which are normally of no interest to users. +For the rare occasions when you actually have to look at them, +enclose them in angle brackets to avoid the lower-case mapping. +For example, +@smallexample +@value{GDBP} print <JMPBUF_SAVE>[0] +@end smallexample + +@item +Printing an object of class-wide type or dereferencing an +access-to-class-wide value will display all the components of the object's +specific type (as indicated by its run-time tag). Likewise, component +selection on such a value will operate on the specific type of the +object. + +@end itemize + +@node Stopping Before Main Program +@subsubsection Stopping at the Very Beginning + +@cindex breakpointing Ada elaboration code +It is sometimes necessary to debug the program during elaboration, and +before reaching the main procedure. +As defined in the Ada Reference +Manual, the elaboration code is invoked from a procedure called +@code{adainit}. To run your program up to the beginning of +elaboration, simply use the following two commands: +@code{tbreak adainit} and @code{run}. + +@node Ada Glitches +@subsubsection Known Peculiarities of Ada Mode +@cindex Ada, problems + +Besides the omissions listed previously (@pxref{Omissions from Ada}), +we know of several problems with and limitations of Ada mode in +@value{GDBN}, +some of which will be fixed with planned future releases of the debugger +and the GNU Ada compiler. + +@itemize @bullet +@item +Currently, the debugger +has insufficient information to determine whether certain pointers represent +pointers to objects or the objects themselves. +Thus, the user may have to tack an extra @code{.all} after an expression +to get it printed properly. + +@item +Static constants that the compiler chooses not to materialize as objects in +storage are invisible to the debugger. + +@item +Named parameter associations in function argument lists are ignored (the +argument lists are treated as positional). + +@item +Many useful library packages are currently invisible to the debugger. + +@item +Fixed-point arithmetic, conversions, input, and output is carried out using +floating-point arithmetic, and may give results that only approximate those on +the host machine. + +@item +The type of the @t{'Address} attribute may not be @code{System.Address}. + +@item +The GNAT compiler never generates the prefix @code{Standard} for any of +the standard symbols defined by the Ada language. @value{GDBN} knows about +this: it will strip the prefix from names when you use it, and will never +look for a name you have so qualified among local symbols, nor match against +symbols in other packages or subprograms. If you have +defined entities anywhere in your program other than parameters and +local variables whose simple names match names in @code{Standard}, +GNAT's lack of qualification here can cause confusion. When this happens, +you can usually resolve the confusion +by qualifying the problematic names with package +@code{Standard} explicitly. +@end itemize + @node Unsupported languages @section Unsupported languages @@ -9888,9 +10239,9 @@ symbol table. It cannot be shared across multiple host platforms. @c (eg rooted in val of env var GDBSYMS) could exist for mappable symbol @c files. -@kindex core @kindex core-file @item core-file @r{[} @var{filename} @r{]} +@itemx core Specify the whereabouts of a core dump file to be used as the ``contents of memory''. Traditionally, core files contain only some parts of the address space of the process that generated them; @value{GDBN} can access the @@ -10308,7 +10659,7 @@ polynomials, reversals, byte ordering, etc.), the simplest way to describe the CRC used in @code{.gnu_debuglink} sections is to give the complete code for a function that computes it: -@kindex @code{gnu_debuglink_crc32} +@kindex gnu_debuglink_crc32 @smallexample unsigned long gnu_debuglink_crc32 (unsigned long crc, @@ -10580,22 +10931,24 @@ Use the @code{show gnutarget} command to display what file format and @code{show gnutarget} displays @samp{The current BDF target is "auto"}. @end table +@cindex common targets Here are some common targets (available, or not, depending on the GDB configuration): @table @code -@kindex target exec +@kindex target @item target exec @var{program} +@cindex executable file target An executable file. @samp{target exec @var{program}} is the same as @samp{exec-file @var{program}}. -@kindex target core @item target core @var{filename} +@cindex core dump file target A core dump file. @samp{target core @var{filename}} is the same as @samp{core-file @var{filename}}. -@kindex target remote @item target remote @var{dev} +@cindex remote target Remote serial target in GDB-specific protocol. The argument @var{dev} specifies what serial device to use for the connection (e.g. @file{/dev/ttya}). @xref{Remote, ,Remote debugging}. @code{target remote} @@ -10603,8 +10956,8 @@ supports the @code{load} command. This is only useful if you have some other way of getting the stub to the target system, and you can put it somewhere in memory where it won't get clobbered by the download. -@kindex target sim @item target sim +@cindex built-in simulator target Builtin CPU simulator. @value{GDBN} includes simulators for most architectures. In general, @smallexample @@ -10625,8 +10978,8 @@ Some configurations may include these targets as well: @table @code -@kindex target nrom @item target nrom @var{dev} +@cindex NetROM ROM emulator target NetROM ROM emulator. This target only supports downloading. @end table @@ -10675,15 +11028,13 @@ which to use. However, you may still find it useful to adjust @value{GDBN}'s idea of processor endian-ness manually. @table @code -@kindex set endian big +@kindex set endian @item set endian big Instruct @value{GDBN} to assume the target is big-endian. -@kindex set endian little @item set endian little Instruct @value{GDBN} to assume the target is little-endian. -@kindex set endian auto @item set endian auto Instruct @value{GDBN} to use the byte order associated with the executable. @@ -11156,14 +11507,14 @@ subroutines: @table @code @item set_debug_traps -@kindex set_debug_traps +@findex set_debug_traps @cindex remote serial stub, initialization This routine arranges for @code{handle_exception} to run when your program stops. You must call this subroutine explicitly near the beginning of your program. @item handle_exception -@kindex handle_exception +@findex handle_exception @cindex remote serial stub, main routine This is the central workhorse, but your program never calls it explicitly---the setup code arranges for @code{handle_exception} to @@ -11211,13 +11562,13 @@ serial port. @table @code @item int getDebugChar() -@kindex getDebugChar +@findex getDebugChar Write this subroutine to read a single character from the serial port. It may be identical to @code{getchar} for your target system; a different name is used to allow you to distinguish the two if you wish. @item void putDebugChar(int) -@kindex putDebugChar +@findex putDebugChar Write this subroutine to write a single character to the serial port. It may be identical to @code{putchar} for your target system; a different name is used to allow you to distinguish the two if you wish. @@ -11240,7 +11591,7 @@ Other routines you need to supply are: @table @code @item void exceptionHandler (int @var{exception_number}, void *@var{exception_address}) -@kindex exceptionHandler +@findex exceptionHandler Write this function to install @var{exception_address} in the exception handling tables. You need to do this because the stub does not have any way of knowing what the exception handling tables on your target system @@ -11262,7 +11613,7 @@ should be at privilege level 0 (the most privileged level). The help from @code{exceptionHandler}. @item void flush_i_cache() -@kindex flush_i_cache +@findex flush_i_cache On @sc{sparc} and @sc{sparclite} only, write this subroutine to flush the instruction cache, if any, on your target machine. If there is no instruction cache, this subroutine may be a no-op. @@ -11276,7 +11627,7 @@ You must also make sure this library routine is available: @table @code @item void *memset(void *, int, int) -@kindex memset +@findex memset This is the standard library function @code{memset} that sets an area of memory to a known value. If you have one of the free versions of @code{libc.a}, @code{memset} can be found there; otherwise, you must @@ -11376,6 +11727,7 @@ configurations. @menu * HP-UX:: HP-UX +* BSD libkvm Interface:: Debugging BSD kernel memory images * SVR4 Process Information:: SVR4 process information * DJGPP Native:: Features specific to the DJGPP port * Cygwin Native:: Features specific to the Cygwin port @@ -11388,6 +11740,46 @@ On HP-UX systems, if you refer to a function or variable name that begins with a dollar sign, @value{GDBN} searches for a user or system name first, before it searches for a convenience variable. +@node BSD libkvm Interface +@subsection BSD libkvm Interface + +@cindex libkvm +@cindex kernel memory image +@cindex kernel crash dump + +BSD-derived systems (FreeBSD/NetBSD/OpenBSD) have a kernel memory +interface that provides a uniform interface for accessing kernel virtual +memory images, including live systems and crash dumps. @value{GDBN} +uses this interface to allow you to debug live kernels and kernel crash +dumps on many native BSD configurations. This is implemented as a +special @code{kvm} debugging target. For debugging a live system, load +the currently running kernel into @value{GDBN} and connect to the +@code{kvm} target: + +@smallexample +(@value{GDBP}) @b{target kvm} +@end smallexample + +For debugging crash dumps, provide the file name of the crash dump as an +argument: + +@smallexample +(@value{GDBP}) @b{target kvm /var/crash/bsd.0} +@end smallexample + +Once connected to the @code{kvm} target, the following commands are +available: + +@table @code +@kindex kvm +@item kvm pcb +Set current context from pcb address. + +@item kvm proc +Set current context from proc address. This command isn't available on +modern FreeBSD systems. +@end table + @node SVR4 Process Information @subsection SVR4 process information @@ -11714,7 +12106,7 @@ some confusion. If in doubt, try the @code{info functions} and @pxref{Symbols}). Here's an example: @smallexample -(gdb) info function CreateFileA +(@value{GDBP}) info function CreateFileA All functions matching regular expression "CreateFileA": Non-debugging symbols: @@ -11723,7 +12115,7 @@ Non-debugging symbols: @end smallexample @smallexample -(gdb) info function ! +(@value{GDBP}) info function ! All functions matching regular expression "!": Non-debugging symbols: @@ -11750,28 +12142,28 @@ type information in the command. Here's an example of the type of problem: @smallexample -(gdb) print 'cygwin1!__argv' +(@value{GDBP}) print 'cygwin1!__argv' $1 = 268572168 @end smallexample @smallexample -(gdb) x 'cygwin1!__argv' +(@value{GDBP}) x 'cygwin1!__argv' 0x10021610: "\230y\"" @end smallexample And two possible solutions: @smallexample -(gdb) print ((char **)'cygwin1!__argv')[0] +(@value{GDBP}) print ((char **)'cygwin1!__argv')[0] $2 = 0x22fd98 "/cygdrive/c/mydirectory/myprogram" @end smallexample @smallexample -(gdb) x/2x &'cygwin1!__argv' +(@value{GDBP}) x/2x &'cygwin1!__argv' 0x610c0aa8 <cygwin1!__argv>: 0x10021608 0x00000000 -(gdb) x/x 0x10021608 +(@value{GDBP}) x/x 0x10021608 0x10021608: 0x0022fd98 -(gdb) x/s 0x0022fd98 +(@value{GDBP}) x/s 0x0022fd98 0x22fd98: "/cygdrive/c/mydirectory/myprogram" @end smallexample @@ -11782,7 +12174,7 @@ function's frame set-up code. You can work around this by using ``*&'' to set the breakpoint at a raw memory address: @smallexample -(gdb) break *&'python22!PyOS_Readline' +(@value{GDBP}) break *&'python22!PyOS_Readline' Breakpoint 1 at 0x1e04eff0 @end smallexample @@ -11843,7 +12235,7 @@ The following information on connecting to VxWorks was current when this manual was produced; newer releases of VxWorks may use revised procedures. -@kindex INCLUDE_RDB +@findex INCLUDE_RDB To use @value{GDBN} with VxWorks, you must rebuild your VxWorks kernel to include the remote debugging interface routines in the VxWorks library @file{rdb.a}. To do this, define @code{INCLUDE_RDB} in the @@ -12503,49 +12895,39 @@ or Data. For example: @code{hwatch ($LEA == my_var) && ($LDATA < 50) || ($SEA == my_var) && ($SDATA >= 50)} -@kindex htrace info +@kindex htrace @item htrace info Display information about current HW trace configuration. -@kindex htrace trigger @item htrace trigger @var{conditional} Set starting criteria for HW trace. -@kindex htrace qualifier @item htrace qualifier @var{conditional} Set acquisition qualifier for HW trace. -@kindex htrace stop @item htrace stop @var{conditional} Set HW trace stopping criteria. -@kindex htrace record @item htrace record [@var{data}]* Selects the data to be recorded, when qualifier is met and HW trace was triggered. -@kindex htrace enable @item htrace enable -@kindex htrace disable @itemx htrace disable Enables/disables the HW trace. -@kindex htrace rewind @item htrace rewind [@var{filename}] Clears currently recorded trace data. If filename is specified, new trace file is made and any newly collected data will be written there. -@kindex htrace print @item htrace print [@var{start} [@var{len}]] Prints trace buffer, using current record configuration. -@kindex htrace mode continuous @item htrace mode continuous Set continuous trace mode. -@kindex htrace mode suspend @item htrace mode suspend Set suspend trace mode. @@ -13001,7 +13383,7 @@ Prints a line of the form: @samp{Gdb's prompt is: @var{your-prompt}} @cindex readline @cindex command line editing -@value{GDBN} reads its input commands via the @dfn{readline} interface. This +@value{GDBN} reads its input commands via the @dfn{Readline} interface. This @sc{gnu} library provides consistent behavior for programs which provide a command line interface to the user. Advantages are @sc{gnu} Emacs-style or @dfn{vi}-style inline editing of commands, @code{csh}-like history @@ -13026,19 +13408,31 @@ Disable command line editing. Show whether command line editing is enabled. @end table +@xref{Command Line Editing}, for more details about the Readline +interface. Users unfamiliar with @sc{gnu} Emacs or @code{vi} are +encouraged to read that chapter. + @node History @section Command history +@cindex command history @value{GDBN} can keep track of the commands you type during your debugging sessions, so that you can be certain of precisely what happened. Use these commands to manage the @value{GDBN} command history facility. +@value{GDBN} uses the @sc{gnu} History library, a part of the Readline +package, to provide the history facility. @xref{Using History +Interactively}, for the detailed description of the History library. + +Here is the description of @value{GDBN} commands related to command +history. + @table @code @cindex history substitution @cindex history file @kindex set history filename -@kindex GDBHISTFILE +@cindex @env{GDBHISTFILE}, environment variable @item set history filename @var{fname} Set the name of the @value{GDBN} command history file to @var{fname}. This is the file where @value{GDBN} reads an initial command history @@ -13050,7 +13444,7 @@ to the value of the environment variable @code{GDBHISTFILE}, or to is not set. @cindex history save -@kindex set history save +@kindex set history @item set history save @itemx set history save on Record command history in a file, whose name may be specified with the @@ -13060,19 +13454,16 @@ Record command history in a file, whose name may be specified with the Stop recording command history in a file. @cindex history size -@kindex set history size @item set history size @var{size} Set the number of commands which @value{GDBN} keeps in its history list. This defaults to the value of the environment variable @code{HISTSIZE}, or to 256 if this variable is not set. @end table -@cindex history expansion History expansion assigns special meaning to the character @kbd{!}. -@ifset have-readline-appendices -@xref{Event Designators}. -@end ifset +@xref{Event Designators}, for more details. +@cindex history expansion, turn on/off Since @kbd{!} is also the logical not operator in C, history expansion is off by default. If you decide to enable history expansion with the @code{set history expansion on} command, you may sometimes need to @@ -13084,21 +13475,14 @@ history facilities do not attempt substitution on the strings The commands to control history expansion are: @table @code -@kindex set history expansion @item set history expansion on @itemx set history expansion +@kindex set history expansion Enable history expansion. History expansion is off by default. @item set history expansion off Disable history expansion. -The readline code comes with more complete documentation of -editing and history expansion features. Users unfamiliar with @sc{gnu} Emacs -or @code{vi} may wish to read it. -@ifset have-readline-appendices -@xref{Command Line Editing}. -@end ifset - @c @group @kindex show history @item show history @@ -13373,78 +13757,79 @@ Displays state of confirmation requests. @node Debugging Output @section Optional messages about internal happenings +@cindex optional debugging messages + @table @code -@kindex set debug arch +@kindex set debug +@cindex gdbarch debugging info @item set debug arch Turns on or off display of gdbarch debugging info. The default is off -@kindex show debug arch +@kindex show debug @item show debug arch Displays the current state of displaying gdbarch debugging info. -@kindex set debug event @item set debug event +@cindex event debugging info Turns on or off display of @value{GDBN} event debugging info. The default is off. -@kindex show debug event @item show debug event Displays the current state of displaying @value{GDBN} event debugging info. -@kindex set debug expression @item set debug expression +@cindex expression debugging info Turns on or off display of @value{GDBN} expression debugging info. The default is off. -@kindex show debug expression @item show debug expression Displays the current state of displaying @value{GDBN} expression debugging info. -@kindex set debug frame @item set debug frame +@cindex frame debugging info Turns on or off display of @value{GDBN} frame debugging info. The default is off. -@kindex show debug frame @item show debug frame Displays the current state of displaying @value{GDBN} frame debugging info. -@kindex set debug overload +@item set debug observer +@cindex observer debugging info +Turns on or off display of @value{GDBN} observer debugging. This +includes info such as the notification of observable events. +@item show debug observer +Displays the current state of observer debugging. @item set debug overload +@cindex C@t{++} overload debugging info Turns on or off display of @value{GDBN} C@t{++} overload debugging info. This includes info such as ranking of functions, etc. The default is off. -@kindex show debug overload @item show debug overload Displays the current state of displaying @value{GDBN} C@t{++} overload debugging info. -@kindex set debug remote @cindex packets, reporting on stdout @cindex serial connections, debugging @item set debug remote Turns on or off display of reports on all packets sent back and forth across the serial line to the remote machine. The info is printed on the @value{GDBN} standard output stream. The default is off. -@kindex show debug remote @item show debug remote Displays the state of display of remote packets. -@kindex set debug serial @item set debug serial Turns on or off display of @value{GDBN} serial debugging info. The default is off. -@kindex show debug serial @item show debug serial Displays the current state of displaying @value{GDBN} serial debugging info. -@kindex set debug target @item set debug target +@cindex target debugging info Turns on or off display of @value{GDBN} target debugging info. This info includes what is going on at the target level of GDB, as it happens. The -default is off. -@kindex show debug target +default is 0. Set it to 1 to track events, and to 2 to also track the +value of large memory transfers. Changes to this flag do not take effect +until the next time you connect to a target or use the @code{run} command. @item show debug target Displays the current state of displaying @value{GDBN} target debugging info. -@kindex set debug varobj @item set debug varobj +@cindex variable object debugging info Turns on or off display of @value{GDBN} variable object debugging info. The default is off. -@kindex show debug varobj @item show debug varobj Displays the current state of displaying @value{GDBN} variable object debugging info. @@ -13573,7 +13958,6 @@ messages when used in a user-defined command. @cindex hooks, pre-command @kindex hook -@kindex hook- You may define @dfn{hooks}, which are a special kind of user-defined command. Whenever you run the command @samp{foo}, if the user-defined command @samp{hook-foo} exists, it is executed (with no arguments) @@ -13581,7 +13965,6 @@ before that command. @cindex hooks, post-command @kindex hookpost -@kindex hookpost- A hook may also be defined which is run after the command you executed. Whenever you run the command @samp{foo}, if the user-defined command @samp{hookpost-foo} exists, it is executed (with no arguments) after @@ -14202,27 +14585,22 @@ in the TUI mode. List and give the size of all displayed windows. @item layout next -@kindex layout next +@kindex layout Display the next layout. @item layout prev -@kindex layout prev Display the previous layout. @item layout src -@kindex layout src Display the source window only. @item layout asm -@kindex layout asm Display the assembly window only. @item layout split -@kindex layout split Display the source and assembly window. @item layout regs -@kindex layout regs Display the register window together with the source or assembly window. @item focus next | prev | src | asm | regs | split @@ -14643,7 +15021,7 @@ corresponding output for that command will also be prefixed by that same @table @code @item @var{output} @expansion{} -@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}} +@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(@value{GDBP})" @var{nl}} @item @var{result-record} @expansion{} @code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}} @@ -16803,14 +17181,24 @@ There's no @value{GDBN} command which directly corresponds to this one. List the source files for the current executable. +It will always output the filename, but only when GDB can find the absolute +file name of a source file, will it output the fullname. + @subsubheading @value{GDBN} Command There's no @value{GDBN} command which directly corresponds to this one. @code{gdbtk} has an analogous command @samp{gdb_listfiles}. @subsubheading Example -N.A. - +@smallexample +(@value{GDBP}) +-file-list-exec-source-files +^done,files=[ +@{file=foo.c,fullname=/home/foo.c@}, +@{file=/home/bar.c,fullname=/home/bar.c@}, +@{file=gdb_could_not_find_fullpath.c@}] +(@value{GDBP}) +@end smallexample @subheading The @code{-file-list-shared-libraries} Command @findex -file-list-shared-libraries @@ -18496,7 +18884,7 @@ for details. This GDB was configured as "i386-pc-linux-gnu" ^Z^Zpre-prompt -(gdb) +(@value{GDBP}) ^Z^Zprompt @kbd{quit} @@ -18905,6 +19293,16 @@ ours fails to crash, we would know that the bug was not happening for us. If you had not told us to expect a crash, then we would not be able to draw any conclusion from our observations. +@pindex script +@cindex recording a session script +To collect all this information, you can use a session recording program +such as @command{script}, which is available on many Unix systems. +Just run your @value{GDBN} session inside @command{script} and then +include the @file{typescript} file with your bug report. + +Another way to record a @value{GDBN} session is to run @value{GDBN} +inside Emacs and then save the entire buffer to a file. + @item If you wish to suggest changes to the @value{GDBN} source, send us context diffs. If you even discuss something in the @value{GDBN} source, refer to @@ -19408,13 +19806,13 @@ either quit @value{GDBN} or create a core file of the current @value{GDBN} session. @smallexample -(gdb) @kbd{maint internal-error testing, 1, 2} +(@value{GDBP}) @kbd{maint internal-error testing, 1, 2} @dots{}/maint.c:121: internal-error: testing, 1, 2 A problem internal to GDB has been detected. Further debugging may prove unreliable. Quit this debugging session? (y or n) @kbd{n} Create a core file? (y or n) @kbd{n} -(gdb) +(@value{GDBP}) @end smallexample Takes an optional parameter that is used as the text of the error or @@ -19426,18 +19824,18 @@ warning message. Prints the contents of @value{GDBN}'s internal dummy-frame stack. @smallexample -(gdb) @kbd{b add} +(@value{GDBP}) @kbd{b add} @dots{} -(gdb) @kbd{print add(2,3)} +(@value{GDBP}) @kbd{print add(2,3)} Breakpoint 2, add (a=2, b=3) at @dots{} 58 return (a + b); The program being debugged stopped while in a function called from GDB. @dots{} -(gdb) @kbd{maint print dummy-frames} +(@value{GDBP}) @kbd{maint print dummy-frames} 0x1a57c80: pc=0x01014068 fp=0x0200bddc sp=0x0200bdd6 top=0x0200bdd4 id=@{stack=0x200bddc,code=0x101405c@} call_lo=0x01014000 call_hi=0x01014001 -(gdb) +(@value{GDBP}) @end smallexample Takes an optional file parameter. @@ -19468,7 +19866,7 @@ Print @value{GDBN}'s internal register group data structures. Takes an optional file parameter. @smallexample -(gdb) @kbd{maint print reggroups} +(@value{GDBP}) @kbd{maint print reggroups} Group Type general user float user @@ -19497,6 +19895,19 @@ data in a @file{gmon.out} file, be sure to move it to a safe location. Configuring with @samp{--enable-profiling} arranges for @value{GDBN} to be compiled with the @samp{-pg} compiler option. +@kindex maint set dwarf2 max-cache-age +@kindex maint show dwarf2 max-cache-age +@item maint set dwarf2 max-cache-age +@itemx maint show dwarf2 max-cache-age +Control the DWARF 2 compilation unit cache. + +In object files with inter-compilation-unit references, such as those +produced by the GCC option @samp{-feliminate-dwarf2-dups}, the DWARF 2 +reader needs to frequently refer to previously read compilation units. +This setting controls how long a compilation unit will remain in the cache +if it is not referenced. Setting it to zero disables caching, which will +slow down @value{GDBN} startup but reduce memory consumption. + @end table @@ -19896,17 +20307,20 @@ Reserved for future use. @item @code{O} --- reserved -Reserved for future use. - -@item @code{p}@var{n@dots{}} --- read reg @strong{(reserved)} +@item @code{p}@var{hex number of register} --- read register packet @cindex @code{p} packet -@xref{write register packet}. +@xref{read registers packet}, for a description of how the returned +register value is encoded. Reply: @table @samp -@item @var{r@dots{}.} -The hex encoded value of the register in target byte order. +@item @var{XX@dots{}} +the register's value +@item E@var{NN} +for an error +@item +Indicating an unrecognized @var{query}. @end table @item @code{P}@var{n@dots{}}@code{=}@var{r@dots{}} --- write register @@ -20656,7 +21070,7 @@ previous activity (continue, step). No additional continue or step request from @value{GDBN} is required. @smallexample -(gdb) continue +(@value{GDBP}) continue <- target requests 'system call X' target is stopped, @value{GDBN} executes system call -> GDB returns result diff --git a/gnu/usr.bin/binutils/gdb/doc/gdbint.texinfo b/gnu/usr.bin/binutils/gdb/doc/gdbint.texinfo index 7b58f5fd414..8dd234ad568 100644 --- a/gnu/usr.bin/binutils/gdb/doc/gdbint.texinfo +++ b/gnu/usr.bin/binutils/gdb/doc/gdbint.texinfo @@ -1,7 +1,7 @@ \input texinfo @c -*- texinfo -*- @setfilename gdbint.info @include gdb-cfg.texi -@dircategory Programming & development tools. +@dircategory Software development @direntry * Gdb-Internals: (gdbint). The GNU debugger's internals. @end direntry @@ -38,7 +38,7 @@ Free Documentation License''. @page @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.5 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.6 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Solutions\par \hfill \manvers\par @@ -84,6 +84,7 @@ as the mechanisms that adapt @value{GDBN} to specific hosts and targets. * Support Libraries:: * Coding:: * Porting GDB:: +* Versions and Branches:: * Releasing GDB:: * Testsuite:: * Hints:: @@ -476,9 +477,10 @@ no other code touches these values, the implementations of the above two macros can use them for their internal purposes. @findex target_stopped_data_address -@item target_stopped_data_address () -If the inferior has some watchpoint that triggered, return the address -associated with that watchpoint. Otherwise, return zero. +@item target_stopped_data_address (@var{addr_p}) +If the inferior has some watchpoint that triggered, place the address +associated with the watchpoint at the location pointed to by +@var{addr_p} and return non-zero. Otherwise, return zero. @findex HAVE_STEPPABLE_WATCHPOINT @item HAVE_STEPPABLE_WATCHPOINT @@ -598,15 +600,25 @@ less than 4, the number of debug registers available to x86 processors. @findex i386_stopped_data_address -@item i386_stopped_data_address (void) -The macros @code{STOPPED_BY_WATCHPOINT} and -@code{target_stopped_data_address} are set to call this function. The -argument passed to @code{STOPPED_BY_WATCHPOINT} is ignored. This +@item i386_stopped_data_address (@var{addr_p}) +The target function +@code{target_stopped_data_address} is set to call this function. +This function examines the breakpoint condition bits in the DR6 Debug Status register, as returned by the @code{I386_DR_LOW_GET_STATUS} macro, and returns the address associated with the first bit that is set in DR6. +@findex i386_stopped_by_watchpoint +@item i386_stopped_by_watchpoint (void) +The macro @code{STOPPED_BY_WATCHPOINT} +is set to call this function. The +argument passed to @code{STOPPED_BY_WATCHPOINT} is ignored. This +function examines the breakpoint condition bits in the DR6 Debug +Status register, as returned by the @code{I386_DR_LOW_GET_STATUS} +macro, and returns true if any bit is set. Otherwise, false is +returned. + @findex i386_insert_watchpoint @findex i386_remove_watchpoint @item i386_insert_watchpoint (@var{addr}, @var{len}, @var{type}) @@ -654,7 +666,7 @@ register. @item i386_stopped_by_hwbp (void) This function returns non-zero if the inferior has some watchpoint or hardware breakpoint that triggered. It works like -@code{i386_stopped_data_address}, except that it doesn't return the +@code{i386_stopped_data_address}, except that it doesn't record the address whose watchpoint triggered. @findex i386_cleanup_dregs @@ -1372,7 +1384,7 @@ Finally, here's an example of printing an address. The original code: @smallexample annotate_field (4); printf_filtered ("%s ", - local_hex_string_custom ((unsigned long) b->address, "08l")); + hex_string_custom ((unsigned long) b->address, 8)); @end smallexample It became: @@ -2134,9 +2146,6 @@ The default name of @value{GDBN}'s initialization file (normally @item NO_STD_REGS This macro is deprecated. -@item NO_SYS_FILE -Define this if your system does not have a @code{<sys/file.h>}. - @item SIGWINCH_HANDLER If your host defines @code{SIGWINCH}, you can define this to be the name of a function to be called if @code{SIGWINCH} is received. @@ -2168,19 +2177,9 @@ The default value of the prompt string (normally @code{"(gdb) "}). @cindex terminal device The name of the generic TTY device, defaults to @code{"/dev/tty"}. -@item FCLOSE_PROVIDED -Define this if the system declares @code{fclose} in the headers included -in @code{defs.h}. This isn't needed unless your compiler is unusually -anal. - @item FOPEN_RB Define this if binary files are opened the same way as text files. -@item GETENV_PROVIDED -Define this if the system declares @code{getenv} in its headers included -in @code{defs.h}. This isn't needed unless your compiler is unusually -anal. - @item HAVE_MMAP @findex mmap In some cases, use the system call @code{mmap} for reading symbol @@ -2251,10 +2250,6 @@ of functions to indicate that they never return. The default is already set correctly if compiling with GCC. This will almost never need to be defined. -@item NO_SIGINTERRUPT -@findex siginterrupt -Define this to indicate that @code{siginterrupt} is not available. - @item SEEK_CUR @itemx SEEK_SET Define these to appropriate value for the system @code{lseek}, if not already @@ -2264,11 +2259,6 @@ defined. This is the signal for stopping @value{GDBN}. Defaults to @code{SIGTSTP}. (Only redefined for the Convex.) -@item USE_O_NOCTTY -Define this if the interior's tty should be opened with the @code{O_NOCTTY} -flag. (FIXME: This should be a native-only flag, but @file{inflow.c} is -always linked in.) - @item USG Means that System V (prior to SVR4) include files are in use. (FIXME: This symbol is abused in @file{infrun.c}, @file{regex.c}, and @@ -2930,12 +2920,6 @@ Define if the compiler promotes a @code{short} or @code{char} parameter to an @code{int}, but still reports the parameter as its original type, rather than the promoted type. -@item BELIEVE_PCC_PROMOTION_TYPE -@findex BELIEVE_PCC_PROMOTION_TYPE -Define this if @value{GDBN} should believe the type of a @code{short} -argument when compiled by @code{pcc}, but look within a full int space to get -its value. Only defined for Sun-3 at present. - @item BITS_BIG_ENDIAN @findex BITS_BIG_ENDIAN Define this if the numbering of bits in the targets does @strong{not} match the @@ -3041,35 +3025,6 @@ Since the adjustment of a breakpoint may significantly alter a user's expectation, @value{GDBN} prints a warning when an adjusted breakpoint is initially set and each time that that breakpoint is hit. -@item DEPRECATED_CALL_DUMMY_WORDS -@findex DEPRECATED_CALL_DUMMY_WORDS -Pointer to an array of @code{LONGEST} words of data containing -host-byte-ordered @code{DEPRECATED_REGISTER_SIZE} sized values that -partially specify the sequence of instructions needed for an inferior -function call. - -Should be deprecated in favor of a macro that uses target-byte-ordered -data. - -This method has been replaced by @code{push_dummy_code} -(@pxref{push_dummy_code}). - -@item DEPRECATED_SIZEOF_CALL_DUMMY_WORDS -@findex DEPRECATED_SIZEOF_CALL_DUMMY_WORDS -The size of @code{DEPRECATED_CALL_DUMMY_WORDS}. This must return a -positive value. See also @code{DEPRECATED_CALL_DUMMY_LENGTH}. - -This method has been replaced by @code{push_dummy_code} -(@pxref{push_dummy_code}). - -@item CALL_DUMMY -@findex CALL_DUMMY -A static initializer for @code{DEPRECATED_CALL_DUMMY_WORDS}. -Deprecated. - -This method has been replaced by @code{push_dummy_code} -(@pxref{push_dummy_code}). - @item CALL_DUMMY_LOCATION @findex CALL_DUMMY_LOCATION See the file @file{inferior.h}. @@ -3090,15 +3045,6 @@ written to the target. This is often the case for program counters, status words, and other special registers. If this is not defined, @value{GDBN} will assume that all registers may be written. -@item DO_DEFERRED_STORES -@itemx CLEAR_DEFERRED_STORES -@findex CLEAR_DEFERRED_STORES -@findex DO_DEFERRED_STORES -Define this to execute any deferred stores of registers into the inferior, -and to cancel any deferred stores. - -Currently only implemented correctly for native Sparc configurations? - @item int CONVERT_REGISTER_P(@var{regnum}) @findex CONVERT_REGISTER_P Return non-zero if register @var{regnum} can represent data values in a @@ -3308,20 +3254,20 @@ function end symbol is 0. For such targets, you must define @code{FUNCTION_EPILOGUE_SIZE} to expand into the standard size of a function's epilogue. -@item FUNCTION_START_OFFSET -@findex FUNCTION_START_OFFSET +@item DEPRECATED_FUNCTION_START_OFFSET +@findex DEPRECATED_FUNCTION_START_OFFSET An integer, giving the offset in bytes from a function's address (as used in the values of symbols, function pointers, etc.), and the function's first genuine instruction. This is zero on almost all machines: the function's address is usually -the address of its first instruction. However, on the VAX, for example, -each function starts with two bytes containing a bitmask indicating -which registers to save upon entry to the function. The VAX @code{call} -instructions check this value, and save the appropriate registers -automatically. Thus, since the offset from the function's address to -its first instruction is two bytes, @code{FUNCTION_START_OFFSET} would -be 2 on the VAX. +the address of its first instruction. However, on the VAX, for +example, each function starts with two bytes containing a bitmask +indicating which registers to save upon entry to the function. The +VAX @code{call} instructions check this value, and save the +appropriate registers automatically. Thus, since the offset from the +function's address to its first instruction is two bytes, +@code{DEPRECATED_FUNCTION_START_OFFSET} would be 2 on the VAX. @item GCC_COMPILED_FLAG_SYMBOL @itemx GCC2_COMPILED_FLAG_SYMBOL @@ -3411,10 +3357,10 @@ The epilogue of a function is defined as the part of a function where the stack frame of the function already has been destroyed up to the final `return from function call' instruction. -@item SIGTRAMP_START (@var{pc}) -@findex SIGTRAMP_START -@itemx SIGTRAMP_END (@var{pc}) -@findex SIGTRAMP_END +@item DEPRECATED_SIGTRAMP_START (@var{pc}) +@findex DEPRECATED_SIGTRAMP_START +@itemx DEPRECATED_SIGTRAMP_END (@var{pc}) +@findex DEPRECATED_SIGTRAMP_END Define these to be the start and end address of the @code{sigtramp} for the given @var{pc}. On machines where the address is just a compile time constant, the macro expansion will typically just ignore the supplied @@ -3551,43 +3497,6 @@ form. Return the appropriate register set for a core file section with name @var{sect_name} and size @var{sect_size}. - -@item RETURN_VALUE_ON_STACK(@var{type}) -@findex RETURN_VALUE_ON_STACK -@cindex returning structures by value -@cindex structures, returning by value - -Return non-zero if values of type TYPE are returned on the stack, using -the ``struct convention'' (i.e., the caller provides a pointer to a -buffer in which the callee should store the return value). This -controls how the @samp{finish} command finds a function's return value, -and whether an inferior function call reserves space on the stack for -the return value. - -The full logic @value{GDBN} uses here is kind of odd. - -@itemize @bullet -@item -If the type being returned by value is not a structure, union, or array, -and @code{RETURN_VALUE_ON_STACK} returns zero, then @value{GDBN} -concludes the value is not returned using the struct convention. - -@item -Otherwise, @value{GDBN} calls @code{USE_STRUCT_CONVENTION} (see below). -If that returns non-zero, @value{GDBN} assumes the struct convention is -in use. -@end itemize - -In other words, to indicate that a given type is returned by value using -the struct convention, that type must be either a struct, union, array, -or something @code{RETURN_VALUE_ON_STACK} likes, @emph{and} something -that @code{USE_STRUCT_CONVENTION} likes. - -Note that, in C and C@t{++}, arrays are never returned by value. In those -languages, these predicates will always see a pointer type, never an -array type. All the references above to arrays being returned by value -apply only to other languages. - @item SOFTWARE_SINGLE_STEP_P() @findex SOFTWARE_SINGLE_STEP_P Define this as 1 if the target does not have a hardware single-step @@ -3632,22 +3541,6 @@ and guess the starting and ending addresses of the compilation unit from them. @end itemize -@item PCC_SOL_BROKEN -@findex PCC_SOL_BROKEN -(Used only in the Convex target.) - -@item PC_IN_SIGTRAMP (@var{pc}, @var{name}) -@findex PC_IN_SIGTRAMP -@cindex sigtramp -The @dfn{sigtramp} is a routine that the kernel calls (which then calls -the signal handler). On most machines it is a library routine that is -linked into the executable. - -This function, given a program counter value in @var{pc} and the -(possibly NULL) name of the function in which that @var{pc} resides, -returns nonzero if the @var{pc} and/or @var{name} show that we are in -sigtramp. - @item PC_LOAD_SEGMENT @findex PC_LOAD_SEGMENT If defined, print information about the load segment for the program @@ -3695,7 +3588,7 @@ definition is only used in generic code when parsing "$ps".) If defined, used by @code{frame_pop} to remove a stack frame. This method has been superseeded by generic code. -@item push_dummy_call (@var{gdbarch}, @var{func_addr}, @var{regcache}, @var{pc_addr}, @var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr}) +@item push_dummy_call (@var{gdbarch}, @var{function}, @var{regcache}, @var{pc_addr}, @var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr}) @findex push_dummy_call @findex DEPRECATED_PUSH_ARGUMENTS. @anchor{push_dummy_call} Define this to push the dummy frame's call to @@ -3703,13 +3596,15 @@ the inferior function onto the stack. In addition to pushing @var{nargs}, the code should push @var{struct_addr} (when @var{struct_return}), and the return address (@var{bp_addr}). +@var{function} is a pointer to a @code{struct value}; on architectures that use +function descriptors, this contains the function descriptor value. + Returns the updated top-of-stack pointer. This method replaces @code{DEPRECATED_PUSH_ARGUMENTS}. @item CORE_ADDR push_dummy_code (@var{gdbarch}, @var{sp}, @var{funaddr}, @var{using_gcc}, @var{args}, @var{nargs}, @var{value_type}, @var{real_pc}, @var{bp_addr}) @findex push_dummy_code -@findex DEPRECATED_FIX_CALL_DUMMY @anchor{push_dummy_code} Given a stack based call dummy, push the instruction sequence (including space for a breakpoint) to which the called function should return. @@ -3722,24 +3617,8 @@ By default, the stack is grown sufficient to hold a frame-aligned (@pxref{frame_align}) breakpoint, @var{bp_addr} is set to the address reserved for that breakpoint, and @var{real_pc} set to @var{funaddr}. -This method replaces @code{DEPRECATED_CALL_DUMMY_WORDS}, -@code{DEPRECATED_SIZEOF_CALL_DUMMY_WORDS}, @code{CALL_DUMMY}, -@code{CALL_DUMMY_LOCATION}, @code{DEPRECATED_REGISTER_SIZE}, -@code{GDB_TARGET_IS_HPPA}, -@code{DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET}, and -@code{DEPRECATED_FIX_CALL_DUMMY}. - -@item DEPRECATED_PUSH_DUMMY_FRAME -@findex DEPRECATED_PUSH_DUMMY_FRAME -Used in @samp{call_function_by_hand} to create an artificial stack frame. - -@item DEPRECATED_REGISTER_BYTES -@findex DEPRECATED_REGISTER_BYTES -The total amount of space needed to store @value{GDBN}'s copy of the -machine's register state. - -This is no longer needed. @value{GDBN} instead computes the size of the -register buffer at run-time. +This method replaces @code{CALL_DUMMY_LOCATION}, +@code{DEPRECATED_REGISTER_SIZE}. @item REGISTER_NAME(@var{i}) @findex REGISTER_NAME @@ -3870,10 +3749,6 @@ value that is to be returned. This method has been deprecated in favour of @code{gdbarch_return_value} (@pxref{gdbarch_return_value}). -@item SUN_FIXED_LBRAC_BUG -@findex SUN_FIXED_LBRAC_BUG -(Used only for Sun-3 and Sun-4 targets.) - @item SYMBOL_RELOADING_DEFAULT @findex SYMBOL_RELOADING_DEFAULT The default value of the ``symbol-reloading'' variable. (Never defined in @@ -3953,9 +3828,9 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}. @findex read_sp @findex read_fp @anchor{TARGET_READ_SP} These change the behavior of @code{read_pc}, -@code{write_pc}, @code{read_sp} and @code{deprecated_read_fp}. For most -targets, these may be left undefined. @value{GDBN} will call the read -and write register functions with the relevant @code{_REGNUM} argument. +@code{write_pc}, and @code{read_sp}. For most targets, these may be +left undefined. @value{GDBN} will call the read and write register +functions with the relevant @code{_REGNUM} argument. These macros are useful when a target keeps one of these registers in a hard to get at place; for example, part in a segment register and part @@ -3996,8 +3871,8 @@ frame. The value returned must match the dummy frame stack value previously saved using @code{SAVE_DUMMY_FRAME_TOS}. @xref{SAVE_DUMMY_FRAME_TOS}. -@item USE_STRUCT_CONVENTION (@var{gcc_p}, @var{type}) -@findex USE_STRUCT_CONVENTION +@item DEPRECATED_USE_STRUCT_CONVENTION (@var{gcc_p}, @var{type}) +@findex DEPRECATED_USE_STRUCT_CONVENTION If defined, this must be an expression that is nonzero if a value of the given @var{type} being returned from a function must have space allocated for it on the stack. @var{gcc_p} is true if the function @@ -4471,10 +4346,6 @@ target systems are the same. These macros should be defined (or left undefined) in @file{nm-@var{system}.h}. @table @code -@item ATTACH_DETACH -@findex ATTACH_DETACH -If defined, then @value{GDBN} will include support for the @code{attach} and -@code{detach} commands. @item CHILD_PREPARE_TO_STORE @findex CHILD_PREPARE_TO_STORE @@ -4493,10 +4364,6 @@ Define this if the native-dependent code will provide its own routines @file{infptrace.c} is included in this configuration, the default routines in @file{infptrace.c} are used for these functions. -@item FILES_INFO_HOOK -@findex FILES_INFO_HOOK -(Only defined for Convex.) - @item FP0_REGNUM @findex FP0_REGNUM This macro is normally defined to be the number of the first floating @@ -4527,12 +4394,6 @@ needs to know this so that it can subtract this address from absolute addresses in the upage, that are obtained via ptrace or from core files. On systems that don't need this value, set it to zero. -@item KERNEL_U_ADDR_BSD -@findex KERNEL_U_ADDR_BSD -Define this to cause @value{GDBN} to determine the address of @code{u} at -runtime, by using Berkeley-style @code{nlist} on the kernel's image in -the root directory. - @item KERNEL_U_ADDR_HPUX @findex KERNEL_U_ADDR_HPUX Define this to cause @value{GDBN} to determine the address of @code{u} at @@ -4550,10 +4411,6 @@ Defines the format for the name of a @file{/proc} device. Should be defined in @file{nm.h} @emph{only} in order to override the default definition in @file{procfs.c}. -@item PTRACE_FP_BUG -@findex PTRACE_FP_BUG -See @file{mach386-xdep.c}. - @item PTRACE_ARG3_TYPE @findex PTRACE_ARG3_TYPE The type of the third argument to the @code{ptrace} system call, if it @@ -4593,10 +4450,6 @@ the shell execs, and once when the program itself execs. If the actual number of traps is something other than 2, then define this macro to expand into the number expected. -@item SVR4_SHARED_LIBS -@findex SVR4_SHARED_LIBS -Define this to indicate that SVR4-style shared libraries are in use. - @item USE_PROC_FS @findex USE_PROC_FS This determines whether small routines in @file{*-tdep.c}, which @@ -4872,134 +4725,104 @@ functions, since they might never return to your code (they @cindex multi-arch data @cindex data-pointer, per-architecture/per-module -The multi-arch framework includes a mechanism for adding module specific -per-architecture data-pointers to the @code{struct gdbarch} architecture -object. +The multi-arch framework includes a mechanism for adding module +specific per-architecture data-pointers to the @code{struct gdbarch} +architecture object. -A module registers one or more per-architecture data-pointers using the -function @code{register_gdbarch_data}: +A module registers one or more per-architecture data-pointers using: -@deftypefun struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *@var{init}) +@deftypefun struct gdbarch_data *gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *@var{pre_init}) +@var{pre_init} is used to, on-demand, allocate an initial value for a +per-architecture data-pointer using the architecture's obstack (passed +in as a parameter). Since @var{pre_init} can be called during +architecture creation, it is not parameterized with the architecture. +and must not call modules that use per-architecture data. +@end deftypefun -The @var{init} function is used to obtain an initial value for a -per-architecture data-pointer. The function is called, after the -architecture has been created, when the data-pointer is still -uninitialized (@code{NULL}) and its value has been requested via a call -to @code{gdbarch_data}. A data-pointer can also be initialize -explicitly using @code{set_gdbarch_data}. +@deftypefun struct gdbarch_data *gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *@var{post_init}) +@var{post_init} is used to obtain an initial value for a +per-architecture data-pointer @emph{after}. Since @var{post_init} is +always called after architecture creation, it both receives the fully +initialized architecture and is free to call modules that use +per-architecture data (care needs to be taken to ensure that those +other modules do not try to call back to this module as that will +create in cycles in the initialization call graph). +@end deftypefun -Any memory required by the @var{init} function should be allocated -using @code{GDBARCH_OBSTACK_ZALLOC}. That memory is automatically -released when the corresponding architecture is deleted. +These functions return a @code{struct gdbarch_data} that is used to +identify the per-architecture data-pointer added for that module. -The function @code{register_gdbarch_data} returns a @code{struct -gdbarch_data} that is used to identify the data-pointer that was added -to the module. +The per-architecture data-pointer is accessed using the function: +@deftypefun void *gdbarch_data (struct gdbarch *@var{gdbarch}, struct gdbarch_data *@var{data_handle}) +Given the architecture @var{arch} and module data handle +@var{data_handle} (returned by @code{gdbarch_data_register_pre_init} +or @code{gdbarch_data_register_post_init}), this function returns the +current value of the per-architecture data-pointer. If the data +pointer is @code{NULL}, it is first initialized by calling the +corresponding @var{pre_init} or @var{post_init} method. @end deftypefun -A typical module has an @code{init} function of the form: +The examples below assume the following definitions: @smallexample struct nozel @{ int total; @}; static struct gdbarch_data *nozel_handle; -static void * -nozel_init (struct gdbarch *gdbarch) -@{ - struct nozel *data = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct nozel); - @dots{} - return data; -@} @end smallexample -Since uninitialized (@code{NULL}) data-pointers are initialized -on-demand, an @code{init} function is free to call other modules that -use data-pointers. Those modules data-pointers will be initialized as -needed. Care should be taken to ensure that the @code{init} call graph -does not contain cycles. +A module can extend the architecture vector, adding additional +per-architecture data, using the @var{pre_init} method. The module's +per-architecture data is then initialized during architecture +creation. -The data-pointer is registered with the call: +In the below, the module's per-architecture @emph{nozel} is added. An +architecture can specify its nozel by calling @code{set_gdbarch_nozel} +from @code{gdbarch_init}. @smallexample -void -_initialize_nozel (void) +static void * +nozel_pre_init (struct obstack *obstack) @{ - nozel_handle = register_gdbarch_data (nozel_init); -@dots{} + struct nozel *data = OBSTACK_ZALLOC (obstack, struct nozel); + return data; +@} @end smallexample -The per-architecture data-pointer is accessed using the function: - -@deftypefun void *gdbarch_data (struct gdbarch *@var{gdbarch}, struct gdbarch_data *@var{data_handle}) -Given the architecture @var{arch} and module data handle -@var{data_handle} (returned by @code{register_gdbarch_data}, this -function returns the current value of the per-architecture data-pointer. -@end deftypefun - -The non-@code{NULL} data-pointer returned by @code{gdbarch_data} should -be saved in a local variable and then used directly: - @smallexample -int -nozel_total (struct gdbarch *gdbarch) +extern void +set_gdbarch_nozel (struct gdbarch *gdbarch, int total) @{ - int total; struct nozel *data = gdbarch_data (gdbarch, nozel_handle); - @dots{} - return total; + data->total = nozel; @} @end smallexample -It is also possible to directly initialize the data-pointer using: - -@deftypefun void set_gdbarch_data (struct gdbarch *@var{gdbarch}, struct gdbarch_data *@var{handle}, void *@var{pointer}) -Set the still @code{NULL} data-pointer corresponding to @var{handle} -to the non-@code{NULL} @var{pointer} value. -@end deftypefun +A module can on-demand create architecture dependant data structures +using @code{post_init}. -This function is used by modules that require a mechanism for explicitly -setting the per-architecture data-pointer during architecture creation: +In the below, the nozel's total is computed on-demand by +@code{nozel_post_init} using information obtained from the +architecture. @smallexample -/* Always return a non-NULL nozel. */ -static struct nozel * -gdbarch_nozel (struct gdbarch *gdbarch) +static void * +nozel_post_init (struct gdbarch *gdbarch) @{ - struct nozel *nozel = gdbarch_data (gdbarch, nozel_handle); - if (nozel == NULL) - @{ - nozel = nozel_init (gdbarch); - set_gdbarch_data (gdbarch, nozel_handle, nozel); - @} - return nozel; + struct nozel *data = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct nozel); + nozel->total = gdbarch@dots{} (gdbarch); + return data; @} @end smallexample @smallexample -/* Called during architecture creation. */ -extern void -set_gdbarch_nozel (struct gdbarch *gdbarch, int total) +extern int +nozel_total (struct gdbarch *gdbarch) @{ - struct nozel *data = gdbarch_nozel (gdbarch); - @dots{} - data->total = total; + struct nozel *data = gdbarch_data (gdbarch, nozel_handle); + return data->total; @} @end smallexample -@smallexample -void -_initialize_nozel (void) -@{ - nozel_handle = register_gdbarch_data (nozel_init); - @dots{} -@end smallexample - -@noindent -Note that an @code{init} function still needs to be registered. It is -used to initialize the data-pointer when the architecture creation phase -fail to set an initial value. - - @section Wrapping Output Lines @cindex line wrap in output @@ -5079,7 +4902,7 @@ allocation of small temporary values (such as strings). restrict the memory being allocated to no more than a few kilobytes.} @value{GDBN} uses the string function @code{xstrdup} and the print -function @code{xasprintf}. +function @code{xstrprintf}. @emph{Pragmatics: @code{asprintf} and @code{strdup} can fail. Print functions such as @code{sprintf} are very prone to buffer overflow @@ -5557,109 +5380,198 @@ target-dependent @file{.h} and @file{.c} files used for your configuration. @end itemize -@node Releasing GDB +@node Versions and Branches +@chapter Versions and Branches -@chapter Releasing @value{GDBN} -@cindex making a new release of gdb +@section Versions -@section Versions and Branches +@value{GDBN}'s version is determined by the file +@file{gdb/version.in} and takes one of the following forms: -@subsection Version Identifiers +@table @asis +@item @var{major}.@var{minor} +@itemx @var{major}.@var{minor}.@var{patchlevel} +an official release (e.g., 6.0 or 6.0.1) +@item @var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}@var{MM}@var{DD} +a snapshot (e.g., 6.0.50_20020630) +@item @var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}-@var{MM}-@var{DD}-cvs +a @sc{cvs} check out (e.g., 6.0.90_2004-02-30-cvs) +@item @var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}@var{MM}@var{DD} (@var{vendor}) +a vendor specific release of @value{GDBN}, that while based on@* +@var{major}.@var{minor}.@var{patchlevel}_@var{YYYY}@var{MM}@var{DD}, +may contain additional changes +@end table -@value{GDBN}'s version is determined by the file @file{gdb/version.in}. +@value{GDBN}'s mainline uses the @var{major} and @var{minor} version +numbers from the most recent release branch, with a @var{patchlevel} +of 50. As each new release branch is created, the mainline +@var{major} and @var{minor} version numbers are accordingly updated. -@value{GDBN}'s mainline uses ISO dates to differentiate between -versions. The CVS repository uses @var{YYYY}-@var{MM}-@var{DD}-cvs -while the corresponding snapshot uses @var{YYYYMMDD}. +@value{GDBN}'s release branch uses a similar, but slightly more +complicated scheme. When the branch is first cut, the mainline's +@var{patchlevel} is changed to .90. As draft releases are drawn from +the branch, the @var{patchlevel} is incremented. Once the first +release (@var{major}.@var{minor}) has been made, the version prefix is +updated to @var{major}.@var{minor}.0.90. Follow on releases have an +incremented @var{patchlevel}. -@value{GDBN}'s release branch uses a slightly more complicated scheme. -When the branch is first cut, the mainline version identifier is -prefixed with the @var{major}.@var{minor} from of the previous release -series but with .90 appended. As draft releases are drawn from the -branch, the minor minor number (.90) is incremented. Once the first -release (@var{M}.@var{N}) has been made, the version prefix is updated -to @var{M}.@var{N}.0.90 (dot zero, dot ninety). Follow on releases have -an incremented minor minor version number (.0). +If the previous @value{GDBN} version is 6.1 and the current version is +6.2, then, substituting 6 for @var{major} and 1 or 2 for @var{minor}, +here's an illustration of a typical sequence: -Using 5.1 (previous) and 5.2 (current), the example below illustrates a -typical sequence of version identifiers: +@smallexample + <HEAD> + | +6.1.50_2002-03-02-cvs + | + +---------------------------. + | <gdb_6_2-branch> + | | +6.2.50_2002-03-03-cvs 6.1.90 (draft #1) + | | +6.2.50_2002-03-04-cvs 6.1.90_2002-03-04-cvs + | | +6.2.50_2002-03-05-cvs 6.1.91 (draft #2) + | | +6.2.50_2002-03-06-cvs 6.1.91_2002-03-06-cvs + | | +6.2.50_2002-03-07-cvs 6.2 (release) + | | +6.2.50_2002-03-08-cvs 6.2.0.90_2002-03-08-cvs + | | +6.2.50_2002-03-09-cvs 6.2.1 (update) + | | +6.2.50_2002-03-10-cvs <branch closed> + | +6.2.50_2002-03-11-cvs + | + +---------------------------. + | <gdb_6_3-branch> + | | +6.3.50_2002-03-12-cvs 6.2.90 (draft #1) + | | +@end smallexample -@table @asis -@item 5.1.1 -final release from previous branch -@item 2002-03-03-cvs -main-line the day the branch is cut -@item 5.1.90-2002-03-03-cvs -corresponding branch version -@item 5.1.91 -first draft release candidate -@item 5.1.91-2002-03-17-cvs -updated branch version -@item 5.1.92 -second draft release candidate -@item 5.1.92-2002-03-31-cvs -updated branch version -@item 5.1.93 -final release candidate (see below) -@item 5.2 -official release -@item 5.2.0.90-2002-04-07-cvs -updated CVS branch version -@item 5.2.1 -second official release -@end table +@section Release Branches +@cindex Release Branches -Notes: +@value{GDBN} draws a release series (6.2, 6.2.1, @dots{}) from a +single release branch, and identifies that branch using the @sc{cvs} +branch tags: -@itemize @bullet -@item -Minor minor minor draft release candidates such as 5.2.0.91 have been -omitted from the example. Such release candidates are, typically, never -made. -@item -For 5.1.93 the bziped tar ball @file{gdb-5.1.93.tar.bz2} is just the -official @file{gdb-5.2.tar} renamed and compressed. -@end itemize +@smallexample +gdb_@var{major}_@var{minor}-@var{YYYY}@var{MM}@var{DD}-branchpoint +gdb_@var{major}_@var{minor}-branch +gdb_@var{major}_@var{minor}-@var{YYYY}@var{MM}@var{DD}-release +@end smallexample + +@emph{Pragmatics: To help identify the date at which a branch or +release is made, both the branchpoint and release tags include the +date that they are cut (@var{YYYY}@var{MM}@var{DD}) in the tag. The +branch tag, denoting the head of the branch, does not need this.} + +@section Vendor Branches +@cindex vendor branches To avoid version conflicts, vendors are expected to modify the file @file{gdb/version.in} to include a vendor unique alphabetic identifier (an official @value{GDBN} release never uses alphabetic characters in -its version identifer). +its version identifer). E.g., @samp{6.2widgit2}, or @samp{6.2 (Widgit +Inc Patch 2)}. + +@section Experimental Branches +@cindex experimental branches -Since @value{GDBN} does not make minor minor minor releases (e.g., -5.1.0.1) the conflict between that and a minor minor draft release -identifier (e.g., 5.1.0.90) is avoided. +@subsection Guidelines +@value{GDBN} permits the creation of branches, cut from the @sc{cvs} +repository, for experimental development. Branches make it possible +for developers to share preliminary work, and maintainers to examine +significant new developments. -@subsection Branches +The following are a set of guidelines for creating such branches: -@value{GDBN} draws a release series (5.2, 5.2.1, @dots{}) from a single -release branch (gdb_5_2-branch). Since minor minor minor releases -(5.1.0.1) are not made, the need to branch the release branch is avoided -(it also turns out that the effort required for such a a branch and -release is significantly greater than the effort needed to create a new -release from the head of the release branch). +@table @emph + +@item a branch has an owner +The owner can set further policy for a branch, but may not change the +ground rules. In particular, they can set a policy for commits (be it +adding more reviewers or deciding who can commit). + +@item all commits are posted +All changes committed to a branch shall also be posted to +@email{gdb-patches@@sources.redhat.com, the @value{GDBN} patches +mailing list}. While commentary on such changes are encouraged, people +should remember that the changes only apply to a branch. + +@item all commits are covered by an assignment +This ensures that all changes belong to the Free Software Foundation, +and avoids the possibility that the branch may become contaminated. + +@item a branch is focused +A focused branch has a single objective or goal, and does not contain +unnecessary or irrelevant changes. Cleanups, where identified, being +be pushed into the mainline as soon as possible. -Releases 5.0 and 5.1 used branch and release tags of the form: +@item a branch tracks mainline +This keeps the level of divergence under control. It also keeps the +pressure on developers to push cleanups and other stuff into the +mainline. + +@item a branch shall contain the entire @value{GDBN} module +The @value{GDBN} module @code{gdb} should be specified when creating a +branch (branches of individual files should be avoided). @xref{Tags}. + +@item a branch shall be branded using @file{version.in} +The file @file{gdb/version.in} shall be modified so that it identifies +the branch @var{owner} and branch @var{name}, e.g., +@samp{6.2.50_20030303_owner_name} or @samp{6.2 (Owner Name)}. + +@end table +@subsection Tags +@anchor{Tags} + +To simplify the identification of @value{GDBN} branches, the following +branch tagging convention is strongly recommended: + +@table @code + +@item @var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint +@itemx @var{owner}_@var{name}-@var{YYYYMMDD}-branch +The branch point and corresponding branch tag. @var{YYYYMMDD} is the +date that the branch was created. A branch is created using the +sequence: @anchor{experimental branch tags} @smallexample -gdb_N_M-YYYY-MM-DD-branchpoint -gdb_N_M-YYYY-MM-DD-branch -gdb_M_N-YYYY-MM-DD-release +cvs rtag @var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint gdb +cvs rtag -b -r @var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint \ + @var{owner}_@var{name}-@var{YYYYMMDD}-branch gdb @end smallexample -Release 5.2 is trialing the branch and release tags: - +@item @var{owner}_@var{name}-@var{yyyymmdd}-mergepoint +The tagged point, on the mainline, that was used when merging the branch +on @var{yyyymmdd}. To merge in all changes since the branch was cut, +use a command sequence like: @smallexample -gdb_N_M-YYYY-MM-DD-branchpoint -gdb_N_M-branch -gdb_M_N-YYYY-MM-DD-release +cvs rtag @var{owner}_@var{name}-@var{yyyymmdd}-mergepoint gdb +cvs update \ + -j@var{owner}_@var{name}-@var{YYYYMMDD}-branchpoint + -j@var{owner}_@var{name}-@var{yyyymmdd}-mergepoint @end smallexample +@noindent +Similar sequences can be used to just merge in changes since the last +merge. -@emph{Pragmatics: The branchpoint and release tags need to identify when -a branch and release are made. The branch tag, denoting the head of the -branch, does not have this criteria.} +@end table +@noindent +For further information on @sc{cvs}, see +@uref{http://www.gnu.org/software/cvs/, Concurrent Versions System}. + +@node Releasing GDB + +@chapter Releasing @value{GDBN} +@cindex making a new release of gdb @section Branch Commit Policy @@ -6460,6 +6372,15 @@ difficult to test, such as code that handles host OS failures or bugs in particular versions of compilers, and it's OK not to try to write tests for all of those. +DejaGNU supports separate build, host, and target machines. However, +some @value{GDBN} test scripts do not work if the build machine and +the host machine are not the same. In such an environment, these scripts +will give a result of ``UNRESOLVED'', like this: + +@smallexample +UNRESOLVED: gdb.base/example.exp: This test script does not work on a remote host. +@end smallexample + @section Testsuite Organization @cindex test suite organization diff --git a/gnu/usr.bin/binutils/gdb/doc/stabs.texinfo b/gnu/usr.bin/binutils/gdb/doc/stabs.texinfo index a4461321acd..dd8ccdd2d93 100644 --- a/gnu/usr.bin/binutils/gdb/doc/stabs.texinfo +++ b/gnu/usr.bin/binutils/gdb/doc/stabs.texinfo @@ -5,7 +5,7 @@ @c This is a dir.info fragment to support semi-automated addition of @c manuals to an info tree. -@dircategory Programming & development tools. +@dircategory Software development @direntry * Stabs: (stabs). The "stabs" debugging information format. @end direntry @@ -35,7 +35,7 @@ Free Documentation License''. @page @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.4 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.5 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Support\par \hfill \manvers\par @@ -422,9 +422,33 @@ file. This information is contained in a symbol of stab type value of the symbol is the start address of the portion of the text section corresponding to that file. -With the Sun Solaris2 compiler, the desc field contains a -source-language code. -@c Do the debuggers use it? What are the codes? -djm +Some compilers use the desc field to indicate the language of the +source file. Sun's compilers started this usage, and the first +constants are derived from their documentation. Languages added +by gcc/gdb start at 0x32 to avoid conflict with languages Sun may +add in the future. A desc field with a value 0 indicates that no +language has been specified via this mechanism. + +@table @asis +@item @code{N_SO_AS} (0x1) +Assembly language +@item @code{N_SO_C} (0x2) +K&R traditional C +@item @code{N_SO_ANSI_C} (0x3) +ANSI C +@item @code{N_SO_CC} (0x4) +C++ +@item @code{N_SO_FORTRAN} (0x5) +Fortran +@item @code{N_SO_PASCAL} (0x6) +Pascal +@item @code{N_SO_FORTRAN90} (0x7) +Fortran90 +@item @code{N_SO_OBJC} (0x32) +Objective-C +@item @code{N_SO_OBJCPLUS} (0x33) +Objective-C++ +@end table Some compilers (for example, GCC2 and SunOS4 @file{/bin/cc}) also include the directory in which the source was compiled, in a second diff --git a/gnu/usr.bin/binutils/gdb/dpx2-nat.c b/gnu/usr.bin/binutils/gdb/dpx2-nat.c deleted file mode 100644 index 488c06a5383..00000000000 --- a/gnu/usr.bin/binutils/gdb/dpx2-nat.c +++ /dev/null @@ -1,83 +0,0 @@ -/* DPX2 host interface. - Copyright 1988, 1989, 1991, 1993, 1995, 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "defs.h" -#include "gdbcore.h" - -#include "gdb_string.h" -#include <sys/types.h> -#include <sys/param.h> -#include <sys/dir.h> -#include <signal.h> -#include <sys/user.h> -#include <sys/reg.h> -#include <sys/utsname.h> - - -/* This table must line up with REGISTER_NAME in "m68k-tdep.c". */ -/* symbols like 'A0' come from <sys/reg.h> */ -static int regmap[] = -{ - R0, R1, R2, R3, R4, R5, R6, R7, - A0, A1, A2, A3, A4, A5, A6, SP, - PS, PC, - FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7, - FP_CR, FP_SR, FP_IAR -}; - -/* blockend is the value of u.u_ar0, and points to the - * place where D0 is stored - */ - -int -dpx2_register_u_addr (int blockend, int regnum) -{ - if (regnum < FP0_REGNUM) - return (blockend + 4 * regmap[regnum]); - else - return (int) &(((struct user *) 0)->u_fpstate[regmap[regnum]]); -} - -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. - Unfortunately this is not provided in the system header files. - To make matters worse, this value also differs between - the dpx/2200 and dpx/2300 models and nlist is not available on the dpx2. - We use utsname() to decide on which model we are running. - FIXME: This breaks cross examination of core files (it would not be hard - to check whether u.u_ar0 is between 0x7fff5000 and 0x7fffc000 and if so - use 0x7fff5000 and if not use 0x7fffc000. FIXME). */ - -#define KERNEL_U_ADDR_200 0x7fff5000 -#define KERNEL_U_ADDR_300 0x7fffc000 - -CORE_ADDR kernel_u_addr; - -void -_initialize_dpx2_nat (void) -{ - struct utsname uts; - - if (uname (&uts) == 0 && strcmp (uts.machine, "DPX/2200") == 0) - kernel_u_addr = KERNEL_U_ADDR_200; - else - kernel_u_addr = KERNEL_U_ADDR_300; -} diff --git a/gnu/usr.bin/binutils/gdb/dsrec.c b/gnu/usr.bin/binutils/gdb/dsrec.c index 142260002ff..2ca91fe5e21 100644 --- a/gnu/usr.bin/binutils/gdb/dsrec.c +++ b/gnu/usr.bin/binutils/gdb/dsrec.c @@ -1,5 +1,5 @@ /* S-record download support for GDB, the GNU debugger. - Copyright 1995, 1996, 1997, 1999, 2000, 2001 + Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -93,7 +93,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset, { int numbytes; bfd_vma addr = bfd_get_section_vma (abfd, s) + load_offset; - bfd_size_type size = bfd_get_section_size_before_reloc (s); + bfd_size_type size = bfd_get_section_size (s); char *section_name = (char *) bfd_get_section_name (abfd, s); /* Both GDB and BFD have mechanisms for printing addresses. In the below, GDB's is used so that the address is @@ -124,8 +124,9 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset, do { serial_write (desc, srec, reclen); - if (ui_load_progress_hook) - if (ui_load_progress_hook (section_name, (unsigned long) i)) + if (deprecated_ui_load_progress_hook) + if (deprecated_ui_load_progress_hook (section_name, + (unsigned long) i)) error ("Canceled the download"); } while (waitack != NULL && !waitack ()); @@ -137,8 +138,9 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset, } } /* Per-packet (or S-record) loop */ - if (ui_load_progress_hook) - if (ui_load_progress_hook (section_name, (unsigned long) i)) + if (deprecated_ui_load_progress_hook) + if (deprecated_ui_load_progress_hook (section_name, + (unsigned long) i)) error ("Canceled the download"); putchar_unfiltered ('\n'); } @@ -261,7 +263,7 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect, if (sect && abfd) { payload_size = (*maxrecsize - (1 + 1 + 2 + addr_size * 2 + 2)) / 2; - payload_size = min (payload_size, sect->_raw_size - sectoff); + payload_size = min (payload_size, bfd_get_section_size (sect) - sectoff); bfd_get_section_contents (abfd, sect, binbuf, sectoff, payload_size); } diff --git a/gnu/usr.bin/binutils/gdb/dwarf2read.c b/gnu/usr.bin/binutils/gdb/dwarf2read.c index cc69ede557e..420bea094bd 100644 --- a/gnu/usr.bin/binutils/gdb/dwarf2read.c +++ b/gnu/usr.bin/binutils/gdb/dwarf2read.c @@ -44,12 +44,29 @@ #include "dwarf2expr.h" #include "dwarf2loc.h" #include "cp-support.h" +#include "hashtab.h" +#include "command.h" +#include "gdbcmd.h" #include <fcntl.h> #include "gdb_string.h" #include "gdb_assert.h" #include <sys/types.h> +/* A note on memory usage for this file. + + At the present time, this code reads the debug info sections into + the objfile's objfile_obstack. A definite improvement for startup + time, on platforms which do not emit relocations for debug + sections, would be to use mmap instead. The object's complete + debug information is loaded into memory, partly to simplify + absolute DIE references. + + Whether using obstacks or mmap, the sections should remain loaded + until the objfile is released, and pointers into the section data + can be used for any other data associated to the objfile (symbol + names, type names, location expressions to name a few). */ + #ifndef DWARF2_REG_TO_REGNUM #define DWARF2_REG_TO_REGNUM(REG) (REG) #endif @@ -126,19 +143,45 @@ typedef struct statement_prologue } _STATEMENT_PROLOGUE; -/* offsets and sizes of debugging sections */ +static const struct objfile_data *dwarf2_objfile_data_key; + +struct dwarf2_per_objfile +{ + /* Sizes of debugging sections. */ + unsigned int info_size; + unsigned int abbrev_size; + unsigned int line_size; + unsigned int pubnames_size; + unsigned int aranges_size; + unsigned int loc_size; + unsigned int macinfo_size; + unsigned int str_size; + unsigned int ranges_size; + unsigned int frame_size; + unsigned int eh_frame_size; + + /* Loaded data from the sections. */ + char *info_buffer; + char *abbrev_buffer; + char *line_buffer; + char *str_buffer; + char *macinfo_buffer; + char *ranges_buffer; + char *loc_buffer; + + /* A list of all the compilation units. This is used to locate + the target compilation unit of a particular reference. */ + struct dwarf2_per_cu_data **all_comp_units; + + /* The number of compilation units in ALL_COMP_UNITS. */ + int n_comp_units; + + /* A chain of compilation units that are currently read in, so that + they can be freed later. */ + struct dwarf2_per_cu_data *read_in_chain; +}; -static unsigned int dwarf_info_size; -static unsigned int dwarf_abbrev_size; -static unsigned int dwarf_line_size; -static unsigned int dwarf_pubnames_size; -static unsigned int dwarf_aranges_size; -static unsigned int dwarf_loc_size; -static unsigned int dwarf_macinfo_size; -static unsigned int dwarf_str_size; -static unsigned int dwarf_ranges_size; -unsigned int dwarf_frame_size; -unsigned int dwarf_eh_frame_size; +static struct dwarf2_per_objfile *dwarf2_per_objfile; static asection *dwarf_info_section; static asection *dwarf_abbrev_section; @@ -205,10 +248,6 @@ struct comp_unit_head struct comp_unit_head *next; - /* DWARF abbreviation table associated with this compilation unit */ - - struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE]; - /* Base address of this compilation unit. */ CORE_ADDR base_address; @@ -218,6 +257,11 @@ struct comp_unit_head int base_known; }; +/* Fixed size for the DIE hash table. */ +#ifndef REF_HASH_SIZE +#define REF_HASH_SIZE 1021 +#endif + /* Internal state when decoding a particular compilation unit. */ struct dwarf2_cu { @@ -227,8 +271,7 @@ struct dwarf2_cu /* The header of the compilation unit. FIXME drow/2003-11-10: Some of the things from the comp_unit_head - should be moved to the dwarf2_cu structure; for instance the abbrevs - hash table. */ + should logically be moved to the dwarf2_cu structure. */ struct comp_unit_head header; struct function_range *first_fn, *last_fn, *cached_fn; @@ -237,6 +280,8 @@ struct dwarf2_cu enum language language; const struct language_defn *language_defn; + const char *producer; + /* The generic symbol table building routines have separate lists for file scope symbols and all all other scopes (local scopes). So we need to select the right one to pass to add_symbol_to_list(). @@ -258,6 +303,86 @@ struct dwarf2_cu FT_NUM_MEMBERS compile time constant, which is the number of predefined fundamental types gdb knows how to construct. */ struct type *ftypes[FT_NUM_MEMBERS]; /* Fundamental types */ + + /* DWARF abbreviation table associated with this compilation unit. */ + struct abbrev_info **dwarf2_abbrevs; + + /* Storage for the abbrev table. */ + struct obstack abbrev_obstack; + + /* Hash table holding all the loaded partial DIEs. */ + htab_t partial_dies; + + /* Storage for things with the same lifetime as this read-in compilation + unit, including partial DIEs. */ + struct obstack comp_unit_obstack; + + /* When multiple dwarf2_cu structures are living in memory, this field + chains them all together, so that they can be released efficiently. + We will probably also want a generation counter so that most-recently-used + compilation units are cached... */ + struct dwarf2_per_cu_data *read_in_chain; + + /* Backchain to our per_cu entry if the tree has been built. */ + struct dwarf2_per_cu_data *per_cu; + + /* How many compilation units ago was this CU last referenced? */ + int last_used; + + /* A hash table of die offsets for following references. */ + struct die_info *die_ref_table[REF_HASH_SIZE]; + + /* Full DIEs if read in. */ + struct die_info *dies; + + /* A set of pointers to dwarf2_per_cu_data objects for compilation + units referenced by this one. Only set during full symbol processing; + partial symbol tables do not have dependencies. */ + htab_t dependencies; + + /* Mark used when releasing cached dies. */ + unsigned int mark : 1; + + /* This flag will be set if this compilation unit might include + inter-compilation-unit references. */ + unsigned int has_form_ref_addr : 1; + + /* This flag will be set if this compilation unit includes any + DW_TAG_namespace DIEs. If we know that there are explicit + DIEs for namespaces, we don't need to try to infer them + from mangled names. */ + unsigned int has_namespace_info : 1; +}; + +/* Persistent data held for a compilation unit, even when not + processing it. We put a pointer to this structure in the + read_symtab_private field of the psymtab. If we encounter + inter-compilation-unit references, we also maintain a sorted + list of all compilation units. */ + +struct dwarf2_per_cu_data +{ + /* The start offset and length of this compilation unit. 2**31-1 + bytes should suffice to store the length of any compilation unit + - if it doesn't, GDB will fall over anyway. */ + unsigned long offset; + unsigned long length : 31; + + /* Flag indicating this compilation unit will be read in before + any of the current compilation units are processed. */ + unsigned long queued : 1; + + /* Set iff currently read in. */ + struct dwarf2_cu *cu; + + /* If full symbols for this CU have been read in, then this field + holds a map of DIE offsets to types. It isn't always possible + to reconstruct this information later, so we have to preserve + it. */ + htab_t type_hash; + + /* The partial symbol table associated with this compilation unit. */ + struct partial_symtab *psymtab; }; /* The line number information for a compilation unit (found in the @@ -297,10 +422,11 @@ struct line_header unsigned int dir_index; unsigned int mod_time; unsigned int length; + int included_p; /* Non-zero if referenced by the Line Number Program. */ } *file_names; /* The start and end of the statement program following this - header. These point into dwarf_line_buffer. */ + header. These point into dwarf2_per_objfile->line_buffer. */ char *statement_program_start, *statement_program_end; }; @@ -308,20 +434,62 @@ struct line_header need this much information. */ struct partial_die_info { - enum dwarf_tag tag; - unsigned char has_children; - unsigned char is_external; - unsigned char is_declaration; - unsigned char has_type; + /* Offset of this DIE. */ unsigned int offset; - unsigned int abbrev; + + /* DWARF-2 tag for this DIE. */ + ENUM_BITFIELD(dwarf_tag) tag : 16; + + /* Language code associated with this DIE. This is only used + for the compilation unit DIE. */ + unsigned int language : 8; + + /* Assorted flags describing the data found in this DIE. */ + unsigned int has_children : 1; + unsigned int is_external : 1; + unsigned int is_declaration : 1; + unsigned int has_type : 1; + unsigned int has_specification : 1; + unsigned int has_stmt_list : 1; + unsigned int has_pc_info : 1; + + /* Flag set if the SCOPE field of this structure has been + computed. */ + unsigned int scope_set : 1; + + /* The name of this DIE. Normally the value of DW_AT_name, but + sometimes DW_TAG_MIPS_linkage_name or a string computed in some + other fashion. */ char *name; - int has_pc_info; + char *dirname; + + /* The scope to prepend to our children. This is generally + allocated on the comp_unit_obstack, so will disappear + when this compilation unit leaves the cache. */ + char *scope; + + /* The location description associated with this DIE, if any. */ + struct dwarf_block *locdesc; + + /* If HAS_PC_INFO, the PC range associated with this DIE. */ CORE_ADDR lowpc; CORE_ADDR highpc; - struct dwarf_block *locdesc; - unsigned int language; + + /* Pointer into the info_buffer pointing at the target of + DW_AT_sibling, if any. */ char *sibling; + + /* If HAS_SPECIFICATION, the offset of the DIE referred to by + DW_AT_specification (or DW_AT_abstract_origin or + DW_AT_extension). */ + unsigned int spec_offset; + + /* If HAS_STMT_LIST, the offset of the Line Number Information data. */ + unsigned int line_offset; + + /* Pointers to this DIE's parent, first child, and next sibling, + if any. */ + struct partial_die_info *die_parent, *die_child, *die_sibling; }; /* This data structure holds the information of an abbrev. */ @@ -329,8 +497,8 @@ struct abbrev_info { unsigned int number; /* number identifying abbrev */ enum dwarf_tag tag; /* dwarf tag */ - int has_children; /* boolean */ - unsigned int num_attrs; /* number of attributes */ + unsigned short has_children; /* boolean */ + unsigned short num_attrs; /* number of attributes */ struct attr_abbrev *attrs; /* an array of attribute descriptions */ struct abbrev_info *next; /* next in chain */ }; @@ -406,30 +574,11 @@ struct dwarf_block #define ATTR_ALLOC_CHUNK 4 #endif -/* A hash table of die offsets for following references. */ -#ifndef REF_HASH_SIZE -#define REF_HASH_SIZE 1021 -#endif - -static struct die_info *die_ref_table[REF_HASH_SIZE]; - -/* Obstack for allocating temporary storage used during symbol reading. */ -static struct obstack dwarf2_tmp_obstack; - /* Allocate fields for structs, unions and enums in this size. */ #ifndef DW_FIELD_ALLOC_CHUNK #define DW_FIELD_ALLOC_CHUNK 4 #endif -/* Actually data from the sections. */ -static char *dwarf_info_buffer; -static char *dwarf_abbrev_buffer; -static char *dwarf_line_buffer; -static char *dwarf_str_buffer; -static char *dwarf_macinfo_buffer; -static char *dwarf_ranges_buffer; -static char *dwarf_loc_buffer; - /* A zeroed version of a partial die for initialization purposes. */ static struct partial_die_info zeroed_partial_die; @@ -442,90 +591,6 @@ static int isreg; /* Object lives in register. decode_locdesc's return value is the register number. */ -/* We put a pointer to this structure in the read_symtab_private field - of the psymtab. - The complete dwarf information for an objfile is kept in the - objfile_obstack, so that absolute die references can be handled. - Most of the information in this structure is related to an entire - object file and could be passed via the sym_private field of the objfile. - It is however conceivable that dwarf2 might not be the only type - of symbols read from an object file. */ - -struct dwarf2_pinfo - { - /* Pointer to start of dwarf info buffer for the objfile. */ - - char *dwarf_info_buffer; - - /* Offset in dwarf_info_buffer for this compilation unit. */ - - unsigned long dwarf_info_offset; - - /* Pointer to start of dwarf abbreviation buffer for the objfile. */ - - char *dwarf_abbrev_buffer; - - /* Size of dwarf abbreviation section for the objfile. */ - - unsigned int dwarf_abbrev_size; - - /* Pointer to start of dwarf line buffer for the objfile. */ - - char *dwarf_line_buffer; - - /* Size of dwarf_line_buffer, in bytes. */ - - unsigned int dwarf_line_size; - - /* Pointer to start of dwarf string buffer for the objfile. */ - - char *dwarf_str_buffer; - - /* Size of dwarf string section for the objfile. */ - - unsigned int dwarf_str_size; - - /* Pointer to start of dwarf macro buffer for the objfile. */ - - char *dwarf_macinfo_buffer; - - /* Size of dwarf macinfo section for the objfile. */ - - unsigned int dwarf_macinfo_size; - - /* Pointer to start of dwarf ranges buffer for the objfile. */ - - char *dwarf_ranges_buffer; - - /* Size of dwarf ranges buffer for the objfile. */ - - unsigned int dwarf_ranges_size; - - /* Pointer to start of dwarf locations buffer for the objfile. */ - - char *dwarf_loc_buffer; - - /* Size of dwarf locations buffer for the objfile. */ - - unsigned int dwarf_loc_size; - }; - -#define PST_PRIVATE(p) ((struct dwarf2_pinfo *)(p)->read_symtab_private) -#define DWARF_INFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_info_buffer) -#define DWARF_INFO_OFFSET(p) (PST_PRIVATE(p)->dwarf_info_offset) -#define DWARF_ABBREV_BUFFER(p) (PST_PRIVATE(p)->dwarf_abbrev_buffer) -#define DWARF_ABBREV_SIZE(p) (PST_PRIVATE(p)->dwarf_abbrev_size) -#define DWARF_LINE_BUFFER(p) (PST_PRIVATE(p)->dwarf_line_buffer) -#define DWARF_LINE_SIZE(p) (PST_PRIVATE(p)->dwarf_line_size) -#define DWARF_STR_BUFFER(p) (PST_PRIVATE(p)->dwarf_str_buffer) -#define DWARF_STR_SIZE(p) (PST_PRIVATE(p)->dwarf_str_size) -#define DWARF_MACINFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_macinfo_buffer) -#define DWARF_MACINFO_SIZE(p) (PST_PRIVATE(p)->dwarf_macinfo_size) -#define DWARF_RANGES_BUFFER(p) (PST_PRIVATE(p)->dwarf_ranges_buffer) -#define DWARF_RANGES_SIZE(p) (PST_PRIVATE(p)->dwarf_ranges_size) -#define DWARF_LOC_BUFFER(p) (PST_PRIVATE(p)->dwarf_loc_buffer) -#define DWARF_LOC_SIZE(p) (PST_PRIVATE(p)->dwarf_loc_size) - /* FIXME: We might want to set this from BFD via bfd_arch_bits_per_byte, but this would require a corresponding change in unpack_field_as_long and friends. */ @@ -579,6 +644,24 @@ struct field_info int nfnfields; }; +/* One item on the queue of compilation units to read in full symbols + for. */ +struct dwarf2_queue_item +{ + struct dwarf2_per_cu_data *per_cu; + struct dwarf2_queue_item *next; +}; + +/* The current queue. */ +static struct dwarf2_queue_item *dwarf2_queue, *dwarf2_queue_tail; + +/* Loaded secondary compilation units are kept in memory until they + have not been referenced for the processing of this many + compilation units. Set this to zero to disable caching. Cache + sizes of up to at least twenty will improve startup time for + typical inter-CU-reference binaries, at an obvious memory cost. */ +static int dwarf2_max_cache_age = 5; + /* Various complaints about symbol reading that don't abort the process */ static void @@ -633,32 +716,30 @@ static void dwarf2_locate_sections (bfd *, asection *, void *); static void dwarf2_build_psymtabs_easy (struct objfile *, int); #endif -static void dwarf2_build_psymtabs_hard (struct objfile *, int); +static void dwarf2_create_include_psymtab (char *, struct partial_symtab *, + struct objfile *); + +static void dwarf2_build_include_psymtabs (struct dwarf2_cu *, + struct partial_die_info *, + struct partial_symtab *); -static char *scan_partial_symbols (char *, CORE_ADDR *, CORE_ADDR *, - struct dwarf2_cu *, - const char *namespace); +static void dwarf2_build_psymtabs_hard (struct objfile *, int); -static void add_partial_symbol (struct partial_die_info *, struct dwarf2_cu *, - const char *namespace); +static void scan_partial_symbols (struct partial_die_info *, + CORE_ADDR *, CORE_ADDR *, + struct dwarf2_cu *); -static int pdi_needs_namespace (enum dwarf_tag tag, const char *namespace); +static void add_partial_symbol (struct partial_die_info *, + struct dwarf2_cu *); -static char *add_partial_namespace (struct partial_die_info *pdi, - char *info_ptr, - CORE_ADDR *lowpc, CORE_ADDR *highpc, - struct dwarf2_cu *cu, - const char *namespace); +static int pdi_needs_namespace (enum dwarf_tag tag); -static char *add_partial_structure (struct partial_die_info *struct_pdi, - char *info_ptr, - struct dwarf2_cu *cu, - const char *namespace); +static void add_partial_namespace (struct partial_die_info *pdi, + CORE_ADDR *lowpc, CORE_ADDR *highpc, + struct dwarf2_cu *cu); -static char *add_partial_enumeration (struct partial_die_info *enum_pdi, - char *info_ptr, - struct dwarf2_cu *cu, - const char *namespace); +static void add_partial_enumeration (struct partial_die_info *enum_pdi, + struct dwarf2_cu *cu); static char *locate_pdi_sibling (struct partial_die_info *orig_pdi, char *info_ptr, @@ -673,14 +754,26 @@ char *dwarf2_read_section (struct objfile *, asection *); static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu); -static void dwarf2_empty_abbrev_table (void *); +static void dwarf2_free_abbrev_table (void *); + +static struct abbrev_info *peek_die_abbrev (char *, int *, struct dwarf2_cu *); static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int, struct dwarf2_cu *); +static struct partial_die_info *load_partial_dies (bfd *, char *, int, + struct dwarf2_cu *); + static char *read_partial_die (struct partial_die_info *, + struct abbrev_info *abbrev, unsigned int, bfd *, char *, struct dwarf2_cu *); +static struct partial_die_info *find_partial_die (unsigned long, + struct dwarf2_cu *); + +static void fixup_partial_die (struct partial_die_info *, + struct dwarf2_cu *); + static char *read_full_die (struct die_info **, bfd *, char *, struct dwarf2_cu *, int *); @@ -720,11 +813,16 @@ static unsigned long read_unsigned_leb128 (bfd *, char *, unsigned int *); static long read_signed_leb128 (bfd *, char *, unsigned int *); +static char *skip_leb128 (bfd *, char *); + static void set_cu_language (unsigned int, struct dwarf2_cu *); static struct attribute *dwarf2_attr (struct die_info *, unsigned int, struct dwarf2_cu *); +static int dwarf2_flag_true_p (struct die_info *die, unsigned name, + struct dwarf2_cu *cu); + static int die_is_declaration (struct die_info *, struct dwarf2_cu *cu); static struct die_info *die_specification (struct die_info *die, @@ -732,12 +830,15 @@ static struct die_info *die_specification (struct die_info *die, static void free_line_header (struct line_header *lh); +static void add_file_name (struct line_header *, char *, unsigned int, + unsigned int, unsigned int); + static struct line_header *(dwarf_decode_line_header (unsigned int offset, bfd *abfd, struct dwarf2_cu *cu)); static void dwarf_decode_lines (struct line_header *, char *, bfd *, - struct dwarf2_cu *); + struct dwarf2_cu *, struct partial_symtab *); static void dwarf2_start_subfile (char *, char *); @@ -756,17 +857,14 @@ static struct type *die_type (struct die_info *, struct dwarf2_cu *); static struct type *die_containing_type (struct die_info *, struct dwarf2_cu *); -#if 0 -static struct type *type_at_offset (unsigned int, struct objfile *); -#endif - static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *); static void read_type_die (struct die_info *, struct dwarf2_cu *); static char *determine_prefix (struct die_info *die, struct dwarf2_cu *); -static char *typename_concat (const char *prefix, const char *suffix); +static char *typename_concat (struct obstack *, const char *prefix, const char *suffix, + struct dwarf2_cu *); static void read_typedef (struct die_info *, struct dwarf2_cu *); @@ -823,6 +921,9 @@ static CORE_ADDR decode_locdesc (struct dwarf_block *, struct dwarf2_cu *); static void read_array_type (struct die_info *, struct dwarf2_cu *); +static enum dwarf_array_dim_ordering read_array_order (struct die_info *, + struct dwarf2_cu *); + static void read_tag_pointer_type (struct die_info *, struct dwarf2_cu *); static void read_tag_ptr_to_member_type (struct die_info *, @@ -852,8 +953,6 @@ static struct die_info *read_die_and_siblings (char *info_ptr, bfd *abfd, static void free_die_list (struct die_info *); -static struct cleanup *make_cleanup_free_die_list (struct die_info *); - static void process_die (struct die_info *, struct dwarf2_cu *); static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *); @@ -887,27 +986,26 @@ static void dump_die (struct die_info *); static void dump_die_list (struct die_info *); -static void store_in_ref_table (unsigned int, struct die_info *); - -static void dwarf2_empty_hash_tables (void); +static void store_in_ref_table (unsigned int, struct die_info *, + struct dwarf2_cu *); static unsigned int dwarf2_get_ref_die_offset (struct attribute *, struct dwarf2_cu *); static int dwarf2_get_attr_constant_value (struct attribute *, int); -static struct die_info *follow_die_ref (unsigned int); +static struct die_info *follow_die_ref (struct die_info *, + struct attribute *, + struct dwarf2_cu *); static struct type *dwarf2_fundamental_type (struct objfile *, int, struct dwarf2_cu *); /* memory allocation interface */ -static void dwarf2_free_tmp_obstack (void *); - -static struct dwarf_block *dwarf_alloc_block (void); +static struct dwarf_block *dwarf_alloc_block (struct dwarf2_cu *); -static struct abbrev_info *dwarf_alloc_abbrev (void); +static struct abbrev_info *dwarf_alloc_abbrev (struct dwarf2_cu *); static struct die_info *dwarf_alloc_die (void); @@ -925,12 +1023,66 @@ static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu); +static char *skip_one_die (char *info_ptr, struct abbrev_info *abbrev, + struct dwarf2_cu *cu); + +static void free_stack_comp_unit (void *); + +static void *hashtab_obstack_allocate (void *data, size_t size, size_t count); + +static void dummy_obstack_deallocate (void *object, void *data); + +static hashval_t partial_die_hash (const void *item); + +static int partial_die_eq (const void *item_lhs, const void *item_rhs); + +static struct dwarf2_per_cu_data *dwarf2_find_containing_comp_unit + (unsigned long offset, struct objfile *objfile); + +static struct dwarf2_per_cu_data *dwarf2_find_comp_unit + (unsigned long offset, struct objfile *objfile); + +static void free_one_comp_unit (void *); + +static void free_cached_comp_units (void *); + +static void age_cached_comp_units (void); + +static void free_one_cached_comp_unit (void *); + +static void set_die_type (struct die_info *, struct type *, + struct dwarf2_cu *); + +static void reset_die_and_siblings_types (struct die_info *, + struct dwarf2_cu *); + +static void create_all_comp_units (struct objfile *); + +static struct dwarf2_cu *load_full_comp_unit (struct dwarf2_per_cu_data *); + +static void process_full_comp_unit (struct dwarf2_per_cu_data *); + +static void dwarf2_add_dependence (struct dwarf2_cu *, + struct dwarf2_per_cu_data *); + +static void dwarf2_mark (struct dwarf2_cu *); + +static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); + /* Try to locate the sections we need for DWARF 2 debugging information and return true if we have enough to do something. */ int -dwarf2_has_info (bfd *abfd) +dwarf2_has_info (struct objfile *objfile) { + struct dwarf2_per_objfile *data; + + /* Initialize per-objfile state. */ + data = obstack_alloc (&objfile->objfile_obstack, sizeof (*data)); + memset (data, 0, sizeof (*data)); + set_objfile_data (objfile, dwarf2_objfile_data_key, data); + dwarf2_per_objfile = data; + dwarf_info_section = 0; dwarf_abbrev_section = 0; dwarf_line_section = 0; @@ -941,7 +1093,7 @@ dwarf2_has_info (bfd *abfd) dwarf_ranges_section = 0; dwarf_loc_section = 0; - bfd_map_over_sections (abfd, dwarf2_locate_sections, NULL); + bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL); return (dwarf_info_section != NULL && dwarf_abbrev_section != NULL); } @@ -954,47 +1106,47 @@ dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, void *ignore_ptr) { if (strcmp (sectp->name, INFO_SECTION) == 0) { - dwarf_info_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->info_size = bfd_get_section_size (sectp); dwarf_info_section = sectp; } else if (strcmp (sectp->name, ABBREV_SECTION) == 0) { - dwarf_abbrev_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->abbrev_size = bfd_get_section_size (sectp); dwarf_abbrev_section = sectp; } else if (strcmp (sectp->name, LINE_SECTION) == 0) { - dwarf_line_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->line_size = bfd_get_section_size (sectp); dwarf_line_section = sectp; } else if (strcmp (sectp->name, PUBNAMES_SECTION) == 0) { - dwarf_pubnames_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->pubnames_size = bfd_get_section_size (sectp); dwarf_pubnames_section = sectp; } else if (strcmp (sectp->name, ARANGES_SECTION) == 0) { - dwarf_aranges_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->aranges_size = bfd_get_section_size (sectp); dwarf_aranges_section = sectp; } else if (strcmp (sectp->name, LOC_SECTION) == 0) { - dwarf_loc_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->loc_size = bfd_get_section_size (sectp); dwarf_loc_section = sectp; } else if (strcmp (sectp->name, MACINFO_SECTION) == 0) { - dwarf_macinfo_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->macinfo_size = bfd_get_section_size (sectp); dwarf_macinfo_section = sectp; } else if (strcmp (sectp->name, STR_SECTION) == 0) { - dwarf_str_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->str_size = bfd_get_section_size (sectp); dwarf_str_section = sectp; } else if (strcmp (sectp->name, FRAME_SECTION) == 0) { - dwarf_frame_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->frame_size = bfd_get_section_size (sectp); dwarf_frame_section = sectp; } else if (strcmp (sectp->name, EH_FRAME_SECTION) == 0) @@ -1002,13 +1154,13 @@ dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, void *ignore_ptr) flagword aflag = bfd_get_section_flags (ignore_abfd, sectp); if (aflag & SEC_HAS_CONTENTS) { - dwarf_eh_frame_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->eh_frame_size = bfd_get_section_size (sectp); dwarf_eh_frame_section = sectp; } } else if (strcmp (sectp->name, RANGES_SECTION) == 0) { - dwarf_ranges_size = bfd_get_section_size_before_reloc (sectp); + dwarf2_per_objfile->ranges_size = bfd_get_section_size (sectp); dwarf_ranges_section = sectp; } } @@ -1018,37 +1170,36 @@ dwarf2_locate_sections (bfd *ignore_abfd, asection *sectp, void *ignore_ptr) void dwarf2_build_psymtabs (struct objfile *objfile, int mainline) { - /* We definitely need the .debug_info and .debug_abbrev sections */ - dwarf_info_buffer = dwarf2_read_section (objfile, dwarf_info_section); - dwarf_abbrev_buffer = dwarf2_read_section (objfile, dwarf_abbrev_section); + dwarf2_per_objfile->info_buffer = dwarf2_read_section (objfile, dwarf_info_section); + dwarf2_per_objfile->abbrev_buffer = dwarf2_read_section (objfile, dwarf_abbrev_section); if (dwarf_line_section) - dwarf_line_buffer = dwarf2_read_section (objfile, dwarf_line_section); + dwarf2_per_objfile->line_buffer = dwarf2_read_section (objfile, dwarf_line_section); else - dwarf_line_buffer = NULL; + dwarf2_per_objfile->line_buffer = NULL; if (dwarf_str_section) - dwarf_str_buffer = dwarf2_read_section (objfile, dwarf_str_section); + dwarf2_per_objfile->str_buffer = dwarf2_read_section (objfile, dwarf_str_section); else - dwarf_str_buffer = NULL; + dwarf2_per_objfile->str_buffer = NULL; if (dwarf_macinfo_section) - dwarf_macinfo_buffer = dwarf2_read_section (objfile, + dwarf2_per_objfile->macinfo_buffer = dwarf2_read_section (objfile, dwarf_macinfo_section); else - dwarf_macinfo_buffer = NULL; + dwarf2_per_objfile->macinfo_buffer = NULL; if (dwarf_ranges_section) - dwarf_ranges_buffer = dwarf2_read_section (objfile, dwarf_ranges_section); + dwarf2_per_objfile->ranges_buffer = dwarf2_read_section (objfile, dwarf_ranges_section); else - dwarf_ranges_buffer = NULL; + dwarf2_per_objfile->ranges_buffer = NULL; if (dwarf_loc_section) - dwarf_loc_buffer = dwarf2_read_section (objfile, dwarf_loc_section); + dwarf2_per_objfile->loc_buffer = dwarf2_read_section (objfile, dwarf_loc_section); else - dwarf_loc_buffer = NULL; + dwarf2_per_objfile->loc_buffer = NULL; if (mainline || (objfile->global_psymbols.size == 0 @@ -1089,7 +1240,7 @@ dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline) pubnames_buffer = dwarf2_read_section (objfile, dwarf_pubnames_section); pubnames_ptr = pubnames_buffer; - while ((pubnames_ptr - pubnames_buffer) < dwarf_pubnames_size) + while ((pubnames_ptr - pubnames_buffer) < dwarf2_per_objfile->pubnames_size) { struct comp_unit_head cu_header; int bytes_read; @@ -1138,6 +1289,97 @@ read_comp_unit_head (struct comp_unit_head *cu_header, return info_ptr; } +static char * +partial_read_comp_unit_head (struct comp_unit_head *header, char *info_ptr, + bfd *abfd) +{ + char *beg_of_comp_unit = info_ptr; + + info_ptr = read_comp_unit_head (header, info_ptr, abfd); + + if (header->version != 2) + error ("Dwarf Error: wrong version in compilation unit header " + "(is %d, should be %d) [in module %s]", header->version, + 2, bfd_get_filename (abfd)); + + if (header->abbrev_offset >= dwarf2_per_objfile->abbrev_size) + error ("Dwarf Error: bad offset (0x%lx) in compilation unit header " + "(offset 0x%lx + 6) [in module %s]", + (long) header->abbrev_offset, + (long) (beg_of_comp_unit - dwarf2_per_objfile->info_buffer), + bfd_get_filename (abfd)); + + if (beg_of_comp_unit + header->length + header->initial_length_size + > dwarf2_per_objfile->info_buffer + dwarf2_per_objfile->info_size) + error ("Dwarf Error: bad length (0x%lx) in compilation unit header " + "(offset 0x%lx + 0) [in module %s]", + (long) header->length, + (long) (beg_of_comp_unit - dwarf2_per_objfile->info_buffer), + bfd_get_filename (abfd)); + + return info_ptr; +} + +/* Allocate a new partial symtab for file named NAME and mark this new + partial symtab as being an include of PST. */ + +static void +dwarf2_create_include_psymtab (char *name, struct partial_symtab *pst, + struct objfile *objfile) +{ + struct partial_symtab *subpst = allocate_psymtab (name, objfile); + + subpst->section_offsets = pst->section_offsets; + subpst->textlow = 0; + subpst->texthigh = 0; + + subpst->dependencies = (struct partial_symtab **) + obstack_alloc (&objfile->objfile_obstack, + sizeof (struct partial_symtab *)); + subpst->dependencies[0] = pst; + subpst->number_of_dependencies = 1; + + subpst->globals_offset = 0; + subpst->n_global_syms = 0; + subpst->statics_offset = 0; + subpst->n_static_syms = 0; + subpst->symtab = NULL; + subpst->read_symtab = pst->read_symtab; + subpst->readin = 0; + + /* No private part is necessary for include psymtabs. This property + can be used to differentiate between such include psymtabs and + the regular ones. */ + subpst->read_symtab_private = NULL; +} + +/* Read the Line Number Program data and extract the list of files + included by the source file represented by PST. Build an include + partial symtab for each of these included files. + + This procedure assumes that there *is* a Line Number Program in + the given CU. Callers should check that PDI->HAS_STMT_LIST is set + before calling this procedure. */ + +static void +dwarf2_build_include_psymtabs (struct dwarf2_cu *cu, + struct partial_die_info *pdi, + struct partial_symtab *pst) +{ + struct objfile *objfile = cu->objfile; + bfd *abfd = objfile->obfd; + struct line_header *lh; + + lh = dwarf_decode_line_header (pdi->line_offset, abfd, cu); + if (lh == NULL) + return; /* No linetable, so no includes. */ + + dwarf_decode_lines (lh, NULL, abfd, cu, pst); + + free_line_header (lh); +} + + /* Build the partial symbol table by doing a quick pass through the .debug_info and .debug_abbrev sections. */ @@ -1147,92 +1389,56 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) /* Instead of reading this into a big buffer, we should probably use mmap() on architectures that support it. (FIXME) */ bfd *abfd = objfile->obfd; - char *info_ptr, *abbrev_ptr; + char *info_ptr; char *beg_of_comp_unit; struct partial_die_info comp_unit_die; struct partial_symtab *pst; struct cleanup *back_to; CORE_ADDR lowpc, highpc, baseaddr; - info_ptr = dwarf_info_buffer; - abbrev_ptr = dwarf_abbrev_buffer; - - /* We use dwarf2_tmp_obstack for objects that don't need to survive - the partial symbol scan, like attribute values. - - We could reduce our peak memory consumption during partial symbol - table construction by freeing stuff from this obstack more often - --- say, after processing each compilation unit, or each die --- - but it turns out that this saves almost nothing. For an - executable with 11Mb of Dwarf 2 data, I found about 64k allocated - on dwarf2_tmp_obstack. Some investigation showed: - - 1) 69% of the attributes used forms DW_FORM_addr, DW_FORM_data*, - DW_FORM_flag, DW_FORM_[su]data, and DW_FORM_ref*. These are - all fixed-length values not requiring dynamic allocation. - - 2) 30% of the attributes used the form DW_FORM_string. For - DW_FORM_string, read_attribute simply hands back a pointer to - the null-terminated string in dwarf_info_buffer, so no dynamic - allocation is needed there either. - - 3) The remaining 1% of the attributes all used DW_FORM_block1. - 75% of those were DW_AT_frame_base location lists for - functions; the rest were DW_AT_location attributes, probably - for the global variables. + info_ptr = dwarf2_per_objfile->info_buffer; - Anyway, what this all means is that the memory the dwarf2 - reader uses as temporary space reading partial symbols is about - 0.5% as much as we use for dwarf_*_buffer. That's noise. */ + /* Any cached compilation units will be linked by the per-objfile + read_in_chain. Make sure to free them when we're done. */ + back_to = make_cleanup (free_cached_comp_units, NULL); - obstack_init (&dwarf2_tmp_obstack); - back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL); + create_all_comp_units (objfile); - /* Since the objects we're extracting from dwarf_info_buffer vary in + /* Since the objects we're extracting from .debug_info vary in length, only the individual functions to extract them (like - read_comp_unit_head and read_partial_die) can really know whether + read_comp_unit_head and load_partial_die) can really know whether the buffer is large enough to hold another complete object. - At the moment, they don't actually check that. If - dwarf_info_buffer holds just one extra byte after the last - compilation unit's dies, then read_comp_unit_head will happily - read off the end of the buffer. read_partial_die is similarly - casual. Those functions should be fixed. + At the moment, they don't actually check that. If .debug_info + holds just one extra byte after the last compilation unit's dies, + then read_comp_unit_head will happily read off the end of the + buffer. read_partial_die is similarly casual. Those functions + should be fixed. For this loop condition, simply checking whether there's any data left at all should be sufficient. */ - while (info_ptr < dwarf_info_buffer + dwarf_info_size) + while (info_ptr < (dwarf2_per_objfile->info_buffer + + dwarf2_per_objfile->info_size)) { + struct cleanup *back_to_inner; struct dwarf2_cu cu; + struct abbrev_info *abbrev; + unsigned int bytes_read; + struct dwarf2_per_cu_data *this_cu; + beg_of_comp_unit = info_ptr; + memset (&cu, 0, sizeof (cu)); + + obstack_init (&cu.comp_unit_obstack); + + back_to_inner = make_cleanup (free_stack_comp_unit, &cu); + cu.objfile = objfile; - info_ptr = read_comp_unit_head (&cu.header, info_ptr, abfd); + info_ptr = partial_read_comp_unit_head (&cu.header, info_ptr, abfd); - if (cu.header.version != 2) - { - error ("Dwarf Error: wrong version in compilation unit header (is %d, should be %d) [in module %s]", cu.header.version, 2, bfd_get_filename (abfd)); - return; - } - if (cu.header.abbrev_offset >= dwarf_abbrev_size) - { - error ("Dwarf Error: bad offset (0x%lx) in compilation unit header (offset 0x%lx + 6) [in module %s]", - (long) cu.header.abbrev_offset, - (long) (beg_of_comp_unit - dwarf_info_buffer), - bfd_get_filename (abfd)); - return; - } - if (beg_of_comp_unit + cu.header.length + cu.header.initial_length_size - > dwarf_info_buffer + dwarf_info_size) - { - error ("Dwarf Error: bad length (0x%lx) in compilation unit header (offset 0x%lx + 0) [in module %s]", - (long) cu.header.length, - (long) (beg_of_comp_unit - dwarf_info_buffer), - bfd_get_filename (abfd)); - return; - } /* Complete the cu_header */ - cu.header.offset = beg_of_comp_unit - dwarf_info_buffer; + cu.header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer; cu.header.first_die_ptr = info_ptr; cu.header.cu_head_ptr = beg_of_comp_unit; @@ -1240,11 +1446,14 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) /* Read the abbrevs for this compilation unit into a table */ dwarf2_read_abbrevs (abfd, &cu); - make_cleanup (dwarf2_empty_abbrev_table, cu.header.dwarf2_abbrevs); + make_cleanup (dwarf2_free_abbrev_table, &cu); + + this_cu = dwarf2_find_comp_unit (cu.header.offset, objfile); /* Read the compilation unit die */ - info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr, - &cu); + abbrev = peek_die_abbrev (info_ptr, &bytes_read, &cu); + info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read, + abfd, info_ptr, &cu); /* Set the language we're debugging */ set_cu_language (comp_unit_die.language, &cu); @@ -1256,43 +1465,54 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) objfile->global_psymbols.next, objfile->static_psymbols.next); - pst->read_symtab_private = (char *) - obstack_alloc (&objfile->objfile_obstack, sizeof (struct dwarf2_pinfo)); - DWARF_INFO_BUFFER (pst) = dwarf_info_buffer; - DWARF_INFO_OFFSET (pst) = beg_of_comp_unit - dwarf_info_buffer; - DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer; - DWARF_ABBREV_SIZE (pst) = dwarf_abbrev_size; - DWARF_LINE_BUFFER (pst) = dwarf_line_buffer; - DWARF_LINE_SIZE (pst) = dwarf_line_size; - DWARF_STR_BUFFER (pst) = dwarf_str_buffer; - DWARF_STR_SIZE (pst) = dwarf_str_size; - DWARF_MACINFO_BUFFER (pst) = dwarf_macinfo_buffer; - DWARF_MACINFO_SIZE (pst) = dwarf_macinfo_size; - DWARF_RANGES_BUFFER (pst) = dwarf_ranges_buffer; - DWARF_RANGES_SIZE (pst) = dwarf_ranges_size; - DWARF_LOC_BUFFER (pst) = dwarf_loc_buffer; - DWARF_LOC_SIZE (pst) = dwarf_loc_size; + if (comp_unit_die.dirname) + pst->dirname = xstrdup (comp_unit_die.dirname); + + pst->read_symtab_private = (char *) this_cu; + baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); /* Store the function that reads in the rest of the symbol table */ pst->read_symtab = dwarf2_psymtab_to_symtab; + /* If this compilation unit was already read in, free the + cached copy in order to read it in again. This is + necessary because we skipped some symbols when we first + read in the compilation unit (see load_partial_dies). + This problem could be avoided, but the benefit is + unclear. */ + if (this_cu->cu != NULL) + free_one_cached_comp_unit (this_cu->cu); + + cu.per_cu = this_cu; + + /* Note that this is a pointer to our stack frame, being + added to a global data structure. It will be cleaned up + in free_stack_comp_unit when we finish with this + compilation unit. */ + this_cu->cu = &cu; + + this_cu->psymtab = pst; + /* Check if comp unit has_children. If so, read the rest of the partial symbols from this comp unit. If not, there's no more debug_info for this comp unit. */ if (comp_unit_die.has_children) { + struct partial_die_info *first_die; + lowpc = ((CORE_ADDR) -1); highpc = ((CORE_ADDR) 0); - info_ptr = scan_partial_symbols (info_ptr, &lowpc, &highpc, - &cu, NULL); + first_die = load_partial_dies (abfd, info_ptr, 1, &cu); + + scan_partial_symbols (first_die, &lowpc, &highpc, &cu); /* If we didn't find a lowpc, set it to highpc to avoid complaints from `maint check'. */ if (lowpc == ((CORE_ADDR) -1)) lowpc = highpc; - + /* If the compilation unit didn't have an explicit address range, then use the information extracted from its child dies. */ if (! comp_unit_die.has_pc_info) @@ -1315,153 +1535,341 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline) also happen.) This happens in VxWorks. */ free_named_symtabs (pst->filename); - info_ptr = beg_of_comp_unit + cu.header.length + if (comp_unit_die.has_stmt_list) + { + /* Get the list of files included in the current compilation unit, + and build a psymtab for each of them. */ + dwarf2_build_include_psymtabs (&cu, &comp_unit_die, pst); + } + + info_ptr = beg_of_comp_unit + cu.header.length + cu.header.initial_length_size; + + do_cleanups (back_to_inner); } do_cleanups (back_to); } -/* Read in all interesting dies to the end of the compilation unit or - to the end of the current namespace. NAMESPACE is NULL if we - haven't yet encountered any DW_TAG_namespace entries; otherwise, - it's the name of the current namespace. In particular, it's the - empty string if we're currently in the global namespace but have - previously encountered a DW_TAG_namespace. */ +/* Load the DIEs for a secondary CU into memory. */ -static char * -scan_partial_symbols (char *info_ptr, CORE_ADDR *lowpc, - CORE_ADDR *highpc, struct dwarf2_cu *cu, - const char *namespace) +static void +load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile) +{ + bfd *abfd = objfile->obfd; + char *info_ptr, *beg_of_comp_unit; + struct partial_die_info comp_unit_die; + struct dwarf2_cu *cu; + struct abbrev_info *abbrev; + unsigned int bytes_read; + struct cleanup *back_to; + + info_ptr = dwarf2_per_objfile->info_buffer + this_cu->offset; + beg_of_comp_unit = info_ptr; + + cu = xmalloc (sizeof (struct dwarf2_cu)); + memset (cu, 0, sizeof (struct dwarf2_cu)); + + obstack_init (&cu->comp_unit_obstack); + + cu->objfile = objfile; + info_ptr = partial_read_comp_unit_head (&cu->header, info_ptr, abfd); + + /* Complete the cu_header. */ + cu->header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer; + cu->header.first_die_ptr = info_ptr; + cu->header.cu_head_ptr = beg_of_comp_unit; + + /* Read the abbrevs for this compilation unit into a table. */ + dwarf2_read_abbrevs (abfd, cu); + back_to = make_cleanup (dwarf2_free_abbrev_table, cu); + + /* Read the compilation unit die. */ + abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu); + info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read, + abfd, info_ptr, cu); + + /* Set the language we're debugging. */ + set_cu_language (comp_unit_die.language, cu); + + /* Link this compilation unit into the compilation unit tree. */ + this_cu->cu = cu; + cu->per_cu = this_cu; + + /* Check if comp unit has_children. + If so, read the rest of the partial symbols from this comp unit. + If not, there's no more debug_info for this comp unit. */ + if (comp_unit_die.has_children) + load_partial_dies (abfd, info_ptr, 0, cu); + + do_cleanups (back_to); +} + +/* Create a list of all compilation units in OBJFILE. We do this only + if an inter-comp-unit reference is found; presumably if there is one, + there will be many, and one will occur early in the .debug_info section. + So there's no point in building this list incrementally. */ + +static void +create_all_comp_units (struct objfile *objfile) +{ + int n_allocated; + int n_comp_units; + struct dwarf2_per_cu_data **all_comp_units; + char *info_ptr = dwarf2_per_objfile->info_buffer; + + n_comp_units = 0; + n_allocated = 10; + all_comp_units = xmalloc (n_allocated + * sizeof (struct dwarf2_per_cu_data *)); + + while (info_ptr < dwarf2_per_objfile->info_buffer + dwarf2_per_objfile->info_size) + { + struct comp_unit_head cu_header; + char *beg_of_comp_unit; + struct dwarf2_per_cu_data *this_cu; + unsigned long offset; + int bytes_read; + + offset = info_ptr - dwarf2_per_objfile->info_buffer; + + /* Read just enough information to find out where the next + compilation unit is. */ + cu_header.length = read_initial_length (objfile->obfd, info_ptr, + &cu_header, &bytes_read); + + /* Save the compilation unit for later lookup. */ + this_cu = obstack_alloc (&objfile->objfile_obstack, + sizeof (struct dwarf2_per_cu_data)); + memset (this_cu, 0, sizeof (*this_cu)); + this_cu->offset = offset; + this_cu->length = cu_header.length + cu_header.initial_length_size; + + if (n_comp_units == n_allocated) + { + n_allocated *= 2; + all_comp_units = xrealloc (all_comp_units, + n_allocated + * sizeof (struct dwarf2_per_cu_data *)); + } + all_comp_units[n_comp_units++] = this_cu; + + info_ptr = info_ptr + this_cu->length; + } + + dwarf2_per_objfile->all_comp_units + = obstack_alloc (&objfile->objfile_obstack, + n_comp_units * sizeof (struct dwarf2_per_cu_data *)); + memcpy (dwarf2_per_objfile->all_comp_units, all_comp_units, + n_comp_units * sizeof (struct dwarf2_per_cu_data *)); + xfree (all_comp_units); + dwarf2_per_objfile->n_comp_units = n_comp_units; +} + +/* Process all loaded DIEs for compilation unit CU, starting at FIRST_DIE. + Also set *LOWPC and *HIGHPC to the lowest and highest PC values found + in CU. */ + +static void +scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc, + CORE_ADDR *highpc, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; bfd *abfd = objfile->obfd; - struct partial_die_info pdi; + struct partial_die_info *pdi; /* Now, march along the PDI's, descending into ones which have interesting children but skipping the children of the other ones, until we reach the end of the compilation unit. */ - while (1) - { - /* This flag tells whether or not info_ptr has gotten updated - inside the loop. */ - int info_ptr_updated = 0; + pdi = first_die; - info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu); + while (pdi != NULL) + { + fixup_partial_die (pdi, cu); /* Anonymous namespaces have no name but have interesting children, so we need to look at them. Ditto for anonymous enums. */ - if (pdi.name != NULL || pdi.tag == DW_TAG_namespace - || pdi.tag == DW_TAG_enumeration_type) + if (pdi->name != NULL || pdi->tag == DW_TAG_namespace + || pdi->tag == DW_TAG_enumeration_type) { - switch (pdi.tag) + switch (pdi->tag) { case DW_TAG_subprogram: - if (pdi.has_pc_info) + if (pdi->has_pc_info) { - if (pdi.lowpc < *lowpc) + if (pdi->lowpc < *lowpc) { - *lowpc = pdi.lowpc; + *lowpc = pdi->lowpc; } - if (pdi.highpc > *highpc) + if (pdi->highpc > *highpc) { - *highpc = pdi.highpc; + *highpc = pdi->highpc; } - if (!pdi.is_declaration) + if (!pdi->is_declaration) { - add_partial_symbol (&pdi, cu, namespace); + add_partial_symbol (pdi, cu); } } break; case DW_TAG_variable: case DW_TAG_typedef: case DW_TAG_union_type: - if (!pdi.is_declaration) + if (!pdi->is_declaration) { - add_partial_symbol (&pdi, cu, namespace); + add_partial_symbol (pdi, cu); } break; case DW_TAG_class_type: case DW_TAG_structure_type: - if (!pdi.is_declaration) + if (!pdi->is_declaration) { - info_ptr = add_partial_structure (&pdi, info_ptr, cu, - namespace); - info_ptr_updated = 1; + add_partial_symbol (pdi, cu); } break; case DW_TAG_enumeration_type: - if (!pdi.is_declaration) - { - info_ptr = add_partial_enumeration (&pdi, info_ptr, cu, - namespace); - info_ptr_updated = 1; - } + if (!pdi->is_declaration) + add_partial_enumeration (pdi, cu); break; case DW_TAG_base_type: case DW_TAG_subrange_type: /* File scope base type definitions are added to the partial symbol table. */ - add_partial_symbol (&pdi, cu, namespace); + add_partial_symbol (pdi, cu); break; case DW_TAG_namespace: - /* We've hit a DW_TAG_namespace entry, so we know this - file has been compiled using a compiler that - generates them; update NAMESPACE to reflect that. */ - if (namespace == NULL) - namespace = ""; - info_ptr = add_partial_namespace (&pdi, info_ptr, lowpc, highpc, - cu, namespace); - info_ptr_updated = 1; + add_partial_namespace (pdi, lowpc, highpc, cu); break; default: break; } } - if (pdi.tag == 0) - break; + /* If the die has a sibling, skip to the sibling. */ + + pdi = pdi->die_sibling; + } +} + +/* Functions used to compute the fully scoped name of a partial DIE. + + Normally, this is simple. For C++, the parent DIE's fully scoped + name is concatenated with "::" and the partial DIE's name. For + Java, the same thing occurs except that "." is used instead of "::". + Enumerators are an exception; they use the scope of their parent + enumeration type, i.e. the name of the enumeration type is not + prepended to the enumerator. + + There are two complexities. One is DW_AT_specification; in this + case "parent" means the parent of the target of the specification, + instead of the direct parent of the DIE. The other is compilers + which do not emit DW_TAG_namespace; in this case we try to guess + the fully qualified name of structure types from their members' + linkage names. This must be done using the DIE's children rather + than the children of any DW_AT_specification target. We only need + to do this for structures at the top level, i.e. if the target of + any DW_AT_specification (if any; otherwise the DIE itself) does not + have a parent. */ + +/* Compute the scope prefix associated with PDI's parent, in + compilation unit CU. The result will be allocated on CU's + comp_unit_obstack, or a copy of the already allocated PDI->NAME + field. NULL is returned if no prefix is necessary. */ +static char * +partial_die_parent_scope (struct partial_die_info *pdi, + struct dwarf2_cu *cu) +{ + char *grandparent_scope; + struct partial_die_info *parent, *real_pdi; - /* If the die has a sibling, skip to the sibling, unless another - function has already updated info_ptr for us. */ + /* We need to look at our parent DIE; if we have a DW_AT_specification, + then this means the parent of the specification DIE. */ - /* NOTE: carlton/2003-06-16: This is a bit hackish, but whether - or not we want to update this depends on enough stuff (not - only pdi.tag but also whether or not pdi.name is NULL) that - this seems like the easiest way to handle the issue. */ + real_pdi = pdi; + while (real_pdi->has_specification) + real_pdi = find_partial_die (real_pdi->spec_offset, cu); - if (!info_ptr_updated) - info_ptr = locate_pdi_sibling (&pdi, info_ptr, abfd, cu); + parent = real_pdi->die_parent; + if (parent == NULL) + return NULL; + + if (parent->scope_set) + return parent->scope; + + fixup_partial_die (parent, cu); + + grandparent_scope = partial_die_parent_scope (parent, cu); + + if (parent->tag == DW_TAG_namespace + || parent->tag == DW_TAG_structure_type + || parent->tag == DW_TAG_class_type + || parent->tag == DW_TAG_union_type) + { + if (grandparent_scope == NULL) + parent->scope = parent->name; + else + parent->scope = typename_concat (&cu->comp_unit_obstack, grandparent_scope, + parent->name, cu); + } + else if (parent->tag == DW_TAG_enumeration_type) + /* Enumerators should not get the name of the enumeration as a prefix. */ + parent->scope = grandparent_scope; + else + { + /* FIXME drow/2004-04-01: What should we be doing with + function-local names? For partial symbols, we should probably be + ignoring them. */ + complaint (&symfile_complaints, + "unhandled containing DIE tag %d for DIE at %d", + parent->tag, pdi->offset); + parent->scope = grandparent_scope; } - return info_ptr; + parent->scope_set = 1; + return parent->scope; +} + +/* Return the fully scoped name associated with PDI, from compilation unit + CU. The result will be allocated with malloc. */ +static char * +partial_die_full_name (struct partial_die_info *pdi, + struct dwarf2_cu *cu) +{ + char *parent_scope; + + parent_scope = partial_die_parent_scope (pdi, cu); + if (parent_scope == NULL) + return NULL; + else + return typename_concat (NULL, parent_scope, pdi->name, cu); } static void -add_partial_symbol (struct partial_die_info *pdi, - struct dwarf2_cu *cu, const char *namespace) +add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; CORE_ADDR addr = 0; - char *actual_name = pdi->name; + char *actual_name; + const char *my_prefix; const struct partial_symbol *psym = NULL; CORE_ADDR baseaddr; + int built_actual_name = 0; baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); - /* If we're not in the global namespace and if the namespace name - isn't encoded in a mangled actual_name, add it. */ - - if (pdi_needs_namespace (pdi->tag, namespace)) + actual_name = NULL; + + if (pdi_needs_namespace (pdi->tag)) { - actual_name = alloca (strlen (pdi->name) + 2 + strlen (namespace) + 1); - strcpy (actual_name, namespace); - strcat (actual_name, "::"); - strcat (actual_name, pdi->name); + actual_name = partial_die_full_name (pdi, cu); + if (actual_name) + built_actual_name = 1; } + if (actual_name == NULL) + actual_name = pdi->name; + switch (pdi->tag) { case DW_TAG_subprogram: @@ -1534,6 +1942,12 @@ add_partial_symbol (struct partial_die_info *pdi, &objfile->static_psymbols, 0, (CORE_ADDR) 0, cu->language, objfile); break; + case DW_TAG_namespace: + add_psymbol_to_list (actual_name, strlen (actual_name), + VAR_DOMAIN, LOC_TYPEDEF, + &objfile->global_psymbols, + 0, (CORE_ADDR) 0, cu->language, objfile); + break; case DW_TAG_class_type: case DW_TAG_structure_type: case DW_TAG_union_type: @@ -1546,14 +1960,16 @@ add_partial_symbol (struct partial_die_info *pdi, return; add_psymbol_to_list (actual_name, strlen (actual_name), STRUCT_DOMAIN, LOC_TYPEDEF, - cu->language == language_cplus + (cu->language == language_cplus + || cu->language == language_java) ? &objfile->global_psymbols : &objfile->static_psymbols, 0, (CORE_ADDR) 0, cu->language, objfile); - if (cu->language == language_cplus) + if (cu->language == language_cplus + || cu->language == language_java) { - /* For C++, these implicitly act as typedefs as well. */ + /* For C++ and Java, these implicitly act as typedefs as well. */ add_psymbol_to_list (actual_name, strlen (actual_name), VAR_DOMAIN, LOC_TYPEDEF, &objfile->global_psymbols, @@ -1563,7 +1979,8 @@ add_partial_symbol (struct partial_die_info *pdi, case DW_TAG_enumerator: add_psymbol_to_list (actual_name, strlen (actual_name), VAR_DOMAIN, LOC_CONST, - cu->language == language_cplus + (cu->language == language_cplus + || cu->language == language_java) ? &objfile->global_psymbols : &objfile->static_psymbols, 0, (CORE_ADDR) 0, cu->language, objfile); @@ -1578,26 +1995,30 @@ add_partial_symbol (struct partial_die_info *pdi, (otherwise we'll have psym == NULL), and if we actually had a mangled name to begin with. */ + /* FIXME drow/2004-02-22: Why don't we do this for classes, i.e. the + cases which do not set PSYM above? */ + if (cu->language == language_cplus - && namespace == NULL + && cu->has_namespace_info == 0 && psym != NULL && SYMBOL_CPLUS_DEMANGLED_NAME (psym) != NULL) cp_check_possible_namespace_symbols (SYMBOL_CPLUS_DEMANGLED_NAME (psym), objfile); + + if (built_actual_name) + xfree (actual_name); } -/* Determine whether a die of type TAG living in the C++ namespace - NAMESPACE needs to have the name of the namespace prepended to the +/* Determine whether a die of type TAG living in a C++ class or + namespace needs to have the name of the scope prepended to the name listed in the die. */ static int -pdi_needs_namespace (enum dwarf_tag tag, const char *namespace) +pdi_needs_namespace (enum dwarf_tag tag) { - if (namespace == NULL || namespace[0] == '\0') - return 0; - switch (tag) { + case DW_TAG_namespace: case DW_TAG_typedef: case DW_TAG_class_type: case DW_TAG_structure_type: @@ -1614,151 +2035,259 @@ pdi_needs_namespace (enum dwarf_tag tag, const char *namespace) corresponding to that namespace to the symbol table. NAMESPACE is the name of the enclosing namespace. */ -static char * -add_partial_namespace (struct partial_die_info *pdi, char *info_ptr, +static void +add_partial_namespace (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, - struct dwarf2_cu *cu, const char *namespace) + struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; - const char *new_name = pdi->name; - char *full_name; - - /* Calculate the full name of the namespace that we just entered. */ - if (new_name == NULL) - new_name = "(anonymous namespace)"; - full_name = alloca (strlen (namespace) + 2 + strlen (new_name) + 1); - strcpy (full_name, namespace); - if (*namespace != '\0') - strcat (full_name, "::"); - strcat (full_name, new_name); + /* Add a symbol for the namespace. */ - /* FIXME: carlton/2003-10-07: We can't just replace this by a call - to add_partial_symbol, because we don't have a way to pass in the - full name to that function; that might be a flaw in - add_partial_symbol's interface. */ - - add_psymbol_to_list (full_name, strlen (full_name), - VAR_DOMAIN, LOC_TYPEDEF, - &objfile->global_psymbols, - 0, 0, cu->language, objfile); + add_partial_symbol (pdi, cu); /* Now scan partial symbols in that namespace. */ if (pdi->has_children) - info_ptr = scan_partial_symbols (info_ptr, lowpc, highpc, cu, full_name); - - return info_ptr; + scan_partial_symbols (pdi->die_child, lowpc, highpc, cu); } -/* Read a partial die corresponding to a class or structure. */ +/* See if we can figure out if the class lives in a namespace. We do + this by looking for a member function; its demangled name will + contain namespace info, if there is any. */ -static char * -add_partial_structure (struct partial_die_info *struct_pdi, char *info_ptr, - struct dwarf2_cu *cu, - const char *namespace) +static void +guess_structure_name (struct partial_die_info *struct_pdi, + struct dwarf2_cu *cu) { - bfd *abfd = cu->objfile->obfd; - char *actual_class_name = NULL; - - if (cu->language == language_cplus - && (namespace == NULL || namespace[0] == '\0') - && struct_pdi->name != NULL + if ((cu->language == language_cplus + || cu->language == language_java) + && cu->has_namespace_info == 0 && struct_pdi->has_children) { - /* See if we can figure out if the class lives in a namespace - (or is nested within another class.) We do this by looking - for a member function; its demangled name will contain - namespace info, if there is any. */ - /* NOTE: carlton/2003-10-07: Getting the info this way changes what template types look like, because the demangler frequently doesn't give the same name as the debug info. We could fix this by only using the demangled name to get the prefix (but see comment in read_structure_type). */ - /* FIXME: carlton/2004-01-23: If NAMESPACE equals "", we have - the appropriate debug information, so it would be nice to be - able to avoid this hack. But NAMESPACE may not be the - namespace where this class was defined: NAMESPACE reflects - where STRUCT_PDI occurs in the tree of dies, but because of - DW_AT_specification, that may not actually tell us where the - class is defined. (See the comment in read_func_scope for an - example of how this could occur.) + struct partial_die_info *child_pdi = struct_pdi->die_child; + struct partial_die_info *real_pdi; - Unfortunately, our current partial symtab data structures are - completely unable to deal with DW_AT_specification. So, for - now, the best thing to do is to get nesting information from - places other than the tree structure of dies if there's any - chance that a DW_AT_specification is involved. :-( */ + /* If this DIE (this DIE's specification, if any) has a parent, then + we should not do this. We'll prepend the parent's fully qualified + name when we create the partial symbol. */ - char *next_child = info_ptr; + real_pdi = struct_pdi; + while (real_pdi->has_specification) + real_pdi = find_partial_die (real_pdi->spec_offset, cu); - while (1) - { - struct partial_die_info child_pdi; + if (real_pdi->die_parent != NULL) + return; - next_child = read_partial_die (&child_pdi, abfd, next_child, - cu); - if (!child_pdi.tag) - break; - if (child_pdi.tag == DW_TAG_subprogram) + while (child_pdi != NULL) + { + if (child_pdi->tag == DW_TAG_subprogram) { - actual_class_name = class_name_from_physname (child_pdi.name); + char *actual_class_name + = language_class_name_from_physname (cu->language_defn, + child_pdi->name); if (actual_class_name != NULL) - struct_pdi->name = actual_class_name; + { + struct_pdi->name + = obsavestring (actual_class_name, + strlen (actual_class_name), + &cu->comp_unit_obstack); + xfree (actual_class_name); + } break; } - else - { - next_child = locate_pdi_sibling (&child_pdi, next_child, - abfd, cu); - } + + child_pdi = child_pdi->die_sibling; } } - - add_partial_symbol (struct_pdi, cu, namespace); - xfree (actual_class_name); - - return locate_pdi_sibling (struct_pdi, info_ptr, abfd, cu); } /* Read a partial die corresponding to an enumeration type. */ -static char * -add_partial_enumeration (struct partial_die_info *enum_pdi, char *info_ptr, - struct dwarf2_cu *cu, const char *namespace) +static void +add_partial_enumeration (struct partial_die_info *enum_pdi, + struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; bfd *abfd = objfile->obfd; - struct partial_die_info pdi; + struct partial_die_info *pdi; if (enum_pdi->name != NULL) - add_partial_symbol (enum_pdi, cu, namespace); - - while (1) + add_partial_symbol (enum_pdi, cu); + + pdi = enum_pdi->die_child; + while (pdi) { - info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu); - if (pdi.tag == 0) - break; - if (pdi.tag != DW_TAG_enumerator || pdi.name == NULL) + if (pdi->tag != DW_TAG_enumerator || pdi->name == NULL) complaint (&symfile_complaints, "malformed enumerator DIE ignored"); else - add_partial_symbol (&pdi, cu, namespace); + add_partial_symbol (pdi, cu); + pdi = pdi->die_sibling; } +} - return info_ptr; +/* Read the initial uleb128 in the die at INFO_PTR in compilation unit CU. + Return the corresponding abbrev, or NULL if the number is zero (indicating + an empty DIE). In either case *BYTES_READ will be set to the length of + the initial number. */ + +static struct abbrev_info * +peek_die_abbrev (char *info_ptr, int *bytes_read, struct dwarf2_cu *cu) +{ + bfd *abfd = cu->objfile->obfd; + unsigned int abbrev_number; + struct abbrev_info *abbrev; + + abbrev_number = read_unsigned_leb128 (abfd, info_ptr, bytes_read); + + if (abbrev_number == 0) + return NULL; + + abbrev = dwarf2_lookup_abbrev (abbrev_number, cu); + if (!abbrev) + { + error ("Dwarf Error: Could not find abbrev number %d [in module %s]", abbrev_number, + bfd_get_filename (abfd)); + } + + return abbrev; +} + +/* Scan the debug information for CU starting at INFO_PTR. Returns a + pointer to the end of a series of DIEs, terminated by an empty + DIE. Any children of the skipped DIEs will also be skipped. */ + +static char * +skip_children (char *info_ptr, struct dwarf2_cu *cu) +{ + struct abbrev_info *abbrev; + unsigned int bytes_read; + + while (1) + { + abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu); + if (abbrev == NULL) + return info_ptr + bytes_read; + else + info_ptr = skip_one_die (info_ptr + bytes_read, abbrev, cu); + } +} + +/* Scan the debug information for CU starting at INFO_PTR. INFO_PTR + should point just after the initial uleb128 of a DIE, and the + abbrev corresponding to that skipped uleb128 should be passed in + ABBREV. Returns a pointer to this DIE's sibling, skipping any + children. */ + +static char * +skip_one_die (char *info_ptr, struct abbrev_info *abbrev, + struct dwarf2_cu *cu) +{ + unsigned int bytes_read; + struct attribute attr; + bfd *abfd = cu->objfile->obfd; + unsigned int form, i; + + for (i = 0; i < abbrev->num_attrs; i++) + { + /* The only abbrev we care about is DW_AT_sibling. */ + if (abbrev->attrs[i].name == DW_AT_sibling) + { + read_attribute (&attr, &abbrev->attrs[i], + abfd, info_ptr, cu); + if (attr.form == DW_FORM_ref_addr) + complaint (&symfile_complaints, "ignoring absolute DW_AT_sibling"); + else + return dwarf2_per_objfile->info_buffer + + dwarf2_get_ref_die_offset (&attr, cu); + } + + /* If it isn't DW_AT_sibling, skip this attribute. */ + form = abbrev->attrs[i].form; + skip_attribute: + switch (form) + { + case DW_FORM_addr: + case DW_FORM_ref_addr: + info_ptr += cu->header.addr_size; + break; + case DW_FORM_data1: + case DW_FORM_ref1: + case DW_FORM_flag: + info_ptr += 1; + break; + case DW_FORM_data2: + case DW_FORM_ref2: + info_ptr += 2; + break; + case DW_FORM_data4: + case DW_FORM_ref4: + info_ptr += 4; + break; + case DW_FORM_data8: + case DW_FORM_ref8: + info_ptr += 8; + break; + case DW_FORM_string: + read_string (abfd, info_ptr, &bytes_read); + info_ptr += bytes_read; + break; + case DW_FORM_strp: + info_ptr += cu->header.offset_size; + break; + case DW_FORM_block: + info_ptr += read_unsigned_leb128 (abfd, info_ptr, &bytes_read); + info_ptr += bytes_read; + break; + case DW_FORM_block1: + info_ptr += 1 + read_1_byte (abfd, info_ptr); + break; + case DW_FORM_block2: + info_ptr += 2 + read_2_bytes (abfd, info_ptr); + break; + case DW_FORM_block4: + info_ptr += 4 + read_4_bytes (abfd, info_ptr); + break; + case DW_FORM_sdata: + case DW_FORM_udata: + case DW_FORM_ref_udata: + info_ptr = skip_leb128 (abfd, info_ptr); + break; + case DW_FORM_indirect: + form = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); + info_ptr += bytes_read; + /* We need to continue parsing from here, so just go back to + the top. */ + goto skip_attribute; + + default: + error ("Dwarf Error: Cannot handle %s in DWARF reader [in module %s]", + dwarf_form_name (form), + bfd_get_filename (abfd)); + } + } + + if (abbrev->has_children) + return skip_children (info_ptr, cu); + else + return info_ptr; } -/* Locate ORIG_PDI's sibling; INFO_PTR should point to the next DIE - after ORIG_PDI. */ +/* Locate ORIG_PDI's sibling; INFO_PTR should point to the start of + the next DIE after ORIG_PDI. */ static char * locate_pdi_sibling (struct partial_die_info *orig_pdi, char *info_ptr, bfd *abfd, struct dwarf2_cu *cu) { /* Do we know the sibling already? */ - + if (orig_pdi->sibling) return orig_pdi->sibling; @@ -1767,21 +2296,9 @@ locate_pdi_sibling (struct partial_die_info *orig_pdi, char *info_ptr, if (!orig_pdi->has_children) return info_ptr; - /* Okay, we don't know the sibling, but we have children that we - want to skip. So read children until we run into one without a - tag; return whatever follows it. */ - - while (1) - { - struct partial_die_info pdi; - - info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu); + /* Skip the children the long way. */ - if (pdi.tag == 0) - return info_ptr; - else - info_ptr = locate_pdi_sibling (&pdi, info_ptr, abfd, cu); - } + return skip_children (info_ptr, cu); } /* Expand this partial symbol table into a full symbol table. */ @@ -1804,6 +2321,10 @@ dwarf2_psymtab_to_symtab (struct partial_symtab *pst) gdb_flush (gdb_stdout); } + /* Restore our global data. */ + dwarf2_per_objfile = objfile_data (pst->objfile, + dwarf2_objfile_data_key); + psymtab_to_symtab_1 (pst); /* Finish up the debug error message. */ @@ -1813,65 +2334,234 @@ dwarf2_psymtab_to_symtab (struct partial_symtab *pst) } } +/* Add PER_CU to the queue. */ + +static void +queue_comp_unit (struct dwarf2_per_cu_data *per_cu) +{ + struct dwarf2_queue_item *item; + + per_cu->queued = 1; + item = xmalloc (sizeof (*item)); + item->per_cu = per_cu; + item->next = NULL; + + if (dwarf2_queue == NULL) + dwarf2_queue = item; + else + dwarf2_queue_tail->next = item; + + dwarf2_queue_tail = item; +} + +/* Process the queue. */ + +static void +process_queue (struct objfile *objfile) +{ + struct dwarf2_queue_item *item, *next_item; + + /* Initially, there is just one item on the queue. Load its DIEs, + and the DIEs of any other compilation units it requires, + transitively. */ + + for (item = dwarf2_queue; item != NULL; item = item->next) + { + /* Read in this compilation unit. This may add new items to + the end of the queue. */ + load_full_comp_unit (item->per_cu); + + item->per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain; + dwarf2_per_objfile->read_in_chain = item->per_cu; + + /* If this compilation unit has already had full symbols created, + reset the TYPE fields in each DIE. */ + if (item->per_cu->psymtab->readin) + reset_die_and_siblings_types (item->per_cu->cu->dies, + item->per_cu->cu); + } + + /* Now everything left on the queue needs to be read in. Process + them, one at a time, removing from the queue as we finish. */ + for (item = dwarf2_queue; item != NULL; dwarf2_queue = item = next_item) + { + if (!item->per_cu->psymtab->readin) + process_full_comp_unit (item->per_cu); + + item->per_cu->queued = 0; + next_item = item->next; + xfree (item); + } + + dwarf2_queue_tail = NULL; +} + +/* Free all allocated queue entries. This function only releases anything if + an error was thrown; if the queue was processed then it would have been + freed as we went along. */ + +static void +dwarf2_release_queue (void *dummy) +{ + struct dwarf2_queue_item *item, *last; + + item = dwarf2_queue; + while (item) + { + /* Anything still marked queued is likely to be in an + inconsistent state, so discard it. */ + if (item->per_cu->queued) + { + if (item->per_cu->cu != NULL) + free_one_cached_comp_unit (item->per_cu->cu); + item->per_cu->queued = 0; + } + + last = item; + item = item->next; + xfree (last); + } + + dwarf2_queue = dwarf2_queue_tail = NULL; +} + +/* Read in full symbols for PST, and anything it depends on. */ + static void psymtab_to_symtab_1 (struct partial_symtab *pst) { - struct objfile *objfile = pst->objfile; - bfd *abfd = objfile->obfd; - struct dwarf2_cu cu; - struct die_info *dies; + struct dwarf2_per_cu_data *per_cu; + struct cleanup *back_to; + int i; + + for (i = 0; i < pst->number_of_dependencies; i++) + if (!pst->dependencies[i]->readin) + { + /* Inform about additional files that need to be read in. */ + if (info_verbose) + { + fputs_filtered (" ", gdb_stdout); + wrap_here (""); + fputs_filtered ("and ", gdb_stdout); + wrap_here (""); + printf_filtered ("%s...", pst->dependencies[i]->filename); + wrap_here (""); /* Flush output */ + gdb_flush (gdb_stdout); + } + psymtab_to_symtab_1 (pst->dependencies[i]); + } + + per_cu = (struct dwarf2_per_cu_data *) pst->read_symtab_private; + + if (per_cu == NULL) + { + /* It's an include file, no symbols to read for it. + Everything is in the parent symtab. */ + pst->readin = 1; + return; + } + + back_to = make_cleanup (dwarf2_release_queue, NULL); + + queue_comp_unit (per_cu); + + process_queue (pst->objfile); + + /* Age the cache, releasing compilation units that have not + been used recently. */ + age_cached_comp_units (); + + do_cleanups (back_to); +} + +/* Load the DIEs associated with PST and PER_CU into memory. */ + +static struct dwarf2_cu * +load_full_comp_unit (struct dwarf2_per_cu_data *per_cu) +{ + struct partial_symtab *pst = per_cu->psymtab; + bfd *abfd = pst->objfile->obfd; + struct dwarf2_cu *cu; unsigned long offset; - CORE_ADDR lowpc, highpc; - struct die_info *child_die; char *info_ptr; - struct symtab *symtab; - struct cleanup *back_to; + struct cleanup *back_to, *free_cu_cleanup; struct attribute *attr; CORE_ADDR baseaddr; /* Set local variables from the partial symbol table info. */ - offset = DWARF_INFO_OFFSET (pst); - dwarf_info_buffer = DWARF_INFO_BUFFER (pst); - dwarf_abbrev_buffer = DWARF_ABBREV_BUFFER (pst); - dwarf_abbrev_size = DWARF_ABBREV_SIZE (pst); - dwarf_line_buffer = DWARF_LINE_BUFFER (pst); - dwarf_line_size = DWARF_LINE_SIZE (pst); - dwarf_str_buffer = DWARF_STR_BUFFER (pst); - dwarf_str_size = DWARF_STR_SIZE (pst); - dwarf_macinfo_buffer = DWARF_MACINFO_BUFFER (pst); - dwarf_macinfo_size = DWARF_MACINFO_SIZE (pst); - dwarf_ranges_buffer = DWARF_RANGES_BUFFER (pst); - dwarf_ranges_size = DWARF_RANGES_SIZE (pst); - dwarf_loc_buffer = DWARF_LOC_BUFFER (pst); - dwarf_loc_size = DWARF_LOC_SIZE (pst); - info_ptr = dwarf_info_buffer + offset; - baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); + offset = per_cu->offset; - /* We're in the global namespace. */ - processing_current_prefix = ""; + info_ptr = dwarf2_per_objfile->info_buffer + offset; - obstack_init (&dwarf2_tmp_obstack); - back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL); + cu = xmalloc (sizeof (struct dwarf2_cu)); + memset (cu, 0, sizeof (struct dwarf2_cu)); - buildsym_init (); - make_cleanup (really_free_pendings, NULL); + /* If an error occurs while loading, release our storage. */ + free_cu_cleanup = make_cleanup (free_one_comp_unit, cu); - cu.objfile = objfile; + cu->objfile = pst->objfile; /* read in the comp_unit header */ - info_ptr = read_comp_unit_head (&cu.header, info_ptr, abfd); + info_ptr = read_comp_unit_head (&cu->header, info_ptr, abfd); /* Read the abbrevs for this compilation unit */ - dwarf2_read_abbrevs (abfd, &cu); - make_cleanup (dwarf2_empty_abbrev_table, cu.header.dwarf2_abbrevs); + dwarf2_read_abbrevs (abfd, cu); + back_to = make_cleanup (dwarf2_free_abbrev_table, cu); + + cu->header.offset = offset; + + cu->per_cu = per_cu; + per_cu->cu = cu; + + /* We use this obstack for block values in dwarf_alloc_block. */ + obstack_init (&cu->comp_unit_obstack); + + cu->dies = read_comp_unit (info_ptr, abfd, cu); + + /* We try not to read any attributes in this function, because not + all objfiles needed for references have been loaded yet, and symbol + table processing isn't initialized. But we have to set the CU language, + or we won't be able to build types correctly. */ + attr = dwarf2_attr (cu->dies, DW_AT_language, cu); + if (attr) + set_cu_language (DW_UNSND (attr), cu); + else + set_cu_language (language_minimal, cu); + + do_cleanups (back_to); + + /* We've successfully allocated this compilation unit. Let our caller + clean it up when finished with it. */ + discard_cleanups (free_cu_cleanup); + + return cu; +} + +/* Generate full symbol information for PST and CU, whose DIEs have + already been loaded into memory. */ + +static void +process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) +{ + struct partial_symtab *pst = per_cu->psymtab; + struct dwarf2_cu *cu = per_cu->cu; + struct objfile *objfile = pst->objfile; + bfd *abfd = objfile->obfd; + CORE_ADDR lowpc, highpc; + struct symtab *symtab; + struct cleanup *back_to; + struct attribute *attr; + CORE_ADDR baseaddr; - cu.header.offset = offset; + baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); - cu.list_in_scope = &file_symbols; + /* We're in the global namespace. */ + processing_current_prefix = ""; - dies = read_comp_unit (info_ptr, abfd, &cu); + buildsym_init (); + back_to = make_cleanup (really_free_pendings, NULL); - make_cleanup_free_die_list (dies); + cu->list_in_scope = &file_symbols; /* Find the base address of the compilation unit for range lists and location lists. It will normally be specified by DW_AT_low_pc. @@ -1879,32 +2569,32 @@ psymtab_to_symtab_1 (struct partial_symtab *pst) DW_AT_entry_pc. It's been removed, but GCC still uses this for compilation units with discontinuous ranges. */ - cu.header.base_known = 0; - cu.header.base_address = 0; + cu->header.base_known = 0; + cu->header.base_address = 0; - attr = dwarf2_attr (dies, DW_AT_entry_pc, &cu); + attr = dwarf2_attr (cu->dies, DW_AT_entry_pc, cu); if (attr) { - cu.header.base_address = DW_ADDR (attr); - cu.header.base_known = 1; + cu->header.base_address = DW_ADDR (attr); + cu->header.base_known = 1; } else { - attr = dwarf2_attr (dies, DW_AT_low_pc, &cu); + attr = dwarf2_attr (cu->dies, DW_AT_low_pc, cu); if (attr) { - cu.header.base_address = DW_ADDR (attr); - cu.header.base_known = 1; + cu->header.base_address = DW_ADDR (attr); + cu->header.base_known = 1; } } /* Do line number decoding in read_file_scope () */ - process_die (dies, &cu); + process_die (cu->dies, cu); /* Some compilers don't define a DW_AT_high_pc attribute for the compilation unit. If the DW_AT_high_pc is missing, synthesize it, by scanning the DIE's below the compilation unit. */ - get_scope_pc_bounds (dies, &lowpc, &highpc, &cu); + get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu); symtab = end_symtab (highpc + baseaddr, objfile, SECT_OFF_TEXT (objfile)); @@ -1912,9 +2602,9 @@ psymtab_to_symtab_1 (struct partial_symtab *pst) If the compilation is from a C file generated by language preprocessors, do not set the language if it was already deduced by start_subfile. */ if (symtab != NULL - && !(cu.language == language_c && symtab->language != language_c)) + && !(cu->language == language_c && symtab->language != language_c)) { - symtab->language = cu.language; + symtab->language = cu->language; } pst->symtab = symtab; pst->readin = 1; @@ -2073,19 +2763,16 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) } } - if (objfile->ei.entry_point >= lowpc && - objfile->ei.entry_point < highpc) - { - objfile->ei.deprecated_entry_file_lowpc = lowpc; - objfile->ei.deprecated_entry_file_highpc = highpc; - } - attr = dwarf2_attr (die, DW_AT_language, cu); if (attr) { set_cu_language (DW_UNSND (attr), cu); } + attr = dwarf2_attr (die, DW_AT_producer, cu); + if (attr) + cu->producer = DW_STRING (attr); + /* We assume that we're processing GCC output. */ processing_gcc_compilation = 2; #if 0 @@ -2126,7 +2813,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) { make_cleanup ((make_cleanup_ftype *) free_line_header, (void *) line_header); - dwarf_decode_lines (line_header, comp_dir, abfd, cu); + dwarf_decode_lines (line_header, comp_dir, abfd, cu, NULL); } } @@ -2151,7 +2838,7 @@ add_to_cu_func_list (const char *name, CORE_ADDR lowpc, CORE_ADDR highpc, struct function_range *thisfn; thisfn = (struct function_range *) - obstack_alloc (&dwarf2_tmp_obstack, sizeof (struct function_range)); + obstack_alloc (&cu->comp_unit_obstack, sizeof (struct function_range)); thisfn->name = name; thisfn->lowpc = lowpc; thisfn->highpc = highpc; @@ -2189,7 +2876,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) if (name == NULL || !dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu)) return; - if (cu->language == language_cplus) + if (cu->language == language_cplus + || cu->language == language_java) { struct die_info *spec_die = die_specification (die, cu); @@ -2229,13 +2917,6 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) /* Record the function range for dwarf_decode_lines. */ add_to_cu_func_list (name, lowpc, highpc, cu); - if (objfile->ei.entry_point >= lowpc && - objfile->ei.entry_point < highpc) - { - objfile->ei.entry_func_lowpc = lowpc; - objfile->ei.entry_func_highpc = highpc; - } - new = push_context (0, lowpc); new->name = new_symbol (die, die->type, cu); @@ -2382,14 +3063,14 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, found_base = cu_header->base_known; base = cu_header->base_address; - if (offset >= dwarf_ranges_size) + if (offset >= dwarf2_per_objfile->ranges_size) { complaint (&symfile_complaints, "Offset %d out of bounds for DW_AT_ranges attribute", offset); return 0; } - buffer = dwarf_ranges_buffer + offset; + buffer = dwarf2_per_objfile->ranges_buffer + offset; /* Read in the largest possible address. */ marker = read_address (obfd, buffer, cu, &dummy); @@ -2670,8 +3351,10 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, attr = dwarf2_attr (die, DW_AT_name, cu); if (attr && DW_STRING (attr)) fieldname = DW_STRING (attr); - fp->name = obsavestring (fieldname, strlen (fieldname), - &objfile->objfile_obstack); + + /* The name is already allocated along with this objfile, so we don't + need to duplicate it for the type. */ + fp->name = fieldname; /* Change accessibility for artificial fields (e.g. virtual table pointer or virtual base class pointer) to private. */ @@ -2702,11 +3385,11 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, /* Get physical name. */ physname = dwarf2_linkage_name (die, cu); - SET_FIELD_PHYSNAME (*fp, obsavestring (physname, strlen (physname), - &objfile->objfile_obstack)); + /* The name is already allocated along with this objfile, so we don't + need to duplicate it for the type. */ + SET_FIELD_PHYSNAME (*fp, physname ? physname : ""); FIELD_TYPE (*fp) = die_type (die, cu); - FIELD_NAME (*fp) = obsavestring (fieldname, strlen (fieldname), - &objfile->objfile_obstack); + FIELD_NAME (*fp) = fieldname; } else if (die->tag == DW_TAG_inheritance) { @@ -2874,8 +3557,9 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, /* Fill in the member function field info. */ fnp = &new_fnfield->fnfield; - fnp->physname = obsavestring (physname, strlen (physname), - &objfile->objfile_obstack); + /* The name is already allocated along with this objfile, so we don't + need to duplicate it for the type. */ + fnp->physname = physname ? physname : ""; fnp->type = alloc_type (objfile); if (die->type && TYPE_CODE (die->type) == TYPE_CODE_FUNC) { @@ -2984,6 +3668,26 @@ dwarf2_attach_fn_fields_to_type (struct field_info *fip, struct type *type, TYPE_NFN_FIELDS_TOTAL (type) = total_length; } + +/* Returns non-zero if NAME is the name of a vtable member in CU's + language, zero otherwise. */ +static int +is_vtable_name (const char *name, struct dwarf2_cu *cu) +{ + static const char vptr[] = "_vptr"; + static const char vtable[] = "vtable"; + + /* Look for the C++ and Java forms of the vtable. */ + if ((cu->language == language_java + && strncmp (name, vtable, sizeof (vtable) - 1) == 0) + || (strncmp (name, vptr, sizeof (vptr) - 1) == 0 + && is_cplus_marker (name[sizeof (vptr) - 1]))) + return 1; + + return 0; +} + + /* Called when we find the DIE that starts a structure or union scope (definition) to process all dies that define the members of the structure or union. @@ -3018,17 +3722,20 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_name, cu); if (attr && DW_STRING (attr)) { - if (cu->language == language_cplus) + if (cu->language == language_cplus + || cu->language == language_java) { - char *new_prefix = determine_class_name (die, cu); - TYPE_TAG_NAME (type) = obsavestring (new_prefix, - strlen (new_prefix), - &objfile->objfile_obstack); - back_to = make_cleanup (xfree, new_prefix); + char *new_prefix = determine_class_name (die, cu); + TYPE_TAG_NAME (type) = obsavestring (new_prefix, + strlen (new_prefix), + &objfile->objfile_obstack); + back_to = make_cleanup (xfree, new_prefix); processing_current_prefix = new_prefix; } else { + /* The name is already allocated along with this objfile, so + we don't need to duplicate it for the type. */ TYPE_TAG_NAME (type) = DW_STRING (attr); } } @@ -3058,10 +3765,13 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) TYPE_LENGTH (type) = 0; } + if (die_is_declaration (die, cu)) + TYPE_FLAGS (type) |= TYPE_FLAG_STUB; + /* We need to add the type field to the die immediately so we don't infinitely recurse when dealing with pointers to the structure type within the structure itself. */ - die->type = type; + set_die_type (die, type, cu); if (die->child != NULL && ! die_is_declaration (die, cu)) { @@ -3117,8 +3827,6 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) TYPE_VPTR_BASETYPE (type) = t; if (type == t) { - static const char vptr_name[] = - {'_', 'v', 'p', 't', 'r', '\0'}; int i; /* Our own class provides vtbl ptr. */ @@ -3128,10 +3836,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) { char *fieldname = TYPE_FIELD_NAME (t, i); - if ((strncmp (fieldname, vptr_name, - strlen (vptr_name) - 1) - == 0) - && is_cplus_marker (fieldname[strlen (vptr_name)])) + if (is_vtable_name (fieldname, cu)) { TYPE_VPTR_FIELDNO (type) = i; break; @@ -3154,11 +3859,6 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) do_cleanups (back_to); } - else - { - /* No children, must be stub. */ - TYPE_FLAGS (type) |= TYPE_FLAG_STUB; - } processing_current_prefix = previous_prefix; if (back_to != NULL) @@ -3221,20 +3921,19 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_name, cu); if (attr && DW_STRING (attr)) { - const char *name = DW_STRING (attr); + char *name = DW_STRING (attr); if (processing_has_namespace_info) { - TYPE_TAG_NAME (type) = obconcat (&objfile->objfile_obstack, - processing_current_prefix, - processing_current_prefix[0] == '\0' - ? "" : "::", - name); + TYPE_TAG_NAME (type) = typename_concat (&objfile->objfile_obstack, + processing_current_prefix, + name, cu); } else { - TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), - &objfile->objfile_obstack); + /* The name is already allocated along with this objfile, so + we don't need to duplicate it for the type. */ + TYPE_TAG_NAME (type) = name; } } @@ -3248,11 +3947,11 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) TYPE_LENGTH (type) = 0; } - die->type = type; + set_die_type (die, type, cu); } /* Determine the name of the type represented by DIE, which should be - a named C++ compound type. Return the name in question; the caller + a named C++ or Java compound type. Return the name in question; the caller is responsible for xfree()'ing it. */ static char * @@ -3274,7 +3973,7 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *cu) /* If we don't have namespace debug info, guess the name by trying to demangle the names of members, just like we did in - add_partial_structure. */ + guess_structure_name. */ if (!processing_has_namespace_info) { struct die_info *child; @@ -3285,7 +3984,9 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *cu) { if (child->tag == DW_TAG_subprogram) { - new_prefix = class_name_from_physname (dwarf2_linkage_name + new_prefix + = language_class_name_from_physname (cu->language_defn, + dwarf2_linkage_name (child, cu)); if (new_prefix != NULL) @@ -3297,8 +3998,9 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *cu) if (new_prefix == NULL) { const char *name = dwarf2_name (die, cu); - new_prefix = typename_concat (processing_current_prefix, - name ? name : "<<anonymous>>"); + new_prefix = typename_concat (NULL, processing_current_prefix, + name ? name : "<<anonymous>>", + cu); } if (back_to != NULL) @@ -3411,7 +4113,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) { index_type = dwarf2_fundamental_type (objfile, FT_INTEGER, cu); range_type = create_range_type (NULL, index_type, 0, -1); - die->type = create_array_type (NULL, element_type, range_type); + set_die_type (die, create_array_type (NULL, element_type, range_type), + cu); return; } @@ -3443,9 +4146,20 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) /* Dwarf2 dimensions are output from left to right, create the necessary array types in backwards order. */ + type = element_type; - while (ndim-- > 0) - type = create_array_type (NULL, type, range_types[ndim]); + + if (read_array_order (die, cu) == DW_ORD_col_major) + { + int i = 0; + while (i < ndim) + type = create_array_type (NULL, type, range_types[i++]); + } + else + { + while (ndim-- > 0) + type = create_array_type (NULL, type, range_types[ndim]); + } /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the @@ -3460,9 +4174,44 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) do_cleanups (back_to); /* Install the type in the die. */ - die->type = type; + set_die_type (die, type, cu); +} + +static enum dwarf_array_dim_ordering +read_array_order (struct die_info *die, struct dwarf2_cu *cu) +{ + struct attribute *attr; + + attr = dwarf2_attr (die, DW_AT_ordering, cu); + + if (attr) return DW_SND (attr); + + /* + GNU F77 is a special case, as at 08/2004 array type info is the + opposite order to the dwarf2 specification, but data is still + laid out as per normal fortran. + + FIXME: dsl/2004-8-20: If G77 is ever fixed, this will also need + version checking. + */ + + if (cu->language == language_fortran && + cu->producer && strstr (cu->producer, "GNU F77")) + { + return DW_ORD_row_major; + } + + switch (cu->language_defn->la_array_ordering) + { + case array_column_major: + return DW_ORD_col_major; + case array_row_major: + default: + return DW_ORD_row_major; + }; } + /* First cut: install each common block member as a global variable. */ static void @@ -3519,6 +4268,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) const char *name; int is_anonymous; struct die_info *current_die; + struct cleanup *back_to = make_cleanup (null_cleanup, 0); name = namespace_name (die, &is_anonymous, cu); @@ -3530,14 +4280,8 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) } else { - /* We need temp_name around because processing_current_prefix - is a const char *. */ - char *temp_name = alloca (strlen (previous_prefix) - + 2 + strlen(name) + 1); - strcpy (temp_name, previous_prefix); - strcat (temp_name, "::"); - strcat (temp_name, name); - + char *temp_name = typename_concat (NULL, previous_prefix, name, cu); + make_cleanup (xfree, temp_name); processing_current_prefix = temp_name; } @@ -3557,7 +4301,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) TYPE_TAG_NAME (type) = TYPE_NAME (type); new_symbol (die, type, cu); - die->type = type; + set_die_type (die, type, cu); if (is_anonymous) cp_add_using_directive (processing_current_prefix, @@ -3577,6 +4321,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) } processing_current_prefix = previous_prefix; + do_cleanups (back_to); } /* Return the name of the namespace represented by DIE. Set @@ -3663,7 +4408,7 @@ read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu) } TYPE_LENGTH (type) = byte_size; - die->type = type; + set_die_type (die, type, cu); } /* Extract all information from a DW_TAG_ptr_to_member_type DIE and add to @@ -3687,7 +4432,7 @@ read_tag_ptr_to_member_type (struct die_info *die, struct dwarf2_cu *cu) domain = die_containing_type (die, cu); smash_to_member_type (type, domain, to_type); - die->type = type; + set_die_type (die, type, cu); } /* Extract all information from a DW_TAG_reference_type DIE and add to @@ -3715,7 +4460,7 @@ read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu) { TYPE_LENGTH (type) = cu_header->addr_size; } - die->type = type; + set_die_type (die, type, cu); } static void @@ -3729,7 +4474,8 @@ read_tag_const_type (struct die_info *die, struct dwarf2_cu *cu) } base_type = die_type (die, cu); - die->type = make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0); + set_die_type (die, make_cv_type (1, TYPE_VOLATILE (base_type), base_type, 0), + cu); } static void @@ -3743,7 +4489,8 @@ read_tag_volatile_type (struct die_info *die, struct dwarf2_cu *cu) } base_type = die_type (die, cu); - die->type = make_cv_type (TYPE_CONST (base_type), 1, base_type, 0); + set_die_type (die, make_cv_type (TYPE_CONST (base_type), 1, base_type, 0), + cu); } /* Extract all information from a DW_TAG_string_type DIE and add to @@ -3795,7 +4542,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) char_type = dwarf2_fundamental_type (objfile, FT_CHAR, cu); type = create_string_type (char_type, range_type); } - die->type = type; + set_die_type (die, type, cu); } /* Handle DIES due to C code like: @@ -3822,12 +4569,13 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) return; } type = die_type (die, cu); - ftype = lookup_function_type (type); + ftype = make_function_type (type, (struct type **) 0); - /* All functions in C++ have prototypes. */ + /* All functions in C++ and Java have prototypes. */ attr = dwarf2_attr (die, DW_AT_prototyped, cu); if ((attr && (DW_UNSND (attr) != 0)) - || cu->language == language_cplus) + || cu->language == language_cplus + || cu->language == language_java) TYPE_FLAGS (ftype) |= TYPE_FLAG_PROTOTYPED; if (die->child != NULL) @@ -3876,7 +4624,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) } } - die->type = ftype; + set_die_type (die, ftype, cu); } static void @@ -3893,7 +4641,9 @@ read_typedef (struct die_info *die, struct dwarf2_cu *cu) { name = DW_STRING (attr); } - die->type = init_type (TYPE_CODE_TYPEDEF, 0, TYPE_FLAG_TARGET_STUB, name, objfile); + set_die_type (die, init_type (TYPE_CODE_TYPEDEF, 0, + TYPE_FLAG_TARGET_STUB, name, objfile), + cu); TYPE_TARGET_TYPE (die->type) = die_type (die, cu); } } @@ -3981,7 +4731,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) { type = dwarf_base_type (encoding, size, cu); } - die->type = type; + set_die_type (die, type, cu); } /* Read the given DW_AT_subrange DIE. */ @@ -4016,6 +4766,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) low = 1; } + /* FIXME: For variable sized arrays either of these could be + a variable rather than a constant value. We'll allow it, + but we don't know how to handle it. */ attr = dwarf2_attr (die, DW_AT_lower_bound, cu); if (attr) low = dwarf2_get_attr_constant_value (attr, 0); @@ -4052,7 +4805,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) if (attr) TYPE_LENGTH (range_type) = DW_UNSND (attr); - die->type = range_type; + set_die_type (die, range_type, cu); } @@ -4061,10 +4814,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) static struct die_info * read_comp_unit (char *info_ptr, bfd *abfd, struct dwarf2_cu *cu) { - /* Reset die reference table; we are - building new ones now. */ - dwarf2_empty_hash_tables (); - return read_die_and_children (info_ptr, abfd, cu, &info_ptr, NULL); } @@ -4085,7 +4834,7 @@ read_die_and_children (char *info_ptr, bfd *abfd, int has_children; cur_ptr = read_full_die (&die, abfd, info_ptr, cu, &has_children); - store_in_ref_table (die->offset, die); + store_in_ref_table (die->offset, die, cu); if (has_children) { @@ -4164,19 +4913,6 @@ free_die_list (struct die_info *dies) } } -static void -do_free_die_list_cleanup (void *dies) -{ - free_die_list (dies); -} - -static struct cleanup * -make_cleanup_free_die_list (struct die_info *dies) -{ - return make_cleanup (do_free_die_list_cleanup, dies); -} - - /* Read the contents of the section at OFFSET and of size SIZE from the object file specified by OBJFILE into the objfile_obstack and return it. */ @@ -4185,7 +4921,7 @@ dwarf2_read_section (struct objfile *objfile, asection *sectp) { bfd *abfd = objfile->obfd; char *buf, *retbuf; - bfd_size_type size = bfd_get_section_size_before_reloc (sectp); + bfd_size_type size = bfd_get_section_size (sectp); if (size == 0) return NULL; @@ -4207,7 +4943,8 @@ dwarf2_read_section (struct objfile *objfile, asection *sectp) /* In DWARF version 2, the description of the debugging information is stored in a separate .debug_abbrev section. Before we read any dies from a section we read in all abbreviations and install them - in a hash table. */ + in a hash table. This function also sets flags in CU describing + the data found in the abbrev table. */ static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) @@ -4217,19 +4954,28 @@ dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) struct abbrev_info *cur_abbrev; unsigned int abbrev_number, bytes_read, abbrev_name; unsigned int abbrev_form, hash_number; + struct attr_abbrev *cur_attrs; + unsigned int allocated_attrs; /* Initialize dwarf2 abbrevs */ - memset (cu_header->dwarf2_abbrevs, 0, - ABBREV_HASH_SIZE*sizeof (struct abbrev_info *)); - - abbrev_ptr = dwarf_abbrev_buffer + cu_header->abbrev_offset; + obstack_init (&cu->abbrev_obstack); + cu->dwarf2_abbrevs = obstack_alloc (&cu->abbrev_obstack, + (ABBREV_HASH_SIZE + * sizeof (struct abbrev_info *))); + memset (cu->dwarf2_abbrevs, 0, + ABBREV_HASH_SIZE * sizeof (struct abbrev_info *)); + + abbrev_ptr = dwarf2_per_objfile->abbrev_buffer + cu_header->abbrev_offset; abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; + allocated_attrs = ATTR_ALLOC_CHUNK; + cur_attrs = xmalloc (allocated_attrs * sizeof (struct attr_abbrev)); + /* loop until we reach an abbrev number of 0 */ while (abbrev_number) { - cur_abbrev = dwarf_alloc_abbrev (); + cur_abbrev = dwarf_alloc_abbrev (cu); /* read in abbrev header */ cur_abbrev->number = abbrev_number; @@ -4238,6 +4984,9 @@ dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr); abbrev_ptr += 1; + if (cur_abbrev->tag == DW_TAG_namespace) + cu->has_namespace_info = 1; + /* now read in declarations */ abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; @@ -4245,24 +4994,41 @@ dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) abbrev_ptr += bytes_read; while (abbrev_name) { - if ((cur_abbrev->num_attrs % ATTR_ALLOC_CHUNK) == 0) + if (cur_abbrev->num_attrs == allocated_attrs) { - cur_abbrev->attrs = (struct attr_abbrev *) - xrealloc (cur_abbrev->attrs, - (cur_abbrev->num_attrs + ATTR_ALLOC_CHUNK) - * sizeof (struct attr_abbrev)); + allocated_attrs += ATTR_ALLOC_CHUNK; + cur_attrs + = xrealloc (cur_attrs, (allocated_attrs + * sizeof (struct attr_abbrev))); } - cur_abbrev->attrs[cur_abbrev->num_attrs].name = abbrev_name; - cur_abbrev->attrs[cur_abbrev->num_attrs++].form = abbrev_form; + + /* Record whether this compilation unit might have + inter-compilation-unit references. If we don't know what form + this attribute will have, then it might potentially be a + DW_FORM_ref_addr, so we conservatively expect inter-CU + references. */ + + if (abbrev_form == DW_FORM_ref_addr + || abbrev_form == DW_FORM_indirect) + cu->has_form_ref_addr = 1; + + cur_attrs[cur_abbrev->num_attrs].name = abbrev_name; + cur_attrs[cur_abbrev->num_attrs++].form = abbrev_form; abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; } + cur_abbrev->attrs = obstack_alloc (&cu->abbrev_obstack, + (cur_abbrev->num_attrs + * sizeof (struct attr_abbrev))); + memcpy (cur_abbrev->attrs, cur_attrs, + cur_abbrev->num_attrs * sizeof (struct attr_abbrev)); + hash_number = abbrev_number % ABBREV_HASH_SIZE; - cur_abbrev->next = cu_header->dwarf2_abbrevs[hash_number]; - cu_header->dwarf2_abbrevs[hash_number] = cur_abbrev; + cur_abbrev->next = cu->dwarf2_abbrevs[hash_number]; + cu->dwarf2_abbrevs[hash_number] = cur_abbrev; /* Get next abbreviation. Under Irix6 the abbreviations for a compilation unit are not @@ -4271,40 +5037,27 @@ dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) already read (which means we are about to read the abbreviations for the next compile unit) or if the end of the abbreviation table is reached. */ - if ((unsigned int) (abbrev_ptr - dwarf_abbrev_buffer) - >= dwarf_abbrev_size) + if ((unsigned int) (abbrev_ptr - dwarf2_per_objfile->abbrev_buffer) + >= dwarf2_per_objfile->abbrev_size) break; abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; if (dwarf2_lookup_abbrev (abbrev_number, cu) != NULL) break; } + + xfree (cur_attrs); } -/* Empty the abbrev table for a new compilation unit. */ +/* Release the memory used by the abbrev table for a compilation unit. */ static void -dwarf2_empty_abbrev_table (void *ptr_to_abbrevs_table) +dwarf2_free_abbrev_table (void *ptr_to_cu) { - int i; - struct abbrev_info *abbrev, *next; - struct abbrev_info **abbrevs; - - abbrevs = (struct abbrev_info **)ptr_to_abbrevs_table; + struct dwarf2_cu *cu = ptr_to_cu; - for (i = 0; i < ABBREV_HASH_SIZE; ++i) - { - next = NULL; - abbrev = abbrevs[i]; - while (abbrev) - { - next = abbrev->next; - xfree (abbrev->attrs); - xfree (abbrev); - abbrev = next; - } - abbrevs[i] = NULL; - } + obstack_free (&cu->abbrev_obstack, NULL); + cu->dwarf2_abbrevs = NULL; } /* Lookup an abbrev_info structure in the abbrev hash table. */ @@ -4312,12 +5065,11 @@ dwarf2_empty_abbrev_table (void *ptr_to_abbrevs_table) static struct abbrev_info * dwarf2_lookup_abbrev (unsigned int number, struct dwarf2_cu *cu) { - struct comp_unit_head *cu_header = &cu->header; unsigned int hash_number; struct abbrev_info *abbrev; hash_number = number % ABBREV_HASH_SIZE; - abbrev = cu_header->dwarf2_abbrevs[hash_number]; + abbrev = cu->dwarf2_abbrevs[hash_number]; while (abbrev) { @@ -4329,36 +5081,258 @@ dwarf2_lookup_abbrev (unsigned int number, struct dwarf2_cu *cu) return NULL; } +/* Returns nonzero if TAG represents a type that we might generate a partial + symbol for. */ + +static int +is_type_tag_for_partial (int tag) +{ + switch (tag) + { +#if 0 + /* Some types that would be reasonable to generate partial symbols for, + that we don't at present. */ + case DW_TAG_array_type: + case DW_TAG_file_type: + case DW_TAG_ptr_to_member_type: + case DW_TAG_set_type: + case DW_TAG_string_type: + case DW_TAG_subroutine_type: +#endif + case DW_TAG_base_type: + case DW_TAG_class_type: + case DW_TAG_enumeration_type: + case DW_TAG_structure_type: + case DW_TAG_subrange_type: + case DW_TAG_typedef: + case DW_TAG_union_type: + return 1; + default: + return 0; + } +} + +/* Load all DIEs that are interesting for partial symbols into memory. */ + +static struct partial_die_info * +load_partial_dies (bfd *abfd, char *info_ptr, int building_psymtab, + struct dwarf2_cu *cu) +{ + struct partial_die_info *part_die; + struct partial_die_info *parent_die, *last_die, *first_die = NULL; + struct abbrev_info *abbrev; + unsigned int bytes_read; + + int nesting_level = 1; + + parent_die = NULL; + last_die = NULL; + + cu->partial_dies + = htab_create_alloc_ex (cu->header.length / 12, + partial_die_hash, + partial_die_eq, + NULL, + &cu->comp_unit_obstack, + hashtab_obstack_allocate, + dummy_obstack_deallocate); + + part_die = obstack_alloc (&cu->comp_unit_obstack, + sizeof (struct partial_die_info)); + + while (1) + { + abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu); + + /* A NULL abbrev means the end of a series of children. */ + if (abbrev == NULL) + { + if (--nesting_level == 0) + { + /* PART_DIE was probably the last thing allocated on the + comp_unit_obstack, so we could call obstack_free + here. We don't do that because the waste is small, + and will be cleaned up when we're done with this + compilation unit. This way, we're also more robust + against other users of the comp_unit_obstack. */ + return first_die; + } + info_ptr += bytes_read; + last_die = parent_die; + parent_die = parent_die->die_parent; + continue; + } + + /* Check whether this DIE is interesting enough to save. */ + if (!is_type_tag_for_partial (abbrev->tag) + && abbrev->tag != DW_TAG_enumerator + && abbrev->tag != DW_TAG_subprogram + && abbrev->tag != DW_TAG_variable + && abbrev->tag != DW_TAG_namespace) + { + /* Otherwise we skip to the next sibling, if any. */ + info_ptr = skip_one_die (info_ptr + bytes_read, abbrev, cu); + continue; + } + + info_ptr = read_partial_die (part_die, abbrev, bytes_read, + abfd, info_ptr, cu); + + /* This two-pass algorithm for processing partial symbols has a + high cost in cache pressure. Thus, handle some simple cases + here which cover the majority of C partial symbols. DIEs + which neither have specification tags in them, nor could have + specification tags elsewhere pointing at them, can simply be + processed and discarded. + + This segment is also optional; scan_partial_symbols and + add_partial_symbol will handle these DIEs if we chain + them in normally. When compilers which do not emit large + quantities of duplicate debug information are more common, + this code can probably be removed. */ + + /* Any complete simple types at the top level (pretty much all + of them, for a language without namespaces), can be processed + directly. */ + if (parent_die == NULL + && part_die->has_specification == 0 + && part_die->is_declaration == 0 + && (part_die->tag == DW_TAG_typedef + || part_die->tag == DW_TAG_base_type + || part_die->tag == DW_TAG_subrange_type)) + { + if (building_psymtab && part_die->name != NULL) + add_psymbol_to_list (part_die->name, strlen (part_die->name), + VAR_DOMAIN, LOC_TYPEDEF, + &cu->objfile->static_psymbols, + 0, (CORE_ADDR) 0, cu->language, cu->objfile); + info_ptr = locate_pdi_sibling (part_die, info_ptr, abfd, cu); + continue; + } + + /* If we're at the second level, and we're an enumerator, and + our parent has no specification (meaning possibly lives in a + namespace elsewhere), then we can add the partial symbol now + instead of queueing it. */ + if (part_die->tag == DW_TAG_enumerator + && parent_die != NULL + && parent_die->die_parent == NULL + && parent_die->tag == DW_TAG_enumeration_type + && parent_die->has_specification == 0) + { + if (part_die->name == NULL) + complaint (&symfile_complaints, "malformed enumerator DIE ignored"); + else if (building_psymtab) + add_psymbol_to_list (part_die->name, strlen (part_die->name), + VAR_DOMAIN, LOC_CONST, + (cu->language == language_cplus + || cu->language == language_java) + ? &cu->objfile->global_psymbols + : &cu->objfile->static_psymbols, + 0, (CORE_ADDR) 0, cu->language, cu->objfile); + + info_ptr = locate_pdi_sibling (part_die, info_ptr, abfd, cu); + continue; + } + + /* We'll save this DIE so link it in. */ + part_die->die_parent = parent_die; + part_die->die_sibling = NULL; + part_die->die_child = NULL; + + if (last_die && last_die == parent_die) + last_die->die_child = part_die; + else if (last_die) + last_die->die_sibling = part_die; + + last_die = part_die; + + if (first_die == NULL) + first_die = part_die; + + /* Maybe add the DIE to the hash table. Not all DIEs that we + find interesting need to be in the hash table, because we + also have the parent/sibling/child chains; only those that we + might refer to by offset later during partial symbol reading. + + For now this means things that might have be the target of a + DW_AT_specification, DW_AT_abstract_origin, or + DW_AT_extension. DW_AT_extension will refer only to + namespaces; DW_AT_abstract_origin refers to functions (and + many things under the function DIE, but we do not recurse + into function DIEs during partial symbol reading) and + possibly variables as well; DW_AT_specification refers to + declarations. Declarations ought to have the DW_AT_declaration + flag. It happens that GCC forgets to put it in sometimes, but + only for functions, not for types. + + Adding more things than necessary to the hash table is harmless + except for the performance cost. Adding too few will result in + internal errors in find_partial_die. */ + + if (abbrev->tag == DW_TAG_subprogram + || abbrev->tag == DW_TAG_variable + || abbrev->tag == DW_TAG_namespace + || part_die->is_declaration) + { + void **slot; + + slot = htab_find_slot_with_hash (cu->partial_dies, part_die, + part_die->offset, INSERT); + *slot = part_die; + } + + part_die = obstack_alloc (&cu->comp_unit_obstack, + sizeof (struct partial_die_info)); + + /* For some DIEs we want to follow their children (if any). For C + we have no reason to follow the children of structures; for other + languages we have to, both so that we can get at method physnames + to infer fully qualified class names, and for DW_AT_specification. */ + if (last_die->has_children + && (last_die->tag == DW_TAG_namespace + || last_die->tag == DW_TAG_enumeration_type + || (cu->language != language_c + && (last_die->tag == DW_TAG_class_type + || last_die->tag == DW_TAG_structure_type + || last_die->tag == DW_TAG_union_type)))) + { + nesting_level++; + parent_die = last_die; + continue; + } + + /* Otherwise we skip to the next sibling, if any. */ + info_ptr = locate_pdi_sibling (last_die, info_ptr, abfd, cu); + + /* Back to the top, do it again. */ + } +} + /* Read a minimal amount of information into the minimal die structure. */ static char * -read_partial_die (struct partial_die_info *part_die, bfd *abfd, +read_partial_die (struct partial_die_info *part_die, + struct abbrev_info *abbrev, + unsigned int abbrev_len, bfd *abfd, char *info_ptr, struct dwarf2_cu *cu) { - unsigned int abbrev_number, bytes_read, i; - struct abbrev_info *abbrev; + unsigned int bytes_read, i; struct attribute attr; - struct attribute spec_attr; - int found_spec_attr = 0; int has_low_pc_attr = 0; int has_high_pc_attr = 0; - *part_die = zeroed_partial_die; - abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); - info_ptr += bytes_read; - if (!abbrev_number) + memset (part_die, 0, sizeof (struct partial_die_info)); + + part_die->offset = info_ptr - dwarf2_per_objfile->info_buffer; + + info_ptr += abbrev_len; + + if (abbrev == NULL) return info_ptr; - abbrev = dwarf2_lookup_abbrev (abbrev_number, cu); - if (!abbrev) - { - error ("Dwarf Error: Could not find abbrev number %d [in module %s]", abbrev_number, - bfd_get_filename (abfd)); - } - part_die->offset = info_ptr - dwarf_info_buffer; part_die->tag = abbrev->tag; part_die->has_children = abbrev->has_children; - part_die->abbrev = abbrev_number; for (i = 0; i < abbrev->num_attrs; ++i) { @@ -4374,6 +5348,10 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, if (part_die->name == NULL) part_die->name = DW_STRING (&attr); break; + case DW_AT_comp_dir: + if (part_die->dirname == NULL) + part_die->dirname = DW_STRING (&attr); + break; case DW_AT_MIPS_linkage_name: part_die->name = DW_STRING (&attr); break; @@ -4415,8 +5393,9 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, break; case DW_AT_abstract_origin: case DW_AT_specification: - found_spec_attr = 1; - spec_attr = attr; + case DW_AT_extension: + part_die->has_specification = 1; + part_die->spec_offset = dwarf2_get_ref_die_offset (&attr, cu); break; case DW_AT_sibling: /* Ignore absolute siblings, they might point outside of @@ -4424,35 +5403,18 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, if (attr.form == DW_FORM_ref_addr) complaint (&symfile_complaints, "ignoring absolute DW_AT_sibling"); else - part_die->sibling = - dwarf_info_buffer + dwarf2_get_ref_die_offset (&attr, cu); + part_die->sibling = dwarf2_per_objfile->info_buffer + + dwarf2_get_ref_die_offset (&attr, cu); break; + case DW_AT_stmt_list: + part_die->has_stmt_list = 1; + part_die->line_offset = DW_UNSND (&attr); + break; default: break; } } - /* If we found a reference attribute and the die has no name, try - to find a name in the referred to die. */ - - if (found_spec_attr && part_die->name == NULL) - { - struct partial_die_info spec_die; - char *spec_ptr; - - spec_ptr = dwarf_info_buffer - + dwarf2_get_ref_die_offset (&spec_attr, cu); - read_partial_die (&spec_die, abfd, spec_ptr, cu); - if (spec_die.name) - { - part_die->name = spec_die.name; - - /* Copy DW_AT_external attribute if it is set. */ - if (spec_die.is_external) - part_die->is_external = spec_die.is_external; - } - } - /* When using the GNU linker, .gnu.linkonce. sections are used to eliminate duplicate copies of functions and vtables and such. The linker will arbitrarily choose one and discard the others. @@ -4469,6 +5431,90 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd, return info_ptr; } +/* Find a cached partial DIE at OFFSET in CU. */ + +static struct partial_die_info * +find_partial_die_in_comp_unit (unsigned long offset, struct dwarf2_cu *cu) +{ + struct partial_die_info *lookup_die = NULL; + struct partial_die_info part_die; + + part_die.offset = offset; + lookup_die = htab_find_with_hash (cu->partial_dies, &part_die, offset); + + if (lookup_die == NULL) + internal_error (__FILE__, __LINE__, + "could not find partial DIE in cache\n"); + + return lookup_die; +} + +/* Find a partial DIE at OFFSET, which may or may not be in CU. */ + +static struct partial_die_info * +find_partial_die (unsigned long offset, struct dwarf2_cu *cu) +{ + struct dwarf2_per_cu_data *per_cu; + + if (offset >= cu->header.offset + && offset < cu->header.offset + cu->header.length) + return find_partial_die_in_comp_unit (offset, cu); + + per_cu = dwarf2_find_containing_comp_unit (offset, cu->objfile); + + if (per_cu->cu == NULL) + { + load_comp_unit (per_cu, cu->objfile); + per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain; + dwarf2_per_objfile->read_in_chain = per_cu; + } + + per_cu->cu->last_used = 0; + return find_partial_die_in_comp_unit (offset, per_cu->cu); +} + +/* Adjust PART_DIE before generating a symbol for it. This function + may set the is_external flag or change the DIE's name. */ + +static void +fixup_partial_die (struct partial_die_info *part_die, + struct dwarf2_cu *cu) +{ + /* If we found a reference attribute and the DIE has no name, try + to find a name in the referred to DIE. */ + + if (part_die->name == NULL && part_die->has_specification) + { + struct partial_die_info *spec_die; + + spec_die = find_partial_die (part_die->spec_offset, cu); + + fixup_partial_die (spec_die, cu); + + if (spec_die->name) + { + part_die->name = spec_die->name; + + /* Copy DW_AT_external attribute if it is set. */ + if (spec_die->is_external) + part_die->is_external = spec_die->is_external; + } + } + + /* Set default names for some unnamed DIEs. */ + if (part_die->name == NULL && (part_die->tag == DW_TAG_structure_type + || part_die->tag == DW_TAG_class_type)) + part_die->name = "(anonymous class)"; + + if (part_die->name == NULL && part_die->tag == DW_TAG_namespace) + part_die->name = "(anonymous namespace)"; + + if (part_die->tag == DW_TAG_structure_type + || part_die->tag == DW_TAG_class_type + || part_die->tag == DW_TAG_union_type) + guess_structure_name (part_die, cu); +} + /* Read the die from the .debug_info section buffer. Set DIEP to point to a newly allocated die with its information, except for its child, sibling, and parent fields. Set HAS_CHILDREN to tell @@ -4482,7 +5528,7 @@ read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr, struct abbrev_info *abbrev; struct die_info *die; - offset = info_ptr - dwarf_info_buffer; + offset = info_ptr - dwarf2_per_objfile->info_buffer; abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; if (!abbrev_number) @@ -4500,7 +5546,7 @@ read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr, if (!abbrev) { error ("Dwarf Error: could not find abbrev number %d [in module %s]", - abbrev_number, + abbrev_number, bfd_get_filename (abfd)); } die = dwarf_alloc_die (); @@ -4517,6 +5563,38 @@ read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr, { info_ptr = read_attribute (&die->attrs[i], &abbrev->attrs[i], abfd, info_ptr, cu); + + /* If this attribute is an absolute reference to a different + compilation unit, make sure that compilation unit is loaded + also. */ + if (die->attrs[i].form == DW_FORM_ref_addr + && (DW_ADDR (&die->attrs[i]) < cu->header.offset + || (DW_ADDR (&die->attrs[i]) + >= cu->header.offset + cu->header.length))) + { + struct dwarf2_per_cu_data *per_cu; + per_cu = dwarf2_find_containing_comp_unit (DW_ADDR (&die->attrs[i]), + cu->objfile); + + /* Mark the dependence relation so that we don't flush PER_CU + too early. */ + dwarf2_add_dependence (cu, per_cu); + + /* If it's already on the queue, we have nothing to do. */ + if (per_cu->queued) + continue; + + /* If the compilation unit is already loaded, just mark it as + used. */ + if (per_cu->cu != NULL) + { + per_cu->cu->last_used = 0; + continue; + } + + /* Add it to the queue. */ + queue_comp_unit (per_cu); + } } *diep = die; @@ -4544,7 +5622,7 @@ read_attribute_value (struct attribute *attr, unsigned form, info_ptr += bytes_read; break; case DW_FORM_block2: - blk = dwarf_alloc_block (); + blk = dwarf_alloc_block (cu); blk->size = read_2_bytes (abfd, info_ptr); info_ptr += 2; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -4552,7 +5630,7 @@ read_attribute_value (struct attribute *attr, unsigned form, DW_BLOCK (attr) = blk; break; case DW_FORM_block4: - blk = dwarf_alloc_block (); + blk = dwarf_alloc_block (cu); blk->size = read_4_bytes (abfd, info_ptr); info_ptr += 4; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -4581,7 +5659,7 @@ read_attribute_value (struct attribute *attr, unsigned form, info_ptr += bytes_read; break; case DW_FORM_block: - blk = dwarf_alloc_block (); + blk = dwarf_alloc_block (cu); blk->size = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -4589,7 +5667,7 @@ read_attribute_value (struct attribute *attr, unsigned form, DW_BLOCK (attr) = blk; break; case DW_FORM_block1: - blk = dwarf_alloc_block (); + blk = dwarf_alloc_block (cu); blk->size = read_1_byte (abfd, info_ptr); info_ptr += 1; blk->data = read_n_bytes (abfd, info_ptr, blk->size); @@ -4613,23 +5691,24 @@ read_attribute_value (struct attribute *attr, unsigned form, info_ptr += bytes_read; break; case DW_FORM_ref1: - DW_UNSND (attr) = read_1_byte (abfd, info_ptr); + DW_ADDR (attr) = cu->header.offset + read_1_byte (abfd, info_ptr); info_ptr += 1; break; case DW_FORM_ref2: - DW_UNSND (attr) = read_2_bytes (abfd, info_ptr); + DW_ADDR (attr) = cu->header.offset + read_2_bytes (abfd, info_ptr); info_ptr += 2; break; case DW_FORM_ref4: - DW_UNSND (attr) = read_4_bytes (abfd, info_ptr); + DW_ADDR (attr) = cu->header.offset + read_4_bytes (abfd, info_ptr); info_ptr += 4; break; case DW_FORM_ref8: - DW_UNSND (attr) = read_8_bytes (abfd, info_ptr); + DW_ADDR (attr) = cu->header.offset + read_8_bytes (abfd, info_ptr); info_ptr += 8; break; case DW_FORM_ref_udata: - DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); + DW_ADDR (attr) = (cu->header.offset + + read_unsigned_leb128 (abfd, info_ptr, &bytes_read)); info_ptr += bytes_read; break; case DW_FORM_indirect: @@ -4896,22 +5975,22 @@ read_indirect_string (bfd *abfd, char *buf, LONGEST str_offset = read_offset (abfd, buf, cu_header, (int *) bytes_read_ptr); - if (dwarf_str_buffer == NULL) + if (dwarf2_per_objfile->str_buffer == NULL) { error ("DW_FORM_strp used without .debug_str section [in module %s]", bfd_get_filename (abfd)); return NULL; } - if (str_offset >= dwarf_str_size) + if (str_offset >= dwarf2_per_objfile->str_size) { error ("DW_FORM_strp pointing outside of .debug_str section [in module %s]", bfd_get_filename (abfd)); return NULL; } gdb_assert (HOST_CHAR_BIT == 8); - if (dwarf_str_buffer[str_offset] == '\0') + if (dwarf2_per_objfile->str_buffer[str_offset] == '\0') return NULL; - return dwarf_str_buffer + str_offset; + return dwarf2_per_objfile->str_buffer + str_offset; } static unsigned long @@ -4974,6 +6053,22 @@ read_signed_leb128 (bfd *abfd, char *buf, unsigned int *bytes_read_ptr) return result; } +/* Return a pointer to just past the end of an LEB128 number in BUF. */ + +static char * +skip_leb128 (bfd *abfd, char *buf) +{ + int byte; + + while (1) + { + byte = bfd_get_8 (abfd, (bfd_byte *) buf); + buf++; + if ((byte & 128) == 0) + return buf; + } +} + static void set_cu_language (unsigned int lang, struct dwarf2_cu *cu) { @@ -4999,6 +6094,8 @@ set_cu_language (unsigned int lang, struct dwarf2_cu *cu) break; case DW_LANG_Ada83: case DW_LANG_Ada95: + cu->language = language_ada; + break; case DW_LANG_Cobol74: case DW_LANG_Cobol85: case DW_LANG_Pascal83: @@ -5021,30 +6118,42 @@ dwarf2_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *cu) for (i = 0; i < die->num_attrs; ++i) { if (die->attrs[i].name == name) - { - return &die->attrs[i]; - } + return &die->attrs[i]; if (die->attrs[i].name == DW_AT_specification || die->attrs[i].name == DW_AT_abstract_origin) spec = &die->attrs[i]; } - if (spec) - { - struct die_info *ref_die = - follow_die_ref (dwarf2_get_ref_die_offset (spec, cu)); - if (ref_die) - return dwarf2_attr (ref_die, name, cu); - } + if (spec) + return dwarf2_attr (follow_die_ref (die, spec, cu), name, cu); return NULL; } +/* Return non-zero iff the attribute NAME is defined for the given DIE, + and holds a non-zero value. This function should only be used for + DW_FORM_flag attributes. */ + +static int +dwarf2_flag_true_p (struct die_info *die, unsigned name, struct dwarf2_cu *cu) +{ + struct attribute *attr = dwarf2_attr (die, name, cu); + + return (attr && DW_UNSND (attr)); +} + static int die_is_declaration (struct die_info *die, struct dwarf2_cu *cu) { - return (dwarf2_attr (die, DW_AT_declaration, cu) - && ! dwarf2_attr (die, DW_AT_specification, cu)); + /* A DIE is a declaration if it has a DW_AT_declaration attribute + which value is non-zero. However, we have to be careful with + DIEs having a DW_AT_specification attribute, because dwarf2_attr() + (via dwarf2_flag_true_p) follows this attribute. So we may + end up accidently finding a declaration attribute that belongs + to a different DIE referenced by the specification attribute, + even though the given DIE does not have a declaration attribute. */ + return (dwarf2_flag_true_p (die, DW_AT_declaration, cu) + && dwarf2_attr (die, DW_AT_specification, cu) == NULL); } /* Return the die giving the specification for DIE, if there is @@ -5058,7 +6167,7 @@ die_specification (struct die_info *die, struct dwarf2_cu *cu) if (spec_attr == NULL) return NULL; else - return follow_die_ref (dwarf2_get_ref_die_offset (spec_attr, cu)); + return follow_die_ref (die, spec_attr, cu); } /* Free the line_header structure *LH, and any arrays and strings it @@ -5135,12 +6244,13 @@ add_file_name (struct line_header *lh, fe->dir_index = dir_index; fe->mod_time = mod_time; fe->length = length; + fe->included_p = 0; } /* Read the statement program header starting at OFFSET in - dwarf_line_buffer, according to the endianness of ABFD. Return a - pointer to a struct line_header, allocated using xmalloc. + .debug_line, according to the endianness of ABFD. Return a pointer + to a struct line_header, allocated using xmalloc. NOTE: the strings in the include directory and file name tables of the returned object point into debug_line_buffer, and must not be @@ -5156,7 +6266,7 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, int i; char *cur_dir, *cur_file; - if (dwarf_line_buffer == NULL) + if (dwarf2_per_objfile->line_buffer == NULL) { complaint (&symfile_complaints, "missing .debug_line section"); return 0; @@ -5164,7 +6274,7 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, /* Make sure that at least there's room for the total_length field. That could be 12 bytes long, but we're just going to fudge that. */ - if (offset + 4 >= dwarf_line_size) + if (offset + 4 >= dwarf2_per_objfile->line_size) { dwarf2_statement_list_fits_in_line_number_section_complaint (); return 0; @@ -5175,12 +6285,13 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, back_to = make_cleanup ((make_cleanup_ftype *) free_line_header, (void *) lh); - line_ptr = dwarf_line_buffer + offset; + line_ptr = dwarf2_per_objfile->line_buffer + offset; /* read in the header */ lh->total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read); line_ptr += bytes_read; - if (line_ptr + lh->total_length > dwarf_line_buffer + dwarf_line_size) + if (line_ptr + lh->total_length > (dwarf2_per_objfile->line_buffer + + dwarf2_per_objfile->line_size)) { dwarf2_statement_list_fits_in_line_number_section_complaint (); return 0; @@ -5236,7 +6347,8 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd, line_ptr += bytes_read; lh->statement_program_start = line_ptr; - if (line_ptr > dwarf_line_buffer + dwarf_line_size) + if (line_ptr > (dwarf2_per_objfile->line_buffer + + dwarf2_per_objfile->line_size)) complaint (&symfile_complaints, "line number info header doesn't fit in `.debug_line' section"); @@ -5290,13 +6402,27 @@ check_cu_functions (CORE_ADDR address, struct dwarf2_cu *cu) return fn->lowpc; } -/* Decode the line number information for the compilation unit whose - line number info is at OFFSET in the .debug_line section. - The compilation directory of the file is passed in COMP_DIR. */ +/* Decode the Line Number Program (LNP) for the given line_header + structure and CU. The actual information extracted and the type + of structures created from the LNP depends on the value of PST. + + 1. If PST is NULL, then this procedure uses the data from the program + to create all necessary symbol tables, and their linetables. + The compilation directory of the file is passed in COMP_DIR, + and must not be NULL. + + 2. If PST is not NULL, this procedure reads the program to determine + the list of files included by the unit represented by PST, and + builds all the associated partial symbol tables. In this case, + the value of COMP_DIR is ignored, and can thus be NULL (the COMP_DIR + is not used to compute the full name of the symtab, and therefore + omitting it when building the partial symtab does not introduce + the potential for inconsistency - a partial symtab and its associated + symbtab having a different fullname -). */ static void dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, - struct dwarf2_cu *cu) + struct dwarf2_cu *cu, struct partial_symtab *pst) { char *line_ptr; char *line_end; @@ -5304,6 +6430,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, unsigned char op_code, extended_op, adj_opcode; CORE_ADDR baseaddr; struct objfile *objfile = cu->objfile; + const int decode_for_pst_p = (pst != NULL); baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -5322,9 +6449,9 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, int basic_block = 0; int end_sequence = 0; - /* Start a subfile for the current file of the state machine. */ - if (lh->num_file_names >= file) + if (!decode_for_pst_p && lh->num_file_names >= file) { + /* Start a subfile for the current file of the state machine. */ /* lh->include_dirs and lh->file_names are 0-based, but the directory and file name numbers in the statement program are 1-based. */ @@ -5349,22 +6476,29 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, address += (adj_opcode / lh->line_range) * lh->minimum_instruction_length; line += lh->line_base + (adj_opcode % lh->line_range); - /* append row to matrix using current values */ - record_line (current_subfile, line, - check_cu_functions (address, cu)); + lh->file_names[file - 1].included_p = 1; + if (!decode_for_pst_p) + { + /* append row to matrix using current values */ + record_line (current_subfile, line, + check_cu_functions (address, cu)); + } basic_block = 1; } else switch (op_code) { case DW_LNS_extended_op: - line_ptr += 1; /* ignore length */ + read_unsigned_leb128 (abfd, line_ptr, &bytes_read); + line_ptr += bytes_read; extended_op = read_1_byte (abfd, line_ptr); line_ptr += 1; switch (extended_op) { case DW_LNE_end_sequence: end_sequence = 1; - record_line (current_subfile, 0, address); + lh->file_names[file - 1].included_p = 1; + if (!decode_for_pst_p) + record_line (current_subfile, 0, address); break; case DW_LNE_set_address: address = read_address (abfd, line_ptr, cu, &bytes_read); @@ -5397,8 +6531,10 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, } break; case DW_LNS_copy: - record_line (current_subfile, line, - check_cu_functions (address, cu)); + lh->file_names[file - 1].included_p = 1; + if (!decode_for_pst_p) + record_line (current_subfile, line, + check_cu_functions (address, cu)); basic_block = 0; break; case DW_LNS_advance_pc: @@ -5424,7 +6560,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, dir = lh->include_dirs[fe->dir_index - 1]; else dir = comp_dir; - dwarf2_start_subfile (fe->name, dir); + if (!decode_for_pst_p) + dwarf2_start_subfile (fe->name, dir); } break; case DW_LNS_set_column: @@ -5462,6 +6599,22 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, } } } + + if (decode_for_pst_p) + { + int file_index; + + /* Now that we're done scanning the Line Header Program, we can + create the psymtab of each included file. */ + for (file_index = 0; file_index < lh->num_file_names; file_index++) + if (lh->file_names[file_index].included_p == 1) + { + char *include_name = lh->file_names [file_index].name; + + if (strcmp (include_name, pst->filename) != 0) + dwarf2_create_include_psymtab (include_name, pst, objfile); + } + } } /* Start a subfile for DWARF. FILENAME is the name of the file and @@ -5716,7 +6869,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) read_structure_type, and the correct name is saved in the type. */ - if (cu->language == language_cplus) + if (cu->language == language_cplus + || cu->language == language_java) { struct type *type = SYMBOL_TYPE (sym); @@ -5724,16 +6878,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { /* FIXME: carlton/2003-11-10: Should this use SYMBOL_SET_NAMES instead? (The same problem also - arises a further down in the function.) */ - SYMBOL_LINKAGE_NAME (sym) - = obsavestring (TYPE_TAG_NAME (type), - strlen (TYPE_TAG_NAME (type)), - &objfile->objfile_obstack); + arises further down in this function.) */ + /* The type's name is already allocated along with + this objfile, so we don't need to duplicate it + for the symbol. */ + SYMBOL_LINKAGE_NAME (sym) = TYPE_TAG_NAME (type); } } { - /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't + /* NOTE: carlton/2003-11-10: C++ and Java class symbols shouldn't really ever be static objects: otherwise, if you try to, say, break of a class's method and you're in a file which doesn't mention that class, it won't work unless @@ -5744,26 +6898,29 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) struct pending **list_to_add; list_to_add = (cu->list_in_scope == &file_symbols - && cu->language == language_cplus + && (cu->language == language_cplus + || cu->language == language_java) ? &global_symbols : cu->list_in_scope); add_symbol_to_list (sym, list_to_add); /* The semantics of C++ state that "struct foo { ... }" also - defines a typedef for "foo". Synthesize a typedef symbol so - that "ptype foo" works as expected. */ - if (cu->language == language_cplus) + defines a typedef for "foo". A Java class declaration also + defines a typedef for the class. Synthesize a typedef symbol + so that "ptype foo" works as expected. */ + if (cu->language == language_cplus + || cu->language == language_java) { struct symbol *typedef_sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol)); *typedef_sym = *sym; SYMBOL_DOMAIN (typedef_sym) = VAR_DOMAIN; + /* The symbol's name is already allocated along with + this objfile, so we don't need to duplicate it for + the type. */ if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0) - TYPE_NAME (SYMBOL_TYPE (sym)) = - obsavestring (SYMBOL_NATURAL_NAME (sym), - strlen (SYMBOL_NATURAL_NAME (sym)), - &objfile->objfile_obstack); + TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_NATURAL_NAME (sym); add_symbol_to_list (typedef_sym, list_to_add); } } @@ -5772,10 +6929,9 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) if (processing_has_namespace_info && processing_current_prefix[0] != '\0') { - SYMBOL_LINKAGE_NAME (sym) = obconcat (&objfile->objfile_obstack, - processing_current_prefix, - "::", - name); + SYMBOL_LINKAGE_NAME (sym) = typename_concat (&objfile->objfile_obstack, + processing_current_prefix, + name, cu); } SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_DOMAIN (sym) = VAR_DOMAIN; @@ -5791,10 +6947,9 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) if (processing_has_namespace_info && processing_current_prefix[0] != '\0') { - SYMBOL_LINKAGE_NAME (sym) = obconcat (&objfile->objfile_obstack, - processing_current_prefix, - "::", - name); + SYMBOL_LINKAGE_NAME (sym) = typename_concat (&objfile->objfile_obstack, + processing_current_prefix, + name, cu); } attr = dwarf2_attr (die, DW_AT_const_value, cu); if (attr) @@ -5808,7 +6963,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) struct pending **list_to_add; list_to_add = (cu->list_in_scope == &file_symbols - && cu->language == language_cplus + && (cu->language == language_cplus + || cu->language == language_java) ? &global_symbols : cu->list_in_scope); add_symbol_to_list (sym, list_to_add); @@ -5942,7 +7098,6 @@ die_type (struct die_info *die, struct dwarf2_cu *cu) struct type *type; struct attribute *type_attr; struct die_info *type_die; - unsigned int ref; type_attr = dwarf2_attr (die, DW_AT_type, cu); if (!type_attr) @@ -5951,16 +7106,8 @@ die_type (struct die_info *die, struct dwarf2_cu *cu) return dwarf2_fundamental_type (cu->objfile, FT_VOID, cu); } else - { - ref = dwarf2_get_ref_die_offset (type_attr, cu); - type_die = follow_die_ref (ref); - if (!type_die) - { - error ("Dwarf Error: Cannot find referent at offset %d [in module %s]", - ref, cu->objfile->name); - return NULL; - } - } + type_die = follow_die_ref (die, type_attr, cu); + type = tag_type_to_type (type_die, cu); if (!type) { @@ -5980,19 +7127,11 @@ die_containing_type (struct die_info *die, struct dwarf2_cu *cu) struct type *type = NULL; struct attribute *type_attr; struct die_info *type_die = NULL; - unsigned int ref; type_attr = dwarf2_attr (die, DW_AT_containing_type, cu); if (type_attr) { - ref = dwarf2_get_ref_die_offset (type_attr, cu); - type_die = follow_die_ref (ref); - if (!type_die) - { - error ("Dwarf Error: Cannot find referent at offset %d [in module %s]", ref, - cu->objfile->name); - return NULL; - } + type_die = follow_die_ref (die, type_attr, cu); type = tag_type_to_type (type_die, cu); } if (!type) @@ -6005,24 +7144,6 @@ die_containing_type (struct die_info *die, struct dwarf2_cu *cu) return type; } -#if 0 -static struct type * -type_at_offset (unsigned int offset, struct dwarf2_cu *cu) -{ - struct die_info *die; - struct type *type; - - die = follow_die_ref (offset); - if (!die) - { - error ("Dwarf Error: Cannot find type referent at offset %d.", offset); - return NULL; - } - type = tag_type_to_type (die, cu); - return type; -} -#endif - static struct type * tag_type_to_type (struct die_info *die, struct dwarf2_cu *cu) { @@ -6117,7 +7238,8 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) { struct die_info *parent; - if (cu->language != language_cplus) + if (cu->language != language_cplus + && cu->language != language_java) return NULL; parent = die->parent; @@ -6141,9 +7263,10 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) { int dummy; char *parent_prefix = determine_prefix (parent, cu); - char *retval = typename_concat (parent_prefix, + char *retval = typename_concat (NULL, parent_prefix, namespace_name (parent, &dummy, - cu)); + cu), + cu); xfree (parent_prefix); return retval; } @@ -6176,25 +7299,47 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) } } -/* Return a newly-allocated string formed by concatenating PREFIX, - "::", and SUFFIX, except that if PREFIX is NULL or the empty - string, just return a copy of SUFFIX. */ +/* Return a newly-allocated string formed by concatenating PREFIX and + SUFFIX with appropriate separator. If PREFIX or SUFFIX is NULL or empty, then + simply copy the SUFFIX or PREFIX, respectively. If OBS is non-null, + perform an obconcat, otherwise allocate storage for the result. The CU argument + is used to determine the language and hence, the appropriate separator. */ + +#define MAX_SEP_LEN 2 /* sizeof ("::") */ static char * -typename_concat (const char *prefix, const char *suffix) +typename_concat (struct obstack *obs, const char *prefix, const char *suffix, + struct dwarf2_cu *cu) { - if (prefix == NULL || prefix[0] == '\0') - return xstrdup (suffix); - else - { - char *retval = xmalloc (strlen (prefix) + 2 + strlen (suffix) + 1); + char *sep; - strcpy (retval, prefix); - strcat (retval, "::"); - strcat (retval, suffix); + if (suffix == NULL || suffix[0] == '\0' || prefix == NULL || prefix[0] == '\0') + sep = ""; + else if (cu->language == language_java) + sep = "."; + else + sep = "::"; + if (obs == NULL) + { + char *retval = xmalloc (strlen (prefix) + MAX_SEP_LEN + strlen (suffix) + 1); + retval[0] = '\0'; + + if (prefix) + { + strcpy (retval, prefix); + strcat (retval, sep); + } + if (suffix) + strcat (retval, suffix); + return retval; } + else + { + /* We have an obstack. */ + return obconcat (obs, prefix, sep, suffix); + } } static struct type * @@ -6352,21 +7497,12 @@ static struct die_info * dwarf2_extension (struct die_info *die, struct dwarf2_cu *cu) { struct attribute *attr; - struct die_info *extension_die; - unsigned int ref; attr = dwarf2_attr (die, DW_AT_extension, cu); if (attr == NULL) return NULL; - ref = dwarf2_get_ref_die_offset (attr, cu); - extension_die = follow_die_ref (ref); - if (!extension_die) - { - error ("Dwarf Error: Cannot find referent at offset %d.", ref); - } - - return extension_die; + return follow_die_ref (die, attr, cu); } /* Convert a DIE tag into its string name. */ @@ -7203,13 +8339,16 @@ dump_die (struct die_info *die) case DW_FORM_block1: fprintf_unfiltered (gdb_stderr, "block: size %d", DW_BLOCK (&die->attrs[i])->size); break; + case DW_FORM_ref1: + case DW_FORM_ref2: + case DW_FORM_ref4: + fprintf_unfiltered (gdb_stderr, "constant ref: %ld (adjusted)", + (long) (DW_ADDR (&die->attrs[i]))); + break; case DW_FORM_data1: case DW_FORM_data2: case DW_FORM_data4: case DW_FORM_data8: - case DW_FORM_ref1: - case DW_FORM_ref2: - case DW_FORM_ref4: case DW_FORM_udata: case DW_FORM_sdata: fprintf_unfiltered (gdb_stderr, "constant: %ld", DW_UNSND (&die->attrs[i])); @@ -7253,22 +8392,16 @@ dump_die_list (struct die_info *die) } static void -store_in_ref_table (unsigned int offset, struct die_info *die) +store_in_ref_table (unsigned int offset, struct die_info *die, + struct dwarf2_cu *cu) { int h; struct die_info *old; h = (offset % REF_HASH_SIZE); - old = die_ref_table[h]; + old = cu->die_ref_table[h]; die->next_ref = old; - die_ref_table[h] = die; -} - - -static void -dwarf2_empty_hash_tables (void) -{ - memset (die_ref_table, 0, sizeof (die_ref_table)); + cu->die_ref_table[h] = die; } static unsigned int @@ -7279,14 +8412,12 @@ dwarf2_get_ref_die_offset (struct attribute *attr, struct dwarf2_cu *cu) switch (attr->form) { case DW_FORM_ref_addr: - result = DW_ADDR (attr); - break; case DW_FORM_ref1: case DW_FORM_ref2: case DW_FORM_ref4: case DW_FORM_ref8: case DW_FORM_ref_udata: - result = cu->header.offset + DW_UNSND (attr); + result = DW_ADDR (attr); break; default: complaint (&symfile_complaints, @@ -7319,21 +8450,41 @@ dwarf2_get_attr_constant_value (struct attribute *attr, int default_value) } static struct die_info * -follow_die_ref (unsigned int offset) +follow_die_ref (struct die_info *src_die, struct attribute *attr, + struct dwarf2_cu *cu) { struct die_info *die; + unsigned int offset; int h; + struct die_info temp_die; + struct dwarf2_cu *target_cu; + + offset = dwarf2_get_ref_die_offset (attr, cu); + + if (DW_ADDR (attr) < cu->header.offset + || DW_ADDR (attr) >= cu->header.offset + cu->header.length) + { + struct dwarf2_per_cu_data *per_cu; + per_cu = dwarf2_find_containing_comp_unit (DW_ADDR (attr), + cu->objfile); + target_cu = per_cu->cu; + } + else + target_cu = cu; h = (offset % REF_HASH_SIZE); - die = die_ref_table[h]; + die = target_cu->die_ref_table[h]; while (die) { if (die->offset == offset) - { - return die; - } + return die; die = die->next_ref; } + + error ("Dwarf Error: Cannot find DIE at 0x%lx referenced from DIE " + "at 0x%lx [in module %s]", + (long) src_die->offset, (long) offset, cu->objfile->name); + return NULL; } @@ -7587,28 +8738,23 @@ decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) /* memory allocation interface */ -static void -dwarf2_free_tmp_obstack (void *ignore) -{ - obstack_free (&dwarf2_tmp_obstack, NULL); -} - static struct dwarf_block * -dwarf_alloc_block (void) +dwarf_alloc_block (struct dwarf2_cu *cu) { struct dwarf_block *blk; blk = (struct dwarf_block *) - obstack_alloc (&dwarf2_tmp_obstack, sizeof (struct dwarf_block)); + obstack_alloc (&cu->comp_unit_obstack, sizeof (struct dwarf_block)); return (blk); } static struct abbrev_info * -dwarf_alloc_abbrev (void) +dwarf_alloc_abbrev (struct dwarf2_cu *cu) { struct abbrev_info *abbrev; - abbrev = (struct abbrev_info *) xmalloc (sizeof (struct abbrev_info)); + abbrev = (struct abbrev_info *) + obstack_alloc (&cu->abbrev_obstack, sizeof (struct abbrev_info)); memset (abbrev, 0, sizeof (struct abbrev_info)); return (abbrev); } @@ -7871,14 +9017,15 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, char *mac_ptr, *mac_end; struct macro_source_file *current_file = 0; - if (dwarf_macinfo_buffer == NULL) + if (dwarf2_per_objfile->macinfo_buffer == NULL) { complaint (&symfile_complaints, "missing .debug_macinfo section"); return; } - mac_ptr = dwarf_macinfo_buffer + offset; - mac_end = dwarf_macinfo_buffer + dwarf_macinfo_size; + mac_ptr = dwarf2_per_objfile->macinfo_buffer + offset; + mac_end = dwarf2_per_objfile->macinfo_buffer + + dwarf2_per_objfile->macinfo_size; for (;;) { @@ -8025,8 +9172,8 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, /* We don't know how long the location list is, but make sure we don't run off the edge of the section. */ - baton->size = dwarf_loc_size - DW_UNSND (attr); - baton->data = dwarf_loc_buffer + DW_UNSND (attr); + baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr); + baton->data = dwarf2_per_objfile->loc_buffer + DW_UNSND (attr); baton->base_address = cu->header.base_address; if (cu->header.base_known == 0) complaint (&symfile_complaints, @@ -8047,9 +9194,9 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, { /* Note that we're just copying the block's data pointer here, not the actual data. We're still pointing into the - dwarf_info_buffer for SYM's objfile; right now we never - release that buffer, but when we do clean up properly - this may need to change. */ + info_buffer for SYM's objfile; right now we never release + that buffer, but when we do clean up properly this may + need to change. */ baton->size = DW_BLOCK (attr)->size; baton->data = DW_BLOCK (attr)->data; } @@ -8065,3 +9212,445 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_LOCATION_BATON (sym) = baton; } } + +/* Locate the compilation unit from CU's objfile which contains the + DIE at OFFSET. Raises an error on failure. */ + +static struct dwarf2_per_cu_data * +dwarf2_find_containing_comp_unit (unsigned long offset, + struct objfile *objfile) +{ + struct dwarf2_per_cu_data *this_cu; + int low, high; + + low = 0; + high = dwarf2_per_objfile->n_comp_units - 1; + while (high > low) + { + int mid = low + (high - low) / 2; + if (dwarf2_per_objfile->all_comp_units[mid]->offset >= offset) + high = mid; + else + low = mid + 1; + } + gdb_assert (low == high); + if (dwarf2_per_objfile->all_comp_units[low]->offset > offset) + { + if (low == 0) + error ("Dwarf Error: could not find partial DIE containing " + "offset 0x%lx [in module %s]", + (long) offset, bfd_get_filename (objfile->obfd)); + + gdb_assert (dwarf2_per_objfile->all_comp_units[low-1]->offset <= offset); + return dwarf2_per_objfile->all_comp_units[low-1]; + } + else + { + this_cu = dwarf2_per_objfile->all_comp_units[low]; + if (low == dwarf2_per_objfile->n_comp_units - 1 + && offset >= this_cu->offset + this_cu->length) + error ("invalid dwarf2 offset %ld", offset); + gdb_assert (offset < this_cu->offset + this_cu->length); + return this_cu; + } +} + +/* Locate the compilation unit from OBJFILE which is located at exactly + OFFSET. Raises an error on failure. */ + +static struct dwarf2_per_cu_data * +dwarf2_find_comp_unit (unsigned long offset, struct objfile *objfile) +{ + struct dwarf2_per_cu_data *this_cu; + this_cu = dwarf2_find_containing_comp_unit (offset, objfile); + if (this_cu->offset != offset) + error ("no compilation unit with offset %ld\n", offset); + return this_cu; +} + +/* Release one cached compilation unit, CU. We unlink it from the tree + of compilation units, but we don't remove it from the read_in_chain; + the caller is responsible for that. */ + +static void +free_one_comp_unit (void *data) +{ + struct dwarf2_cu *cu = data; + + if (cu->per_cu != NULL) + cu->per_cu->cu = NULL; + cu->per_cu = NULL; + + obstack_free (&cu->comp_unit_obstack, NULL); + if (cu->dies) + free_die_list (cu->dies); + + xfree (cu); +} + +/* This cleanup function is passed the address of a dwarf2_cu on the stack + when we're finished with it. We can't free the pointer itself, but be + sure to unlink it from the cache. Also release any associated storage + and perform cache maintenance. + + Only used during partial symbol parsing. */ + +static void +free_stack_comp_unit (void *data) +{ + struct dwarf2_cu *cu = data; + + obstack_free (&cu->comp_unit_obstack, NULL); + cu->partial_dies = NULL; + + if (cu->per_cu != NULL) + { + /* This compilation unit is on the stack in our caller, so we + should not xfree it. Just unlink it. */ + cu->per_cu->cu = NULL; + cu->per_cu = NULL; + + /* If we had a per-cu pointer, then we may have other compilation + units loaded, so age them now. */ + age_cached_comp_units (); + } +} + +/* Free all cached compilation units. */ + +static void +free_cached_comp_units (void *data) +{ + struct dwarf2_per_cu_data *per_cu, **last_chain; + + per_cu = dwarf2_per_objfile->read_in_chain; + last_chain = &dwarf2_per_objfile->read_in_chain; + while (per_cu != NULL) + { + struct dwarf2_per_cu_data *next_cu; + + next_cu = per_cu->cu->read_in_chain; + + free_one_comp_unit (per_cu->cu); + *last_chain = next_cu; + + per_cu = next_cu; + } +} + +/* Increase the age counter on each cached compilation unit, and free + any that are too old. */ + +static void +age_cached_comp_units (void) +{ + struct dwarf2_per_cu_data *per_cu, **last_chain; + + dwarf2_clear_marks (dwarf2_per_objfile->read_in_chain); + per_cu = dwarf2_per_objfile->read_in_chain; + while (per_cu != NULL) + { + per_cu->cu->last_used ++; + if (per_cu->cu->last_used <= dwarf2_max_cache_age) + dwarf2_mark (per_cu->cu); + per_cu = per_cu->cu->read_in_chain; + } + + per_cu = dwarf2_per_objfile->read_in_chain; + last_chain = &dwarf2_per_objfile->read_in_chain; + while (per_cu != NULL) + { + struct dwarf2_per_cu_data *next_cu; + + next_cu = per_cu->cu->read_in_chain; + + if (!per_cu->cu->mark) + { + free_one_comp_unit (per_cu->cu); + *last_chain = next_cu; + } + else + last_chain = &per_cu->cu->read_in_chain; + + per_cu = next_cu; + } +} + +/* Remove a single compilation unit from the cache. */ + +static void +free_one_cached_comp_unit (void *target_cu) +{ + struct dwarf2_per_cu_data *per_cu, **last_chain; + + per_cu = dwarf2_per_objfile->read_in_chain; + last_chain = &dwarf2_per_objfile->read_in_chain; + while (per_cu != NULL) + { + struct dwarf2_per_cu_data *next_cu; + + next_cu = per_cu->cu->read_in_chain; + + if (per_cu->cu == target_cu) + { + free_one_comp_unit (per_cu->cu); + *last_chain = next_cu; + break; + } + else + last_chain = &per_cu->cu->read_in_chain; + + per_cu = next_cu; + } +} + +/* A pair of DIE offset and GDB type pointer. We store these + in a hash table separate from the DIEs, and preserve them + when the DIEs are flushed out of cache. */ + +struct dwarf2_offset_and_type +{ + unsigned int offset; + struct type *type; +}; + +/* Hash function for a dwarf2_offset_and_type. */ + +static hashval_t +offset_and_type_hash (const void *item) +{ + const struct dwarf2_offset_and_type *ofs = item; + return ofs->offset; +} + +/* Equality function for a dwarf2_offset_and_type. */ + +static int +offset_and_type_eq (const void *item_lhs, const void *item_rhs) +{ + const struct dwarf2_offset_and_type *ofs_lhs = item_lhs; + const struct dwarf2_offset_and_type *ofs_rhs = item_rhs; + return ofs_lhs->offset == ofs_rhs->offset; +} + +/* Set the type associated with DIE to TYPE. Save it in CU's hash + table if necessary. */ + +static void +set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +{ + struct dwarf2_offset_and_type **slot, ofs; + + die->type = type; + + if (cu->per_cu == NULL) + return; + + if (cu->per_cu->type_hash == NULL) + cu->per_cu->type_hash + = htab_create_alloc_ex (cu->header.length / 24, + offset_and_type_hash, + offset_and_type_eq, + NULL, + &cu->objfile->objfile_obstack, + hashtab_obstack_allocate, + dummy_obstack_deallocate); + + ofs.offset = die->offset; + ofs.type = type; + slot = (struct dwarf2_offset_and_type **) + htab_find_slot_with_hash (cu->per_cu->type_hash, &ofs, ofs.offset, INSERT); + *slot = obstack_alloc (&cu->objfile->objfile_obstack, sizeof (**slot)); + **slot = ofs; +} + +/* Find the type for DIE in TYPE_HASH, or return NULL if DIE does not + have a saved type. */ + +static struct type * +get_die_type (struct die_info *die, htab_t type_hash) +{ + struct dwarf2_offset_and_type *slot, ofs; + + ofs.offset = die->offset; + slot = htab_find_with_hash (type_hash, &ofs, ofs.offset); + if (slot) + return slot->type; + else + return NULL; +} + +/* Restore the types of the DIE tree starting at START_DIE from the hash + table saved in CU. */ + +static void +reset_die_and_siblings_types (struct die_info *start_die, struct dwarf2_cu *cu) +{ + struct die_info *die; + + if (cu->per_cu->type_hash == NULL) + return; + + for (die = start_die; die != NULL; die = die->sibling) + { + die->type = get_die_type (die, cu->per_cu->type_hash); + if (die->child != NULL) + reset_die_and_siblings_types (die->child, cu); + } +} + +/* Set the mark field in CU and in every other compilation unit in the + cache that we must keep because we are keeping CU. */ + +/* Add a dependence relationship from CU to REF_PER_CU. */ + +static void +dwarf2_add_dependence (struct dwarf2_cu *cu, + struct dwarf2_per_cu_data *ref_per_cu) +{ + void **slot; + + if (cu->dependencies == NULL) + cu->dependencies + = htab_create_alloc_ex (5, htab_hash_pointer, htab_eq_pointer, + NULL, &cu->comp_unit_obstack, + hashtab_obstack_allocate, + dummy_obstack_deallocate); + + slot = htab_find_slot (cu->dependencies, ref_per_cu, INSERT); + if (*slot == NULL) + *slot = ref_per_cu; +} + +/* Set the mark field in CU and in every other compilation unit in the + cache that we must keep because we are keeping CU. */ + +static int +dwarf2_mark_helper (void **slot, void *data) +{ + struct dwarf2_per_cu_data *per_cu; + + per_cu = (struct dwarf2_per_cu_data *) *slot; + if (per_cu->cu->mark) + return 1; + per_cu->cu->mark = 1; + + if (per_cu->cu->dependencies != NULL) + htab_traverse (per_cu->cu->dependencies, dwarf2_mark_helper, NULL); + + return 1; +} + +static void +dwarf2_mark (struct dwarf2_cu *cu) +{ + if (cu->mark) + return; + cu->mark = 1; + if (cu->dependencies != NULL) + htab_traverse (cu->dependencies, dwarf2_mark_helper, NULL); +} + +static void +dwarf2_clear_marks (struct dwarf2_per_cu_data *per_cu) +{ + while (per_cu) + { + per_cu->cu->mark = 0; + per_cu = per_cu->cu->read_in_chain; + } +} + +/* Allocation function for the libiberty hash table which uses an + obstack. */ + +static void * +hashtab_obstack_allocate (void *data, size_t size, size_t count) +{ + unsigned int total = size * count; + void *ptr = obstack_alloc ((struct obstack *) data, total); + memset (ptr, 0, total); + return ptr; +} + +/* Trivial deallocation function for the libiberty splay tree and hash + table - don't deallocate anything. Rely on later deletion of the + obstack. */ + +static void +dummy_obstack_deallocate (void *object, void *data) +{ + return; +} + +/* Trivial hash function for partial_die_info: the hash value of a DIE + is its offset in .debug_info for this objfile. */ + +static hashval_t +partial_die_hash (const void *item) +{ + const struct partial_die_info *part_die = item; + return part_die->offset; +} + +/* Trivial comparison function for partial_die_info structures: two DIEs + are equal if they have the same offset. */ + +static int +partial_die_eq (const void *item_lhs, const void *item_rhs) +{ + const struct partial_die_info *part_die_lhs = item_lhs; + const struct partial_die_info *part_die_rhs = item_rhs; + return part_die_lhs->offset == part_die_rhs->offset; +} + +static struct cmd_list_element *set_dwarf2_cmdlist; +static struct cmd_list_element *show_dwarf2_cmdlist; + +static void +set_dwarf2_cmd (char *args, int from_tty) +{ + help_list (set_dwarf2_cmdlist, "maintenance set dwarf2 ", -1, gdb_stdout); +} + +static void +show_dwarf2_cmd (char *args, int from_tty) +{ + cmd_show_list (show_dwarf2_cmdlist, from_tty, ""); +} + +void _initialize_dwarf2_read (void); + +void +_initialize_dwarf2_read (void) +{ + dwarf2_objfile_data_key = register_objfile_data (); + + add_prefix_cmd ("dwarf2", class_maintenance, set_dwarf2_cmd, + "Set DWARF 2 specific variables.\n" + "Configure DWARF 2 variables such as the cache size", + &set_dwarf2_cmdlist, "maintenance set dwarf2 ", + 0/*allow-unknown*/, &maintenance_set_cmdlist); + + add_prefix_cmd ("dwarf2", class_maintenance, show_dwarf2_cmd, + "Show DWARF 2 specific variables\n" + "Show DWARF 2 variables such as the cache size", + &show_dwarf2_cmdlist, "maintenance show dwarf2 ", + 0/*allow-unknown*/, &maintenance_show_cmdlist); + + add_setshow_zinteger_cmd ("max-cache-age", class_obscure, + &dwarf2_max_cache_age, + "Set the upper bound on the age of cached " + "dwarf2 compilation units.", + "Show the upper bound on the age of cached " + "dwarf2 compilation units.", + "A higher limit means that cached " + "compilation units will be stored\n" + "in memory longer, and more total memory will " + "be used. Zero disables\n" + "caching, which can slow down startup.", + "The upper bound on the age of cached " + "dwarf2 compilation units is %d.", + NULL, NULL, &set_dwarf2_cmdlist, + &show_dwarf2_cmdlist); +} diff --git a/gnu/usr.bin/binutils/gdb/dwarfread.c b/gnu/usr.bin/binutils/gdb/dwarfread.c index c245108c08e..f8aa4a8d096 100644 --- a/gnu/usr.bin/binutils/gdb/dwarfread.c +++ b/gnu/usr.bin/binutils/gdb/dwarfread.c @@ -29,7 +29,7 @@ DWARF-1 is slowly headed for obsoletion. - In gcc HEAD 2003-11-29 16:28:31 UTC, no targets prefer dwarf-1. + In gcc 3.4.0, support for dwarf-1 has been removed. In gcc 3.3.2, these targets prefer dwarf-1: @@ -73,11 +73,22 @@ Some non-gcc compilers produce dwarf-1: PR gdb/1179 was from a user with Diab C++ 4.3. + On 2003-07-25 the gdb list received a report from a user + with Diab Compiler 4.4b. Other users have also reported using Diab compilers with dwarf-1. + + Diab Compiler Suite 5.0.1 supports dwarf-2/dwarf-3 for C and C++. + (Diab(tm) Compiler Suite 5.0.1 Release Notes, DOC-14691-ZD-00, + Wind River Systems, 2002-07-31). + On 2003-06-09 the gdb list received a report from a user with Absoft ProFortran f77 which is dwarf-1. - -- chastain 2003-12-01 + Absoft ProFortran Linux[sic] Fortran User Guide (no version, + but copyright dates are 1991-2001) says that Absoft ProFortran + supports -gdwarf1 and -gdwarf2. + + -- chastain 2004-04-24 */ /* @@ -1781,12 +1792,6 @@ read_func_scope (struct dieinfo *dip, char *thisdie, char *enddie, return; } - if (objfile->ei.entry_point >= dip->at_low_pc && - objfile->ei.entry_point < dip->at_high_pc) - { - objfile->ei.entry_func_lowpc = dip->at_low_pc; - objfile->ei.entry_func_highpc = dip->at_high_pc; - } new = push_context (0, dip->at_low_pc); new->name = new_symbol (dip, objfile); list_in_scope = &local_symbols; @@ -1882,12 +1887,6 @@ read_file_scope (struct dieinfo *dip, char *thisdie, char *enddie, struct cleanup *back_to; struct symtab *symtab; - if (objfile->ei.entry_point >= dip->at_low_pc && - objfile->ei.entry_point < dip->at_high_pc) - { - objfile->ei.deprecated_entry_file_lowpc = dip->at_low_pc; - objfile->ei.deprecated_entry_file_highpc = dip->at_high_pc; - } set_cu_language (dip); if (dip->at_producer != NULL) { diff --git a/gnu/usr.bin/binutils/gdb/elfread.c b/gnu/usr.bin/binutils/gdb/elfread.c index 83a18627526..3aa2f66eec4 100644 --- a/gnu/usr.bin/binutils/gdb/elfread.c +++ b/gnu/usr.bin/binutils/gdb/elfread.c @@ -83,12 +83,12 @@ elf_locate_sections (bfd *ignore_abfd, asection *sectp, void *eip) if (strcmp (sectp->name, ".debug") == 0) { ei->dboffset = sectp->filepos; - ei->dbsize = bfd_get_section_size_before_reloc (sectp); + ei->dbsize = bfd_get_section_size (sectp); } else if (strcmp (sectp->name, ".line") == 0) { ei->lnoffset = sectp->filepos; - ei->lnsize = bfd_get_section_size_before_reloc (sectp); + ei->lnsize = bfd_get_section_size (sectp); } else if (strcmp (sectp->name, ".stab") == 0) { @@ -377,7 +377,7 @@ elf_symtab_read (struct objfile *objfile, int dynamic) + (sizeof (CORE_ADDR) * max_index)); sectinfo = (struct stab_section_info *) - xmmalloc (objfile->md, size); + xmalloc (size); memset (sectinfo, 0, size); sectinfo->num_sections = max_index; if (filesym == NULL) @@ -499,7 +499,7 @@ elf_symfile_read (struct objfile *objfile, int mainline) /* Allocate struct to keep track of the symfile */ objfile->sym_stab_info = (struct dbx_symfile_info *) - xmmalloc (objfile->md, sizeof (struct dbx_symfile_info)); + xmalloc (sizeof (struct dbx_symfile_info)); memset ((char *) objfile->sym_stab_info, 0, sizeof (struct dbx_symfile_info)); make_cleanup (free_elfinfo, (void *) objfile); @@ -575,7 +575,7 @@ elf_symfile_read (struct objfile *objfile, int mainline) str_sect->filepos, bfd_section_size (abfd, str_sect)); } - if (dwarf2_has_info (abfd)) + if (dwarf2_has_info (objfile)) { /* DWARF 2 sections */ dwarf2_build_psymtabs (objfile, mainline); @@ -608,7 +608,7 @@ free_elfinfo (void *objp) while (ssi) { nssi = ssi->next; - xmfree (objfile->md, ssi); + xfree (ssi); ssi = nssi; } @@ -639,7 +639,7 @@ elf_symfile_finish (struct objfile *objfile) { if (objfile->sym_stab_info != NULL) { - xmfree (objfile->md, objfile->sym_stab_info); + xfree (objfile->sym_stab_info); } } diff --git a/gnu/usr.bin/binutils/gdb/eval.c b/gnu/usr.bin/binutils/gdb/eval.c index 452aeb7f243..4418e0ad29b 100644 --- a/gnu/usr.bin/binutils/gdb/eval.c +++ b/gnu/usr.bin/binutils/gdb/eval.c @@ -37,9 +37,6 @@ #include "block.h" #include "parser-defs.h" -/* Defined in symtab.c */ -extern int hp_som_som_object_present; - /* This is defined in valops.c */ extern int overload_resolution; @@ -972,7 +969,7 @@ evaluate_subexp_standard (struct type *expect_type, /* 1997-08-01 Currently we do not support function invocation via pointers-to-methods with HP aCC. Pointer does not point to the function, but possibly to some thunk. */ - if (hp_som_som_object_present) + if (deprecated_hp_som_som_object_present) { error ("Not implemented: function invocation through pointer to method with HP aCC"); } @@ -1368,7 +1365,7 @@ evaluate_subexp_standard (struct type *expect_type, arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); /* With HP aCC, pointers to methods do not point to the function code */ - if (hp_som_som_object_present && + if (deprecated_hp_som_som_object_present && (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) && (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD)) error ("Pointers to methods not supported with HP aCC"); /* 1997-08-19 */ @@ -1381,7 +1378,7 @@ evaluate_subexp_standard (struct type *expect_type, arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); /* With HP aCC, pointers to methods do not point to the function code */ - if (hp_som_som_object_present && + if (deprecated_hp_som_som_object_present && (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) && (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD)) error ("Pointers to methods not supported with HP aCC"); /* 1997-08-19 */ @@ -1391,7 +1388,7 @@ evaluate_subexp_standard (struct type *expect_type, handle_pointer_to_member: /* HP aCC generates offsets that have bit #29 set; turn it off to get a real offset to the member. */ - if (hp_som_som_object_present) + if (deprecated_hp_som_som_object_present) { if (!mem_offset) /* no bias -> really null */ error ("Attempted dereference of null pointer-to-member"); @@ -1431,7 +1428,7 @@ evaluate_subexp_standard (struct type *expect_type, arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside); /* Do special stuff for HP aCC pointers to members */ - if (hp_som_som_object_present) + if (deprecated_hp_som_som_object_present) { /* 1997-08-19 Can't assign HP aCC pointers to methods. No details of the implementation yet; but the pointer appears to point to a code @@ -1613,9 +1610,8 @@ evaluate_subexp_standard (struct type *expect_type, multi_f77_subscript: { - int subscript_array[MAX_FORTRAN_DIMS + 1]; /* 1-based array of - subscripts, max == 7 */ - int array_size_array[MAX_FORTRAN_DIMS + 1]; + int subscript_array[MAX_FORTRAN_DIMS]; + int array_size_array[MAX_FORTRAN_DIMS]; int ndimensions = 1, i; struct type *tmp_type; int offset_item; /* The array offset where the item lives */ @@ -1633,7 +1629,8 @@ evaluate_subexp_standard (struct type *expect_type, let us actually find out where this element exists in the array. */ offset_item = 0; - for (i = 1; i <= nargs; i++) + /* Take array indices left to right */ + for (i = 0; i < nargs; i++) { /* Evaluate each subscript, It must be a legal integer in F77 */ arg2 = evaluate_subexp_with_coercion (exp, pos, noside); @@ -1641,7 +1638,11 @@ evaluate_subexp_standard (struct type *expect_type, /* Fill in the subscript and array size arrays */ subscript_array[i] = value_as_long (arg2); + } + /* Internal type of array is arranged right to left */ + for (i = 0; i < nargs; i++) + { retcode = f77_get_dynamic_upperbound (tmp_type, &upper); if (retcode == BOUND_FETCH_ERROR) error ("Cannot obtain dynamic upper bound"); @@ -1650,11 +1651,11 @@ evaluate_subexp_standard (struct type *expect_type, if (retcode == BOUND_FETCH_ERROR) error ("Cannot obtain dynamic lower bound"); - array_size_array[i] = upper - lower + 1; + array_size_array[nargs - i - 1] = upper - lower + 1; /* Zero-normalize subscripts so that offsetting will work. */ - subscript_array[i] -= lower; + subscript_array[nargs - i - 1] -= lower; /* If we are at the bottom of a multidimensional array type then keep a ptr to the last ARRAY @@ -1664,17 +1665,17 @@ evaluate_subexp_standard (struct type *expect_type, of base element type that we apply a simple offset to. */ - if (i < nargs) + if (i < nargs - 1) tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type)); } /* Now let us calculate the offset for this item */ - offset_item = subscript_array[ndimensions]; + offset_item = subscript_array[ndimensions - 1]; - for (i = ndimensions - 1; i >= 1; i--) + for (i = ndimensions - 1; i > 0; --i) offset_item = - array_size_array[i] * offset_item + subscript_array[i]; + array_size_array[i - 1] * offset_item + subscript_array[i - 1]; /* Construct a value node with the value of the offset */ @@ -1934,7 +1935,7 @@ evaluate_subexp_standard (struct type *expect_type, { struct value *retvalp = evaluate_subexp_for_address (exp, pos, noside); /* If HP aCC object, use bias for pointers to members */ - if (hp_som_som_object_present && + if (deprecated_hp_som_som_object_present && (TYPE_CODE (VALUE_TYPE (retvalp)) == TYPE_CODE_PTR) && (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (retvalp))) == TYPE_CODE_MEMBER)) { diff --git a/gnu/usr.bin/binutils/gdb/exec.c b/gnu/usr.bin/binutils/gdb/exec.c index 418b0b3aa35..f3246cacb89 100644 --- a/gnu/usr.bin/binutils/gdb/exec.c +++ b/gnu/usr.bin/binutils/gdb/exec.c @@ -33,10 +33,6 @@ #include "value.h" #include "exec.h" -#ifdef USG -#include <sys/types.h> -#endif - #include <fcntl.h> #include "readline/readline.h" #include "gdb_string.h" @@ -53,7 +49,7 @@ struct vmap *map_vmap (bfd *, bfd *); -void (*file_changed_hook) (char *); +void (*deprecated_file_changed_hook) (char *); /* Prototypes for local functions */ @@ -194,7 +190,7 @@ exec_file_attach (char *filename, int from_tty) char *scratch_pathname; int scratch_chan; - scratch_chan = openp (getenv ("PATH"), 1, filename, + scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename, write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, &scratch_pathname); #if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__) @@ -202,8 +198,9 @@ exec_file_attach (char *filename, int from_tty) { char *exename = alloca (strlen (filename) + 5); strcat (strcpy (exename, filename), ".exe"); - scratch_chan = openp (getenv ("PATH"), 1, exename, write_files ? - O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, &scratch_pathname); + scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, exename, + write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, + &scratch_pathname); } #endif if (scratch_chan < 0) @@ -267,9 +264,10 @@ exec_file_attach (char *filename, int from_tty) push_target (&exec_ops); /* Tell display code (if any) about the changed file name. */ - if (exec_file_display_hook) - (*exec_file_display_hook) (filename); + if (deprecated_exec_file_display_hook) + (*deprecated_exec_file_display_hook) (filename); } + bfd_cache_close_all (); } /* Process the first arg in ARGS as the new exec file. @@ -324,8 +322,8 @@ file_command (char *arg, int from_tty) the exec file, but that's rough. */ exec_file_command (arg, from_tty); symbol_file_command (arg, from_tty); - if (file_changed_hook) - file_changed_hook (arg); + if (deprecated_file_changed_hook) + deprecated_file_changed_hook (arg); } @@ -524,8 +522,8 @@ void print_section_info (struct target_ops *t, bfd *abfd) { struct section_table *p; - /* FIXME: "016l" is not wide enough when TARGET_ADDR_BIT > 64. */ - char *fmt = TARGET_ADDR_BIT <= 32 ? "08l" : "016l"; + /* FIXME: 16 is not wide enough when TARGET_ADDR_BIT > 64. */ + int wid = TARGET_ADDR_BIT <= 32 ? 8 : 16; printf_filtered ("\t`%s', ", bfd_get_filename (abfd)); wrap_here (" "); @@ -538,8 +536,8 @@ print_section_info (struct target_ops *t, bfd *abfd) } for (p = t->to_sections; p < t->to_sections_end; p++) { - printf_filtered ("\t%s", local_hex_string_custom (p->addr, fmt)); - printf_filtered (" - %s", local_hex_string_custom (p->endaddr, fmt)); + printf_filtered ("\t%s", hex_string_custom (p->addr, wid)); + printf_filtered (" - %s", hex_string_custom (p->endaddr, wid)); /* FIXME: A format of "08l" is not wide enough for file offsets larger than 4GB. OTOH, making it "016l" isn't desirable either @@ -548,7 +546,7 @@ print_section_info (struct target_ops *t, bfd *abfd) format string accordingly. */ if (info_verbose) printf_filtered (" @ %s", - local_hex_string_custom (p->the_bfd_section->filepos, "08l")); + hex_string_custom (p->the_bfd_section->filepos, 8)); printf_filtered (" is %s", bfd_section_name (p->bfd, p->the_bfd_section)); if (p->bfd != abfd) { @@ -701,7 +699,7 @@ Specify the filename of the executable file."; exec_ops.to_open = exec_open; exec_ops.to_close = exec_close; exec_ops.to_attach = find_default_attach; - exec_ops.to_xfer_memory = xfer_memory; + exec_ops.deprecated_xfer_memory = xfer_memory; exec_ops.to_files_info = exec_files_info; exec_ops.to_insert_breakpoint = ignore; exec_ops.to_remove_breakpoint = ignore; @@ -745,7 +743,7 @@ This can be used if the exec file does not contain section addresses,\n\ file itself are wrong. Each section must be changed separately. The\n\ ``info files'' command lists all the sections and their addresses."); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("write", class_support, var_boolean, (char *) &write_files, "Set writing into executable and core files.", &setlist), diff --git a/gnu/usr.bin/binutils/gdb/expression.h b/gnu/usr.bin/binutils/gdb/expression.h index 03b45c2ef9a..2b09716e907 100644 --- a/gnu/usr.bin/binutils/gdb/expression.h +++ b/gnu/usr.bin/binutils/gdb/expression.h @@ -378,6 +378,8 @@ struct expression extern struct expression *parse_expression (char *); +extern struct expression *parse_expression_in_context (char *, int); + extern struct expression *parse_exp_1 (char **, struct block *, int); /* The innermost context required by the stack and register variables diff --git a/gnu/usr.bin/binutils/gdb/f-exp.y b/gnu/usr.bin/binutils/gdb/f-exp.y index adff33b4dd3..5ef65d3bee6 100644 --- a/gnu/usr.bin/binutils/gdb/f-exp.y +++ b/gnu/usr.bin/binutils/gdb/f-exp.y @@ -1150,7 +1150,10 @@ yylex () yylval.tsym.type = SYMBOL_TYPE (sym); return TYPENAME; } - if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0) + yylval.tsym.type + = language_lookup_primitive_type_by_name (current_language, + current_gdbarch, tmp); + if (yylval.tsym.type != NULL) return TYPENAME; /* Input names that aren't symbols but ARE valid hex numbers, diff --git a/gnu/usr.bin/binutils/gdb/f-lang.c b/gnu/usr.bin/binutils/gdb/f-lang.c index 1e7cd45362c..e058dd4aa43 100644 --- a/gnu/usr.bin/binutils/gdb/f-lang.c +++ b/gnu/usr.bin/binutils/gdb/f-lang.c @@ -462,9 +462,11 @@ const struct language_defn f_language_defn = range_check_on, type_check_on, case_sensitive_off, + array_column_major, &exp_descriptor_standard, f_parse, /* parser */ f_error, /* parser error function */ + null_post_parser, f_printchar, /* Print character constant */ f_printstr, /* function to print string constant */ f_emit_char, /* Function to print a single character */ @@ -477,15 +479,13 @@ const struct language_defn f_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%o", "0", "o", ""}, /* Octal format info */ - {"%d", "", "d", ""}, /* Decimal format info */ - {"0x%x", "0x", "x", ""}, /* Hex format info */ + NULL, /* Language specific class_name_from_physname */ f_op_print_tab, /* expression operators for printing */ 0, /* arrays are first-class (not c-style) */ 1, /* String lower bound */ &builtin_type_f_character, /* Type of string elements */ default_word_break_characters, + NULL, /* FIXME: la_language_arch_info. */ LANG_MAGIC }; diff --git a/gnu/usr.bin/binutils/gdb/fbsd-proc.c b/gnu/usr.bin/binutils/gdb/fbsd-proc.c deleted file mode 100644 index 16813a9a1c8..00000000000 --- a/gnu/usr.bin/binutils/gdb/fbsd-proc.c +++ /dev/null @@ -1,166 +0,0 @@ -/* FreeBSD-specific methods for using the /proc file system. - - Copyright 2002, 2003 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 "gdbcore.h" -#include "inferior.h" -#include "gdb_string.h" - -#include <sys/procfs.h> -#include <sys/types.h> - -#include "elf-bfd.h" - -#include "gregset.h" - -char * -child_pid_to_exec_file (int pid) -{ - char *path; - char *buf; - - xasprintf (&path, "/proc/%d/file", pid); - buf = xcalloc (MAXPATHLEN, sizeof (char)); - make_cleanup (xfree, path); - make_cleanup (xfree, buf); - - if (readlink (path, buf, MAXPATHLEN) > 0) - return buf; - - return NULL; -} - -static int -read_mapping (FILE *mapfile, unsigned long *start, unsigned long *end, - char *protection) -{ - /* FreeBSD 5.1-RELEASE uses a 256-byte buffer. */ - char buf[256]; - int resident, privateresident; - unsigned long obj; - int ret = EOF; - - /* As of FreeBSD 5.0-RELEASE, the layout is described in - /usr/src/sys/fs/procfs/procfs_map.c. Somewhere in 5.1-CURRENT a - new column was added to the procfs map. Therefore we can't use - fscanf since we need to support older releases too. */ - if (fgets (buf, sizeof buf, mapfile) != NULL) - ret = sscanf (buf, "%lx %lx %d %d %lx %s", start, end, - &resident, &privateresident, &obj, protection); - - return (ret != 0 && ret != EOF); -} - -static int -fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, - int, int, int, void *), - void *obfd) -{ - pid_t pid = ptid_get_pid (inferior_ptid); - char *mapfilename; - FILE *mapfile; - unsigned long start, end, size; - char protection[4]; - int read, write, exec; - - xasprintf (&mapfilename, "/proc/%ld/map", (long) pid); - mapfile = fopen (mapfilename, "r"); - if (mapfile == NULL) - error ("Couldn't open %s\n", mapfilename); - - if (info_verbose) - fprintf_filtered (gdb_stdout, - "Reading memory regions from %s\n", mapfilename); - - /* Now iterate until end-of-file. */ - while (read_mapping (mapfile, &start, &end, &protection[0])) - { - size = end - start; - - read = (strchr (protection, 'r') != 0); - write = (strchr (protection, 'w') != 0); - exec = (strchr (protection, 'x') != 0); - - if (info_verbose) - { - fprintf_filtered (gdb_stdout, - "Save segment, %ld bytes at 0x%s (%c%c%c)\n", - size, paddr_nz (start), - read ? 'r' : '-', - write ? 'w' : '-', - exec ? 'x' : '-'); - } - - /* Invoke the callback function to create the corefile segment. */ - func (start, size, read, write, exec, obfd); - } - - fclose (mapfile); - return 0; -} - -static char * -fbsd_make_corefile_notes (bfd *obfd, int *note_size) -{ - gregset_t gregs; - fpregset_t fpregs; - char *note_data = NULL; - Elf_Internal_Ehdr *i_ehdrp; - - /* Put a "FreeBSD" label in the ELF header. */ - i_ehdrp = elf_elfheader (obfd); - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - - fill_gregset (&gregs, -1); - note_data = elfcore_write_prstatus (obfd, note_data, note_size, - ptid_get_pid (inferior_ptid), - stop_signal, &gregs); - - fill_fpregset (&fpregs, -1); - note_data = elfcore_write_prfpreg (obfd, note_data, note_size, - &fpregs, sizeof (fpregs)); - - if (get_exec_file (0)) - { - char *fname = strrchr (get_exec_file (0), '/') + 1; - char *psargs = xstrdup (fname); - - if (get_inferior_args ()) - psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL); - - note_data = elfcore_write_prpsinfo (obfd, note_data, note_size, - fname, psargs); - } - - make_cleanup (xfree, note_data); - return note_data; -} - - -void -_initialize_fbsd_proc (void) -{ - extern void inftarg_set_find_memory_regions (); - extern void inftarg_set_make_corefile_notes (); - - inftarg_set_find_memory_regions (fbsd_find_memory_regions); - inftarg_set_make_corefile_notes (fbsd_make_corefile_notes); -} diff --git a/gnu/usr.bin/binutils/gdb/findvar.c b/gnu/usr.bin/binutils/gdb/findvar.c index cb1ef655dc2..3d5d3f3a729 100644 --- a/gnu/usr.bin/binutils/gdb/findvar.c +++ b/gnu/usr.bin/binutils/gdb/findvar.c @@ -282,24 +282,8 @@ value_of_register (int regnum, struct frame_info *frame) reg_val = allocate_value (register_type (current_gdbarch, regnum)); - /* Convert raw data to virtual format if necessary. */ - - if (DEPRECATED_REGISTER_CONVERTIBLE_P () - && DEPRECATED_REGISTER_CONVERTIBLE (regnum)) - { - DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum), - raw_buffer, VALUE_CONTENTS_RAW (reg_val)); - } - else if (DEPRECATED_REGISTER_RAW_SIZE (regnum) == DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)) - memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer, - DEPRECATED_REGISTER_RAW_SIZE (regnum)); - else - internal_error (__FILE__, __LINE__, - "Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size", - REGISTER_NAME (regnum), - regnum, - DEPRECATED_REGISTER_RAW_SIZE (regnum), - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)); + memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer, + register_size (current_gdbarch, regnum)); VALUE_LVAL (reg_val) = lval; VALUE_ADDRESS (reg_val) = addr; VALUE_REGNO (reg_val) = regnum; @@ -671,7 +655,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) /* Copy all of the data out, whereever it may be. */ for (local_regnum = regnum, value_bytes_copied = 0; value_bytes_copied < len; - (value_bytes_copied += DEPRECATED_REGISTER_RAW_SIZE (local_regnum), + (value_bytes_copied += register_size (current_gdbarch, local_regnum), ++local_regnum)) { int realnum; @@ -737,9 +721,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) some fiddling with the last register copied here for little endian machines. */ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && len < DEPRECATED_REGISTER_RAW_SIZE (regnum)) + && len < register_size (current_gdbarch, regnum)) /* Big-endian, and we want less than full size. */ - VALUE_OFFSET (v) = DEPRECATED_REGISTER_RAW_SIZE (regnum) - len; + VALUE_OFFSET (v) = register_size (current_gdbarch, regnum) - len; else VALUE_OFFSET (v) = 0; memcpy (VALUE_CONTENTS_RAW (v), value_bytes + VALUE_OFFSET (v), len); diff --git a/gnu/usr.bin/binutils/gdb/fork-child.c b/gnu/usr.bin/binutils/gdb/fork-child.c index e1d32b06452..90580baaa76 100644 --- a/gnu/usr.bin/binutils/gdb/fork-child.c +++ b/gnu/usr.bin/binutils/gdb/fork-child.c @@ -1,6 +1,8 @@ /* Fork a Unix child process, and set up to debug it, for GDB. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - 2001 Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, + 2000, 2001, 2004 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of GDB. @@ -34,19 +36,18 @@ #include <signal.h> -/* This just gets used as a default if we can't find SHELL */ +/* This just gets used as a default if we can't find SHELL. */ #ifndef SHELL_FILE #define SHELL_FILE "/bin/sh" #endif extern char **environ; -/* This function breaks up an argument string into an argument - * vector suitable for passing to execvp(). - * E.g., on "run a b c d" this routine would get as input - * the string "a b c d", and as output it would fill in argv with - * the four arguments "a", "b", "c", "d". - */ +/* Break up SCRATCH into an argument vector suitable for passing to + execvp and store it in ARGV. E.g., on "run a b c d" this routine + would get as input the string "a b c d", and as output it would + fill in ARGV with the four arguments "a", "b", "c", "d". */ + static void breakup_args (char *scratch, char **argv) { @@ -54,49 +55,45 @@ breakup_args (char *scratch, char **argv) for (;;) { - /* Scan past leading separators */ while (*cp == ' ' || *cp == '\t' || *cp == '\n') - { - cp++; - } + cp++; - /* Break if at end of string */ + /* Break if at end of string. */ if (*cp == '\0') break; - /* Take an arg */ + /* Take an arg. */ *argv++ = cp; - /* Scan for next arg separator */ + /* Scan for next arg separator. */ cp = strchr (cp, ' '); if (cp == NULL) cp = strchr (cp, '\t'); if (cp == NULL) cp = strchr (cp, '\n'); - /* No separators => end of string => break */ + /* No separators => end of string => break. */ if (cp == NULL) break; - /* Replace the separator with a terminator */ + /* Replace the separator with a terminator. */ *cp++ = '\0'; } - /* execv requires a null-terminated arg vector */ + /* Null-terminate the vector. */ *argv = NULL; - } -/* When executing a command under the given shell, return non-zero - if the '!' character should be escaped when embedded in a quoted +/* When executing a command under the given shell, return non-zero if + the '!' character should be escaped when embedded in a quoted command-line argument. */ static int escape_bang_in_quoted_argument (const char *shell_file) { const int shell_file_len = strlen (shell_file); - + /* Bang should be escaped only in C Shells. For now, simply check that the shell name ends with 'csh', which covers at least csh and tcsh. This should be good enough for now. */ @@ -112,14 +109,14 @@ escape_bang_in_quoted_argument (const char *shell_file) return 0; } -/* Start an inferior Unix child process and sets inferior_ptid to its pid. - EXEC_FILE is the file to run. - ALLARGS is a string containing the arguments to the program. - ENV is the environment vector to pass. SHELL_FILE is the shell file, - or NULL if we should pick one. Errors reported with error(). */ +/* Start an inferior Unix child process and sets inferior_ptid to its + pid. EXEC_FILE is the file to run. ALLARGS is a string containing + the arguments to the program. ENV is the environment vector to + pass. SHELL_FILE is the shell file, or NULL if we should pick + one. */ -/* This function is NOT-REENTRANT. Some of the variables have been - made static to ensure that they survive the vfork() call. */ +/* This function is NOT reentrant. Some of the variables have been + made static to ensure that they survive the vfork call. */ void fork_inferior (char *exec_file_arg, char *allargs, char **env, @@ -141,20 +138,19 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, int shell = 0; static char **argv; - /* If no exec file handed to us, get it from the exec-file command -- with - a good, common error message if none is specified. */ + /* If no exec file handed to us, get it from the exec-file command + -- with a good, common error message if none is specified. */ exec_file = exec_file_arg; if (exec_file == 0) exec_file = get_exec_file (1); - /* STARTUP_WITH_SHELL is defined in inferior.h. - * If 0, we'll just do a fork/exec, no shell, so don't - * bother figuring out what shell. - */ + /* STARTUP_WITH_SHELL is defined in inferior.h. If 0,e we'll just + do a fork/exec, no shell, so don't bother figuring out what + shell. */ shell_file = shell_file_arg; if (STARTUP_WITH_SHELL) { - /* Figure out what shell to start up the user program under. */ + /* Figure out what shell to start up the user program under. */ if (shell_file == NULL) shell_file = getenv ("SHELL"); if (shell_file == NULL) @@ -162,9 +158,9 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, shell = 1; } - /* Multiplying the length of exec_file by 4 is to account for the fact - that it may expand when quoted; it is a worst-case number based on - every character being '. */ + /* Multiplying the length of exec_file by 4 is to account for the + fact that it may expand when quoted; it is a worst-case number + based on every character being '. */ len = 5 + 4 * strlen (exec_file) + 1 + strlen (allargs) + 1 + /*slop */ 12; /* If desired, concat something onto the front of ALLARGS. SHELL_COMMAND is the result. */ @@ -178,17 +174,18 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, if (!shell) { - /* We're going to call execvp. Create argv */ - /* Largest case: every other character is a separate arg */ - argv = (char **) xmalloc (((strlen (allargs) + 1) / (unsigned) 2 + 2) * sizeof (*argv)); + /* We're going to call execvp. Create argument vector. + Calculate an upper bound on the length of the vector by + assuming that every other character is a separate + argument. */ + int argc = (strlen (allargs) + 1) / 2 + 2; + argv = (char **) xmalloc (argc * sizeof (*argv)); argv[0] = exec_file; breakup_args (allargs, &argv[1]); - } else { - - /* We're going to call a shell */ + /* We're going to call a shell. */ /* Now add exec_file, quoting as necessary. */ @@ -198,9 +195,9 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, strcat (shell_command, "exec "); - /* Quoting in this style is said to work with all shells. But csh - on IRIX 4.0.1 can't deal with it. So we only quote it if we need - to. */ + /* Quoting in this style is said to work with all shells. But + csh on IRIX 4.0.1 can't deal with it. So we only quote it if + we need to. */ p = exec_file; while (1) { @@ -251,32 +248,29 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, strcat (shell_command, " "); strcat (shell_command, allargs); - } - /* exec is said to fail if the executable is open. */ + /* On some systems an exec will fail if the executable is open. */ close_exec_file (); /* Retain a copy of our environment variables, since the child will - replace the value of environ and if we're vforked, we have to + replace the value of environ and if we're vforked, we have to restore it. */ save_our_env = environ; /* Tell the terminal handling subsystem what tty we plan to run on; it will just record the information for later. */ - new_tty_prefork (inferior_io_terminal); /* It is generally good practice to flush any possible pending stdio - output prior to doing a fork, to avoid the possibility of both the - parent and child flushing the same data after the fork. */ - + output prior to doing a fork, to avoid the possibility of both + the parent and child flushing the same data after the fork. */ gdb_flush (gdb_stdout); gdb_flush (gdb_stderr); - /* If there's any initialization of the target layers that must happen - to prepare to handle the child we're about fork, do it now... - */ + /* If there's any initialization of the target layers that must + happen to prepare to handle the child we're about fork, do it + now... */ if (pre_trace_fun != NULL) (*pre_trace_fun) (); @@ -301,9 +295,9 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, if (debug_setpgrp == -1) perror ("setpgrp failed in child"); - /* Ask the tty subsystem to switch to the one we specified earlier - (or to share the current terminal, if none was specified). */ - + /* Ask the tty subsystem to switch to the one we specified + earlier (or to share the current terminal, if none was + specified). */ new_tty (); /* Changing the signal handlers for the inferior after @@ -314,14 +308,15 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, /* "Trace me, Dr. Memory!" */ (*traceme_fun) (); + /* The call above set this process (the "child") as debuggable - * by the original gdb process (the "parent"). Since processes - * (unlike people) can have only one parent, if you are - * debugging gdb itself (and your debugger is thus _already_ the - * controller/parent for this child), code from here on out - * is undebuggable. Indeed, you probably got an error message - * saying "not parent". Sorry--you'll have to use print statements! - */ + by the original gdb process (the "parent"). Since processes + (unlike people) can have only one parent, if you are debugging + gdb itself (and your debugger is thus _already_ the + controller/parent for this child), code from here on out is + undebuggable. Indeed, you probably got an error message + saying "not parent". Sorry; you'll have to use print + statements! */ /* There is no execlpe call, so we have to set the environment for our child in the global variable. If we've vforked, this @@ -330,19 +325,17 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, path to find $SHELL. Rich Pixley says so, and I agree. */ environ = env; - /* If we decided above to start up with a shell, - * we exec the shell, - * "-c" says to interpret the next arg as a shell command - * to execute, and this command is "exec <target-program> <args>". - * "-f" means "fast startup" to the c-shell, which means - * don't do .cshrc file. Doing .cshrc may cause fork/exec - * events which will confuse debugger start-up code. - */ + /* If we decided above to start up with a shell, we exec the + shell, "-c" says to interpret the next arg as a shell command + to execute, and this command is "exec <target-program> + <args>". "-f" means "fast startup" to the c-shell, which + means don't do .cshrc file. Doing .cshrc may cause fork/exec + events which will confuse debugger start-up code. */ if (shell) { execlp (shell_file, shell_file, "-c", shell_command, (char *) 0); - /* If we get here, it's an error */ + /* If we get here, it's an error. */ fprintf_unfiltered (gdb_stderr, "Cannot exec %s: %s.\n", shell_file, safe_strerror (errno)); gdb_flush (gdb_stderr); @@ -350,13 +343,14 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, } else { - /* Otherwise, we directly exec the target program with execvp. */ + /* Otherwise, we directly exec the target program with + execvp. */ int i; char *errstring; execvp (exec_file, argv); - /* If we get here, it's an error */ + /* If we get here, it's an error. */ errstring = safe_strerror (errno); fprintf_unfiltered (gdb_stderr, "Cannot exec %s ", exec_file); @@ -369,9 +363,10 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, i++; } fprintf_unfiltered (gdb_stderr, ".\n"); - /* This extra info seems to be useless - fprintf_unfiltered (gdb_stderr, "Got error %s.\n", errstring); - */ +#if 0 + /* This extra info seems to be useless. */ + fprintf_unfiltered (gdb_stderr, "Got error %s.\n", errstring); +#endif gdb_flush (gdb_stderr); _exit (0177); } @@ -382,20 +377,21 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env, init_thread_list (); - inferior_ptid = pid_to_ptid (pid); /* Needed for wait_for_inferior stuff below */ + /* Needed for wait_for_inferior stuff below. */ + inferior_ptid = pid_to_ptid (pid); /* Now that we have a child process, make it our target, and - initialize anything target-vector-specific that needs initializing. */ - + initialize anything target-vector-specific that needs + initializing. */ (*init_trace_fun) (pid); /* We are now in the child process of interest, having exec'd the correct program, and are poised at the first instruction of the new program. */ - /* Allow target dependent code to play with the new process. This might be - used to have target-specific code initialize a variable in the new process - prior to executing the first instruction. */ + /* Allow target dependent code to play with the new process. This + might be used to have target-specific code initialize a variable + in the new process prior to executing the first instruction. */ TARGET_CREATE_INFERIOR_HOOK (pid); #ifdef SOLIB_CREATE_INFERIOR_HOOK @@ -409,18 +405,16 @@ void startup_inferior (int ntraps) { int pending_execs = ntraps; - int terminal_initted; + int terminal_initted = 0; - /* The process was started by the fork that created it, - but it will have stopped one instruction after execing the shell. - Here we must get it up to actual execution of the real program. */ + /* The process was started by the fork that created it, but it will + have stopped one instruction after execing the shell. Here we + must get it up to actual execution of the real program. */ clear_proceed_status (); init_wait_for_inferior (); - terminal_initted = 0; - if (STARTUP_WITH_SHELL) inferior_ignoring_startup_exec_events = ntraps; else @@ -430,13 +424,14 @@ startup_inferior (int ntraps) while (1) { - /* Make wait_for_inferior be quiet */ + /* Make wait_for_inferior be quiet. */ stop_soon = STOP_QUIETLY; wait_for_inferior (); if (stop_signal != TARGET_SIGNAL_TRAP) { - /* Let shell child handle its own signals in its own way */ - /* FIXME, what if child has exit()ed? Must exit loop somehow */ + /* Let shell child handle its own signals in its own way. + FIXME: what if child has exited? Must exit loop + somehow. */ resume (0, stop_signal); } else @@ -444,9 +439,10 @@ startup_inferior (int ntraps) /* We handle SIGTRAP, however; it means child did an exec. */ if (!terminal_initted) { - /* Now that the child has exec'd we know it has already set its - process group. On POSIX systems, tcsetpgrp will fail with - EPERM if we try it before the child's setpgid. */ + /* Now that the child has exec'd we know it has already + set its process group. On POSIX systems, tcsetpgrp + will fail with EPERM if we try it before the child's + setpgid. */ /* Set up the "saved terminal modes" of the inferior based on what modes we are starting it with. */ @@ -458,11 +454,10 @@ startup_inferior (int ntraps) terminal_initted = 1; } - pending_execs = pending_execs - 1; - if (0 == pending_execs) + if (--pending_execs == 0) break; - resume (0, TARGET_SIGNAL_0); /* Just make it go on */ + resume (0, TARGET_SIGNAL_0); /* Just make it go on. */ } } stop_soon = NO_STOP_QUIETLY; diff --git a/gnu/usr.bin/binutils/gdb/frame.c b/gnu/usr.bin/binutils/gdb/frame.c index 46d14c055c0..0d0e2c9094d 100644 --- a/gnu/usr.bin/binutils/gdb/frame.c +++ b/gnu/usr.bin/binutils/gdb/frame.c @@ -39,6 +39,10 @@ #include "frame-base.h" #include "command.h" #include "gdbcmd.h" +#include "observer.h" +#include "objfiles.h" + +static struct frame_info *get_prev_frame_1 (struct frame_info *this_frame); /* We keep a cache of stack frames, each of which is a "struct frame_info". The innermost one gets allocated (in @@ -57,39 +61,16 @@ struct frame_info increases. This is a cached value. It could just as easily be computed by counting back from the selected frame to the inner most frame. */ - /* NOTE: cagney/2002-04-05: Perhaphs a level of ``-1'' should be + /* NOTE: cagney/2002-04-05: Perhaps a level of ``-1'' should be reserved to indicate a bogus frame - one that has been created just to keep GDB happy (GDB always needs a frame). For the moment leave this as speculation. */ int level; - /* The frame's type. */ - /* FIXME: cagney/2003-04-02: Should instead be returning - ->unwind->type. Unfortunately, legacy code is still explicitly - setting the type using the method deprecated_set_frame_type. - Eliminate that method and this field can be eliminated. */ - enum frame_type type; - - /* For each register, address of where it was saved on entry to the - frame, or zero if it was not saved on entry to this frame. This - includes special registers such as pc and fp saved in special - ways in the stack frame. The SP_REGNUM is even more special, the - address here is the sp for the previous frame, not the address - where the sp was saved. */ - /* Allocated by frame_saved_regs_zalloc () which is called / - initialized by DEPRECATED_FRAME_INIT_SAVED_REGS(). */ - CORE_ADDR *saved_regs; /*NUM_REGS + NUM_PSEUDO_REGS*/ - - /* Anything extra for this structure that may have been defined in - the machine dependent files. */ - /* Allocated by frame_extra_info_zalloc () which is called / - initialized by DEPRECATED_INIT_EXTRA_FRAME_INFO */ - struct frame_extra_info *extra_info; - /* The frame's low-level unwinder and corresponding cache. The low-level unwinder is responsible for unwinding register values for the previous frame. The low-level unwind methods are - selected based on the presence, or otherwize, of register unwind + selected based on the presence, or otherwise, of register unwind information such as CFI. */ void *prologue_cache; const struct frame_unwind *unwind; @@ -136,14 +117,25 @@ static int frame_debug; static int backtrace_past_main; static unsigned int backtrace_limit = UINT_MAX; +static void +fprint_field (struct ui_file *file, const char *name, int p, CORE_ADDR addr) +{ + if (p) + fprintf_unfiltered (file, "%s=0x%s", name, paddr_nz (addr)); + else + fprintf_unfiltered (file, "!%s", name); +} void fprint_frame_id (struct ui_file *file, struct frame_id id) { - fprintf_unfiltered (file, "{stack=0x%s,code=0x%s,special=0x%s}", - paddr_nz (id.stack_addr), - paddr_nz (id.code_addr), - paddr_nz (id.special_addr)); + fprintf_unfiltered (file, "{"); + fprint_field (file, "stack", id.stack_addr_p, id.stack_addr); + fprintf_unfiltered (file, ","); + fprint_field (file, "code", id.code_addr_p, id.code_addr); + fprintf_unfiltered (file, ","); + fprint_field (file, "special", id.special_addr_p, id.special_addr); + fprintf_unfiltered (file, "}"); } static void @@ -151,9 +143,6 @@ fprint_frame_type (struct ui_file *file, enum frame_type type) { switch (type) { - case UNKNOWN_FRAME: - fprintf_unfiltered (file, "UNKNOWN_FRAME"); - return; case NORMAL_FRAME: fprintf_unfiltered (file, "NORMAL_FRAME"); return; @@ -181,7 +170,10 @@ fprint_frame (struct ui_file *file, struct frame_info *fi) fprintf_unfiltered (file, "level=%d", fi->level); fprintf_unfiltered (file, ","); fprintf_unfiltered (file, "type="); - fprint_frame_type (file, fi->type); + if (fi->unwind != NULL) + fprint_frame_type (file, fi->unwind->type); + else + fprintf_unfiltered (file, "<unknown>"); fprintf_unfiltered (file, ","); fprintf_unfiltered (file, "unwind="); if (fi->unwind != NULL) @@ -221,21 +213,13 @@ get_frame_id (struct frame_info *fi) } if (!fi->this_id.p) { - gdb_assert (!legacy_frame_p (current_gdbarch)); if (frame_debug) fprintf_unfiltered (gdb_stdlog, "{ get_frame_id (fi=%d) ", fi->level); /* Find the unwinder. */ if (fi->unwind == NULL) - { - fi->unwind = frame_unwind_find_by_frame (fi->next); - /* FIXME: cagney/2003-04-02: Rather than storing the frame's - type in the frame, the unwinder's type should be returned - directly. Unfortunately, legacy code, called by - legacy_get_prev_frame, explicitly set the frames type - using the method deprecated_set_frame_type(). */ - fi->type = fi->unwind->type; - } + fi->unwind = frame_unwind_find_by_frame (fi->next, + &fi->prologue_cache); /* Find THIS frame's ID. */ fi->unwind->this_id (fi->next, &fi->prologue_cache, &fi->this_id.value); fi->this_id.p = 1; @@ -249,31 +233,58 @@ get_frame_id (struct frame_info *fi) return fi->this_id.value; } +struct frame_id +frame_unwind_id (struct frame_info *next_frame) +{ + /* Use prev_frame, and not get_prev_frame. The latter will truncate + the frame chain, leading to this function unintentionally + returning a null_frame_id (e.g., when a caller requests the frame + ID of "main()"s caller. */ + return get_frame_id (get_prev_frame_1 (next_frame)); +} + const struct frame_id null_frame_id; /* All zeros. */ struct frame_id frame_id_build_special (CORE_ADDR stack_addr, CORE_ADDR code_addr, CORE_ADDR special_addr) { - struct frame_id id; + struct frame_id id = null_frame_id; id.stack_addr = stack_addr; + id.stack_addr_p = 1; id.code_addr = code_addr; + id.code_addr_p = 1; id.special_addr = special_addr; + id.special_addr_p = 1; return id; } struct frame_id frame_id_build (CORE_ADDR stack_addr, CORE_ADDR code_addr) { - return frame_id_build_special (stack_addr, code_addr, 0); + struct frame_id id = null_frame_id; + id.stack_addr = stack_addr; + id.stack_addr_p = 1; + id.code_addr = code_addr; + id.code_addr_p = 1; + return id; +} + +struct frame_id +frame_id_build_wild (CORE_ADDR stack_addr) +{ + struct frame_id id = null_frame_id; + id.stack_addr = stack_addr; + id.stack_addr_p = 1; + return id; } int frame_id_p (struct frame_id l) { int p; - /* The .code can be NULL but the .stack cannot. */ - p = (l.stack_addr != 0); + /* The frame is valid iff it has a valid stack address. */ + p = l.stack_addr_p; if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "{ frame_id_p (l="); @@ -287,20 +298,21 @@ int frame_id_eq (struct frame_id l, struct frame_id r) { int eq; - if (l.stack_addr == 0 || r.stack_addr == 0) - /* Like a NaN, if either ID is invalid, the result is false. */ + if (!l.stack_addr_p || !r.stack_addr_p) + /* Like a NaN, if either ID is invalid, the result is false. + Note that a frame ID is invalid iff it is the null frame ID. */ eq = 0; else if (l.stack_addr != r.stack_addr) /* If .stack addresses are different, the frames are different. */ eq = 0; - else if (l.code_addr == 0 || r.code_addr == 0) - /* A zero code addr is a wild card, always succeed. */ + else if (!l.code_addr_p || !r.code_addr_p) + /* An invalid code addr is a wild card, always succeed. */ eq = 1; else if (l.code_addr != r.code_addr) /* If .code addresses are different, the frames are different. */ eq = 0; - else if (l.special_addr == 0 || r.special_addr == 0) - /* A zero special addr is a wild card (or unused), always succeed. */ + else if (!l.special_addr_p || !r.special_addr_p) + /* An invalid special addr is a wild card (or unused), always succeed. */ eq = 1; else if (l.special_addr == r.special_addr) /* Frames are equal. */ @@ -323,7 +335,7 @@ int frame_id_inner (struct frame_id l, struct frame_id r) { int inner; - if (l.stack_addr == 0 || r.stack_addr == 0) + if (!l.stack_addr_p || !r.stack_addr_p) /* Like NaN, any operation involving an invalid ID always fails. */ inner = 0; else @@ -364,8 +376,8 @@ frame_find_by_id (struct frame_id id) if (frame_id_inner (id, this)) /* Gone to far. */ return NULL; - /* Either, we're not yet gone far enough out along the frame - chain (inner(this,id), or we're comparing frameless functions + /* Either we're not yet gone far enough out along the frame + chain (inner(this,id)), or we're comparing frameless functions (same .base, different .func, no test available). Struggle on until we've definitly gone to far. */ } @@ -400,21 +412,13 @@ frame_pc_unwind (struct frame_info *this_frame) } else if (this_frame->level < 0) { - /* FIXME: cagney/2003-03-06: Old code and and a sentinel + /* FIXME: cagney/2003-03-06: Old code and a sentinel frame. Do like was always done. Fetch the PC's value - direct from the global registers array (via read_pc). + directly from the global registers array (via read_pc). This assumes that this frame belongs to the current global register cache. The assumption is dangerous. */ pc = read_pc (); } - else if (DEPRECATED_FRAME_SAVED_PC_P ()) - { - /* FIXME: cagney/2003-03-06: Old code, but not a sentinel - frame. Do like was always done. Note that this method, - unlike unwind_pc(), tries to handle all the different - frame cases directly. It fails. */ - pc = DEPRECATED_FRAME_SAVED_PC (this_frame); - } else internal_error (__FILE__, __LINE__, "No gdbarch_unwind_pc method"); this_frame->prev_pc.value = pc; @@ -453,48 +457,46 @@ get_frame_func (struct frame_info *fi) } static int -do_frame_unwind_register (void *src, int regnum, void *buf) +do_frame_register_read (void *src, int regnum, void *buf) { - frame_unwind_register (src, regnum, buf); + frame_register_read (src, regnum, buf); return 1; } +struct regcache * +frame_save_as_regcache (struct frame_info *this_frame) +{ + struct regcache *regcache = regcache_xmalloc (current_gdbarch); + struct cleanup *cleanups = make_cleanup_regcache_xfree (regcache); + regcache_save (regcache, do_frame_register_read, this_frame); + discard_cleanups (cleanups); + return regcache; +} + void frame_pop (struct frame_info *this_frame) { - struct regcache *scratch_regcache; - struct cleanup *cleanups; + /* Make a copy of all the register values unwound from this frame. + Save them in a scratch buffer so that there isn't a race between + trying to extract the old values from the current_regcache while + at the same time writing new values into that same cache. */ + struct regcache *scratch + = frame_save_as_regcache (get_prev_frame_1 (this_frame)); + struct cleanup *cleanups = make_cleanup_regcache_xfree (scratch); + + /* FIXME: cagney/2003-03-16: It should be possible to tell the + target's register cache that it is about to be hit with a burst + register transfer and that the sequence of register writes should + be batched. The pair target_prepare_to_store() and + target_store_registers() kind of suggest this functionality. + Unfortunately, they don't implement it. Their lack of a formal + definition can lead to targets writing back bogus values + (arguably a bug in the target code mind). */ + /* Now copy those saved registers into the current regcache. + Here, regcache_cpy() calls regcache_restore(). */ + regcache_cpy (current_regcache, scratch); + do_cleanups (cleanups); - if (DEPRECATED_POP_FRAME_P ()) - { - /* A legacy architecture that has implemented a custom pop - function. All new architectures should instead be using the - generic code below. */ - DEPRECATED_POP_FRAME; - } - else - { - /* Make a copy of all the register values unwound from this - frame. Save them in a scratch buffer so that there isn't a - race betweening trying to extract the old values from the - current_regcache while, at the same time writing new values - into that same cache. */ - struct regcache *scratch = regcache_xmalloc (current_gdbarch); - struct cleanup *cleanups = make_cleanup_regcache_xfree (scratch); - regcache_save (scratch, do_frame_unwind_register, this_frame); - /* FIXME: cagney/2003-03-16: It should be possible to tell the - target's register cache that it is about to be hit with a - burst register transfer and that the sequence of register - writes should be batched. The pair target_prepare_to_store() - and target_store_registers() kind of suggest this - functionality. Unfortunately, they don't implement it. Their - lack of a formal definition can lead to targets writing back - bogus values (arguably a bug in the target code mind). */ - /* Now copy those saved registers into the current regcache. - Here, regcache_cpy() calls regcache_restore(). */ - regcache_cpy (current_regcache, scratch); - do_cleanups (cleanups); - } /* We've made right mess of GDB's local state, just discard everything. */ flush_cached_frames (); @@ -525,24 +527,17 @@ frame_register_unwind (struct frame_info *frame, int regnum, /* NOTE: cagney/2002-11-27: A program trying to unwind a NULL frame is broken. There is always a frame. If there, for some reason, - isn't, there is some pretty busted code as it should have + isn't a frame, there is some pretty busted code as it should have detected the problem before calling here. */ gdb_assert (frame != NULL); /* Find the unwinder. */ if (frame->unwind == NULL) - { - frame->unwind = frame_unwind_find_by_frame (frame->next); - /* FIXME: cagney/2003-04-02: Rather than storing the frame's - type in the frame, the unwinder's type should be returned - directly. Unfortunately, legacy code, called by - legacy_get_prev_frame, explicitly set the frames type using - the method deprecated_set_frame_type(). */ - frame->type = frame->unwind->type; - } + frame->unwind = frame_unwind_find_by_frame (frame->next, + &frame->prologue_cache); /* Ask this frame to unwind its register. See comment in - "frame-unwind.h" for why NEXT frame and this unwind cace are + "frame-unwind.h" for why NEXT frame and this unwind cache are passed in. */ frame->unwind->prev_register (frame->next, &frame->prologue_cache, regnum, optimizedp, lvalp, addrp, realnump, bufferp); @@ -582,33 +577,6 @@ frame_register (struct frame_info *frame, int regnum, gdb_assert (realnump != NULL); /* gdb_assert (bufferp != NULL); */ - /* Ulgh! Old code that, for lval_register, sets ADDRP to the offset - of the register in the register cache. It should instead return - the REGNUM corresponding to that register. Translate the . */ - if (DEPRECATED_GET_SAVED_REGISTER_P ()) - { - DEPRECATED_GET_SAVED_REGISTER (bufferp, optimizedp, addrp, frame, - regnum, lvalp); - /* Compute the REALNUM if the caller wants it. */ - if (*lvalp == lval_register) - { - int regnum; - for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) - { - if (*addrp == register_offset_hack (current_gdbarch, regnum)) - { - *realnump = regnum; - return; - } - } - internal_error (__FILE__, __LINE__, - "Failed to compute the register number corresponding" - " to 0x%s", paddr_d (*addrp)); - } - *realnump = -1; - return; - } - /* Obtain the register value by unwinding the register from the next (more inner frame). */ gdb_assert (frame != NULL && frame->next != NULL); @@ -639,7 +607,8 @@ frame_unwind_register_signed (struct frame_info *frame, int regnum) { char buf[MAX_REGISTER_SIZE]; frame_unwind_register (frame, regnum, buf); - return extract_signed_integer (buf, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)); + return extract_signed_integer (buf, register_size (get_frame_arch (frame), + regnum)); } LONGEST @@ -653,7 +622,8 @@ frame_unwind_register_unsigned (struct frame_info *frame, int regnum) { char buf[MAX_REGISTER_SIZE]; frame_unwind_register (frame, regnum, buf); - return extract_unsigned_integer (buf, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)); + return extract_unsigned_integer (buf, register_size (get_frame_arch (frame), + regnum)); } ULONGEST @@ -668,7 +638,9 @@ frame_unwind_unsigned_register (struct frame_info *frame, int regnum, { char buf[MAX_REGISTER_SIZE]; frame_unwind_register (frame, regnum, buf); - (*val) = extract_unsigned_integer (buf, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum)); + (*val) = extract_unsigned_integer (buf, + register_size (get_frame_arch (frame), + regnum)); } void @@ -704,8 +676,7 @@ put_frame_register (struct frame_info *frame, int regnum, const void *buf) /* frame_register_read () Find and return the value of REGNUM for the specified stack frame. - The number of bytes copied is DEPRECATED_REGISTER_RAW_SIZE - (REGNUM). + The number of bytes copied is REGISTER_SIZE (REGNUM). Returns 0 if the register value could not be found. */ @@ -718,7 +689,7 @@ frame_register_read (struct frame_info *frame, int regnum, void *myaddr) int realnum; frame_register (frame, regnum, &optimized, &lval, &addr, &realnum, myaddr); - /* FIXME: cagney/2002-05-15: This test, is just bogus. + /* FIXME: cagney/2002-05-15: This test is just bogus. It indicates that the target failed to supply a value for a register because it was "not available" at this time. Problem @@ -754,7 +725,6 @@ static struct frame_info * create_sentinel_frame (struct regcache *regcache) { struct frame_info *frame = FRAME_OBSTACK_ZALLOC (struct frame_info); - frame->type = NORMAL_FRAME; frame->level = -1; /* Explicitly initialize the sentinel frame's cache. Provide it with the underlying regcache. In the future additional @@ -796,20 +766,6 @@ frame_obstack_zalloc (unsigned long size) return data; } -CORE_ADDR * -frame_saved_regs_zalloc (struct frame_info *fi) -{ - fi->saved_regs = (CORE_ADDR *) - frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS); - return fi->saved_regs; -} - -CORE_ADDR * -deprecated_get_frame_saved_regs (struct frame_info *fi) -{ - return fi->saved_regs; -} - /* Return the innermost (currently executing) stack frame. This is split into two functions. The function unwind_to_current_frame() is wrapped in catch exceptions so that, even when the unwind of the @@ -819,7 +775,7 @@ static int unwind_to_current_frame (struct ui_out *ui_out, void *args) { struct frame_info *frame = get_prev_frame (args); - /* A sentinel frame can fail to unwind, eg, because it's PC value + /* A sentinel frame can fail to unwind, e.g., because its PC value lands in somewhere like start. */ if (frame == NULL) return 1; @@ -861,7 +817,7 @@ get_current_frame (void) struct frame_info *deprecated_selected_frame; -/* Return the selected frame. Always non-null (unless there isn't an +/* Return the selected frame. Always non-NULL (unless there isn't an inferior sufficient for creating a frame) in which case an error is thrown. */ @@ -878,9 +834,9 @@ get_selected_frame (void) return deprecated_selected_frame; } -/* This is a variant of get_selected_frame which can be called when +/* This is a variant of get_selected_frame() which can be called when the inferior does not have a frame; in that case it will return - NULL instead of calling error (). */ + NULL instead of calling error(). */ struct frame_info * deprecated_safe_get_selected_frame (void) @@ -898,26 +854,26 @@ select_frame (struct frame_info *fi) struct symtab *s; deprecated_selected_frame = fi; - /* NOTE: cagney/2002-05-04: FI can be NULL. This occures when the + /* NOTE: cagney/2002-05-04: FI can be NULL. This occurs when the frame is being invalidated. */ - if (selected_frame_level_changed_hook) - selected_frame_level_changed_hook (frame_relative_level (fi)); + if (deprecated_selected_frame_level_changed_hook) + deprecated_selected_frame_level_changed_hook (frame_relative_level (fi)); /* FIXME: kseitz/2002-08-28: It would be nice to call - selected_frame_level_changed_event right here, but due to limitations + selected_frame_level_changed_event() right here, but due to limitations in the current interfaces, we would end up flooding UIs with events - because select_frame is used extensively internally. + because select_frame() is used extensively internally. Once we have frame-parameterized frame (and frame-related) commands, the event notification can be moved here, since this function will only - be called when the users selected frame is being changed. */ + be called when the user's selected frame is being changed. */ /* Ensure that symbols for this frame are read in. Also, determine the source language of this frame, and switch to it if desired. */ if (fi) { /* We retrieve the frame's symtab by using the frame PC. However - we cannot use the frame pc as is, because it usually points to + we cannot use the frame PC as-is, because it usually points to the instruction following the "call", which is sometimes the first instruction of another function. So we rely on get_frame_address_in_block() which provides us with a PC which @@ -932,244 +888,7 @@ select_frame (struct frame_info *fi) } } } - -/* Return the register saved in the simplistic ``saved_regs'' cache. - If the value isn't here AND a value is needed, try the next inner - most frame. */ - -static void -legacy_saved_regs_prev_register (struct frame_info *next_frame, - void **this_prologue_cache, - int regnum, int *optimizedp, - enum lval_type *lvalp, CORE_ADDR *addrp, - int *realnump, void *bufferp) -{ - /* HACK: New code is passed the next frame and this cache. - Unfortunately, old code expects this frame. Since this is a - backward compatibility hack, cheat by walking one level along the - prologue chain to the frame the old code expects. - - Do not try this at home. Professional driver, closed course. */ - struct frame_info *frame = next_frame->prev; - gdb_assert (frame != NULL); - - if (deprecated_get_frame_saved_regs (frame) == NULL) - { - /* If nothing's initialized the saved regs, do it now. */ - gdb_assert (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()); - DEPRECATED_FRAME_INIT_SAVED_REGS (frame); - gdb_assert (deprecated_get_frame_saved_regs (frame) != NULL); - } - - if (deprecated_get_frame_saved_regs (frame) != NULL - && deprecated_get_frame_saved_regs (frame)[regnum] != 0) - { - if (regnum == SP_REGNUM) - { - /* SP register treated specially. */ - *optimizedp = 0; - *lvalp = not_lval; - *addrp = 0; - *realnump = -1; - if (bufferp != NULL) - /* NOTE: cagney/2003-05-09: In-lined store_address with - it's body - store_unsigned_integer. */ - store_unsigned_integer (bufferp, DEPRECATED_REGISTER_RAW_SIZE (regnum), - deprecated_get_frame_saved_regs (frame)[regnum]); - } - else - { - /* Any other register is saved in memory, fetch it but cache - a local copy of its value. */ - *optimizedp = 0; - *lvalp = lval_memory; - *addrp = deprecated_get_frame_saved_regs (frame)[regnum]; - *realnump = -1; - if (bufferp != NULL) - { -#if 1 - /* Save each register value, as it is read in, in a - frame based cache. */ - void **regs = (*this_prologue_cache); - if (regs == NULL) - { - int sizeof_cache = ((NUM_REGS + NUM_PSEUDO_REGS) - * sizeof (void *)); - regs = frame_obstack_zalloc (sizeof_cache); - (*this_prologue_cache) = regs; - } - if (regs[regnum] == NULL) - { - regs[regnum] - = frame_obstack_zalloc (DEPRECATED_REGISTER_RAW_SIZE (regnum)); - read_memory (deprecated_get_frame_saved_regs (frame)[regnum], regs[regnum], - DEPRECATED_REGISTER_RAW_SIZE (regnum)); - } - memcpy (bufferp, regs[regnum], DEPRECATED_REGISTER_RAW_SIZE (regnum)); -#else - /* Read the value in from memory. */ - read_memory (deprecated_get_frame_saved_regs (frame)[regnum], bufferp, - DEPRECATED_REGISTER_RAW_SIZE (regnum)); -#endif - } - } - return; - } - - /* No luck. Assume this and the next frame have the same register - value. Pass the unwind request down the frame chain to the next - frame. Hopefully that frame will find the register's location. */ - frame_register_unwind (next_frame, regnum, optimizedp, lvalp, addrp, - realnump, bufferp); -} - -static void -legacy_saved_regs_this_id (struct frame_info *next_frame, - void **this_prologue_cache, - struct frame_id *id) -{ - /* A developer is trying to bring up a new architecture, help them - by providing a default unwinder that refuses to unwind anything - (the ID is always NULL). In the case of legacy code, - legacy_get_prev_frame() will have previously set ->this_id.p, so - this code won't be called. */ - (*id) = null_frame_id; -} -const struct frame_unwind legacy_saved_regs_unwinder = { - /* Not really. It gets overridden by legacy_get_prev_frame. */ - UNKNOWN_FRAME, - legacy_saved_regs_this_id, - legacy_saved_regs_prev_register -}; -const struct frame_unwind *legacy_saved_regs_unwind = &legacy_saved_regs_unwinder; - - -/* Function: deprecated_generic_get_saved_register - Find register number REGNUM relative to FRAME and put its (raw, - target format) contents in *RAW_BUFFER. - - Set *OPTIMIZED if the variable was optimized out (and thus can't be - fetched). Note that this is never set to anything other than zero - in this implementation. - - Set *LVAL to lval_memory, lval_register, or not_lval, depending on - whether the value was fetched from memory, from a register, or in a - strange and non-modifiable way (e.g. a frame pointer which was - calculated rather than fetched). We will use not_lval for values - fetched from generic dummy frames. - - Set *ADDRP to the address, either in memory or as a - DEPRECATED_REGISTER_BYTE offset into the registers array. If the - value is stored in a dummy frame, set *ADDRP to zero. - - The argument RAW_BUFFER must point to aligned memory. */ - -void -deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, - CORE_ADDR *addrp, - struct frame_info *frame, int regnum, - enum lval_type *lval) -{ - if (!target_has_registers) - error ("No registers."); - - /* Normal systems don't optimize out things with register numbers. */ - if (optimized != NULL) - *optimized = 0; - - if (addrp) /* default assumption: not found in memory */ - *addrp = 0; - - /* Note: since the current frame's registers could only have been - saved by frames INTERIOR TO the current frame, we skip examining - the current frame itself: otherwise, we would be getting the - previous frame's registers which were saved by the current frame. */ - - if (frame != NULL) - { - for (frame = get_next_frame (frame); - frame_relative_level (frame) >= 0; - frame = get_next_frame (frame)) - { - if (get_frame_type (frame) == DUMMY_FRAME) - { - if (lval) /* found it in a CALL_DUMMY frame */ - *lval = not_lval; - if (raw_buffer) - /* FIXME: cagney/2002-06-26: This should be via the - gdbarch_register_read() method so that it, on the - fly, constructs either a raw or pseudo register - from the raw register cache. */ - regcache_raw_read - (deprecated_find_dummy_frame_regcache (get_frame_pc (frame), - get_frame_base (frame)), - regnum, raw_buffer); - return; - } - - DEPRECATED_FRAME_INIT_SAVED_REGS (frame); - if (deprecated_get_frame_saved_regs (frame) != NULL - && deprecated_get_frame_saved_regs (frame)[regnum] != 0) - { - if (lval) /* found it saved on the stack */ - *lval = lval_memory; - if (regnum == SP_REGNUM) - { - if (raw_buffer) /* SP register treated specially */ - /* NOTE: cagney/2003-05-09: In-line store_address - with it's body - store_unsigned_integer. */ - store_unsigned_integer (raw_buffer, - DEPRECATED_REGISTER_RAW_SIZE (regnum), - deprecated_get_frame_saved_regs (frame)[regnum]); - } - else - { - if (addrp) /* any other register */ - *addrp = deprecated_get_frame_saved_regs (frame)[regnum]; - if (raw_buffer) - read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer, - DEPRECATED_REGISTER_RAW_SIZE (regnum)); - } - return; - } - } - } - - /* If we get thru the loop to this point, it means the register was - not saved in any frame. Return the actual live-register value. */ - - if (lval) /* found it in a live register */ - *lval = lval_register; - if (addrp) - *addrp = DEPRECATED_REGISTER_BYTE (regnum); - if (raw_buffer) - deprecated_read_register_gen (regnum, raw_buffer); -} - -/* Determine the frame's type based on its PC. */ - -static enum frame_type -frame_type_from_pc (CORE_ADDR pc) -{ - /* FIXME: cagney/2002-11-24: Can't yet directly call - pc_in_dummy_frame() as some architectures don't set - PC_IN_CALL_DUMMY() to generic_pc_in_call_dummy() (remember the - latter is implemented by simply calling pc_in_dummy_frame). */ - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES - && DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) - return DUMMY_FRAME; - else - { - char *name; - find_pc_partial_function (pc, &name, NULL, NULL); - if (PC_IN_SIGTRAMP (pc, name)) - return SIGTRAMP_FRAME; - else - return NORMAL_FRAME; - } -} - /* Create an arbitrary (i.e. address specified by user) or innermost frame. Always returns a non-NULL value. */ @@ -1191,19 +910,12 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc) /* Select/initialize both the unwind function and the frame's type based on the PC. */ - fi->unwind = frame_unwind_find_by_frame (fi->next); - if (fi->unwind->type != UNKNOWN_FRAME) - fi->type = fi->unwind->type; - else - fi->type = frame_type_from_pc (pc); + fi->unwind = frame_unwind_find_by_frame (fi->next, &fi->prologue_cache); fi->this_id.p = 1; deprecated_update_frame_base_hack (fi, addr); deprecated_update_frame_pc_hack (fi, pc); - if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()) - DEPRECATED_INIT_EXTRA_FRAME_INFO (0, fi); - if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "-> "); @@ -1227,6 +939,14 @@ get_next_frame (struct frame_info *this_frame) return NULL; } +/* Observer for the target_changed event. */ + +void +frame_observer_target_changed (struct target_ops *target) +{ + flush_cached_frames (); +} + /* Flush the entire frame cache. */ void @@ -1257,485 +977,127 @@ reinit_frame_cache (void) } } -/* Create the previous frame using the deprecated methods - INIT_EXTRA_INFO, INIT_FRAME_PC and INIT_FRAME_PC_FIRST. */ +/* Return a "struct frame_info" corresponding to the frame that called + THIS_FRAME. Returns NULL if there is no such frame. + + Unlike get_prev_frame, this function always tries to unwind the + frame. */ static struct frame_info * -legacy_get_prev_frame (struct frame_info *this_frame) +get_prev_frame_1 (struct frame_info *this_frame) { - CORE_ADDR address = 0; - struct frame_info *prev; - int fromleaf; - - /* Don't frame_debug print legacy_get_prev_frame() here, just - confuses the output. */ + struct frame_info *prev_frame; + struct frame_id this_id; - /* Allocate the new frame. + gdb_assert (this_frame != NULL); - There is no reason to worry about memory leaks, should the - remainder of the function fail. The allocated memory will be - quickly reclaimed when the frame cache is flushed, and the `we've - been here before' check, in get_prev_frame will stop repeated - memory allocation calls. */ - prev = FRAME_OBSTACK_ZALLOC (struct frame_info); - prev->level = this_frame->level + 1; - - /* Do not completely wire it in to the frame chain. Some (bad) code - in INIT_FRAME_EXTRA_INFO tries to look along frame->prev to pull - some fancy tricks (of course such code is, by definition, - recursive). - - On the other hand, methods, such as get_frame_pc() and - get_frame_base() rely on being able to walk along the frame - chain. Make certain that at least they work by providing that - link. Of course things manipulating prev can't go back. */ - prev->next = this_frame; - - /* NOTE: cagney/2002-11-18: Should have been correctly setting the - frame's type here, before anything else, and not last, at the - bottom of this function. The various - DEPRECATED_INIT_EXTRA_FRAME_INFO, DEPRECATED_INIT_FRAME_PC, - DEPRECATED_INIT_FRAME_PC_FIRST and - DEPRECATED_FRAME_INIT_SAVED_REGS methods are full of work-arounds - that handle the frame not being correctly set from the start. - Unfortunately those same work-arounds rely on the type defaulting - to NORMAL_FRAME. Ulgh! The new frame code does not have this - problem. */ - prev->type = UNKNOWN_FRAME; - - /* A legacy frame's ID is always computed here. Mark it as valid. */ - prev->this_id.p = 1; - - /* Handle sentinel frame unwind as a special case. */ - if (this_frame->level < 0) + if (frame_debug) { - /* Try to unwind the PC. If that doesn't work, assume we've reached - the oldest frame and simply return. Is there a better sentinal - value? The unwound PC value is then used to initialize the new - previous frame's type. - - Note that the pc-unwind is intentionally performed before the - frame chain. This is ok since, for old targets, both - frame_pc_unwind (nee, DEPRECATED_FRAME_SAVED_PC) and - DEPRECATED_FRAME_CHAIN()) assume THIS_FRAME's data structures - have already been initialized (using - DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order - doesn't matter. - - By unwinding the PC first, it becomes possible to, in the case of - a dummy frame, avoid also unwinding the frame ID. This is - because (well ignoring the PPC) a dummy frame can be located - using THIS_FRAME's frame ID. */ - - deprecated_update_frame_pc_hack (prev, frame_pc_unwind (this_frame)); - if (get_frame_pc (prev) == 0) - { - /* The allocated PREV_FRAME will be reclaimed when the frame - obstack is next purged. */ - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, - " // unwound legacy PC zero }\n"); - } - return NULL; - } - - /* Set the unwind functions based on that identified PC. Ditto - for the "type" but strongly prefer the unwinder's frame type. */ - prev->unwind = frame_unwind_find_by_frame (prev->next); - if (prev->unwind->type == UNKNOWN_FRAME) - prev->type = frame_type_from_pc (get_frame_pc (prev)); - else - prev->type = prev->unwind->type; - - /* Find the prev's frame's ID. */ - if (prev->type == DUMMY_FRAME - && gdbarch_unwind_dummy_id_p (current_gdbarch)) - { - /* When unwinding a normal frame, the stack structure is - determined by analyzing the frame's function's code (be - it using brute force prologue analysis, or the dwarf2 - CFI). In the case of a dummy frame, that simply isn't - possible. The The PC is either the program entry point, - or some random address on the stack. Trying to use that - PC to apply standard frame ID unwind techniques is just - asking for trouble. */ - /* Use an architecture specific method to extract the prev's - dummy ID from the next frame. Note that this method uses - frame_register_unwind to obtain the register values - needed to determine the dummy frame's ID. */ - prev->this_id.value = gdbarch_unwind_dummy_id (current_gdbarch, - this_frame); - } + fprintf_unfiltered (gdb_stdlog, "{ get_prev_frame_1 (this_frame="); + if (this_frame != NULL) + fprintf_unfiltered (gdb_stdlog, "%d", this_frame->level); else - { - /* We're unwinding a sentinel frame, the PC of which is - pointing at a stack dummy. Fake up the dummy frame's ID - using the same sequence as is found a traditional - unwinder. Once all architectures supply the - unwind_dummy_id method, this code can go away. */ - prev->this_id.value = frame_id_build (deprecated_read_fp (), - read_pc ()); - } - - /* Check that the unwound ID is valid. */ - if (!frame_id_p (prev->this_id.value)) - { - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, - " // unwound legacy ID invalid }\n"); - } - return NULL; - } - - /* Check that the new frame isn't inner to (younger, below, - next) the old frame. If that happens the frame unwind is - going backwards. */ - /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since - that doesn't have a valid frame ID. Should instead set the - sentinel frame's frame ID to a `sentinel'. Leave it until - after the switch to storing the frame ID, instead of the - frame base, in the frame object. */ - - /* Link it in. */ - this_frame->prev = prev; - - /* FIXME: cagney/2002-01-19: This call will go away. Instead of - initializing extra info, all frames will use the frame_cache - (passed to the unwind functions) to store additional frame - info. Unfortunately legacy targets can't use - legacy_get_prev_frame() to unwind the sentinel frame and, - consequently, are forced to take this code path and rely on - the below call to DEPRECATED_INIT_EXTRA_FRAME_INFO to - initialize the inner-most frame. */ - if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()) - { - DEPRECATED_INIT_EXTRA_FRAME_INFO (0, prev); - } - - if (prev->type == NORMAL_FRAME) - prev->this_id.value.code_addr - = get_pc_function_start (prev->this_id.value.code_addr); - - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, prev); - fprintf_unfiltered (gdb_stdlog, " } // legacy innermost frame\n"); - } - return prev; + fprintf_unfiltered (gdb_stdlog, "<NULL>"); + fprintf_unfiltered (gdb_stdlog, ") "); } - /* This code only works on normal frames. A sentinel frame, where - the level is -1, should never reach this code. */ - gdb_assert (this_frame->level >= 0); - - /* On some machines it is possible to call a function without - setting up a stack frame for it. On these machines, we - define this macro to take two args; a frameinfo pointer - identifying a frame and a variable to set or clear if it is - or isn't leafless. */ - - /* Still don't want to worry about this except on the innermost - frame. This macro will set FROMLEAF if THIS_FRAME is a frameless - function invocation. */ - if (this_frame->level == 0) - /* FIXME: 2002-11-09: Frameless functions can occure anywhere in - the frame chain, not just the inner most frame! The generic, - per-architecture, frame code should handle this and the below - should simply be removed. */ - fromleaf = (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P () - && DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (this_frame)); - else - fromleaf = 0; - - if (fromleaf) - /* A frameless inner-most frame. The `FP' (which isn't an - architecture frame-pointer register!) of the caller is the same - as the callee. */ - /* FIXME: 2002-11-09: There isn't any reason to special case this - edge condition. Instead the per-architecture code should hande - it locally. */ - /* FIXME: cagney/2003-06-16: This returns the inner most stack - address for the previous frame, that, however, is wrong. It - should be the inner most stack address for the previous to - previous frame. This is because it is the previous to previous - frame's innermost stack address that is constant through out - the lifetime of the previous frame (trust me :-). */ - address = get_frame_base (this_frame); - else - { - /* Two macros defined in tm.h specify the machine-dependent - actions to be performed here. - - First, get the frame's chain-pointer. - - If that is zero, the frame is the outermost frame or a leaf - called by the outermost frame. This means that if start - calls main without a frame, we'll return 0 (which is fine - anyway). - - Nope; there's a problem. This also returns when the current - routine is a leaf of main. This is unacceptable. We move - this to after the ffi test; I'd rather have backtraces from - start go curfluy than have an abort called from main not show - main. */ - if (DEPRECATED_FRAME_CHAIN_P ()) - address = DEPRECATED_FRAME_CHAIN (this_frame); - else - { - /* Someone is part way through coverting an old architecture - to the new frame code. Implement FRAME_CHAIN the way the - new frame will. */ - /* Find PREV frame's unwinder. */ - prev->unwind = frame_unwind_find_by_frame (this_frame->next); - /* FIXME: cagney/2003-04-02: Rather than storing the frame's - type in the frame, the unwinder's type should be returned - directly. Unfortunately, legacy code, called by - legacy_get_prev_frame, explicitly set the frames type - using the method deprecated_set_frame_type(). */ - prev->type = prev->unwind->type; - /* Find PREV frame's ID. */ - prev->unwind->this_id (this_frame, - &prev->prologue_cache, - &prev->this_id.value); - prev->this_id.p = 1; - address = prev->this_id.value.stack_addr; - } - - if (!legacy_frame_chain_valid (address, this_frame)) - { - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, - " // legacy frame chain invalid }\n"); - } - return NULL; - } - } - if (address == 0) + /* Only try to do the unwind once. */ + if (this_frame->prev_p) { if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, - " // legacy frame chain NULL }\n"); + fprint_frame (gdb_stdlog, this_frame->prev); + fprintf_unfiltered (gdb_stdlog, " // cached \n"); } - return NULL; + return this_frame->prev; } + this_frame->prev_p = 1; - /* Link in the already allocated prev frame. */ - this_frame->prev = prev; - deprecated_update_frame_base_hack (prev, address); - - /* This change should not be needed, FIXME! We should determine - whether any targets *need* DEPRECATED_INIT_FRAME_PC to happen - after DEPRECATED_INIT_EXTRA_FRAME_INFO and come up with a simple - way to express what goes on here. - - DEPRECATED_INIT_EXTRA_FRAME_INFO is called from two places: - create_new_frame (where the PC is already set up) and here (where - it isn't). DEPRECATED_INIT_FRAME_PC is only called from here, - always after DEPRECATED_INIT_EXTRA_FRAME_INFO. - - The catch is the MIPS, where DEPRECATED_INIT_EXTRA_FRAME_INFO - requires the PC value (which hasn't been set yet). Some other - machines appear to require DEPRECATED_INIT_EXTRA_FRAME_INFO - before they can do DEPRECATED_INIT_FRAME_PC. Phoo. - - We shouldn't need DEPRECATED_INIT_FRAME_PC_FIRST to add more - complication to an already overcomplicated part of GDB. - gnu@cygnus.com, 15Sep92. - - Assuming that some machines need DEPRECATED_INIT_FRAME_PC after - DEPRECATED_INIT_EXTRA_FRAME_INFO, one possible scheme: - - SETUP_INNERMOST_FRAME(): Default version is just create_new_frame - (deprecated_read_fp ()), read_pc ()). Machines with extra frame - info would do that (or the local equivalent) and then set the - extra fields. - - SETUP_ARBITRARY_FRAME(argc, argv): Only change here is that - create_new_frame would no longer init extra frame info; - SETUP_ARBITRARY_FRAME would have to do that. - - INIT_PREV_FRAME(fromleaf, prev) Replace - DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC. - This should also return a flag saying whether to keep the new - frame, or whether to discard it, because on some machines (e.g. - mips) it is really awkward to have DEPRECATED_FRAME_CHAIN_VALID - called BEFORE DEPRECATED_INIT_EXTRA_FRAME_INFO (there is no good - way to get information deduced in DEPRECATED_FRAME_CHAIN_VALID - into the extra fields of the new frame). std_frame_pc(fromleaf, - prev) - - This is the default setting for INIT_PREV_FRAME. It just does - what the default DEPRECATED_INIT_FRAME_PC does. Some machines - will call it from INIT_PREV_FRAME (either at the beginning, the - end, or in the middle). Some machines won't use it. - - kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94. */ - - /* NOTE: cagney/2002-11-09: Just ignore the above! There is no - reason for things to be this complicated. - - The trick is to assume that there is always a frame. Instead of - special casing the inner-most frame, create fake frame - (containing the hardware registers) that is inner to the - user-visible inner-most frame (...) and then unwind from that. - That way architecture code can use use the standard - frame_XX_unwind() functions and not differentiate between the - inner most and any other case. - - Since there is always a frame to unwind from, there is always - somewhere (THIS_FRAME) to store all the info needed to construct - a new (previous) frame without having to first create it. This - means that the convolution below - needing to carefully order a - frame's initialization - isn't needed. - - The irony here though, is that DEPRECATED_FRAME_CHAIN(), at least - for a more up-to-date architecture, always calls - FRAME_SAVED_PC(), and FRAME_SAVED_PC() computes the PC but - without first needing the frame! Instead of the convolution - below, we could have simply called FRAME_SAVED_PC() and been done - with it! Note that FRAME_SAVED_PC() is being superseed by - frame_pc_unwind() and that function does have somewhere to cache - that PC value. */ - - if (DEPRECATED_INIT_FRAME_PC_FIRST_P ()) - deprecated_update_frame_pc_hack (prev, - DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, - prev)); - - if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()) - DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, prev); - - /* This entry is in the frame queue now, which is good since - FRAME_SAVED_PC may use that queue to figure out its value (see - tm-sparc.h). We want the pc saved in the inferior frame. */ - if (DEPRECATED_INIT_FRAME_PC_P ()) - deprecated_update_frame_pc_hack (prev, - DEPRECATED_INIT_FRAME_PC (fromleaf, - prev)); - - /* If ->frame and ->pc are unchanged, we are in the process of - getting ourselves into an infinite backtrace. Some architectures - check this in DEPRECATED_FRAME_CHAIN or thereabouts, but it seems - like there is no reason this can't be an architecture-independent - check. */ - if (get_frame_base (prev) == get_frame_base (this_frame) - && get_frame_pc (prev) == get_frame_pc (this_frame)) + /* Check that this frame's ID was valid. If it wasn't, don't try to + unwind to the prev frame. Be careful to not apply this test to + the sentinel frame. */ + this_id = get_frame_id (this_frame); + if (this_frame->level >= 0 && !frame_id_p (this_id)) { - this_frame->prev = NULL; - obstack_free (&frame_cache_obstack, prev); if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "-> "); fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, - " // legacy this.id == prev.id }\n"); + fprintf_unfiltered (gdb_stdlog, " // this ID is NULL }\n"); } return NULL; } - /* Initialize the code used to unwind the frame PREV based on the PC - (and probably other architectural information). The PC lets you - check things like the debug info at that point (dwarf2cfi?) and - use that to decide how the frame should be unwound. + /* Check that this frame's ID isn't inner to (younger, below, next) + the next frame. This happens when a frame unwind goes backwards. + Exclude signal trampolines (due to sigaltstack the frame ID can + go backwards) and sentinel frames (the test is meaningless). */ + if (this_frame->next->level >= 0 + && this_frame->next->unwind->type != SIGTRAMP_FRAME + && frame_id_inner (this_id, get_frame_id (this_frame->next))) + error ("Previous frame inner to this frame (corrupt stack?)"); - If there isn't a FRAME_CHAIN, the code above will have already - done this. */ - if (prev->unwind == NULL) - prev->unwind = frame_unwind_find_by_frame (prev->next); + /* Check that this and the next frame are not identical. If they + are, there is most likely a stack cycle. As with the inner-than + test above, avoid comparing the inner-most and sentinel frames. */ + if (this_frame->level > 0 + && frame_id_eq (this_id, get_frame_id (this_frame->next))) + error ("Previous frame identical to this frame (corrupt stack?)"); - /* If the unwinder provides a frame type, use it. Otherwize - continue on to that heuristic mess. */ - if (prev->unwind->type != UNKNOWN_FRAME) - { - prev->type = prev->unwind->type; - if (prev->type == NORMAL_FRAME) - /* FIXME: cagney/2003-06-16: would get_frame_pc() be better? */ - prev->this_id.value.code_addr - = get_pc_function_start (prev->this_id.value.code_addr); - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, prev); - fprintf_unfiltered (gdb_stdlog, " } // legacy with unwound type\n"); - } - return prev; - } + /* Allocate the new frame but do not wire it in to the frame chain. + Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along + frame->next to pull some fancy tricks (of course such code is, by + definition, recursive). Try to prevent it. - /* NOTE: cagney/2002-11-18: The code segments, found in - create_new_frame and get_prev_frame(), that initializes the - frames type is subtly different. The latter only updates ->type - when it encounters a SIGTRAMP_FRAME or DUMMY_FRAME. This stops - get_prev_frame() overriding the frame's type when the INIT code - has previously set it. This is really somewhat bogus. The - initialization, as seen in create_new_frame(), should occur - before the INIT function has been called. */ - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES - && (DEPRECATED_PC_IN_CALL_DUMMY_P () - ? DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (prev), 0, 0) - : pc_in_dummy_frame (get_frame_pc (prev)))) - prev->type = DUMMY_FRAME; - else - { - /* FIXME: cagney/2002-11-10: This should be moved to before the - INIT code above so that the INIT code knows what the frame's - type is (in fact, for a [generic] dummy-frame, the type can - be set and then the entire initialization can be skipped. - Unforunatly, its the INIT code that sets the PC (Hmm, catch - 22). */ - char *name; - find_pc_partial_function (get_frame_pc (prev), &name, NULL, NULL); - if (PC_IN_SIGTRAMP (get_frame_pc (prev), name)) - prev->type = SIGTRAMP_FRAME; - /* FIXME: cagney/2002-11-11: Leave prev->type alone. Some - architectures are forcing the frame's type in INIT so we - don't want to override it here. Remember, NORMAL_FRAME == 0, - so it all works (just :-/). Once this initialization is - moved to the start of this function, all this nastness will - go away. */ - } + There is no reason to worry about memory leaks, should the + remainder of the function fail. The allocated memory will be + quickly reclaimed when the frame cache is flushed, and the `we've + been here before' check above will stop repeated memory + allocation calls. */ + prev_frame = FRAME_OBSTACK_ZALLOC (struct frame_info); + prev_frame->level = this_frame->level + 1; + + /* Don't yet compute ->unwind (and hence ->type). It is computed + on-demand in get_frame_type, frame_register_unwind, and + get_frame_id. */ + + /* Don't yet compute the frame's ID. It is computed on-demand by + get_frame_id(). */ + + /* The unwound frame ID is validate at the start of this function, + as part of the logic to decide if that frame should be further + unwound, and not here while the prev frame is being created. + Doing this makes it possible for the user to examine a frame that + has an invalid frame ID. + + Some very old VAX code noted: [...] For the sake of argument, + suppose that the stack is somewhat trashed (which is one reason + that "info frame" exists). So, return 0 (indicating we don't + know the address of the arglist) if we don't know what frame this + frame calls. */ - if (prev->type == NORMAL_FRAME) - prev->this_id.value.code_addr - = get_pc_function_start (prev->this_id.value.code_addr); + /* Link it in. */ + this_frame->prev = prev_frame; + prev_frame->next = this_frame; if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, prev); - fprintf_unfiltered (gdb_stdlog, " } // legacy with confused type\n"); + fprint_frame (gdb_stdlog, prev_frame); + fprintf_unfiltered (gdb_stdlog, " }\n"); } - return prev; + return prev_frame; } -/* Return a structure containing various interesting information - about the frame that called THIS_FRAME. Returns NULL - if there is no such frame. +/* Debug routine to print a NULL frame being returned. */ - This function tests some target-independent conditions that should - terminate the frame chain, such as unwinding past main(). It - should not contain any target-dependent tests, such as checking - whether the program-counter is zero. */ - -struct frame_info * -get_prev_frame (struct frame_info *this_frame) +static void +frame_debug_got_null_frame (struct ui_file *file, + struct frame_info *this_frame, + const char *reason) { - struct frame_info *prev_frame; - struct frame_id this_id; - if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "{ get_prev_frame (this_frame="); @@ -1743,8 +1105,44 @@ get_prev_frame (struct frame_info *this_frame) fprintf_unfiltered (gdb_stdlog, "%d", this_frame->level); else fprintf_unfiltered (gdb_stdlog, "<NULL>"); - fprintf_unfiltered (gdb_stdlog, ") "); + fprintf_unfiltered (gdb_stdlog, ") -> // %s}\n", reason); } +} + +/* Is this (non-sentinel) frame in the "main"() function? */ + +static int +inside_main_func (struct frame_info *this_frame) +{ + struct minimal_symbol *msymbol; + CORE_ADDR maddr; + + if (symfile_objfile == 0) + return 0; + msymbol = lookup_minimal_symbol (main_name (), NULL, symfile_objfile); + if (msymbol == NULL) + return 0; + /* Make certain that the code, and not descriptor, address is + returned. */ + maddr = gdbarch_convert_from_func_ptr_addr (current_gdbarch, + SYMBOL_VALUE_ADDRESS (msymbol), + ¤t_target); + return maddr == get_frame_func (this_frame); +} + +/* Return a structure containing various interesting information about + the frame that called THIS_FRAME. Returns NULL if there is entier + no such frame or the frame fails any of a set of target-independent + condition that should terminate the frame chain (e.g., as unwinding + past main()). + + This function should not contain target-dependent tests, such as + checking whether the program-counter is zero. */ + +struct frame_info * +get_prev_frame (struct frame_info *this_frame) +{ + struct frame_info *prev_frame; /* Return the inner-most frame, when the caller passes in NULL. */ /* NOTE: cagney/2002-11-09: Not sure how this would happen. The @@ -1757,9 +1155,9 @@ get_prev_frame (struct frame_info *this_frame) while (1) { frame = get_prev_frame (frame); .... }. Ulgh! Why it couldn't be written better, I don't know. - NOTE: cagney/2003-01-11: I suspect what is happening is + NOTE: cagney/2003-01-11: I suspect what is happening in block_innermost_frame() is, when the target has no state - (registers, memory, ...), still calling this function. The + (registers, memory, ...), it is still calling this function. The assumption being that this function will return NULL indicating that a frame isn't possible, rather than checking that the target has state and then calling get_current_frame() and @@ -1778,6 +1176,7 @@ get_prev_frame (struct frame_info *this_frame) Per the above, this code shouldn't even be called with a NULL THIS_FRAME. */ + frame_debug_got_null_frame (gdb_stdlog, this_frame, "this_frame NULL"); return current_frame; } @@ -1786,20 +1185,15 @@ get_prev_frame (struct frame_info *this_frame) get_current_frame(). */ gdb_assert (this_frame != NULL); - /* Make sure we pass an address within THIS_FRAME's code block to - inside_main_func. Otherwise, we might stop unwinding at a - function which has a call instruction as its last instruction if - that function immediately precedes main(). */ if (this_frame->level >= 0 && !backtrace_past_main - && inside_main_func (get_frame_address_in_block (this_frame))) - /* Don't unwind past main(), bug always unwind the sentinel frame. - Note, this is done _before_ the frame has been marked as - previously unwound. That way if the user later decides to - allow unwinds past main(), that just happens. */ + && inside_main_func (this_frame)) + /* Don't unwind past main(). Note, this is done _before_ the + frame has been marked as previously unwound. That way if the + user later decides to enable unwinds past main(), that will + automatically happen. */ { - if (frame_debug) - fprintf_unfiltered (gdb_stdlog, "-> NULL // inside main func }\n"); + frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside main func"); return NULL; } @@ -1810,22 +1204,21 @@ get_prev_frame (struct frame_info *this_frame) /* If we're already inside the entry function for the main objfile, then it isn't valid. Don't apply this test to a dummy frame - - dummy frame PC's typically land in the entry func. Don't apply + dummy frame PCs typically land in the entry func. Don't apply this test to the sentinel frame. Sentinel frames should always be allowed to unwind. */ /* NOTE: cagney/2003-02-25: Don't enable until someone has found hard evidence that this is needed. */ - /* NOTE: cagney/2003-07-07: Fixed a bug in inside_main_func - wasn't - checking for "main" in the minimal symbols. With that fixed - asm-source tests now stop in "main" instead of halting the - backtrace in wierd and wonderful ways somewhere inside the entry - file. Suspect that deprecated_inside_entry_file and - inside_entry_func tests were added to work around that (now - fixed) case. */ + /* NOTE: cagney/2003-07-07: Fixed a bug in inside_main_func() - + wasn't checking for "main" in the minimal symbols. With that + fixed asm-source tests now stop in "main" instead of halting the + backtrace in weird and wonderful ways somewhere inside the entry + file. Suspect that tests for inside the entry file/func were + added to work around that (now fixed) case. */ /* NOTE: cagney/2003-07-15: danielj (if I'm reading it right) suggested having the inside_entry_func test use the - inside_main_func msymbol trick (along with entry_point_address I - guess) to determine the address range of the start function. + inside_main_func() msymbol trick (along with entry_point_address() + I guess) to determine the address range of the start function. That should provide a far better stopper than the current heuristics. */ /* NOTE: cagney/2003-07-15: Need to add a "set backtrace @@ -1835,147 +1228,14 @@ get_prev_frame (struct frame_info *this_frame) #if 0 && backtrace_beyond_entry_func #endif - && this_frame->type != DUMMY_FRAME && this_frame->level >= 0 + && this_frame->unwind->type != DUMMY_FRAME && this_frame->level >= 0 && inside_entry_func (this_frame)) { - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, "// inside entry func }\n"); - } - return NULL; - } - - /* Only try to do the unwind once. */ - if (this_frame->prev_p) - { - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, this_frame->prev); - fprintf_unfiltered (gdb_stdlog, " // cached \n"); - } - return this_frame->prev; - } - this_frame->prev_p = 1; - - /* If we're inside the entry file, it isn't valid. Don't apply this - test to a dummy frame - dummy frame PC's typically land in the - entry file. Don't apply this test to the sentinel frame. - Sentinel frames should always be allowed to unwind. */ - /* NOTE: drow/2002-12-25: should there be a way to disable this - check? It assumes a single small entry file, and the way some - debug readers (e.g. dbxread) figure out which object is the - entry file is somewhat hokey. */ - /* NOTE: cagney/2003-01-10: If there is a way of disabling this test - then it should probably be moved to before the ->prev_p test, - above. */ - /* NOTE: vinschen/2003-04-01: Disabled. It turns out that the call - to deprecated_inside_entry_file destroys a meaningful backtrace - under some conditions. E. g. the backtrace tests in the - asm-source testcase are broken for some targets. In this test - the functions are all implemented as part of one file and the - testcase is not necessarily linked with a start file (depending - on the target). What happens is, that the first frame is printed - normaly and following frames are treated as being inside the - enttry file then. This way, only the #0 frame is printed in the - backtrace output. */ - if (0 - && this_frame->type != DUMMY_FRAME && this_frame->level >= 0 - && deprecated_inside_entry_file (get_frame_pc (this_frame))) - { - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, " // inside entry file }\n"); - } - return NULL; - } - - /* If any of the old frame initialization methods are around, use - the legacy get_prev_frame method. */ - if (legacy_frame_p (current_gdbarch)) - { - prev_frame = legacy_get_prev_frame (this_frame); - return prev_frame; - } - - /* Check that this frame's ID was valid. If it wasn't, don't try to - unwind to the prev frame. Be careful to not apply this test to - the sentinel frame. */ - this_id = get_frame_id (this_frame); - if (this_frame->level >= 0 && !frame_id_p (this_id)) - { - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, NULL); - fprintf_unfiltered (gdb_stdlog, " // this ID is NULL }\n"); - } + frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside entry func"); return NULL; } - /* Check that this frame's ID isn't inner to (younger, below, next) - the next frame. This happens when a frame unwind goes backwards. - Since the sentinel frame doesn't really exist, don't compare the - inner-most against that sentinel. */ - if (this_frame->level > 0 - && frame_id_inner (this_id, get_frame_id (this_frame->next))) - error ("Previous frame inner to this frame (corrupt stack?)"); - - /* Check that this and the next frame are not identical. If they - are, there is most likely a stack cycle. As with the inner-than - test above, avoid comparing the inner-most and sentinel frames. */ - if (this_frame->level > 0 - && frame_id_eq (this_id, get_frame_id (this_frame->next))) - error ("Previous frame identical to this frame (corrupt stack?)"); - - /* Allocate the new frame but do not wire it in to the frame chain. - Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along - frame->next to pull some fancy tricks (of course such code is, by - definition, recursive). Try to prevent it. - - There is no reason to worry about memory leaks, should the - remainder of the function fail. The allocated memory will be - quickly reclaimed when the frame cache is flushed, and the `we've - been here before' check above will stop repeated memory - allocation calls. */ - prev_frame = FRAME_OBSTACK_ZALLOC (struct frame_info); - prev_frame->level = this_frame->level + 1; - - /* Don't yet compute ->unwind (and hence ->type). It is computed - on-demand in get_frame_type, frame_register_unwind, and - get_frame_id. */ - - /* Don't yet compute the frame's ID. It is computed on-demand by - get_frame_id(). */ - - /* The unwound frame ID is validate at the start of this function, - as part of the logic to decide if that frame should be further - unwound, and not here while the prev frame is being created. - Doing this makes it possible for the user to examine a frame that - has an invalid frame ID. - - Some very old VAX code noted: [...] For the sake of argument, - suppose that the stack is somewhat trashed (which is one reason - that "info frame" exists). So, return 0 (indicating we don't - know the address of the arglist) if we don't know what frame this - frame calls. */ - - /* Link it in. */ - this_frame->prev = prev_frame; - prev_frame->next = this_frame; - - if (frame_debug) - { - fprintf_unfiltered (gdb_stdlog, "-> "); - fprint_frame (gdb_stdlog, prev_frame); - fprintf_unfiltered (gdb_stdlog, " }\n"); - } - - return prev_frame; + return get_prev_frame_1 (this_frame); } CORE_ADDR @@ -1999,7 +1259,7 @@ frame_unwind_address_in_block (struct frame_info *next_frame) "call". Adjust that PC value so that it falls on the call instruction (which, hopefully, falls within THIS frame's code block. So far it's proved to be a very good approximation. See - get_frame_type for why ->type can't be used. */ + get_frame_type() for why ->type can't be used. */ if (next_frame->level >= 0 && get_frame_type (next_frame) == NORMAL_FRAME) --pc; @@ -2110,52 +1370,12 @@ frame_relative_level (struct frame_info *fi) enum frame_type get_frame_type (struct frame_info *frame) { - /* Some targets still don't use [generic] dummy frames. Catch them - here. */ - if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES - && deprecated_frame_in_dummy (frame)) - return DUMMY_FRAME; - - /* Some legacy code, e.g, mips_init_extra_frame_info() wants - to determine the frame's type prior to it being completely - initialized. Don't attempt to lazily initialize ->unwind for - legacy code. It will be initialized in legacy_get_prev_frame(). */ - if (frame->unwind == NULL && !legacy_frame_p (current_gdbarch)) - { - /* Initialize the frame's unwinder because it is that which - provides the frame's type. */ - frame->unwind = frame_unwind_find_by_frame (frame->next); - /* FIXME: cagney/2003-04-02: Rather than storing the frame's - type in the frame, the unwinder's type should be returned - directly. Unfortunately, legacy code, called by - legacy_get_prev_frame, explicitly set the frames type using - the method deprecated_set_frame_type(). */ - frame->type = frame->unwind->type; - } - if (frame->type == UNKNOWN_FRAME) - return NORMAL_FRAME; - else - return frame->type; -} - -void -deprecated_set_frame_type (struct frame_info *frame, enum frame_type type) -{ - /* Arrrg! See comment in "frame.h". */ - frame->type = type; -} - -struct frame_extra_info * -get_frame_extra_info (struct frame_info *fi) -{ - return fi->extra_info; -} - -struct frame_extra_info * -frame_extra_info_zalloc (struct frame_info *fi, long size) -{ - fi->extra_info = frame_obstack_zalloc (size); - return fi->extra_info; + if (frame->unwind == NULL) + /* Initialize the frame's unwinder because that's what + provides the frame's type. */ + frame->unwind = frame_unwind_find_by_frame (frame->next, + &frame->prologue_cache); + return frame->unwind->type; } void @@ -2166,7 +1386,7 @@ deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc) "{ deprecated_update_frame_pc_hack (frame=%d,pc=0x%s) }\n", frame->level, paddr_nz (pc)); /* NOTE: cagney/2003-03-11: Some architectures (e.g., Arm) are - maintaining a locally allocated frame object. Since such frame's + maintaining a locally allocated frame object. Since such frames are not in the frame chain, it isn't possible to assume that the frame has a next. Sigh. */ if (frame->next != NULL) @@ -2190,27 +1410,6 @@ deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base) frame->this_id.value.stack_addr = base; } -struct frame_info * -deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs, - long sizeof_extra_info) -{ - struct frame_info *frame = XMALLOC (struct frame_info); - memset (frame, 0, sizeof (*frame)); - frame->this_id.p = 1; - make_cleanup (xfree, frame); - if (sizeof_saved_regs > 0) - { - frame->saved_regs = xcalloc (1, sizeof_saved_regs); - make_cleanup (xfree, frame->saved_regs); - } - if (sizeof_extra_info > 0) - { - frame->extra_info = xcalloc (1, sizeof_extra_info); - make_cleanup (xfree, frame->extra_info); - } - return frame; -} - /* Memory access methods. */ void @@ -2234,6 +1433,14 @@ get_frame_memory_unsigned (struct frame_info *this_frame, CORE_ADDR addr, return read_memory_unsigned_integer (addr, len); } +int +safe_frame_unwind_memory (struct frame_info *this_frame, + CORE_ADDR addr, void *buf, int len) +{ + /* NOTE: deprecated_read_memory_nobpt returns zero on success! */ + return !deprecated_read_memory_nobpt (addr, buf, len); +} + /* Architecture method. */ struct gdbarch * @@ -2253,12 +1460,12 @@ get_frame_sp (struct frame_info *this_frame) CORE_ADDR frame_sp_unwind (struct frame_info *next_frame) { - /* Normality, an architecture that provides a way of obtaining any + /* Normality - an architecture that provides a way of obtaining any frame inner-most address. */ if (gdbarch_unwind_sp_p (current_gdbarch)) return gdbarch_unwind_sp (current_gdbarch, next_frame); /* Things are looking grim. If it's the inner-most frame and there - is a TARGET_READ_SP then that can be used. */ + is a TARGET_READ_SP, then that can be used. */ if (next_frame->level < 0 && TARGET_READ_SP_P ()) return TARGET_READ_SP (); /* Now things are really are grim. Hope that the value returned by @@ -2272,34 +1479,6 @@ frame_sp_unwind (struct frame_info *next_frame) internal_error (__FILE__, __LINE__, "Missing unwind SP method"); } - -int -legacy_frame_p (struct gdbarch *current_gdbarch) -{ - if (DEPRECATED_INIT_FRAME_PC_P () - || DEPRECATED_INIT_FRAME_PC_FIRST_P () - || DEPRECATED_INIT_EXTRA_FRAME_INFO_P () - || DEPRECATED_FRAME_CHAIN_P ()) - /* No question, it's a legacy frame. */ - return 1; - if (gdbarch_unwind_dummy_id_p (current_gdbarch)) - /* No question, it's not a legacy frame (provided none of the - deprecated methods checked above are present that is). */ - return 0; - if (DEPRECATED_TARGET_READ_FP_P () - || DEPRECATED_FP_REGNUM >= 0) - /* Assume it's legacy. If you're trying to convert a legacy frame - target to the new mechanism, get rid of these. legacy - get_prev_frame requires these when unwind_frame_id isn't - available. */ - return 1; - /* Default to assuming that it's brand new code, and hence not - legacy. Force it down the non-legacy path so that the new code - uses the new frame mechanism from day one. Dummy frame's won't - work very well but we can live with that. */ - return 0; -} - extern initialize_file_ftype _initialize_frame; /* -Wmissing-prototypes */ static struct cmd_list_element *set_backtrace_cmdlist; @@ -2322,6 +1501,8 @@ _initialize_frame (void) { obstack_init (&frame_cache_obstack); + observer_attach_target_changed (frame_observer_target_changed); + add_prefix_cmd ("backtrace", class_maintenance, set_backtrace_cmd, "\ Set backtrace specific variables.\n\ Configure backtrace variables such as the backtrace limit", @@ -2335,29 +1516,29 @@ Show backtrace variables such as the backtrace limit", add_setshow_boolean_cmd ("past-main", class_obscure, &backtrace_past_main, "\ -Set whether backtraces should continue past \"main\".\n\ +Set whether backtraces should continue past \"main\".", "\ +Show whether backtraces should continue past \"main\".", "\ Normally the caller of \"main\" is not of interest, so GDB will terminate\n\ the backtrace at \"main\". Set this variable if you need to see the rest\n\ of the stack trace.", "\ -Show whether backtraces should continue past \"main\".\n\ -Normally the caller of \"main\" is not of interest, so GDB will terminate\n\ -the backtrace at \"main\". Set this variable if you need to see the rest\n\ -of the stack trace.", +Whether backtraces should continue past \"main\" is %s.", NULL, NULL, &set_backtrace_cmdlist, &show_backtrace_cmdlist); add_setshow_uinteger_cmd ("limit", class_obscure, &backtrace_limit, "\ -Set an upper bound on the number of backtrace levels.\n\ +Set an upper bound on the number of backtrace levels.", "\ +Show the upper bound on the number of backtrace levels.", "\ No more than the specified number of frames can be displayed or examined.\n\ Zero is unlimited.", "\ -Show the upper bound on the number of backtrace levels.", +An upper bound on the number of backtrace levels is %s.", NULL, NULL, &set_backtrace_cmdlist, &show_backtrace_cmdlist); /* Debug this files internals. */ - add_show_from_set (add_set_cmd ("frame", class_maintenance, var_zinteger, - &frame_debug, "Set frame debugging.\n\ + deprecated_add_show_from_set + (add_set_cmd ("frame", class_maintenance, var_zinteger, + &frame_debug, "Set frame debugging.\n\ When non-zero, frame specific internal debugging is enabled.", &setdebuglist), - &showdebuglist); + &showdebuglist); } diff --git a/gnu/usr.bin/binutils/gdb/frame.h b/gnu/usr.bin/binutils/gdb/frame.h index 0cdae6d31dc..f4b10891b46 100644 --- a/gnu/usr.bin/binutils/gdb/frame.h +++ b/gnu/usr.bin/binutils/gdb/frame.h @@ -40,8 +40,8 @@ strongly hinting at its unsafeness) safe_....(): Safer version of various functions, doesn't throw an - error (leave this for later?). Returns non-zero if the fetch - succeeds. Return a freshly allocated error message? + error (leave this for later?). Returns non-zero / non-NULL if the + request succeeds, zero / NULL otherwize. Suffixes: @@ -71,10 +71,6 @@ struct block; struct gdbarch; struct ui_file; -/* A legacy unwinder to prop up architectures using the old style - saved regs array. */ -extern const struct frame_unwind *legacy_saved_regs_unwind; - /* The frame object. */ struct frame_info; @@ -94,23 +90,39 @@ struct frame_id outer-most address (the inner-most address of the previous frame) is used. Watch out for all the legacy targets that still use the function pointer register or stack pointer register. They are - wrong. */ + wrong. + + This field is valid only if stack_addr_p is true. Otherwise, this + frame represents the null frame. */ CORE_ADDR stack_addr; + /* The frame's code address. This shall be constant through out the lifetime of the frame. While the PC (a.k.a. resume address) changes as the function is executed, this code address cannot. Typically, it is set to the address of the entry point of the - frame's function (as returned by frame_func_unwind(). */ + frame's function (as returned by frame_func_unwind(). + + This field is valid only if code_addr_p is true. Otherwise, this + frame is considered to have a wildcard code address, i.e. one that + matches every address value in frame comparisons. */ CORE_ADDR code_addr; + /* The frame's special address. This shall be constant through out the lifetime of the frame. This is used for architectures that may have frames that do not change the stack but are still distinct and have some form of distinct identifier (e.g. the ia64 which uses a 2nd stack for registers). This field is treated as unordered - i.e. will not be used in frame ordering comparisons such as frame_id_inner(). - A zero in this field will be treated as a wild-card when comparing - frames for equality. */ + + This field is valid only if special_addr_p is true. Otherwise, this + frame is considered to have a wildcard special address, i.e. one that + matches every address value in frame comparisons. */ CORE_ADDR special_addr; + + /* Flags to indicate the above fields have valid contents. */ + unsigned int stack_addr_p : 1; + unsigned int code_addr_p : 1; + unsigned int special_addr_p : 1; }; /* Methods for constructing and comparing Frame IDs. @@ -135,22 +147,24 @@ extern const struct frame_id null_frame_id; /* Construct a frame ID. The first parameter is the frame's constant stack address (typically the outer-bound), and the second the - frame's constant code address (typically the entry point) (or zero, - to indicate a wild card). The special identifier address is - defaulted to zero. */ + frame's constant code address (typically the entry point). + The special identifier address is set to indicate a wild card. */ extern struct frame_id frame_id_build (CORE_ADDR stack_addr, CORE_ADDR code_addr); /* Construct a special frame ID. The first parameter is the frame's constant stack address (typically the outer-bound), the second is the - frame's constant code address (typically the entry point) (or zero, - to indicate a wild card), and the third parameter is the frame's - special identifier address (or zero to indicate a wild card or - unused default). */ + frame's constant code address (typically the entry point), + and the third parameter is the frame's special identifier address. */ extern struct frame_id frame_id_build_special (CORE_ADDR stack_addr, CORE_ADDR code_addr, CORE_ADDR special_addr); +/* Construct a wild card frame ID. The parameter is the frame's constant + stack address (typically the outer-bound). The code address as well + as the special identifier address are set to indicate wild cards. */ +extern struct frame_id frame_id_build_wild (CORE_ADDR stack_addr); + /* Returns non-zero when L is a valid frame (a valid frame has a non-zero .base). */ extern int frame_id_p (struct frame_id l); @@ -175,7 +189,7 @@ extern void fprint_frame_id (struct ui_file *file, struct frame_id id); CLI (selected using `up', `down', ...). The frames are created on-demand (via get_prev_frame()) and then held in a frame cache. */ /* FIXME: cagney/2002-11-28: Er, there is a lie here. If you do the - sequence: `thread 1; up; thread 2; thread 1' you loose thread 1's + sequence: `thread 1; up; thread 2; thread 1' you lose thread 1's selected frame. At present GDB only tracks the selected frame of the current thread. But be warned, that might change. */ /* FIXME: cagney/2002-11-14: At any time, only one thread's selected @@ -193,11 +207,11 @@ extern struct frame_info *get_current_frame (void); FIXME: cagney/2002-11-28: The only difference between flush_cached_frames() and reinit_frame_cache() is that the latter - explicitly sets the selected frame back to the current frame there + explicitly sets the selected frame back to the current frame -- there isn't any real difference (except that one delays the selection of a new frame). Code can instead simply rely on get_selected_frame() - to reinit's the selected frame as needed. As for invalidating the - cache, there should be two methods one that reverts the thread's + to reinit the selected frame as needed. As for invalidating the + cache, there should be two methods: one that reverts the thread's selected frame back to current frame (for when the inferior resumes) and one that does not (for when the user modifies the target invalidating the frame cache). */ @@ -234,7 +248,7 @@ extern struct frame_info *frame_find_by_id (struct frame_id id); This replaced: frame->pc; */ extern CORE_ADDR get_frame_pc (struct frame_info *); -/* An address (not necessarily alligned to an instruction boundary) +/* An address (not necessarily aligned to an instruction boundary) that falls within THIS frame's code block. When a function call is the last statement in a block, the return @@ -267,8 +281,8 @@ extern CORE_ADDR get_frame_func (struct frame_info *fi); attributes that are determined by the PC. Note that for a normal frame, the PC refers to the resume address after the return, and not the call instruction. In such a case, the address is adjusted - so that it (approximatly) identifies the call site (and not return - site). + so that it (approximately) identifies the call site (and not the + return site). NOTE: cagney/2002-11-28: The frame cache could be used to cache the computed value. Working on the assumption that the bottle-neck is @@ -310,8 +324,24 @@ extern CORE_ADDR get_frame_base (struct frame_info *); /* Return the per-frame unique identifer. Can be used to relocate a frame after a frame cache flush (and other similar operations). If - FI is NULL, return the null_frame_id. */ + FI is NULL, return the null_frame_id. + + NOTE: kettenis/20040508: These functions return a structure. On + platforms where structures are returned in static storage (vax, + m68k), this may trigger compiler bugs in code like: + + if (frame_id_eq (get_frame_id (l), get_frame_id (r))) + + where the return value from the first get_frame_id (l) gets + overwritten by the second get_frame_id (r). Please avoid writing + code like this. Use code like: + + struct frame_id id = get_frame_id (l); + if (frame_id_eq (id, get_frame_id (r))) + + instead, since that avoids the bug. */ extern struct frame_id get_frame_id (struct frame_info *fi); +extern struct frame_id frame_unwind_id (struct frame_info *next_frame); /* Assuming that a frame is `normal', return its base-address, or 0 if the information isn't available. NOTE: This address is really only @@ -341,11 +371,6 @@ extern int frame_relative_level (struct frame_info *fi); enum frame_type { - /* The frame's type hasn't yet been defined. This is a catch-all - for legacy code that uses really strange technicques, such as - deprecated_set_frame_type, to set the frame's type. New code - should not use this value. */ - UNKNOWN_FRAME, /* A true stack frame, created by the target program during normal execution. */ NORMAL_FRAME, @@ -354,23 +379,13 @@ enum frame_type DUMMY_FRAME, /* In a signal handler, various OSs handle this in various ways. The main thing is that the frame may be far from normal. */ - SIGTRAMP_FRAME + SIGTRAMP_FRAME, + /* Sentinel or registers frame. This frame obtains register values + direct from the inferior's registers. */ + SENTINEL_FRAME }; extern enum frame_type get_frame_type (struct frame_info *); -/* FIXME: cagney/2002-11-10: Some targets want to directly mark a - frame as being of a specific type. This shouldn't be necessary. - PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and - DEPRECATED_PC_IN_CALL_DUMMY() indicates a DUMMY_FRAME. I suspect - the real problem here is that get_prev_frame() only sets - initialized after DEPRECATED_INIT_EXTRA_FRAME_INFO as been called. - Consequently, some targets found that the frame's type was wrong - and tried to fix it. The correct fix is to modify get_prev_frame() - so that it initializes the frame's type before calling any other - functions. */ -extern void deprecated_set_frame_type (struct frame_info *, - enum frame_type type); - /* Unwind the stack frame so that the value of REGNUM, in the previous (up, older) frame is returned. If VALUEP is NULL, don't fetch/compute the value. Instead just return the location of the @@ -405,7 +420,7 @@ extern void frame_unwind_unsigned_register (struct frame_info *frame, int regnum, ULONGEST *val); /* Get the value of the register that belongs to this FRAME. This - function is a wrapper to the call sequence ``frame_unwind_register + function is a wrapper to the call sequence ``frame_register_unwind (get_next_frame (FRAME))''. As per frame_register_unwind(), if VALUEP is NULL, the registers value is not fetched/computed. */ @@ -460,12 +475,17 @@ extern LONGEST get_frame_memory_signed (struct frame_info *this_frame, extern ULONGEST get_frame_memory_unsigned (struct frame_info *this_frame, CORE_ADDR memaddr, int len); +/* Same as above, but return non-zero when the entire memory read + succeeds, zero otherwize. */ +extern int safe_frame_unwind_memory (struct frame_info *this_frame, + CORE_ADDR addr, void *buf, int len); + /* Return this frame's architecture. */ extern struct gdbarch *get_frame_arch (struct frame_info *this_frame); -/* Values for the source flag to be used in print_frame_info_base(). */ +/* Values for the source flag to be used in print_frame_info_base(). */ enum print_what { /* Print only the source line, like in stepi. */ @@ -482,7 +502,7 @@ enum print_what /* Allocate additional space for appendices to a struct frame_info. NOTE: Much of GDB's code works on the assumption that the allocated saved_regs[] array is the size specified below. If you try to make - that array smaller, GDB will happily walk off its end. */ + that array smaller, GDB will happily walk off its end. */ #ifdef SIZEOF_FRAME_SAVED_REGS #error "SIZEOF_FRAME_SAVED_REGS can not be re-defined" @@ -498,16 +518,8 @@ extern void *frame_obstack_zalloc (unsigned long size); #define FRAME_OBSTACK_ZALLOC(TYPE) ((TYPE *) frame_obstack_zalloc (sizeof (TYPE))) #define FRAME_OBSTACK_CALLOC(NUMBER,TYPE) ((TYPE *) frame_obstack_zalloc ((NUMBER) * sizeof (TYPE))) -/* If legacy_frame_chain_valid() returns zero it means that the given - frame is the outermost one and has no caller. - - This method has been superseeded by the per-architecture - frame_unwind_pc() (returns 0 to indicate an invalid return address) - and per-frame this_id() (returns a NULL frame ID to indicate an - invalid frame). */ -extern int legacy_frame_chain_valid (CORE_ADDR, struct frame_info *); - -extern void generic_save_dummy_frame_tos (CORE_ADDR sp); +/* Create a regcache, and copy the frame's registers into it. */ +struct regcache *frame_save_as_regcache (struct frame_info *this_frame); extern struct block *get_frame_block (struct frame_info *, CORE_ADDR *addr_in_block); @@ -525,7 +537,7 @@ extern struct block *get_frame_block (struct frame_info *, Should it look at the most recently specified SAL? If the target has no state, should this function try to extract a block from the most recently selected SAL? That way `list foo' would give it some - sort of reference point. Then again, perhaphs that would confuse + sort of reference point. Then again, perhaps that would confuse things. Calls to this function can be broken down into two categories: Code @@ -535,7 +547,7 @@ extern struct block *get_frame_block (struct frame_info *, The latter can be eliminated by correctly parameterizing the code, the former though is more interesting. Per the "address" command, - it occures in the CLI code and makes it possible for commands to + it occurs in the CLI code and makes it possible for commands to work, even when the inferior has no state. */ extern struct block *get_selected_block (CORE_ADDR *addr_in_block); @@ -544,49 +556,22 @@ extern struct symbol *get_frame_function (struct frame_info *); extern CORE_ADDR get_pc_function_start (CORE_ADDR); -extern int legacy_frameless_look_for_prologue (struct frame_info *); - extern struct frame_info *find_relative_frame (struct frame_info *, int *); -extern void show_and_print_stack_frame (struct frame_info *fi, int level, - int source); +extern void show_and_print_stack_frame (struct frame_info *fi, int print_level, + enum print_what print_what); -extern void print_stack_frame (struct frame_info *, int, int); +extern void print_stack_frame (struct frame_info *, int print_level, + enum print_what print_what); extern void show_stack_frame (struct frame_info *); -extern void print_frame_info (struct frame_info *, int, int, int); - -extern void show_frame_info (struct frame_info *, int, int, int); +extern void print_frame_info (struct frame_info *, int print_level, + enum print_what print_what, int args); extern struct frame_info *block_innermost_frame (struct block *); -/* NOTE: cagney/2002-09-13: There is no need for this function. */ -extern CORE_ADDR deprecated_read_register_dummy (CORE_ADDR pc, - CORE_ADDR fp, int); -extern void generic_push_dummy_frame (void); -extern void generic_pop_current_frame (void (*)(struct frame_info *)); -extern void generic_pop_dummy_frame (void); - -extern int generic_pc_in_call_dummy (CORE_ADDR pc, - CORE_ADDR sp, CORE_ADDR fp); - -/* NOTE: cagney/2002-06-26: Targets should no longer use this - function. Instead, the contents of a dummy frames registers can be - obtained by applying: frame_register_unwind to the dummy frame; or - frame_register_unwind() to the next outer frame. */ - -extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp); - - -/* The DEPRECATED_GET_SAVED_REGISTER architecture interface is - entirely redundant. New architectures should implement per-frame - unwinders (ref "frame-unwind.h"). */ -extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *, - struct frame_info *, int, - enum lval_type *); - -extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi); +extern int deprecated_pc_in_call_dummy (CORE_ADDR pc); /* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a function called get_frame_register_p(). This slightly weird (and @@ -606,7 +591,7 @@ extern void args_info (char *, int); extern void locals_info (char *, int); -extern void (*selected_frame_level_changed_hook) (int); +extern void (*deprecated_selected_frame_level_changed_hook) (int); extern void return_command (char *, int); @@ -619,11 +604,11 @@ extern void return_command (char *, int); Unfortunately, it isn't that easy. The relevant code needs to be audited to determine if it is - possible (or pratical) to instead pass the applicable frame in as a + possible (or practical) to instead pass the applicable frame in as a parameter. For instance, DEPRECATED_DO_REGISTERS_INFO() relied on the deprecated_selected_frame global, while its replacement, PRINT_REGISTERS_INFO(), is parameterized with the selected frame. - The only real exceptions occure at the edge (in the CLI code) where + The only real exceptions occur at the edge (in the CLI code) where user commands need to pick up the selected frame before proceeding. This is important. GDB is trying to stamp out the hack: @@ -655,22 +640,6 @@ extern struct frame_info *deprecated_safe_get_selected_frame (void); extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc); - -/* Create/access the frame's `extra info'. The extra info is used by - older code to store information such as the analyzed prologue. The - zalloc() should only be called by the INIT_EXTRA_INFO method. */ - -extern struct frame_extra_info *frame_extra_info_zalloc (struct frame_info *fi, - long size); -extern struct frame_extra_info *get_frame_extra_info (struct frame_info *fi); - -/* Create/access the frame's `saved_regs'. The saved regs are used by - older code to store the address of each register (except for - SP_REGNUM where the value of the register in the previous frame is - stored). */ -extern CORE_ADDR *frame_saved_regs_zalloc (struct frame_info *); -extern CORE_ADDR *deprecated_get_frame_saved_regs (struct frame_info *); - /* FIXME: cagney/2002-12-06: Has the PC in the current frame changed? "infrun.c", Thanks to DECR_PC_AFTER_BREAK, can change the PC after the initial frame create. This puts things back in sync. @@ -681,7 +650,7 @@ extern void deprecated_update_frame_pc_hack (struct frame_info *frame, /* FIXME: cagney/2002-12-18: Has the frame's base changed? Or to be more exact, was that initial guess at the frame's base as returned - by deprecated_read_fp() wrong? If it was, fix it. This shouldn't + by the deleted read_fp() wrong? If it was, fix it. This shouldn't be necessary since the code should be getting the frame's base correct from the outset. @@ -689,17 +658,4 @@ extern void deprecated_update_frame_pc_hack (struct frame_info *frame, extern void deprecated_update_frame_base_hack (struct frame_info *frame, CORE_ADDR base); -/* FIXME: cagney/2003-01-05: Allocate a frame, along with the - saved_regs and extra_info. Set up cleanups for all three. Same as - for deprecated_frame_xmalloc, targets are calling this when - creating a scratch `struct frame_info'. The frame overhaul makes - this unnecessary since all frame queries are parameterized with a - common cache parameter and a frame. */ -extern struct frame_info *deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs, - long sizeof_extra_info); - -/* Return non-zero if the architecture is relying on legacy frame - code. */ -extern int legacy_frame_p (struct gdbarch *gdbarch); - #endif /* !defined (FRAME_H) */ diff --git a/gnu/usr.bin/binutils/gdb/gdb.1 b/gnu/usr.bin/binutils/gdb/gdb.1 index e0a32193275..9b90fa88981 100644 --- a/gnu/usr.bin/binutils/gdb/gdb.1 +++ b/gnu/usr.bin/binutils/gdb/gdb.1 @@ -1,6 +1,6 @@ .\" Copyright 1991, 1999 Free Software Foundation, Inc. .\" See section COPYING for conditions for redistribution -.\" $Id: gdb.1,v 1.3 2004/05/21 20:23:07 kettenis Exp $ +.\" $Id: gdb.1,v 1.4 2004/12/27 14:00:35 kettenis Exp $ .TH gdb 1 "22may2002" "GNU Tools" "GNU Tools" .SH NAME gdb \- The GNU Debugger diff --git a/gnu/usr.bin/binutils/gdb/gdbcmd.h b/gnu/usr.bin/binutils/gdb/gdbcmd.h index 8c4490ec940..9dabd2c6587 100644 --- a/gnu/usr.bin/binutils/gdb/gdbcmd.h +++ b/gnu/usr.bin/binutils/gdb/gdbcmd.h @@ -98,6 +98,14 @@ extern struct cmd_list_element *maintenanceinfolist; extern struct cmd_list_element *maintenanceprintlist; +/* Chain containing all defined "maintenance set" subcommands. */ + +extern struct cmd_list_element *maintenance_set_cmdlist; + +/* Chain containing all defined "maintenance show" subcommands. */ + +extern struct cmd_list_element *maintenance_show_cmdlist; + extern struct cmd_list_element *setprintlist; extern struct cmd_list_element *showprintlist; diff --git a/gnu/usr.bin/binutils/gdb/gdbcore.h b/gnu/usr.bin/binutils/gdb/gdbcore.h index e03ebf47fa7..734e7dfc760 100644 --- a/gnu/usr.bin/binutils/gdb/gdbcore.h +++ b/gnu/usr.bin/binutils/gdb/gdbcore.h @@ -1,6 +1,8 @@ /* Machine independent variables that describe the core file under GDB. - Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, + 1996, 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, + Inc. This file is part of GDB. @@ -43,7 +45,12 @@ extern int have_core_file_p (void); address out of bounds. If breakpoints are inserted, returns shadow contents, not the breakpoints themselves. From breakpoint.c. */ -extern int read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len); +/* NOTE: cagney/2004-06-10: Code reading from a live inferior can use + the get_frame_memory methods, code reading from an exec can use the + target methods. */ + +extern int deprecated_read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, + unsigned len); /* Report a memory error with error(). */ @@ -96,12 +103,12 @@ extern void generic_search (int len, char *data, char *mask, /* Hook for `exec_file_command' command to call. */ -extern void (*exec_file_display_hook) (char *filename); +extern void (*deprecated_exec_file_display_hook) (char *filename); /* Hook for "file_command", which is more useful than above (because it is invoked AFTER symbols are read, not before) */ -extern void (*file_changed_hook) (char *filename); +extern void (*deprecated_file_changed_hook) (char *filename); extern void specify_exec_file_hook (void (*hook) (char *filename)); @@ -194,15 +201,18 @@ struct core_fns unsigned core_reg_size, int which, CORE_ADDR reg_addr); - /* Finds the next struct core_fns. They are allocated and initialized - in whatever module implements the functions pointed to; an - initializer calls add_core_fns to add them to the global chain. */ + /* Finds the next struct core_fns. They are allocated and + initialized in whatever module implements the functions pointed + to; an initializer calls deprecated_add_core_fns to add them to + the global chain. */ struct core_fns *next; }; -extern void add_core_fns (struct core_fns *cf); +/* NOTE: cagney/2004-04-05: Replaced by "regset.h" and + regset_from_core_section(). */ +extern void deprecated_add_core_fns (struct core_fns *cf); extern int default_core_sniffer (struct core_fns *cf, bfd * abfd); extern int default_check_format (bfd * abfd); diff --git a/gnu/usr.bin/binutils/gdb/gdbserver/Makefile.in b/gnu/usr.bin/binutils/gdb/gdbserver/Makefile.in index 3af7eb46180..712376157ff 100644 --- a/gnu/usr.bin/binutils/gdb/gdbserver/Makefile.in +++ b/gnu/usr.bin/binutils/gdb/gdbserver/Makefile.in @@ -103,6 +103,7 @@ INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \ # LDFLAGS is specifically reserved for setting from the command line # when running make. LDFLAGS = @LDFLAGS@ +INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@ # Perhaps should come from parent Makefile VERSION = gdbserver-4.12.3 @@ -171,19 +172,19 @@ clean-info: gdbserver: $(OBS) ${ADD_DEPS} ${CDEPS} rm -f gdbserver - ${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbserver $(OBS) \ + ${CC-LD} $(GLOBAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver $(OBS) \ $(GDBSERVER_LIBS) $(XM_CLIBS) gdbreplay: gdbreplay.o rm -f gdbreplay - ${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbreplay gdbreplay.o \ + ${CC-LD} $(GLOBAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay gdbreplay.o \ $(XM_CLIBS) # Put the proper machine-specific files first, so M-. on a machine # specific routine gets the one for the correct machine. # The xyzzy stuff below deals with empty DEPFILES TAGS: ${TAGFILES} - etags `find ${srcdir}/../config -name $(TM_FILE) -print` \ + etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \ `find ${srcdir}/../config -name ${XM_FILE} -print` \ `find ${srcdir}/../config -name ${NAT_FILE} -print` \ `for i in yzzy ${DEPFILES}; do \ diff --git a/gnu/usr.bin/binutils/gdb/gdbserver/configure.in b/gnu/usr.bin/binutils/gdb/gdbserver/configure.in index a5a34dfbda0..027699a6063 100644 --- a/gnu/usr.bin/binutils/gdb/gdbserver/configure.in +++ b/gnu/usr.bin/binutils/gdb/gdbserver/configure.in @@ -1,5 +1,5 @@ dnl Autoconf configure script for GDB server. -dnl Copyright 2000, 2002 Free Software Foundation, Inc. +dnl Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc. dnl dnl This file is part of GDB. dnl @@ -114,6 +114,11 @@ if test "$srv_linux_thread_db" = "yes"; then else srv_libs="$srv_cv_thread_db" fi + old_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -rdynamic" + AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=]) + AC_SUBST(RDYNAMIC) + LDFLAGS="$old_LDFLAGS" fi if test "$srv_linux_thread_db" = "yes"; then diff --git a/gnu/usr.bin/binutils/gdb/gdbserver/remote-utils.c b/gnu/usr.bin/binutils/gdb/gdbserver/remote-utils.c index 26b267a3aaf..0d2bdef06a0 100644 --- a/gnu/usr.bin/binutils/gdb/gdbserver/remote-utils.c +++ b/gnu/usr.bin/binutils/gdb/gdbserver/remote-utils.c @@ -37,6 +37,17 @@ #include <unistd.h> #include <arpa/inet.h> +/* A cache entry for a successfully looked-up symbol. */ +struct sym_cache +{ + const char *name; + CORE_ADDR addr; + struct sym_cache *next; +}; + +/* The symbol cache. */ +static struct sym_cache *symbol_cache; + int remote_debug = 0; struct ui_file *gdb_stdlog; @@ -353,13 +364,14 @@ input_interrupt (int unused) if (select (remote_desc + 1, &readset, 0, 0, &immediate) > 0) { int cc; - char c; + char c = 0; cc = read (remote_desc, &c, 1); if (cc != 1 || c != '\003') { - fprintf (stderr, "input_interrupt, cc = %d c = %d\n", cc, c); + fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n", + cc, c, c); return; } @@ -385,16 +397,33 @@ unblock_async_io (void) sigprocmask (SIG_UNBLOCK, &sigio_set, NULL); } +/* Asynchronous I/O support. SIGIO must be enabled when waiting, in order to + accept Control-C from the client, and must be disabled when talking to + the client. */ + +/* Current state of asynchronous I/O. */ +static int async_io_enabled; + +/* Enable asynchronous I/O. */ void enable_async_io (void) { + if (async_io_enabled) + return; + signal (SIGIO, input_interrupt); + async_io_enabled = 1; } +/* Disable asynchronous I/O. */ void disable_async_io (void) { + if (!async_io_enabled) + return; + signal (SIGIO, SIG_IGN); + async_io_enabled = 0; } /* Returns next char from remote GDB. -1 if error. */ @@ -692,11 +721,23 @@ decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr, convert_ascii_to_int (&from[i++], to, *len_ptr); } +/* Ask GDB for the address of NAME, and return it in ADDRP if found. + Returns 1 if the symbol is found, 0 if it is not, -1 on error. */ + int look_up_one_symbol (const char *name, CORE_ADDR *addrp) { char own_buf[266], *p, *q; int len; + struct sym_cache *sym; + + /* Check the cache first. */ + for (sym = symbol_cache; sym; sym = sym->next) + if (strcmp (name, sym->name) == 0) + { + *addrp = sym->addr; + return 1; + } /* Send the request. */ strcpy (own_buf, "qSymbol:"); @@ -731,6 +772,13 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp) return 0; decode_address (addrp, p, q - p); + + /* Save the symbol in our cache. */ + sym = malloc (sizeof (*sym)); + sym->name = strdup (name); + sym->addr = *addrp; + sym->next = symbol_cache; + symbol_cache = sym; + return 1; } - diff --git a/gnu/usr.bin/binutils/gdb/gdbthread.h b/gnu/usr.bin/binutils/gdb/gdbthread.h index 09dea26ca8c..c58a38eab67 100644 --- a/gnu/usr.bin/binutils/gdb/gdbthread.h +++ b/gnu/usr.bin/binutils/gdb/gdbthread.h @@ -45,11 +45,9 @@ struct thread_info /* State from wait_for_inferior */ CORE_ADDR prev_pc; struct breakpoint *step_resume_breakpoint; - struct breakpoint *through_sigtramp_breakpoint; CORE_ADDR step_range_start; CORE_ADDR step_range_end; struct frame_id step_frame_id; - CORE_ADDR step_sp; int current_line; struct symtab *current_symtab; int trap_expected; @@ -67,10 +65,6 @@ struct thread_info when we finally do stop stepping. */ bpstat stepping_through_solib_catchpoints; - /* This is set to TRUE when this thread is in a signal handler - trampoline and we're single-stepping through it. */ - int stepping_through_sigtramp; - /* Private data used by the target vector implementation. */ struct private_thread_info *private; }; @@ -118,7 +112,6 @@ extern void save_infrun_state (ptid_t ptid, CORE_ADDR prev_pc, int trap_expected, struct breakpoint *step_resume_breakpoint, - struct breakpoint *through_sigtramp_breakpoint, CORE_ADDR step_range_start, CORE_ADDR step_range_end, const struct frame_id *step_frame_id, @@ -126,10 +119,8 @@ extern void save_infrun_state (ptid_t ptid, int another_trap, int stepping_through_solib_after_catch, bpstat stepping_through_solib_catchpoints, - int stepping_through_sigtramp, int current_line, - struct symtab *current_symtab, - CORE_ADDR step_sp); + struct symtab *current_symtab); /* infrun context switch: load the debugger state previously saved for the given thread. */ @@ -137,7 +128,6 @@ extern void load_infrun_state (ptid_t ptid, CORE_ADDR *prev_pc, int *trap_expected, struct breakpoint **step_resume_breakpoint, - struct breakpoint **through_sigtramp_breakpoint, CORE_ADDR *step_range_start, CORE_ADDR *step_range_end, struct frame_id *step_frame_id, @@ -145,10 +135,8 @@ extern void load_infrun_state (ptid_t ptid, int *another_trap, int *stepping_through_solib_affter_catch, bpstat *stepping_through_solib_catchpoints, - int *stepping_through_sigtramp, int *current_line, - struct symtab **current_symtab, - CORE_ADDR *step_sp); + struct symtab **current_symtab); /* Commands with a prefix of `thread'. */ extern struct cmd_list_element *thread_cmd_list; diff --git a/gnu/usr.bin/binutils/gdb/gdbtypes.c b/gnu/usr.bin/binutils/gdb/gdbtypes.c index 1349ffbbe19..f8604bc151a 100644 --- a/gnu/usr.bin/binutils/gdb/gdbtypes.c +++ b/gnu/usr.bin/binutils/gdb/gdbtypes.c @@ -97,8 +97,10 @@ struct type *builtin_type_vec64; struct type *builtin_type_vec64i; struct type *builtin_type_vec128; struct type *builtin_type_vec128i; +struct type *builtin_type_ieee_single[BFD_ENDIAN_UNKNOWN]; struct type *builtin_type_ieee_single_big; struct type *builtin_type_ieee_single_little; +struct type *builtin_type_ieee_double[BFD_ENDIAN_UNKNOWN]; struct type *builtin_type_ieee_double_big; struct type *builtin_type_ieee_double_little; struct type *builtin_type_ieee_double_littlebyte_bigword; @@ -107,10 +109,13 @@ struct type *builtin_type_m68881_ext; struct type *builtin_type_i960_ext; struct type *builtin_type_m88110_ext; struct type *builtin_type_m88110_harris_ext; +struct type *builtin_type_arm_ext[BFD_ENDIAN_UNKNOWN]; struct type *builtin_type_arm_ext_big; struct type *builtin_type_arm_ext_littlebyte_bigword; +struct type *builtin_type_ia64_spill[BFD_ENDIAN_UNKNOWN]; struct type *builtin_type_ia64_spill_big; struct type *builtin_type_ia64_spill_little; +struct type *builtin_type_ia64_quad[BFD_ENDIAN_UNKNOWN]; struct type *builtin_type_ia64_quad_big; struct type *builtin_type_ia64_quad_little; struct type *builtin_type_void_data_ptr; @@ -774,8 +779,12 @@ create_array_type (struct type *result_type, struct type *element_type, struct type * create_string_type (struct type *result_type, struct type *range_type) { + struct type *string_char_type; + + string_char_type = language_string_char_type (current_language, + current_gdbarch); result_type = create_array_type (result_type, - *current_language->string_char_type, + string_char_type, range_type); TYPE_CODE (result_type) = TYPE_CODE_STRING; return (result_type); @@ -1026,24 +1035,6 @@ type_name_no_tag (const struct type *type) return TYPE_NAME (type); } -/* Lookup a primitive type named NAME. - Return zero if NAME is not a primitive type. */ - -struct type * -lookup_primitive_typename (char *name) -{ - struct type **const *p; - - for (p = current_language->la_builtin_type_vector; *p != NULL; p++) - { - if (strcmp (TYPE_NAME (**p), name) == 0) - { - return (**p); - } - } - return (NULL); -} - /* Lookup a typedef or primitive type named NAME, visible in lexical block BLOCK. If NOERR is nonzero, return zero if NAME is not suitably defined. */ @@ -1057,7 +1048,9 @@ lookup_typename (char *name, struct block *block, int noerr) sym = lookup_symbol (name, block, VAR_DOMAIN, 0, (struct symtab **) NULL); if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF) { - tmp = lookup_primitive_typename (name); + tmp = language_lookup_primitive_type_by_name (current_language, + current_gdbarch, + name); if (tmp) { return (tmp); @@ -3227,57 +3220,13 @@ build_gdbtypes (void) init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "string", (struct objfile *) NULL); - builtin_type_int0 = - init_type (TYPE_CODE_INT, 0 / 8, - 0, - "int0_t", (struct objfile *) NULL); - builtin_type_int8 = - init_type (TYPE_CODE_INT, 8 / 8, - 0, - "int8_t", (struct objfile *) NULL); - builtin_type_uint8 = - init_type (TYPE_CODE_INT, 8 / 8, - TYPE_FLAG_UNSIGNED, - "uint8_t", (struct objfile *) NULL); - builtin_type_int16 = - init_type (TYPE_CODE_INT, 16 / 8, - 0, - "int16_t", (struct objfile *) NULL); - builtin_type_uint16 = - init_type (TYPE_CODE_INT, 16 / 8, - TYPE_FLAG_UNSIGNED, - "uint16_t", (struct objfile *) NULL); - builtin_type_int32 = - init_type (TYPE_CODE_INT, 32 / 8, - 0, - "int32_t", (struct objfile *) NULL); - builtin_type_uint32 = - init_type (TYPE_CODE_INT, 32 / 8, - TYPE_FLAG_UNSIGNED, - "uint32_t", (struct objfile *) NULL); - builtin_type_int64 = - init_type (TYPE_CODE_INT, 64 / 8, - 0, - "int64_t", (struct objfile *) NULL); - builtin_type_uint64 = - init_type (TYPE_CODE_INT, 64 / 8, - TYPE_FLAG_UNSIGNED, - "uint64_t", (struct objfile *) NULL); - builtin_type_int128 = - init_type (TYPE_CODE_INT, 128 / 8, - 0, - "int128_t", (struct objfile *) NULL); - builtin_type_uint128 = - init_type (TYPE_CODE_INT, 128 / 8, - TYPE_FLAG_UNSIGNED, - "uint128_t", (struct objfile *) NULL); builtin_type_bool = init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "bool", (struct objfile *) NULL); /* Add user knob for controlling resolution of opaque types */ - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("opaque-type-resolution", class_support, var_boolean, (char *) &opaque_type_resolution, "Set resolution of opaque struct/class/union types (if set before loading symbols).", &setlist), @@ -3360,13 +3309,223 @@ build_gdbtypes (void) "__bfd_vma", (struct objfile *) NULL); } +static struct gdbarch_data *gdbtypes_data; + +const struct builtin_type * +builtin_type (struct gdbarch *gdbarch) +{ + return gdbarch_data (gdbarch, gdbtypes_data); +} + + +static struct type * +build_flt (int bit, char *name, const struct floatformat *floatformat) +{ + struct type *t; + if (bit <= 0 || floatformat == NULL) + { + gdb_assert (builtin_type_error != NULL); + return builtin_type_error; + } + t = init_type (TYPE_CODE_FLT, bit / TARGET_CHAR_BIT, + 0, name, (struct objfile *) NULL); + TYPE_FLOATFORMAT (t) = floatformat; + return t; +} + +static struct type * +build_complex (int bit, char *name, struct type *target_type) +{ + struct type *t; + if (bit <= 0 || target_type == builtin_type_error) + { + gdb_assert (builtin_type_error != NULL); + return builtin_type_error; + } + t = init_type (TYPE_CODE_COMPLEX, 2 * bit / TARGET_CHAR_BIT, + 0, name, (struct objfile *) NULL); + TYPE_TARGET_TYPE (t) = target_type; + return t; +} + +static void * +gdbtypes_post_init (struct gdbarch *gdbarch) +{ + struct builtin_type *builtin_type + = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_type); + + builtin_type->builtin_void = + init_type (TYPE_CODE_VOID, 1, + 0, + "void", (struct objfile *) NULL); + builtin_type->builtin_char = + init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + (TYPE_FLAG_NOSIGN + | (TARGET_CHAR_SIGNED ? 0 : TYPE_FLAG_UNSIGNED)), + "char", (struct objfile *) NULL); + builtin_type->builtin_true_char = + init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, + "true character", (struct objfile *) NULL); + builtin_type->builtin_signed_char = + init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, + "signed char", (struct objfile *) NULL); + builtin_type->builtin_unsigned_char = + init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, + "unsigned char", (struct objfile *) NULL); + builtin_type->builtin_short = + init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT, + 0, + "short", (struct objfile *) NULL); + builtin_type->builtin_unsigned_short = + init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, + "unsigned short", (struct objfile *) NULL); + builtin_type->builtin_int = + init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, + 0, + "int", (struct objfile *) NULL); + builtin_type->builtin_unsigned_int = + init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, + "unsigned int", (struct objfile *) NULL); + builtin_type->builtin_long = + init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, + 0, + "long", (struct objfile *) NULL); + builtin_type->builtin_unsigned_long = + init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, + "unsigned long", (struct objfile *) NULL); + builtin_type->builtin_long_long = + init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + 0, + "long long", (struct objfile *) NULL); + builtin_type->builtin_unsigned_long_long = + init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, + "unsigned long long", (struct objfile *) NULL); + builtin_type->builtin_float + = build_flt (gdbarch_float_bit (gdbarch), "float", + gdbarch_float_format (gdbarch)); + builtin_type->builtin_double + = build_flt (gdbarch_double_bit (gdbarch), "double", + gdbarch_double_format (gdbarch)); + builtin_type->builtin_long_double + = build_flt (gdbarch_long_double_bit (gdbarch), "long double", + gdbarch_long_double_format (gdbarch)); + builtin_type->builtin_complex + = build_complex (gdbarch_float_bit (gdbarch), "complex", + builtin_type->builtin_float); + builtin_type->builtin_double_complex + = build_complex (gdbarch_double_bit (gdbarch), "double complex", + builtin_type->builtin_double); + builtin_type->builtin_string = + init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, + "string", (struct objfile *) NULL); + builtin_type->builtin_bool = + init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, + "bool", (struct objfile *) NULL); + + /* Pointer/Address types. */ + + /* NOTE: on some targets, addresses and pointers are not necessarily + the same --- for example, on the D10V, pointers are 16 bits long, + but addresses are 32 bits long. See doc/gdbint.texinfo, + ``Pointers Are Not Always Addresses''. + + The upshot is: + - gdb's `struct type' always describes the target's + representation. + - gdb's `struct value' objects should always hold values in + target form. + - gdb's CORE_ADDR values are addresses in the unified virtual + address space that the assembler and linker work with. Thus, + since target_read_memory takes a CORE_ADDR as an argument, it + can access any memory on the target, even if the processor has + separate code and data address spaces. + + So, for example: + - If v is a value holding a D10V code pointer, its contents are + in target form: a big-endian address left-shifted two bits. + - If p is a D10V pointer type, TYPE_LENGTH (p) == 2, just as + sizeof (void *) == 2 on the target. + + In this context, builtin_type->CORE_ADDR is a bit odd: it's a + target type for a value the target will never see. It's only + used to hold the values of (typeless) linker symbols, which are + indeed in the unified virtual address space. */ + builtin_type->builtin_data_ptr + = make_pointer_type (builtin_type->builtin_void, NULL); + builtin_type->builtin_func_ptr + = lookup_pointer_type (lookup_function_type (builtin_type->builtin_void)); + builtin_type->builtin_core_addr = + init_type (TYPE_CODE_INT, TARGET_ADDR_BIT / 8, + TYPE_FLAG_UNSIGNED, + "__CORE_ADDR", (struct objfile *) NULL); + + return builtin_type; +} + extern void _initialize_gdbtypes (void); void _initialize_gdbtypes (void) { struct cmd_list_element *c; + + builtin_type_int0 = + init_type (TYPE_CODE_INT, 0 / 8, + 0, + "int0_t", (struct objfile *) NULL); + builtin_type_int8 = + init_type (TYPE_CODE_INT, 8 / 8, + 0, + "int8_t", (struct objfile *) NULL); + builtin_type_uint8 = + init_type (TYPE_CODE_INT, 8 / 8, + TYPE_FLAG_UNSIGNED, + "uint8_t", (struct objfile *) NULL); + builtin_type_int16 = + init_type (TYPE_CODE_INT, 16 / 8, + 0, + "int16_t", (struct objfile *) NULL); + builtin_type_uint16 = + init_type (TYPE_CODE_INT, 16 / 8, + TYPE_FLAG_UNSIGNED, + "uint16_t", (struct objfile *) NULL); + builtin_type_int32 = + init_type (TYPE_CODE_INT, 32 / 8, + 0, + "int32_t", (struct objfile *) NULL); + builtin_type_uint32 = + init_type (TYPE_CODE_INT, 32 / 8, + TYPE_FLAG_UNSIGNED, + "uint32_t", (struct objfile *) NULL); + builtin_type_int64 = + init_type (TYPE_CODE_INT, 64 / 8, + 0, + "int64_t", (struct objfile *) NULL); + builtin_type_uint64 = + init_type (TYPE_CODE_INT, 64 / 8, + TYPE_FLAG_UNSIGNED, + "uint64_t", (struct objfile *) NULL); + builtin_type_int128 = + init_type (TYPE_CODE_INT, 128 / 8, + 0, + "int128_t", (struct objfile *) NULL); + builtin_type_uint128 = + init_type (TYPE_CODE_INT, 128 / 8, + TYPE_FLAG_UNSIGNED, + "uint128_t", (struct objfile *) NULL); + build_gdbtypes (); + gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); + /* FIXME - For the moment, handle types by swapping them in and out. Should be using the per-architecture data-pointer and a large struct. */ @@ -3388,16 +3547,6 @@ _initialize_gdbtypes (void) DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_complex); DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_double_complex); DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_string); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_int8); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_uint8); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_int16); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_uint16); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_int32); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_uint32); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_int64); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_uint64); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_int128); - DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_uint128); DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_v4sf); DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_v4si); DEPRECATED_REGISTER_GDBARCH_SWAP (builtin_type_v16qi); @@ -3433,6 +3582,14 @@ _initialize_gdbtypes (void) init_type (TYPE_CODE_FLT, floatformat_ieee_single_little.totalsize / 8, 0, "builtin_type_ieee_single_little", NULL); TYPE_FLOATFORMAT (builtin_type_ieee_single_little) = &floatformat_ieee_single_little; + builtin_type_ieee_single[BFD_ENDIAN_BIG] + = build_flt (floatformat_ieee_single_big.totalsize, + "builtin_type_ieee_single_big", + &floatformat_ieee_single_big); + builtin_type_ieee_single[BFD_ENDIAN_LITTLE] + = build_flt (floatformat_ieee_single_little.totalsize, + "builtin_type_ieee_single_little", + &floatformat_ieee_single_little); builtin_type_ieee_double_big = init_type (TYPE_CODE_FLT, floatformat_ieee_double_big.totalsize / 8, 0, "builtin_type_ieee_double_big", NULL); @@ -3441,6 +3598,14 @@ _initialize_gdbtypes (void) init_type (TYPE_CODE_FLT, floatformat_ieee_double_little.totalsize / 8, 0, "builtin_type_ieee_double_little", NULL); TYPE_FLOATFORMAT (builtin_type_ieee_double_little) = &floatformat_ieee_double_little; + builtin_type_ieee_double[BFD_ENDIAN_BIG] + = build_flt (floatformat_ieee_double_big.totalsize, + "builtin_type_ieee_double_big", + &floatformat_ieee_double_big); + builtin_type_ieee_double[BFD_ENDIAN_LITTLE] + = build_flt (floatformat_ieee_double_little.totalsize, + "builtin_type_ieee_double_little", + &floatformat_ieee_double_little); builtin_type_ieee_double_littlebyte_bigword = init_type (TYPE_CODE_FLT, floatformat_ieee_double_littlebyte_bigword.totalsize / 8, 0, "builtin_type_ieee_double_littlebyte_bigword", NULL); @@ -3473,6 +3638,14 @@ _initialize_gdbtypes (void) init_type (TYPE_CODE_FLT, floatformat_arm_ext_littlebyte_bigword.totalsize / 8, 0, "builtin_type_arm_ext_littlebyte_bigword", NULL); TYPE_FLOATFORMAT (builtin_type_arm_ext_littlebyte_bigword) = &floatformat_arm_ext_littlebyte_bigword; + builtin_type_arm_ext[BFD_ENDIAN_BIG] + = build_flt (floatformat_arm_ext_big.totalsize, + "builtin_type_arm_ext_big", + &floatformat_arm_ext_big); + builtin_type_arm_ext[BFD_ENDIAN_LITTLE] + = build_flt (floatformat_arm_ext_littlebyte_bigword.totalsize, + "builtin_type_arm_ext_littlebyte_bigword", + &floatformat_arm_ext_littlebyte_bigword); builtin_type_ia64_spill_big = init_type (TYPE_CODE_FLT, floatformat_ia64_spill_big.totalsize / 8, 0, "builtin_type_ia64_spill_big", NULL); @@ -3481,6 +3654,14 @@ _initialize_gdbtypes (void) init_type (TYPE_CODE_FLT, floatformat_ia64_spill_little.totalsize / 8, 0, "builtin_type_ia64_spill_little", NULL); TYPE_FLOATFORMAT (builtin_type_ia64_spill_little) = &floatformat_ia64_spill_little; + builtin_type_ia64_spill[BFD_ENDIAN_BIG] + = build_flt (floatformat_ia64_spill_big.totalsize, + "builtin_type_ia64_spill_big", + &floatformat_ia64_spill_big); + builtin_type_ia64_spill[BFD_ENDIAN_LITTLE] + = build_flt (floatformat_ia64_spill_little.totalsize, + "builtin_type_ia64_spill_little", + &floatformat_ia64_spill_little); builtin_type_ia64_quad_big = init_type (TYPE_CODE_FLT, floatformat_ia64_quad_big.totalsize / 8, 0, "builtin_type_ia64_quad_big", NULL); @@ -3489,11 +3670,18 @@ _initialize_gdbtypes (void) init_type (TYPE_CODE_FLT, floatformat_ia64_quad_little.totalsize / 8, 0, "builtin_type_ia64_quad_little", NULL); TYPE_FLOATFORMAT (builtin_type_ia64_quad_little) = &floatformat_ia64_quad_little; - - add_show_from_set ( - add_set_cmd ("overload", no_class, var_zinteger, (char *) &overload_debug, - "Set debugging of C++ overloading.\n\ - When enabled, ranking of the functions\n\ - is displayed.", &setdebuglist), - &showdebuglist); + builtin_type_ia64_quad[BFD_ENDIAN_BIG] + = build_flt (floatformat_ia64_quad_big.totalsize, + "builtin_type_ia64_quad_big", + &floatformat_ia64_quad_big); + builtin_type_ia64_quad[BFD_ENDIAN_LITTLE] + = build_flt (floatformat_ia64_quad_little.totalsize, + "builtin_type_ia64_quad_little", + &floatformat_ia64_quad_little); + + deprecated_add_show_from_set + (add_set_cmd ("overload", no_class, var_zinteger, (char *) &overload_debug, + "Set debugging of C++ overloading.\n\ +When enabled, ranking of the functions is displayed.", &setdebuglist), + &showdebuglist); } diff --git a/gnu/usr.bin/binutils/gdb/gdbtypes.h b/gnu/usr.bin/binutils/gdb/gdbtypes.h index a1141d72e25..eb28de2faae 100644 --- a/gnu/usr.bin/binutils/gdb/gdbtypes.h +++ b/gnu/usr.bin/binutils/gdb/gdbtypes.h @@ -82,7 +82,27 @@ enum type_code { TYPE_CODE_UNDEF, /* Not used; catches errors */ TYPE_CODE_PTR, /* Pointer type */ - TYPE_CODE_ARRAY, /* Array type with lower & upper bounds. */ + + /* Array type with lower & upper bounds. + + Regardless of the language, GDB represents multidimensional + array types the way C does: as arrays of arrays. So an + instance of a GDB array type T can always be seen as a series + of instances of TYPE_TARGET_TYPE (T) laid out sequentially in + memory. + + Row-major languages like C lay out multi-dimensional arrays so + that incrementing the rightmost index in a subscripting + expression results in the smallest change in the address of the + element referred to. Column-major languages like Fortran lay + them out so that incrementing the leftmost index results in the + smallest change. + + This means that, in column-major languages, working our way + from type to target type corresponds to working through indices + from right to left, not left to right. */ + TYPE_CODE_ARRAY, + TYPE_CODE_STRUCT, /* C struct or Pascal record */ TYPE_CODE_UNION, /* C union or Pascal variant part */ TYPE_CODE_ENUM, /* Enumeration type */ @@ -136,7 +156,7 @@ enum type_code TYPE_CODE_TEMPLATE, /* C++ template */ TYPE_CODE_TEMPLATE_ARG, /* C++ template arg */ - TYPE_CODE_NAMESPACE, /* C++ namespace. */ + TYPE_CODE_NAMESPACE /* C++ namespace. */ }; /* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an @@ -273,6 +293,17 @@ enum type_code #define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \ & TYPE_FLAG_ADDRESS_CLASS_ALL) +/* The debugging formats (especially STABS) do not contain enough information + to represent all Ada types---especially those whose size depends on + dynamic quantities. Therefore, the GNAT Ada compiler includes + extra information in the form of additional type definitions + connected by naming conventions. This flag indicates that the + type is an ordinary (unencoded) GDB type that has been created from + the necessary run-time information, and does not need further + interpretation. Optionally marks ordinary, fixed-size GDB type. */ + +#define TYPE_FLAG_FIXED_INSTANCE (1 << 15) + /* Array bound type. */ enum array_bound_type { @@ -923,7 +954,58 @@ extern void allocate_cplus_struct_type (struct type *); (TYPE_NFIELDS (thistype) == 0) && \ (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0))) +struct builtin_type +{ + /* Address/pointer types. */ + + /* `pointer to data' type. Some target platforms use an implicitly + {sign,zero} -extended 32-bit ABI pointer on a 64-bit ISA. */ + struct type *builtin_data_ptr; + + /* `pointer to function (returning void)' type. Harvard + architectures mean that ABI function and code pointers are not + interconvertible. Similarly, since ANSI, C standards have + explicitly said that pointers to functions and pointers to data + are not interconvertible --- that is, you can't cast a function + pointer to void * and back, and expect to get the same value. + However, all function pointer types are interconvertible, so void + (*) () can server as a generic function pointer. */ + struct type *builtin_func_ptr; + + /* The target CPU's address type. This is the ISA address size. */ + struct type *builtin_core_addr; + + /* Integral types. */ + + /* We use this for the '/c' print format, because c_char is just a + one-byte integral type, which languages less laid back than C + will print as ... well, a one-byte integral type. */ + struct type *builtin_true_char; + + /* Implicit size/sign (based on the the architecture's ABI). */ + struct type *builtin_void; + struct type *builtin_char; + struct type *builtin_short; + struct type *builtin_int; + struct type *builtin_long; + struct type *builtin_signed_char; + struct type *builtin_unsigned_char; + struct type *builtin_unsigned_short; + struct type *builtin_unsigned_int; + struct type *builtin_unsigned_long; + struct type *builtin_float; + struct type *builtin_double; + struct type *builtin_long_double; + struct type *builtin_complex; + struct type *builtin_double_complex; + struct type *builtin_string; + struct type *builtin_bool; + struct type *builtin_long_long; + struct type *builtin_unsigned_long_long; +}; +/* Return the type table for the specified architecture. */ +extern const struct builtin_type *builtin_type (struct gdbarch *gdbarch); /* Implicit sizes */ extern struct type *builtin_type_void; @@ -999,8 +1081,10 @@ extern struct type *builtin_type_vec128; extern struct type *builtin_type_vec128i; /* Explicit floating-point formats. See "floatformat.h". */ +extern struct type *builtin_type_ieee_single[BFD_ENDIAN_UNKNOWN]; extern struct type *builtin_type_ieee_single_big; extern struct type *builtin_type_ieee_single_little; +extern struct type *builtin_type_ieee_double[BFD_ENDIAN_UNKNOWN]; extern struct type *builtin_type_ieee_double_big; extern struct type *builtin_type_ieee_double_little; extern struct type *builtin_type_ieee_double_littlebyte_bigword; @@ -1009,10 +1093,13 @@ extern struct type *builtin_type_m68881_ext; extern struct type *builtin_type_i960_ext; extern struct type *builtin_type_m88110_ext; extern struct type *builtin_type_m88110_harris_ext; +extern struct type *builtin_type_arm_ext[BFD_ENDIAN_UNKNOWN]; extern struct type *builtin_type_arm_ext_big; extern struct type *builtin_type_arm_ext_littlebyte_bigword; +extern struct type *builtin_type_ia64_spill[BFD_ENDIAN_UNKNOWN]; extern struct type *builtin_type_ia64_spill_big; extern struct type *builtin_type_ia64_spill_little; +extern struct type *builtin_type_ia64_quad[BFD_ENDIAN_UNKNOWN]; extern struct type *builtin_type_ia64_quad_big; extern struct type *builtin_type_ia64_quad_little; @@ -1153,12 +1240,8 @@ extern struct type *check_typedef (struct type *); extern void check_stub_method_group (struct type *, int); -extern struct type *lookup_primitive_typename (char *); - extern char *gdb_mangle_name (struct type *, int, int); -extern struct type *builtin_type (char **); - extern struct type *lookup_typename (char *, struct block *, int); extern struct type *lookup_template_type (char *, struct type *, diff --git a/gnu/usr.bin/binutils/gdb/gnu-nat.c b/gnu/usr.bin/binutils/gdb/gnu-nat.c index a61d577f839..c10e6e61456 100644 --- a/gnu/usr.bin/binutils/gdb/gnu-nat.c +++ b/gnu/usr.bin/binutils/gdb/gnu-nat.c @@ -1574,7 +1574,7 @@ rewait: } /* Pass back out our results. */ - bcopy (&inf->wait.status, status, sizeof (*status)); + memcpy (status, &inf->wait.status, sizeof (*status)); thread = inf->wait.thread; if (thread) @@ -2040,7 +2040,8 @@ cur_inf (void) } static void -gnu_create_inferior (char *exec_file, char *allargs, char **env) +gnu_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { struct inf *inf = cur_inf (); @@ -2102,8 +2103,6 @@ gnu_can_run (void) } -#ifdef ATTACH_DETACH - /* Attach to process PID, then initialize for debugging it and wait for the trace-trap that results from attaching. */ static void @@ -2188,8 +2187,6 @@ gnu_detach (char *args, int from_tty) unpush_target (&gnu_ops); /* Pop out of handling an inferior */ } -#endif /* ATTACH_DETACH */ - static void gnu_terminal_init_inferior (void) @@ -2600,7 +2597,7 @@ init_gnu_ops (void) gnu_ops.to_fetch_registers = gnu_fetch_registers; /* to_fetch_registers */ gnu_ops.to_store_registers = gnu_store_registers; /* to_store_registers */ gnu_ops.to_prepare_to_store = gnu_prepare_to_store; /* to_prepare_to_store */ - gnu_ops.to_xfer_memory = gnu_xfer_memory; /* to_xfer_memory */ + gnu_ops.deprecated_xfer_memory = gnu_xfer_memory; gnu_ops.to_find_memory_regions = gnu_find_memory_regions; gnu_ops.to_insert_breakpoint = memory_insert_breakpoint; gnu_ops.to_remove_breakpoint = memory_remove_breakpoint; diff --git a/gnu/usr.bin/binutils/gdb/h8300-tdep.c b/gnu/usr.bin/binutils/gdb/h8300-tdep.c index d15c43582be..0d6c3bcbb26 100644 --- a/gnu/usr.bin/binutils/gdb/h8300-tdep.c +++ b/gnu/usr.bin/binutils/gdb/h8300-tdep.c @@ -519,9 +519,7 @@ h8300_frame_init_saved_regs (struct frame_info *fi) static CORE_ADDR h8300_frame_chain (struct frame_info *thisframe) { - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe), - get_frame_base (thisframe), - get_frame_base (thisframe))) + if (deprecated_pc_in_call_dummy (get_frame_pc (thisframe))) { /* initialize the from_pc now */ get_frame_extra_info (thisframe)->from_pc = deprecated_read_register_dummy (get_frame_pc (thisframe), @@ -540,9 +538,7 @@ h8300_frame_chain (struct frame_info *thisframe) static CORE_ADDR h8300_frame_saved_pc (struct frame_info *frame) { - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), - get_frame_base (frame), - get_frame_base (frame))) + if (deprecated_pc_in_call_dummy (get_frame_pc (frame))) return deprecated_read_register_dummy (get_frame_pc (frame), get_frame_base (frame), E_PC_REGNUM); @@ -632,7 +628,7 @@ h8300_init_extra_frame_info (int fromleaf, struct frame_info *fi) to begin with. */ static CORE_ADDR -h8300_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -739,11 +735,9 @@ h8300_pop_frame (void) unsigned regno; struct frame_info *frame = get_current_frame (); - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), - get_frame_base (frame), - get_frame_base (frame))) + if (deprecated_pc_in_call_dummy (get_frame_pc (frame))) { - generic_pop_dummy_frame (); + deprecated_pop_dummy_frame (); } else { @@ -1323,10 +1317,9 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) */ /* Stack grows up. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_deprecated_frameless_function_invocation (gdbarch, legacy_frameless_look_for_prologue); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address); - set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention); + set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention); set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc); set_gdbarch_push_dummy_code (gdbarch, h8300_push_dummy_code); set_gdbarch_push_dummy_call (gdbarch, h8300_push_dummy_call); diff --git a/gnu/usr.bin/binutils/gdb/hppa-tdep.c b/gnu/usr.bin/binutils/gdb/hppa-tdep.c index b8638ff1c0e..a1da98d37e3 100644 --- a/gnu/usr.bin/binutils/gdb/hppa-tdep.c +++ b/gnu/usr.bin/binutils/gdb/hppa-tdep.c @@ -1,6 +1,11 @@ -/* Target-dependent code for PA-RISC. +/* Target-dependent code for the HP PA architecture, for GDB. - Copyright 2003, 2004 Free Software Foundation, Inc. + Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, + 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. + + Contributed by the Center for Software Science at the + University of Utah (pa-gdb-bugs@cs.utah.edu). This file is part of GDB. @@ -20,491 +25,2608 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "bfd.h" +#include "inferior.h" +#include "regcache.h" +#include "completer.h" +#include "osabi.h" +#include "gdb_assert.h" #include "arch-utils.h" -#include "dis-asm.h" -#include "floatformat.h" -#include "frame.h" -#include "frame-base.h" -#include "frame-unwind.h" -#include "gdbtypes.h" +/* For argument passing to the inferior */ #include "symtab.h" -#include "objfiles.h" -#include "osabi.h" -#include "regcache.h" -#include "target.h" +#include "dis-asm.h" #include "trad-frame.h" +#include "frame-unwind.h" +#include "frame-base.h" -#include "gdb_assert.h" - +#include "gdbcore.h" +#include "gdbcmd.h" +#include "objfiles.h" #include "hppa-tdep.h" -/* This file implements a PA-RISC 32-bit ABI. */ - -/* Please use the hppa32_-prefix for 32-bit specific code, the - hppa64_-prefix for 64-bit specific code and the sparc_-prefix for - sparc64-tdep.c. The 64-bit specific code lives in hppa64-tdep.c; - don't add any here. */ +static int hppa_debug = 0; + +/* Some local constants. */ +static const int hppa32_num_regs = 128; +static const int hppa64_num_regs = 96; + +/* hppa-specific object data -- unwind and solib info. + TODO/maybe: think about splitting this into two parts; the unwind data is + common to all hppa targets, but is only used in this file; we can register + that separately and make this static. The solib data is probably hpux- + specific, so we can create a separate extern objfile_data that is registered + by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c. */ +const struct objfile_data *hppa_objfile_priv_data = NULL; + +/* Get at various relevent fields of an instruction word. */ +#define MASK_5 0x1f +#define MASK_11 0x7ff +#define MASK_14 0x3fff +#define MASK_21 0x1fffff + +/* Sizes (in bytes) of the native unwind entries. */ +#define UNWIND_ENTRY_SIZE 16 +#define STUB_UNWIND_ENTRY_SIZE 8 + +/* FIXME: brobecker 2002-11-07: We will likely be able to make the + following functions static, once we hppa is partially multiarched. */ +int hppa_pc_requires_run_before_use (CORE_ADDR pc); +int hppa_instruction_nullified (void); + +/* Handle 32/64-bit struct return conventions. */ + +static enum return_value_convention +hppa32_return_value (struct gdbarch *gdbarch, + struct type *type, struct regcache *regcache, + void *readbuf, const void *writebuf) +{ + if (TYPE_LENGTH (type) <= 2 * 4) + { + /* The value always lives in the right hand end of the register + (or register pair)? */ + int b; + int reg = TYPE_CODE (type) == TYPE_CODE_FLT ? HPPA_FP4_REGNUM : 28; + int part = TYPE_LENGTH (type) % 4; + /* The left hand register contains only part of the value, + transfer that first so that the rest can be xfered as entire + 4-byte registers. */ + if (part > 0) + { + if (readbuf != NULL) + regcache_cooked_read_part (regcache, reg, 4 - part, + part, readbuf); + if (writebuf != NULL) + regcache_cooked_write_part (regcache, reg, 4 - part, + part, writebuf); + reg++; + } + /* Now transfer the remaining register values. */ + for (b = part; b < TYPE_LENGTH (type); b += 4) + { + if (readbuf != NULL) + regcache_cooked_read (regcache, reg, (char *) readbuf + b); + if (writebuf != NULL) + regcache_cooked_write (regcache, reg, (const char *) writebuf + b); + reg++; + } + return RETURN_VALUE_REGISTER_CONVENTION; + } + else + return RETURN_VALUE_STRUCT_CONVENTION; +} -/* The PA-RISCC Floating-Point Quad-Precision format is similar to - big-endian IA-64 Quad-recision format. */ -#define floatformat_hppa_quad floatformat_ia64_quad_big +static enum return_value_convention +hppa64_return_value (struct gdbarch *gdbarch, + struct type *type, struct regcache *regcache, + void *readbuf, const void *writebuf) +{ + /* RM: Floats are returned in FR4R, doubles in FR4. Integral values + are in r28, padded on the left. Aggregates less that 65 bits are + in r28, right padded. Aggregates upto 128 bits are in r28 and + r29, right padded. */ + if (TYPE_CODE (type) == TYPE_CODE_FLT + && TYPE_LENGTH (type) <= 8) + { + /* Floats are right aligned? */ + int offset = register_size (gdbarch, HPPA_FP4_REGNUM) - TYPE_LENGTH (type); + if (readbuf != NULL) + regcache_cooked_read_part (regcache, HPPA_FP4_REGNUM, offset, + TYPE_LENGTH (type), readbuf); + if (writebuf != NULL) + regcache_cooked_write_part (regcache, HPPA_FP4_REGNUM, offset, + TYPE_LENGTH (type), writebuf); + return RETURN_VALUE_REGISTER_CONVENTION; + } + else if (TYPE_LENGTH (type) <= 8 && is_integral_type (type)) + { + /* Integrals are right aligned. */ + int offset = register_size (gdbarch, HPPA_FP4_REGNUM) - TYPE_LENGTH (type); + if (readbuf != NULL) + regcache_cooked_read_part (regcache, 28, offset, + TYPE_LENGTH (type), readbuf); + if (writebuf != NULL) + regcache_cooked_write_part (regcache, 28, offset, + TYPE_LENGTH (type), writebuf); + return RETURN_VALUE_REGISTER_CONVENTION; + } + else if (TYPE_LENGTH (type) <= 2 * 8) + { + /* Composite values are left aligned. */ + int b; + for (b = 0; b < TYPE_LENGTH (type); b += 8) + { + int part = min (8, TYPE_LENGTH (type) - b); + if (readbuf != NULL) + regcache_cooked_read_part (regcache, 28 + b / 8, 0, part, + (char *) readbuf + b); + if (writebuf != NULL) + regcache_cooked_write_part (regcache, 28 + b / 8, 0, part, + (const char *) writebuf + b); + } + return RETURN_VALUE_REGISTER_CONVENTION; + } + else + return RETURN_VALUE_STRUCT_CONVENTION; +} -/* Macros to extract fields from PA-RISC instructions. */ -#define X_OP(i) (((i) >> 26) & 0x3f) -#define X_B(i) (((i) >> 21) & 0x1f) -#define X_R(i) (((i) >> 16) & 0x1f) -#define X_T(i) (((i) >> 16) & 0x1f) -#define X_IM14(i) ((i) & 0x3fff) -/* Sign extension macros. */ -#define X_DISP14(i) (low_sign_extend (X_IM14 (i), 14)) +/* Routines to extract various sized constants out of hppa + instructions. */ -/* Fetch the instruction at PC. Instructions may be fetched - big-endian or little-endian dependent on the (optional) E-bit in - the PSW. Traditionally, the PA-RISC architecture is big-endian - though. */ +/* This assumes that no garbage lies outside of the lower bits of + value. */ -unsigned long -hppa_fetch_instruction (CORE_ADDR pc) +int +hppa_sign_extend (unsigned val, unsigned bits) { - unsigned char buf[4]; + return (int) (val >> (bits - 1) ? (-1 << bits) | val : val); +} - /* If we can't read the instruction at PC, return zero. */ - if (target_read_memory (pc, buf, sizeof (buf))) - return 0; +/* For many immediate values the sign bit is the low bit! */ - return extract_unsigned_integer (buf, 4); +int +hppa_low_hppa_sign_extend (unsigned val, unsigned bits) +{ + return (int) ((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1); } -static CORE_ADDR -hppa_addr_bits_remove (CORE_ADDR addr) +/* Extract the bits at positions between FROM and TO, using HP's numbering + (MSB = 0). */ + +int +hppa_get_field (unsigned word, int from, int to) { - return addr & ~0x3; + return ((word) >> (31 - (to)) & ((1 << ((to) - (from) + 1)) - 1)); } -static LONGEST -low_sign_extend (ULONGEST val, ULONGEST bits) +/* extract the immediate field from a ld{bhw}s instruction */ + +int +hppa_extract_5_load (unsigned word) { - return (LONGEST) ((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1); + return hppa_low_hppa_sign_extend (word >> 16 & MASK_5, 5); } -static const char *hppa32_register_names[] = +/* extract the immediate field from a break instruction */ + +unsigned +hppa_extract_5r_store (unsigned word) { - "r0", "r1", "rp", "r3", "r4", "r5", "r6", "r7", - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", - "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", - "r24", "r25", "r26", "r27", "r28", "r29", "sp", "r31", - "sar", "pcoqh", "pcoqt" -}; + return (word & MASK_5); +} -/* Total number of registers. */ -#define HPPA32_NUM_REGS ARRAY_SIZE (hppa32_register_names) +/* extract the immediate field from a {sr}sm instruction */ -/* Return the name of register REGNUM. */ +unsigned +hppa_extract_5R_store (unsigned word) +{ + return (word >> 16 & MASK_5); +} + +/* extract a 14 bit immediate field */ -static const char * -hppa32_register_name (int regnum) +int +hppa_extract_14 (unsigned word) { - if (regnum >= 0 && regnum < HPPA32_NUM_REGS) - return hppa32_register_names[regnum]; + return hppa_low_hppa_sign_extend (word & MASK_14, 14); +} - return NULL; +/* extract a 21 bit constant */ + +int +hppa_extract_21 (unsigned word) +{ + int val; + + word &= MASK_21; + word <<= 11; + val = hppa_get_field (word, 20, 20); + val <<= 11; + val |= hppa_get_field (word, 9, 19); + val <<= 2; + val |= hppa_get_field (word, 5, 6); + val <<= 5; + val |= hppa_get_field (word, 0, 4); + val <<= 2; + val |= hppa_get_field (word, 7, 8); + return hppa_sign_extend (val, 21) << 11; } -/* Return the GDB type object for the "standard" data type of data in - register REGNUM. */ +/* extract a 17 bit constant from branch instructions, returning the + 19 bit signed value. */ -static struct type * -hppa32_register_type (struct gdbarch *gdbarch, int regnum) +int +hppa_extract_17 (unsigned word) { - if (regnum == HPPA_SP_REGNUM) - return builtin_type_void_data_ptr; + return hppa_sign_extend (hppa_get_field (word, 19, 28) | + hppa_get_field (word, 29, 29) << 10 | + hppa_get_field (word, 11, 15) << 11 | + (word & 0x1) << 16, 17) << 2; +} - if (regnum == HPPA_RP_REGNUM - || regnum == HPPA_PCOQ_HEAD_REGNUM - || regnum == HPPA_PCOQ_TAIL_REGNUM) - return builtin_type_void_func_ptr; +CORE_ADDR +hppa_symbol_address(const char *sym) +{ + struct minimal_symbol *minsym; - return builtin_type_int32; + minsym = lookup_minimal_symbol (sym, NULL, NULL); + if (minsym) + return SYMBOL_VALUE_ADDRESS (minsym); + else + return (CORE_ADDR)-1; } -/* Use the program counter to determine the contents and size of a - breakpoint instruction. Return a pointer to a string of bytes that - encode a breakpoint instruction, store the length of the string in - *LEN and optionally adjust *PC to point to the correct memory - location for inserting the breakpoint. */ - -static const unsigned char * -hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len) +/* Compare the start address for two unwind entries returning 1 if + the first address is larger than the second, -1 if the second is + larger than the first, and zero if they are equal. */ + +static int +compare_unwind_entries (const void *arg1, const void *arg2) { - static unsigned char break_insn[] = { 0x00, 0x01, 0x00, 0x04 }; + const struct unwind_table_entry *a = arg1; + const struct unwind_table_entry *b = arg2; + + if (a->region_start > b->region_start) + return 1; + else if (a->region_start < b->region_start) + return -1; + else + return 0; +} + +static void +record_text_segment_lowaddr (bfd *abfd, asection *section, void *data) +{ + if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) + == (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) + { + bfd_vma value = section->vma - section->filepos; + CORE_ADDR *low_text_segment_address = (CORE_ADDR *)data; - *len = sizeof (break_insn); - return break_insn; + if (value < *low_text_segment_address) + *low_text_segment_address = value; + } } - -CORE_ADDR -hppa32_analyze_prologue (CORE_ADDR start_pc, CORE_ADDR current_pc, - struct hppa_frame_cache *cache) +static void +internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table, + asection *section, unsigned int entries, unsigned int size, + CORE_ADDR text_offset) { - unsigned long insn; - CORE_ADDR pc; + /* We will read the unwind entries into temporary memory, then + fill in the actual unwind table. */ - /* When compiling without optimization, GCC uses %r3 as a frame - pointer and emits the following prologue to set up the stack - frame: + if (size > 0) + { + unsigned long tmp; + unsigned i; + char *buf = alloca (size); + CORE_ADDR low_text_segment_address; + + /* For ELF targets, then unwinds are supposed to + be segment relative offsets instead of absolute addresses. + + Note that when loading a shared library (text_offset != 0) the + unwinds are already relative to the text_offset that will be + passed in. */ + if (gdbarch_tdep (current_gdbarch)->is_elf && text_offset == 0) + { + low_text_segment_address = -1; - stw %rp,-20(%sp) - copy %r3,%r1 - copy %r30,%r3 - stwm %r1,d(%sp) + bfd_map_over_sections (objfile->obfd, + record_text_segment_lowaddr, + &low_text_segment_address); - This instruction sequence is followed by instructions that save - the callee-saved registers. BSD system call stubs use a somewhat - different calling convention where the return pointer (%rp) is - saved in the "External/Stub RP" slot instead of the "Current RP" - slot. In that case the first instruction is "stw %rp,-24(%sp)". */ + text_offset = low_text_segment_address; + } - /* We'll increase START_PC as we encounter instructions that we - recognize as part of the prologue. */ + bfd_get_section_contents (objfile->obfd, section, buf, 0, size); - /* If CURRENT_PC isn't set, provide a reasonable default that's - guaranteed to cover the entire prologue. */ - if (current_pc == (CORE_ADDR) -1) - current_pc = start_pc + 64; + /* Now internalize the information being careful to handle host/target + endian issues. */ + for (i = 0; i < entries; i++) + { + table[i].region_start = bfd_get_32 (objfile->obfd, + (bfd_byte *) buf); + table[i].region_start += text_offset; + buf += 4; + table[i].region_end = bfd_get_32 (objfile->obfd, (bfd_byte *) buf); + table[i].region_end += text_offset; + buf += 4; + tmp = bfd_get_32 (objfile->obfd, (bfd_byte *) buf); + buf += 4; + table[i].Cannot_unwind = (tmp >> 31) & 0x1; + table[i].Millicode = (tmp >> 30) & 0x1; + table[i].Millicode_save_sr0 = (tmp >> 29) & 0x1; + table[i].Region_description = (tmp >> 27) & 0x3; + table[i].reserved1 = (tmp >> 26) & 0x1; + table[i].Entry_SR = (tmp >> 25) & 0x1; + table[i].Entry_FR = (tmp >> 21) & 0xf; + table[i].Entry_GR = (tmp >> 16) & 0x1f; + table[i].Args_stored = (tmp >> 15) & 0x1; + table[i].Variable_Frame = (tmp >> 14) & 0x1; + table[i].Separate_Package_Body = (tmp >> 13) & 0x1; + table[i].Frame_Extension_Millicode = (tmp >> 12) & 0x1; + table[i].Stack_Overflow_Check = (tmp >> 11) & 0x1; + table[i].Two_Instruction_SP_Increment = (tmp >> 10) & 0x1; + table[i].Ada_Region = (tmp >> 9) & 0x1; + table[i].cxx_info = (tmp >> 8) & 0x1; + table[i].cxx_try_catch = (tmp >> 7) & 0x1; + table[i].sched_entry_seq = (tmp >> 6) & 0x1; + table[i].reserved2 = (tmp >> 5) & 0x1; + table[i].Save_SP = (tmp >> 4) & 0x1; + table[i].Save_RP = (tmp >> 3) & 0x1; + table[i].Save_MRP_in_frame = (tmp >> 2) & 0x1; + table[i].extn_ptr_defined = (tmp >> 1) & 0x1; + table[i].Cleanup_defined = tmp & 0x1; + tmp = bfd_get_32 (objfile->obfd, (bfd_byte *) buf); + buf += 4; + table[i].MPE_XL_interrupt_marker = (tmp >> 31) & 0x1; + table[i].HP_UX_interrupt_marker = (tmp >> 30) & 0x1; + table[i].Large_frame = (tmp >> 29) & 0x1; + table[i].Pseudo_SP_Set = (tmp >> 28) & 0x1; + table[i].reserved4 = (tmp >> 27) & 0x1; + table[i].Total_frame_size = tmp & 0x7ffffff; + + /* Stub unwinds are handled elsewhere. */ + table[i].stub_unwind.stub_type = 0; + table[i].stub_unwind.padding = 0; + } + } +} - /* Short-circuit if CURRENT_PC point at the start of this function. */ - else if (current_pc <= start_pc) - return start_pc; +/* Read in the backtrace information stored in the `$UNWIND_START$' section of + the object file. This info is used mainly by find_unwind_entry() to find + out the stack frame size and frame pointer used by procedures. We put + everything on the psymbol obstack in the objfile so that it automatically + gets freed when the objfile is destroyed. */ - /* Provide a dummy cache if necessary. */ - if (cache == NULL) +static void +read_unwind_info (struct objfile *objfile) +{ + asection *unwind_sec, *stub_unwind_sec; + unsigned unwind_size, stub_unwind_size, total_size; + unsigned index, unwind_entries; + unsigned stub_entries, total_entries; + CORE_ADDR text_offset; + struct hppa_unwind_info *ui; + struct hppa_objfile_private *obj_private; + + text_offset = ANOFFSET (objfile->section_offsets, 0); + ui = (struct hppa_unwind_info *) obstack_alloc (&objfile->objfile_obstack, + sizeof (struct hppa_unwind_info)); + + ui->table = NULL; + ui->cache = NULL; + ui->last = -1; + + /* For reasons unknown the HP PA64 tools generate multiple unwinder + sections in a single executable. So we just iterate over every + section in the BFD looking for unwinder sections intead of trying + to do a lookup with bfd_get_section_by_name. + + First determine the total size of the unwind tables so that we + can allocate memory in a nice big hunk. */ + total_entries = 0; + for (unwind_sec = objfile->obfd->sections; + unwind_sec; + unwind_sec = unwind_sec->next) { - size_t sizeof_saved_regs = - HPPA32_NUM_REGS * sizeof (struct trad_frame_saved_reg); - - cache = alloca (sizeof (struct hppa_frame_cache)); - cache->saved_regs = alloca (sizeof_saved_regs); + if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0 + || strcmp (unwind_sec->name, ".PARISC.unwind") == 0) + { + unwind_size = bfd_section_size (objfile->obfd, unwind_sec); + unwind_entries = unwind_size / UNWIND_ENTRY_SIZE; - /* We only initialize the members we care about. */ - cache->frame_size = 0; - cache->saved_regs[HPPA_R3_REGNUM].realreg = -1; + total_entries += unwind_entries; + } } - for (pc = start_pc; pc < current_pc; pc += 4) + /* Now compute the size of the stub unwinds. Note the ELF tools do not + use stub unwinds at the curren time. */ + stub_unwind_sec = bfd_get_section_by_name (objfile->obfd, "$UNWIND_END$"); + + if (stub_unwind_sec) { - /* Fetch the next instruction. */ - insn = hppa_fetch_instruction (pc); + stub_unwind_size = bfd_section_size (objfile->obfd, stub_unwind_sec); + stub_entries = stub_unwind_size / STUB_UNWIND_ENTRY_SIZE; + } + else + { + stub_unwind_size = 0; + stub_entries = 0; + } - /* stw %rp,-20(%sp) or stw %rp,-24(%sp) */ - if (insn == 0x6bc23fd9 || insn == 0x6bc23fd1) + /* Compute total number of unwind entries and their total size. */ + total_entries += stub_entries; + total_size = total_entries * sizeof (struct unwind_table_entry); + + /* Allocate memory for the unwind table. */ + ui->table = (struct unwind_table_entry *) + obstack_alloc (&objfile->objfile_obstack, total_size); + ui->last = total_entries - 1; + + /* Now read in each unwind section and internalize the standard unwind + entries. */ + index = 0; + for (unwind_sec = objfile->obfd->sections; + unwind_sec; + unwind_sec = unwind_sec->next) + { + if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0 + || strcmp (unwind_sec->name, ".PARISC.unwind") == 0) { - /* This instruction saves the return pointer (%rp) into the - "Current RP" slot (or the "External/Stub RP" slot for BSD - system call stubs) in the in the frame marker. */ - cache->saved_regs[HPPA_RP_REGNUM].addr = X_DISP14 (insn); - start_pc = pc + 4; + unwind_size = bfd_section_size (objfile->obfd, unwind_sec); + unwind_entries = unwind_size / UNWIND_ENTRY_SIZE; + + internalize_unwinds (objfile, &ui->table[index], unwind_sec, + unwind_entries, unwind_size, text_offset); + index += unwind_entries; } + } + + /* Now read in and internalize the stub unwind entries. */ + if (stub_unwind_size > 0) + { + unsigned int i; + char *buf = alloca (stub_unwind_size); + + /* Read in the stub unwind entries. */ + bfd_get_section_contents (objfile->obfd, stub_unwind_sec, buf, + 0, stub_unwind_size); - /* copy %r3,%r1 */ - else if (insn == 0x08030241) + /* Now convert them into regular unwind entries. */ + for (i = 0; i < stub_entries; i++, index++) { - /* We've found the instruction that saves the frame pointer - (%r3) into %r1. */ - cache->saved_regs[HPPA_R3_REGNUM].realreg = HPPA_R1_REGNUM; - start_pc = pc + 4; + /* Clear out the next unwind entry. */ + memset (&ui->table[index], 0, sizeof (struct unwind_table_entry)); + + /* Convert offset & size into region_start and region_end. + Stuff away the stub type into "reserved" fields. */ + ui->table[index].region_start = bfd_get_32 (objfile->obfd, + (bfd_byte *) buf); + ui->table[index].region_start += text_offset; + buf += 4; + ui->table[index].stub_unwind.stub_type = bfd_get_8 (objfile->obfd, + (bfd_byte *) buf); + buf += 2; + ui->table[index].region_end + = ui->table[index].region_start + 4 * + (bfd_get_16 (objfile->obfd, (bfd_byte *) buf) - 1); + buf += 2; } - /* copy %sp,%r3 */ - else if (insn == 0x081e0243) + } + + /* Unwind table needs to be kept sorted. */ + qsort (ui->table, total_entries, sizeof (struct unwind_table_entry), + compare_unwind_entries); + + /* Keep a pointer to the unwind information. */ + obj_private = (struct hppa_objfile_private *) + objfile_data (objfile, hppa_objfile_priv_data); + if (obj_private == NULL) + { + obj_private = (struct hppa_objfile_private *) + obstack_alloc (&objfile->objfile_obstack, + sizeof (struct hppa_objfile_private)); + set_objfile_data (objfile, hppa_objfile_priv_data, obj_private); + obj_private->unwind_info = NULL; + obj_private->so_info = NULL; + obj_private->dp = 0; + } + obj_private->unwind_info = ui; +} + +/* Lookup the unwind (stack backtrace) info for the given PC. We search all + of the objfiles seeking the unwind table entry for this PC. Each objfile + contains a sorted list of struct unwind_table_entry. Since we do a binary + search of the unwind tables, we depend upon them to be sorted. */ + +struct unwind_table_entry * +find_unwind_entry (CORE_ADDR pc) +{ + int first, middle, last; + struct objfile *objfile; + struct hppa_objfile_private *priv; + + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "{ find_unwind_entry 0x%s -> ", + paddr_nz (pc)); + + /* A function at address 0? Not in HP-UX! */ + if (pc == (CORE_ADDR) 0) + { + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "NULL }\n"); + return NULL; + } + + ALL_OBJFILES (objfile) + { + struct hppa_unwind_info *ui; + ui = NULL; + priv = objfile_data (objfile, hppa_objfile_priv_data); + if (priv) + ui = ((struct hppa_objfile_private *) priv)->unwind_info; + + if (!ui) + { + read_unwind_info (objfile); + priv = objfile_data (objfile, hppa_objfile_priv_data); + if (priv == NULL) + error ("Internal error reading unwind information."); + ui = ((struct hppa_objfile_private *) priv)->unwind_info; + } + + /* First, check the cache */ + + if (ui->cache + && pc >= ui->cache->region_start + && pc <= ui->cache->region_end) + { + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "0x%s (cached) }\n", + paddr_nz ((CORE_ADDR) ui->cache)); + return ui->cache; + } + + /* Not in the cache, do a binary search */ + + first = 0; + last = ui->last; + + while (first <= last) + { + middle = (first + last) / 2; + if (pc >= ui->table[middle].region_start + && pc <= ui->table[middle].region_end) + { + ui->cache = &ui->table[middle]; + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "0x%s }\n", + paddr_nz ((CORE_ADDR) ui->cache)); + return &ui->table[middle]; + } + + if (pc < ui->table[middle].region_start) + last = middle - 1; + else + first = middle + 1; + } + } /* ALL_OBJFILES() */ + + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "NULL (not found) }\n"); + + return NULL; +} + +static const unsigned char * +hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len) +{ + static const unsigned char breakpoint[] = {0x00, 0x01, 0x00, 0x04}; + (*len) = sizeof (breakpoint); + return breakpoint; +} + +/* Return the name of a register. */ + +const char * +hppa32_register_name (int i) +{ + static char *names[] = { + "flags", "r1", "rp", "r3", + "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", + "r12", "r13", "r14", "r15", + "r16", "r17", "r18", "r19", + "r20", "r21", "r22", "r23", + "r24", "r25", "r26", "dp", + "ret0", "ret1", "sp", "r31", + "sar", "pcoqh", "pcsqh", "pcoqt", + "pcsqt", "eiem", "iir", "isr", + "ior", "ipsw", "goto", "sr4", + "sr0", "sr1", "sr2", "sr3", + "sr5", "sr6", "sr7", "cr0", + "cr8", "cr9", "ccr", "cr12", + "cr13", "cr24", "cr25", "cr26", + "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad", + "fpsr", "fpe1", "fpe2", "fpe3", + "fpe4", "fpe5", "fpe6", "fpe7", + "fr4", "fr4R", "fr5", "fr5R", + "fr6", "fr6R", "fr7", "fr7R", + "fr8", "fr8R", "fr9", "fr9R", + "fr10", "fr10R", "fr11", "fr11R", + "fr12", "fr12R", "fr13", "fr13R", + "fr14", "fr14R", "fr15", "fr15R", + "fr16", "fr16R", "fr17", "fr17R", + "fr18", "fr18R", "fr19", "fr19R", + "fr20", "fr20R", "fr21", "fr21R", + "fr22", "fr22R", "fr23", "fr23R", + "fr24", "fr24R", "fr25", "fr25R", + "fr26", "fr26R", "fr27", "fr27R", + "fr28", "fr28R", "fr29", "fr29R", + "fr30", "fr30R", "fr31", "fr31R" + }; + if (i < 0 || i >= (sizeof (names) / sizeof (*names))) + return NULL; + else + return names[i]; +} + +const char * +hppa64_register_name (int i) +{ + static char *names[] = { + "flags", "r1", "rp", "r3", + "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", + "r12", "r13", "r14", "r15", + "r16", "r17", "r18", "r19", + "r20", "r21", "r22", "r23", + "r24", "r25", "r26", "dp", + "ret0", "ret1", "sp", "r31", + "sar", "pcoqh", "pcsqh", "pcoqt", + "pcsqt", "eiem", "iir", "isr", + "ior", "ipsw", "goto", "sr4", + "sr0", "sr1", "sr2", "sr3", + "sr5", "sr6", "sr7", "cr0", + "cr8", "cr9", "ccr", "cr12", + "cr13", "cr24", "cr25", "cr26", + "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad", + "fpsr", "fpe1", "fpe2", "fpe3", + "fr4", "fr5", "fr6", "fr7", + "fr8", "fr9", "fr10", "fr11", + "fr12", "fr13", "fr14", "fr15", + "fr16", "fr17", "fr18", "fr19", + "fr20", "fr21", "fr22", "fr23", + "fr24", "fr25", "fr26", "fr27", + "fr28", "fr29", "fr30", "fr31" + }; + if (i < 0 || i >= (sizeof (names) / sizeof (*names))) + return NULL; + else + return names[i]; +} + +/* This function pushes a stack frame with arguments as part of the + inferior function calling mechanism. + + This is the version of the function for the 32-bit PA machines, in + which later arguments appear at lower addresses. (The stack always + grows towards higher addresses.) + + We simply allocate the appropriate amount of stack space and put + arguments into their proper slots. */ + +CORE_ADDR +hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + struct regcache *regcache, CORE_ADDR bp_addr, + int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) +{ + /* Stack base address at which any pass-by-reference parameters are + stored. */ + CORE_ADDR struct_end = 0; + /* Stack base address at which the first parameter is stored. */ + CORE_ADDR param_end = 0; + + /* The inner most end of the stack after all the parameters have + been pushed. */ + CORE_ADDR new_sp = 0; + + /* Two passes. First pass computes the location of everything, + second pass writes the bytes out. */ + int write_pass; + + /* Global pointer (r19) of the function we are trying to call. */ + CORE_ADDR gp; + + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + for (write_pass = 0; write_pass < 2; write_pass++) + { + CORE_ADDR struct_ptr = 0; + /* The first parameter goes into sp-36, each stack slot is 4-bytes. + struct_ptr is adjusted for each argument below, so the first + argument will end up at sp-36. */ + CORE_ADDR param_ptr = 32; + int i; + int small_struct = 0; + + for (i = 0; i < nargs; i++) { - /* We've found the instruction that sets up the new frame - pointer. */ - cache->saved_regs[HPPA_SP_REGNUM].realreg = HPPA_R3_REGNUM; - start_pc = pc + 4; + struct value *arg = args[i]; + struct type *type = check_typedef (VALUE_TYPE (arg)); + /* The corresponding parameter that is pushed onto the + stack, and [possibly] passed in a register. */ + char param_val[8]; + int param_len; + memset (param_val, 0, sizeof param_val); + if (TYPE_LENGTH (type) > 8) + { + /* Large parameter, pass by reference. Store the value + in "struct" area and then pass its address. */ + param_len = 4; + struct_ptr += align_up (TYPE_LENGTH (type), 8); + if (write_pass) + write_memory (struct_end - struct_ptr, VALUE_CONTENTS (arg), + TYPE_LENGTH (type)); + store_unsigned_integer (param_val, 4, struct_end - struct_ptr); + } + else if (TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_ENUM) + { + /* Integer value store, right aligned. "unpack_long" + takes care of any sign-extension problems. */ + param_len = align_up (TYPE_LENGTH (type), 4); + store_unsigned_integer (param_val, param_len, + unpack_long (type, + VALUE_CONTENTS (arg))); + } + else if (TYPE_CODE (type) == TYPE_CODE_FLT) + { + /* Floating point value store, right aligned. */ + param_len = align_up (TYPE_LENGTH (type), 4); + memcpy (param_val, VALUE_CONTENTS (arg), param_len); + } + else + { + param_len = align_up (TYPE_LENGTH (type), 4); + + /* Small struct value are stored right-aligned. */ + memcpy (param_val + param_len - TYPE_LENGTH (type), + VALUE_CONTENTS (arg), TYPE_LENGTH (type)); + + /* Structures of size 5, 6 and 7 bytes are special in that + the higher-ordered word is stored in the lower-ordered + argument, and even though it is a 8-byte quantity the + registers need not be 8-byte aligned. */ + if (param_len > 4 && param_len < 8) + small_struct = 1; + } + + param_ptr += param_len; + if (param_len == 8 && !small_struct) + param_ptr = align_up (param_ptr, 8); + + /* First 4 non-FP arguments are passed in gr26-gr23. + First 4 32-bit FP arguments are passed in fr4L-fr7L. + First 2 64-bit FP arguments are passed in fr5 and fr7. + + The rest go on the stack, starting at sp-36, towards lower + addresses. 8-byte arguments must be aligned to a 8-byte + stack boundary. */ + if (write_pass) + { + write_memory (param_end - param_ptr, param_val, param_len); + + /* There are some cases when we don't know the type + expected by the callee (e.g. for variadic functions), so + pass the parameters in both general and fp regs. */ + if (param_ptr <= 48) + { + int grreg = 26 - (param_ptr - 36) / 4; + int fpLreg = 72 + (param_ptr - 36) / 4 * 2; + int fpreg = 74 + (param_ptr - 32) / 8 * 4; + + regcache_cooked_write (regcache, grreg, param_val); + regcache_cooked_write (regcache, fpLreg, param_val); + + if (param_len > 4) + { + regcache_cooked_write (regcache, grreg + 1, + param_val + 4); + + regcache_cooked_write (regcache, fpreg, param_val); + regcache_cooked_write (regcache, fpreg + 1, + param_val + 4); + } + } + } } - else if (X_OP (insn) == 0x1b && X_B (insn) == HPPA_SP_REGNUM - && X_R (insn) == HPPA_R1_REGNUM && X_DISP14 (insn) > 0) + /* Update the various stack pointers. */ + if (!write_pass) { - /* We've found the instruction that saves the old frame - pointer (living in %r1) onto the stack. */ - cache->saved_regs[HPPA_R3_REGNUM].addr = 0; - start_pc = pc + 4; + struct_end = sp + align_up (struct_ptr, 64); + /* PARAM_PTR already accounts for all the arguments passed + by the user. However, the ABI mandates minimum stack + space allocations for outgoing arguments. The ABI also + mandates minimum stack alignments which we must + preserve. */ + param_end = struct_end + align_up (param_ptr, 64); + } + } - /* Only set the frame size of we don't have a frame pointer. */ - if (cache->saved_regs[HPPA_SP_REGNUM].realreg != HPPA_R3_REGNUM) - cache->frame_size = X_DISP14 (insn); + /* If a structure has to be returned, set up register 28 to hold its + address */ + if (struct_return) + write_register (28, struct_addr); - /* The frame is fully set up now. */ - return pc + 4; - } + gp = tdep->find_global_pointer (function); + + if (gp != 0) + write_register (19, gp); + + /* Set the return address. */ + regcache_cooked_write_unsigned (regcache, HPPA_RP_REGNUM, bp_addr); + + /* Update the Stack Pointer. */ + regcache_cooked_write_unsigned (regcache, HPPA_SP_REGNUM, param_end); + + return param_end; +} - /* stwm r,d(%sp) */ - else if (X_OP (insn) == 0x1b && X_B (insn) == HPPA_SP_REGNUM - && X_R (insn) >= HPPA_R3_REGNUM - && X_R (insn) <= HPPA_R18_REGNUM - && X_DISP14 (insn) > 0) +/* This function pushes a stack frame with arguments as part of the + inferior function calling mechanism. + + This is the version for the PA64, in which later arguments appear + at higher addresses. (The stack always grows towards higher + addresses.) + + We simply allocate the appropriate amount of stack space and put + arguments into their proper slots. + + This ABI also requires that the caller provide an argument pointer + to the callee, so we do that too. */ + +CORE_ADDR +hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, + struct regcache *regcache, CORE_ADDR bp_addr, + int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) +{ + /* NOTE: cagney/2004-02-27: This is a guess - its implemented by + reverse engineering testsuite failures. */ + + /* Stack base address at which any pass-by-reference parameters are + stored. */ + CORE_ADDR struct_end = 0; + /* Stack base address at which the first parameter is stored. */ + CORE_ADDR param_end = 0; + + /* The inner most end of the stack after all the parameters have + been pushed. */ + CORE_ADDR new_sp = 0; + + /* Two passes. First pass computes the location of everything, + second pass writes the bytes out. */ + int write_pass; + for (write_pass = 0; write_pass < 2; write_pass++) + { + CORE_ADDR struct_ptr = 0; + CORE_ADDR param_ptr = 0; + int i; + for (i = 0; i < nargs; i++) { - /* stwm %r1,d(%sp) */ - if (X_R (insn) == HPPA_R1_REGNUM - && cache->saved_regs[HPPA_R3_REGNUM].realreg == HPPA_R1_REGNUM) - cache->saved_regs[HPPA_R3_REGNUM].addr = 0; + struct value *arg = args[i]; + struct type *type = check_typedef (VALUE_TYPE (arg)); + if ((TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_ENUM) + && TYPE_LENGTH (type) <= 8) + { + /* Integer value store, right aligned. "unpack_long" + takes care of any sign-extension problems. */ + param_ptr += 8; + if (write_pass) + { + ULONGEST val = unpack_long (type, VALUE_CONTENTS (arg)); + int reg = 27 - param_ptr / 8; + write_memory_unsigned_integer (param_end - param_ptr, + val, 8); + if (reg >= 19) + regcache_cooked_write_unsigned (regcache, reg, val); + } + } else - cache->saved_regs[X_R (insn)].addr = 0; + { + /* Small struct value, store left aligned? */ + int reg; + if (TYPE_LENGTH (type) > 8) + { + param_ptr = align_up (param_ptr, 16); + reg = 26 - param_ptr / 8; + param_ptr += align_up (TYPE_LENGTH (type), 16); + } + else + { + param_ptr = align_up (param_ptr, 8); + reg = 26 - param_ptr / 8; + param_ptr += align_up (TYPE_LENGTH (type), 8); + } + if (write_pass) + { + int byte; + write_memory (param_end - param_ptr, VALUE_CONTENTS (arg), + TYPE_LENGTH (type)); + for (byte = 0; byte < TYPE_LENGTH (type); byte += 8) + { + if (reg >= 19) + { + int len = min (8, TYPE_LENGTH (type) - byte); + regcache_cooked_write_part (regcache, reg, 0, len, + VALUE_CONTENTS (arg) + byte); + } + reg--; + } + } + } + } + /* Update the various stack pointers. */ + if (!write_pass) + { + struct_end = sp + struct_ptr; + /* PARAM_PTR already accounts for all the arguments passed + by the user. However, the ABI mandates minimum stack + space allocations for outgoing arguments. The ABI also + mandates minimum stack alignments which we must + preserve. */ + param_end = struct_end + max (align_up (param_ptr, 16), 64); + } + } - /* Only set the frame size of we don't have a frame pointer. */ - if (cache->saved_regs[HPPA_SP_REGNUM].realreg != HPPA_R3_REGNUM) - cache->frame_size = X_DISP14 (insn); + /* If a structure has to be returned, set up register 28 to hold its + address */ + if (struct_return) + write_register (28, struct_addr); + + /* Set the return address. */ + regcache_cooked_write_unsigned (regcache, HPPA_RP_REGNUM, bp_addr); + + /* Update the Stack Pointer. */ + regcache_cooked_write_unsigned (regcache, HPPA_SP_REGNUM, param_end + 64); + + /* The stack will have 32 bytes of additional space for a frame marker. */ + return param_end + 64; +} - /* The frame is fully set up now. */ - return pc + 4; +static CORE_ADDR +hppa32_convert_from_func_ptr_addr (struct gdbarch *gdbarch, + CORE_ADDR addr, + struct target_ops *targ) +{ + if (addr & 2) + { + CORE_ADDR plabel; + + plabel = addr & ~3; + target_read_memory(plabel, (char *)&addr, 4); + } + + return addr; +} + +static CORE_ADDR +hppa32_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) +{ + /* HP frames are 64-byte (or cache line) aligned (yes that's _byte_ + and not _bit_)! */ + return align_up (addr, 64); +} + +/* Force all frames to 16-byte alignment. Better safe than sorry. */ + +static CORE_ADDR +hppa64_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) +{ + /* Just always 16-byte align. */ + return align_up (addr, 16); +} + + +/* Get the PC from %r31 if currently in a syscall. Also mask out privilege + bits. */ + +static CORE_ADDR +hppa_target_read_pc (ptid_t ptid) +{ + int flags = read_register_pid (HPPA_FLAGS_REGNUM, ptid); + + /* The following test does not belong here. It is OS-specific, and belongs + in native code. */ + /* Test SS_INSYSCALL */ + if (flags & 2) + return read_register_pid (31, ptid) & ~0x3; + + return read_register_pid (HPPA_PCOQ_HEAD_REGNUM, ptid) & ~0x3; +} + +/* Write out the PC. If currently in a syscall, then also write the new + PC value into %r31. */ + +static void +hppa_target_write_pc (CORE_ADDR v, ptid_t ptid) +{ + int flags = read_register_pid (HPPA_FLAGS_REGNUM, ptid); + + /* The following test does not belong here. It is OS-specific, and belongs + in native code. */ + /* If in a syscall, then set %r31. Also make sure to get the + privilege bits set correctly. */ + /* Test SS_INSYSCALL */ + if (flags & 2) + write_register_pid (31, v | 0x3, ptid); + + write_register_pid (HPPA_PCOQ_HEAD_REGNUM, v, ptid); + write_register_pid (HPPA_PCOQ_TAIL_REGNUM, v + 4, ptid); +} + +/* return the alignment of a type in bytes. Structures have the maximum + alignment required by their fields. */ + +static int +hppa_alignof (struct type *type) +{ + int max_align, align, i; + CHECK_TYPEDEF (type); + switch (TYPE_CODE (type)) + { + case TYPE_CODE_PTR: + case TYPE_CODE_INT: + case TYPE_CODE_FLT: + return TYPE_LENGTH (type); + case TYPE_CODE_ARRAY: + return hppa_alignof (TYPE_FIELD_TYPE (type, 0)); + case TYPE_CODE_STRUCT: + case TYPE_CODE_UNION: + max_align = 1; + for (i = 0; i < TYPE_NFIELDS (type); i++) + { + /* Bit fields have no real alignment. */ + /* if (!TYPE_FIELD_BITPOS (type, i)) */ + if (!TYPE_FIELD_BITSIZE (type, i)) /* elz: this should be bitsize */ + { + align = hppa_alignof (TYPE_FIELD_TYPE (type, i)); + max_align = max (max_align, align); + } + } + return max_align; + default: + return 4; + } +} + +/* For the given instruction (INST), return any adjustment it makes + to the stack pointer or zero for no adjustment. + + This only handles instructions commonly found in prologues. */ + +static int +prologue_inst_adjust_sp (unsigned long inst) +{ + /* This must persist across calls. */ + static int save_high21; + + /* The most common way to perform a stack adjustment ldo X(sp),sp */ + if ((inst & 0xffffc000) == 0x37de0000) + return hppa_extract_14 (inst); + + /* stwm X,D(sp) */ + if ((inst & 0xffe00000) == 0x6fc00000) + return hppa_extract_14 (inst); + + /* std,ma X,D(sp) */ + if ((inst & 0xffe00008) == 0x73c00008) + return (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3); + + /* addil high21,%r1; ldo low11,(%r1),%r30) + save high bits in save_high21 for later use. */ + if ((inst & 0xffe00000) == 0x28200000) + { + save_high21 = hppa_extract_21 (inst); + return 0; + } + + if ((inst & 0xffff0000) == 0x343e0000) + return save_high21 + hppa_extract_14 (inst); + + /* fstws as used by the HP compilers. */ + if ((inst & 0xffffffe0) == 0x2fd01220) + return hppa_extract_5_load (inst); + + /* No adjustment. */ + return 0; +} + +/* Return nonzero if INST is a branch of some kind, else return zero. */ + +static int +is_branch (unsigned long inst) +{ + switch (inst >> 26) + { + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x27: + case 0x28: + case 0x29: + case 0x2a: + case 0x2b: + case 0x2f: + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x38: + case 0x39: + case 0x3a: + case 0x3b: + return 1; + + default: + return 0; + } +} + +/* Return the register number for a GR which is saved by INST or + zero it INST does not save a GR. */ + +static int +inst_saves_gr (unsigned long inst) +{ + /* Does it look like a stw? */ + if ((inst >> 26) == 0x1a || (inst >> 26) == 0x1b + || (inst >> 26) == 0x1f + || ((inst >> 26) == 0x1f + && ((inst >> 6) == 0xa))) + return hppa_extract_5R_store (inst); + + /* Does it look like a std? */ + if ((inst >> 26) == 0x1c + || ((inst >> 26) == 0x03 + && ((inst >> 6) & 0xf) == 0xb)) + return hppa_extract_5R_store (inst); + + /* Does it look like a stwm? GCC & HPC may use this in prologues. */ + if ((inst >> 26) == 0x1b) + return hppa_extract_5R_store (inst); + + /* Does it look like sth or stb? HPC versions 9.0 and later use these + too. */ + if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18 + || ((inst >> 26) == 0x3 + && (((inst >> 6) & 0xf) == 0x8 + || (inst >> 6) & 0xf) == 0x9)) + return hppa_extract_5R_store (inst); + + return 0; +} + +/* Return the register number for a FR which is saved by INST or + zero it INST does not save a FR. + + Note we only care about full 64bit register stores (that's the only + kind of stores the prologue will use). + + FIXME: What about argument stores with the HP compiler in ANSI mode? */ + +static int +inst_saves_fr (unsigned long inst) +{ + /* is this an FSTD ? */ + if ((inst & 0xfc00dfc0) == 0x2c001200) + return hppa_extract_5r_store (inst); + if ((inst & 0xfc000002) == 0x70000002) + return hppa_extract_5R_store (inst); + /* is this an FSTW ? */ + if ((inst & 0xfc00df80) == 0x24001200) + return hppa_extract_5r_store (inst); + if ((inst & 0xfc000002) == 0x7c000000) + return hppa_extract_5R_store (inst); + return 0; +} + +/* Advance PC across any function entry prologue instructions + to reach some "real" code. + + Use information in the unwind table to determine what exactly should + be in the prologue. */ + + +CORE_ADDR +skip_prologue_hard_way (CORE_ADDR pc) +{ + char buf[4]; + CORE_ADDR orig_pc = pc; + unsigned long inst, stack_remaining, save_gr, save_fr, save_rp, save_sp; + unsigned long args_stored, status, i, restart_gr, restart_fr; + struct unwind_table_entry *u; + + restart_gr = 0; + restart_fr = 0; + +restart: + u = find_unwind_entry (pc); + if (!u) + return pc; + + /* If we are not at the beginning of a function, then return now. */ + if ((pc & ~0x3) != u->region_start) + return pc; + + /* This is how much of a frame adjustment we need to account for. */ + stack_remaining = u->Total_frame_size << 3; + + /* Magic register saves we want to know about. */ + save_rp = u->Save_RP; + save_sp = u->Save_SP; + + /* An indication that args may be stored into the stack. Unfortunately + the HPUX compilers tend to set this in cases where no args were + stored too!. */ + args_stored = 1; + + /* Turn the Entry_GR field into a bitmask. */ + save_gr = 0; + for (i = 3; i < u->Entry_GR + 3; i++) + { + /* Frame pointer gets saved into a special location. */ + if (u->Save_SP && i == HPPA_FP_REGNUM) + continue; + + save_gr |= (1 << i); + } + save_gr &= ~restart_gr; + + /* Turn the Entry_FR field into a bitmask too. */ + save_fr = 0; + for (i = 12; i < u->Entry_FR + 12; i++) + save_fr |= (1 << i); + save_fr &= ~restart_fr; + + /* Loop until we find everything of interest or hit a branch. + + For unoptimized GCC code and for any HP CC code this will never ever + examine any user instructions. + + For optimzied GCC code we're faced with problems. GCC will schedule + its prologue and make prologue instructions available for delay slot + filling. The end result is user code gets mixed in with the prologue + and a prologue instruction may be in the delay slot of the first branch + or call. + + Some unexpected things are expected with debugging optimized code, so + we allow this routine to walk past user instructions in optimized + GCC code. */ + while (save_gr || save_fr || save_rp || save_sp || stack_remaining > 0 + || args_stored) + { + unsigned int reg_num; + unsigned long old_stack_remaining, old_save_gr, old_save_fr; + unsigned long old_save_rp, old_save_sp, next_inst; + + /* Save copies of all the triggers so we can compare them later + (only for HPC). */ + old_save_gr = save_gr; + old_save_fr = save_fr; + old_save_rp = save_rp; + old_save_sp = save_sp; + old_stack_remaining = stack_remaining; + + status = deprecated_read_memory_nobpt (pc, buf, 4); + inst = extract_unsigned_integer (buf, 4); + + /* Yow! */ + if (status != 0) + return pc; + + /* Note the interesting effects of this instruction. */ + stack_remaining -= prologue_inst_adjust_sp (inst); + + /* There are limited ways to store the return pointer into the + stack. */ + if (inst == 0x6bc23fd9 || inst == 0x0fc212c1) + save_rp = 0; + + /* These are the only ways we save SP into the stack. At this time + the HP compilers never bother to save SP into the stack. */ + if ((inst & 0xffffc000) == 0x6fc10000 + || (inst & 0xffffc00c) == 0x73c10008) + save_sp = 0; + + /* Are we loading some register with an offset from the argument + pointer? */ + if ((inst & 0xffe00000) == 0x37a00000 + || (inst & 0xffffffe0) == 0x081d0240) + { + pc += 4; + continue; } - /* ldo d(%sp),%sp */ - else if (X_OP (insn) == 0x0d && X_B (insn) == HPPA_SP_REGNUM - && X_T (insn) == HPPA_SP_REGNUM && X_DISP14 (insn) > 0) + /* Account for general and floating-point register saves. */ + reg_num = inst_saves_gr (inst); + save_gr &= ~(1 << reg_num); + + /* Ugh. Also account for argument stores into the stack. + Unfortunately args_stored only tells us that some arguments + where stored into the stack. Not how many or what kind! + + This is a kludge as on the HP compiler sets this bit and it + never does prologue scheduling. So once we see one, skip past + all of them. We have similar code for the fp arg stores below. + + FIXME. Can still die if we have a mix of GR and FR argument + stores! */ + if (reg_num >= (TARGET_PTR_BIT == 64 ? 19 : 23) && reg_num <= 26) { - cache->frame_size = X_DISP14 (insn); + while (reg_num >= (TARGET_PTR_BIT == 64 ? 19 : 23) && reg_num <= 26) + { + pc += 4; + status = deprecated_read_memory_nobpt (pc, buf, 4); + inst = extract_unsigned_integer (buf, 4); + if (status != 0) + return pc; + reg_num = inst_saves_gr (inst); + } + args_stored = 0; + continue; + } + + reg_num = inst_saves_fr (inst); + save_fr &= ~(1 << reg_num); - /* Only set the frame size of we don't have a frame pointer. */ - if (cache->saved_regs[HPPA_SP_REGNUM].realreg != HPPA_R3_REGNUM) - cache->frame_size = X_DISP14 (insn); + status = deprecated_read_memory_nobpt (pc + 4, buf, 4); + next_inst = extract_unsigned_integer (buf, 4); - /* The frame is fully set up now. */ - return pc + 4; + /* Yow! */ + if (status != 0) + return pc; + + /* We've got to be read to handle the ldo before the fp register + save. */ + if ((inst & 0xfc000000) == 0x34000000 + && inst_saves_fr (next_inst) >= 4 + && inst_saves_fr (next_inst) <= (TARGET_PTR_BIT == 64 ? 11 : 7)) + { + /* So we drop into the code below in a reasonable state. */ + reg_num = inst_saves_fr (next_inst); + pc -= 4; } + + /* Ugh. Also account for argument stores into the stack. + This is a kludge as on the HP compiler sets this bit and it + never does prologue scheduling. So once we see one, skip past + all of them. */ + if (reg_num >= 4 && reg_num <= (TARGET_PTR_BIT == 64 ? 11 : 7)) + { + while (reg_num >= 4 && reg_num <= (TARGET_PTR_BIT == 64 ? 11 : 7)) + { + pc += 8; + status = deprecated_read_memory_nobpt (pc, buf, 4); + inst = extract_unsigned_integer (buf, 4); + if (status != 0) + return pc; + if ((inst & 0xfc000000) != 0x34000000) + break; + status = deprecated_read_memory_nobpt (pc + 4, buf, 4); + next_inst = extract_unsigned_integer (buf, 4); + if (status != 0) + return pc; + reg_num = inst_saves_fr (next_inst); + } + args_stored = 0; + continue; + } + + /* Quit if we hit any kind of branch. This can happen if a prologue + instruction is in the delay slot of the first call/branch. */ + if (is_branch (inst)) + break; + + /* What a crock. The HP compilers set args_stored even if no + arguments were stored into the stack (boo hiss). This could + cause this code to then skip a bunch of user insns (up to the + first branch). + + To combat this we try to identify when args_stored was bogusly + set and clear it. We only do this when args_stored is nonzero, + all other resources are accounted for, and nothing changed on + this pass. */ + if (args_stored + && !(save_gr || save_fr || save_rp || save_sp || stack_remaining > 0) + && old_save_gr == save_gr && old_save_fr == save_fr + && old_save_rp == save_rp && old_save_sp == save_sp + && old_stack_remaining == stack_remaining) + break; + + /* Bump the PC. */ + pc += 4; } - return start_pc; + /* We've got a tenative location for the end of the prologue. However + because of limitations in the unwind descriptor mechanism we may + have went too far into user code looking for the save of a register + that does not exist. So, if there registers we expected to be saved + but never were, mask them out and restart. + + This should only happen in optimized code, and should be very rare. */ + if (save_gr || (save_fr && !(restart_fr || restart_gr))) + { + pc = orig_pc; + restart_gr = save_gr; + restart_fr = save_fr; + goto restart; + } + + return pc; } + +/* Return the address of the PC after the last prologue instruction if + we can determine it from the debug symbols. Else return zero. */ + static CORE_ADDR -hppa32_skip_prologue (CORE_ADDR start_pc) +after_prologue (CORE_ADDR pc) { struct symtab_and_line sal; - CORE_ADDR func_start, func_end; + CORE_ADDR func_addr, func_end; + struct symbol *f; + + /* If we can not find the symbol in the partial symbol table, then + there is no hope we can determine the function's start address + with this code. */ + if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end)) + return 0; + + /* Get the line associated with FUNC_ADDR. */ + sal = find_pc_line (func_addr, 0); + + /* There are only two cases to consider. First, the end of the source line + is within the function bounds. In that case we return the end of the + source line. Second is the end of the source line extends beyond the + bounds of the current function. We need to use the slow code to + examine instructions in that case. + + Anything else is simply a bug elsewhere. Fixing it here is absolutely + the wrong thing to do. In fact, it should be entirely possible for this + function to always return zero since the slow instruction scanning code + is supposed to *always* work. If it does not, then it is a bug. */ + if (sal.end < func_end) + return sal.end; + else + return 0; +} - /* This is the preferred method, find the end of the prologue by - using the debugging information. */ - if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end)) +/* To skip prologues, I use this predicate. Returns either PC itself + if the code at PC does not look like a function prologue; otherwise + returns an address that (if we're lucky) follows the prologue. If + LENIENT, then we must skip everything which is involved in setting + up the frame (it's OK to skip more, just so long as we don't skip + anything which might clobber the registers which are being saved. + Currently we must not skip more on the alpha, but we might the lenient + stuff some day. */ + +static CORE_ADDR +hppa_skip_prologue (CORE_ADDR pc) +{ + unsigned long inst; + int offset; + CORE_ADDR post_prologue_pc; + char buf[4]; + + /* See if we can determine the end of the prologue via the symbol table. + If so, then return either PC, or the PC after the prologue, whichever + is greater. */ + + post_prologue_pc = after_prologue (pc); + + /* If after_prologue returned a useful address, then use it. Else + fall back on the instruction skipping code. + + Some folks have claimed this causes problems because the breakpoint + may be the first instruction of the prologue. If that happens, then + the instruction skipping code has a bug that needs to be fixed. */ + if (post_prologue_pc != 0) + return max (pc, post_prologue_pc); + else + return (skip_prologue_hard_way (pc)); +} + +struct hppa_frame_cache +{ + CORE_ADDR base; + struct trad_frame_saved_reg *saved_regs; +}; + +static struct hppa_frame_cache * +hppa_frame_cache (struct frame_info *next_frame, void **this_cache) +{ + struct hppa_frame_cache *cache; + long saved_gr_mask; + long saved_fr_mask; + CORE_ADDR this_sp; + long frame_size; + struct unwind_table_entry *u; + CORE_ADDR prologue_end; + int i; + + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "{ hppa_frame_cache (frame=%d) -> ", + frame_relative_level(next_frame)); + + if ((*this_cache) != NULL) { - sal = find_pc_line (func_start, 0); + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "base=0x%s (cached) }", + paddr_nz (((struct hppa_frame_cache *)*this_cache)->base)); + return (*this_cache); + } + cache = FRAME_OBSTACK_ZALLOC (struct hppa_frame_cache); + (*this_cache) = cache; + cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); - if (sal.end < func_end - && start_pc <= sal.end) - return sal.end; + /* Yow! */ + u = find_unwind_entry (frame_pc_unwind (next_frame)); + if (!u) + { + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "base=NULL (no unwind entry) }"); + return (*this_cache); } - /* Analyze the prologue. */ - return hppa32_analyze_prologue (start_pc, (CORE_ADDR) -1, NULL); + /* Turn the Entry_GR field into a bitmask. */ + saved_gr_mask = 0; + for (i = 3; i < u->Entry_GR + 3; i++) + { + /* Frame pointer gets saved into a special location. */ + if (u->Save_SP && i == HPPA_FP_REGNUM) + continue; + + saved_gr_mask |= (1 << i); + } + + /* Turn the Entry_FR field into a bitmask too. */ + saved_fr_mask = 0; + for (i = 12; i < u->Entry_FR + 12; i++) + saved_fr_mask |= (1 << i); + + /* Loop until we find everything of interest or hit a branch. + + For unoptimized GCC code and for any HP CC code this will never ever + examine any user instructions. + + For optimized GCC code we're faced with problems. GCC will schedule + its prologue and make prologue instructions available for delay slot + filling. The end result is user code gets mixed in with the prologue + and a prologue instruction may be in the delay slot of the first branch + or call. + + Some unexpected things are expected with debugging optimized code, so + we allow this routine to walk past user instructions in optimized + GCC code. */ + { + int final_iteration = 0; + CORE_ADDR pc, end_pc; + int looking_for_sp = u->Save_SP; + int looking_for_rp = u->Save_RP; + int fp_loc = -1; + + /* We have to use hppa_skip_prologue instead of just + skip_prologue_using_sal, in case we stepped into a function without + symbol information. hppa_skip_prologue also bounds the returned + pc by the passed in pc, so it will not return a pc in the next + function. */ + + /* We used to use frame_func_unwind () to locate the beginning of the + function to pass to skip_prologue (). However, when objects are + compiled without debug symbols, frame_func_unwind can return the wrong + function (or 0). We can do better than that by using unwind records. */ + + prologue_end = hppa_skip_prologue (u->region_start); + end_pc = frame_pc_unwind (next_frame); + + if (prologue_end != 0 && end_pc > prologue_end) + end_pc = prologue_end; + + frame_size = 0; + + for (pc = u->region_start; + ((saved_gr_mask || saved_fr_mask + || looking_for_sp || looking_for_rp + || frame_size < (u->Total_frame_size << 3)) + && pc < end_pc); + pc += 4) + { + int reg; + char buf4[4]; + long status = deprecated_read_memory_nobpt (pc, buf4, sizeof buf4); + long inst = extract_unsigned_integer (buf4, sizeof buf4); + + /* Note the interesting effects of this instruction. */ + frame_size += prologue_inst_adjust_sp (inst); + + /* There are limited ways to store the return pointer into the + stack. */ + if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */ + { + looking_for_rp = 0; + cache->saved_regs[HPPA_RP_REGNUM].addr = -20; + } + else if (inst == 0x6bc23fd1) /* stw rp,-0x18(sr0,sp) */ + { + looking_for_rp = 0; + cache->saved_regs[HPPA_RP_REGNUM].addr = -24; + } + else if (inst == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */ + { + looking_for_rp = 0; + cache->saved_regs[HPPA_RP_REGNUM].addr = -16; + } + + /* Check to see if we saved SP into the stack. This also + happens to indicate the location of the saved frame + pointer. */ + if ((inst & 0xffffc000) == 0x6fc10000 /* stw,ma r1,N(sr0,sp) */ + || (inst & 0xffffc00c) == 0x73c10008) /* std,ma r1,N(sr0,sp) */ + { + looking_for_sp = 0; + cache->saved_regs[HPPA_FP_REGNUM].addr = 0; + } + + /* Account for general and floating-point register saves. */ + reg = inst_saves_gr (inst); + if (reg >= 3 && reg <= 18 + && (!u->Save_SP || reg != HPPA_FP_REGNUM)) + { + saved_gr_mask &= ~(1 << reg); + if ((inst >> 26) == 0x1b && hppa_extract_14 (inst) >= 0) + /* stwm with a positive displacement is a _post_ + _modify_. */ + cache->saved_regs[reg].addr = 0; + else if ((inst & 0xfc00000c) == 0x70000008) + /* A std has explicit post_modify forms. */ + cache->saved_regs[reg].addr = 0; + else + { + CORE_ADDR offset; + + if ((inst >> 26) == 0x1c) + offset = (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3); + else if ((inst >> 26) == 0x03) + offset = hppa_low_hppa_sign_extend (inst & 0x1f, 5); + else + offset = hppa_extract_14 (inst); + + /* Handle code with and without frame pointers. */ + if (u->Save_SP) + cache->saved_regs[reg].addr = offset; + else + cache->saved_regs[reg].addr = (u->Total_frame_size << 3) + offset; + } + } + + /* GCC handles callee saved FP regs a little differently. + + It emits an instruction to put the value of the start of + the FP store area into %r1. It then uses fstds,ma with a + basereg of %r1 for the stores. + + HP CC emits them at the current stack pointer modifying the + stack pointer as it stores each register. */ + + /* ldo X(%r3),%r1 or ldo X(%r30),%r1. */ + if ((inst & 0xffffc000) == 0x34610000 + || (inst & 0xffffc000) == 0x37c10000) + fp_loc = hppa_extract_14 (inst); + + reg = inst_saves_fr (inst); + if (reg >= 12 && reg <= 21) + { + /* Note +4 braindamage below is necessary because the FP + status registers are internally 8 registers rather than + the expected 4 registers. */ + saved_fr_mask &= ~(1 << reg); + if (fp_loc == -1) + { + /* 1st HP CC FP register store. After this + instruction we've set enough state that the GCC and + HPCC code are both handled in the same manner. */ + cache->saved_regs[reg + HPPA_FP4_REGNUM + 4].addr = 0; + fp_loc = 8; + } + else + { + cache->saved_regs[reg + HPPA_FP0_REGNUM + 4].addr = fp_loc; + fp_loc += 8; + } + } + + /* Quit if we hit any kind of branch the previous iteration. */ + if (final_iteration) + break; + /* We want to look precisely one instruction beyond the branch + if we have not found everything yet. */ + if (is_branch (inst)) + final_iteration = 1; + } + } + + { + /* The frame base always represents the value of %sp at entry to + the current function (and is thus equivalent to the "saved" + stack pointer. */ + CORE_ADDR this_sp = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM); + CORE_ADDR fp; + + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, " (this_sp=0x%s, pc=0x%s, " + "prologue_end=0x%s) ", + paddr_nz (this_sp), + paddr_nz (frame_pc_unwind (next_frame)), + paddr_nz (prologue_end)); + + /* Check to see if a frame pointer is available, and use it for + frame unwinding if it is. + + There are some situations where we need to rely on the frame + pointer to do stack unwinding. For example, if a function calls + alloca (), the stack pointer can get adjusted inside the body of + the function. In this case, the ABI requires that the compiler + maintain a frame pointer for the function. + + The unwind record has a flag (alloca_frame) that indicates that + a function has a variable frame; unfortunately, gcc/binutils + does not set this flag. Instead, whenever a frame pointer is used + and saved on the stack, the Save_SP flag is set. We use this to + decide whether to use the frame pointer for unwinding. + + fp may be zero if it is not available in an inner frame because + it has been modified by not yet saved. + + TODO: For the HP compiler, maybe we should use the alloca_frame flag + instead of Save_SP. */ + + fp = frame_unwind_register_unsigned (next_frame, HPPA_FP_REGNUM); + + if (frame_pc_unwind (next_frame) >= prologue_end + && u->Save_SP && fp != 0) + { + cache->base = fp; + + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [frame pointer] }", + paddr_nz (cache->base)); + } + else if (u->Save_SP + && trad_frame_addr_p (cache->saved_regs, HPPA_SP_REGNUM)) + { + /* Both we're expecting the SP to be saved and the SP has been + saved. The entry SP value is saved at this frame's SP + address. */ + cache->base = read_memory_integer (this_sp, TARGET_PTR_BIT / 8); + + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [saved] }", + paddr_nz (cache->base)); + } + else + { + /* The prologue has been slowly allocating stack space. Adjust + the SP back. */ + cache->base = this_sp - frame_size; + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [unwind adjust] } ", + paddr_nz (cache->base)); + + } + trad_frame_set_value (cache->saved_regs, HPPA_SP_REGNUM, cache->base); + } + + /* The PC is found in the "return register", "Millicode" uses "r31" + as the return register while normal code uses "rp". */ + if (u->Millicode) + { + if (trad_frame_addr_p (cache->saved_regs, 31)) + cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[31]; + else + { + ULONGEST r31 = frame_unwind_register_unsigned (next_frame, 31); + trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, r31); + } + } + else + { + if (trad_frame_addr_p (cache->saved_regs, HPPA_RP_REGNUM)) + cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM]; + else + { + ULONGEST rp = frame_unwind_register_unsigned (next_frame, HPPA_RP_REGNUM); + trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, rp); + } + } + + /* If the frame pointer was not saved in this frame, but we should be saving + it, set it to an invalid value so that another frame will not pick up the + wrong frame pointer. This can happen if we start unwinding after the + frame pointer has been modified, but before we've saved it to the + stack. */ + if (u->Save_SP && !trad_frame_addr_p (cache->saved_regs, HPPA_FP_REGNUM)) + trad_frame_set_value (cache->saved_regs, HPPA_FP_REGNUM, 0); + + { + /* Convert all the offsets into addresses. */ + int reg; + for (reg = 0; reg < NUM_REGS; reg++) + { + if (trad_frame_addr_p (cache->saved_regs, reg)) + cache->saved_regs[reg].addr += cache->base; + } + } + + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "base=0x%s }", + paddr_nz (((struct hppa_frame_cache *)*this_cache)->base)); + return (*this_cache); +} + +static void +hppa_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) +{ + struct hppa_frame_cache *info; + CORE_ADDR pc = frame_pc_unwind (next_frame); + struct unwind_table_entry *u; + + info = hppa_frame_cache (next_frame, this_cache); + u = find_unwind_entry (pc); + + (*this_id) = frame_id_build (info->base, u->region_start); } +static void +hppa_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct hppa_frame_cache *info = hppa_frame_cache (next_frame, this_cache); + hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind hppa_frame_unwind = +{ + NORMAL_FRAME, + hppa_frame_this_id, + hppa_frame_prev_register +}; + +static const struct frame_unwind * +hppa_frame_unwind_sniffer (struct frame_info *next_frame) +{ + CORE_ADDR pc = frame_pc_unwind (next_frame); + + if (find_unwind_entry (pc)) + return &hppa_frame_unwind; + + return NULL; +} + +/* This is a generic fallback frame unwinder that kicks in if we fail all + the other ones. Normally we would expect the stub and regular unwinder + to work, but in some cases we might hit a function that just doesn't + have any unwind information available. In this case we try to do + unwinding solely based on code reading. This is obviously going to be + slow, so only use this as a last resort. Currently this will only + identify the stack and pc for the frame. */ + static struct hppa_frame_cache * -hppa32_frame_cache (struct frame_info *next_frame, void **this_cache) +hppa_fallback_frame_cache (struct frame_info *next_frame, void **this_cache) { struct hppa_frame_cache *cache; - int regnum; + unsigned int frame_size; + int found_rp; + CORE_ADDR pc, start_pc, end_pc, cur_pc; - if (*this_cache) - return *this_cache; + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, "{ hppa_fallback_frame_cache (frame=%d)-> ", + frame_relative_level(next_frame)); - /* Allocate a new cache. */ cache = FRAME_OBSTACK_ZALLOC (struct hppa_frame_cache); + (*this_cache) = cache; cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); - cache->frame_size = 0; - cache->pc = frame_func_unwind (next_frame); - if (cache->pc != 0) + pc = frame_func_unwind (next_frame); + cur_pc = frame_pc_unwind (next_frame); + frame_size = 0; + found_rp = 0; + + find_pc_partial_function (pc, NULL, &start_pc, &end_pc); + + if (start_pc == 0 || end_pc == 0) { - CORE_ADDR addr_in_block = frame_unwind_address_in_block (next_frame); - hppa32_analyze_prologue (cache->pc, addr_in_block, cache); + error ("Cannot find bounds of current function (@0x%s), unwinding will " + "fail.", paddr_nz (pc)); + return cache; } - /* Calculate this frame's base. */ - gdb_assert (trad_frame_realreg_p (cache->saved_regs, HPPA_SP_REGNUM)); - regnum = cache->saved_regs[HPPA_SP_REGNUM].realreg; - cache->base = frame_unwind_register_unsigned (next_frame, regnum); - if (cache->frame_size > 0) + if (end_pc > cur_pc) + end_pc = cur_pc; + + for (pc = start_pc; pc < end_pc; pc += 4) { - cache->base -= cache->frame_size; - trad_frame_set_value (cache->saved_regs, HPPA_SP_REGNUM, cache->base); + unsigned int insn; + + insn = read_memory_unsigned_integer (pc, 4); + + frame_size += prologue_inst_adjust_sp (insn); + + /* There are limited ways to store the return pointer into the + stack. */ + if (insn == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */ + { + cache->saved_regs[HPPA_RP_REGNUM].addr = -20; + found_rp = 1; + } + else if (insn == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */ + { + cache->saved_regs[HPPA_RP_REGNUM].addr = -16; + found_rp = 1; + } } - for (regnum = HPPA_R1_REGNUM; regnum < HPPA32_NUM_REGS; regnum++) + if (hppa_debug) + fprintf_unfiltered (gdb_stdlog, " frame_size = %d, found_rp = %d }\n", + frame_size, found_rp); + + cache->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM) - frame_size; + trad_frame_set_value (cache->saved_regs, HPPA_SP_REGNUM, cache->base); + + if (trad_frame_addr_p (cache->saved_regs, HPPA_RP_REGNUM)) { - if (trad_frame_addr_p (cache->saved_regs, regnum)) - cache->saved_regs[regnum].addr += cache->base; + cache->saved_regs[HPPA_RP_REGNUM].addr += cache->base; + cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM]; + } + else + { + ULONGEST rp = frame_unwind_register_unsigned (next_frame, HPPA_RP_REGNUM); + trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, rp); } - /* Identify the head of the program counter offset queue (%pcoqh) - with the return pointer (%rp). */ - cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM]; - - *this_cache = cache; return cache; } static void -hppa32_frame_this_id (struct frame_info *next_frame, void **this_cache, - struct frame_id *this_id) +hppa_fallback_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) { - struct hppa_frame_cache *cache = - hppa32_frame_cache (next_frame, this_cache); + struct hppa_frame_cache *info = + hppa_fallback_frame_cache (next_frame, this_cache); + (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame)); +} - /* This marks the outermost frame. */ - if (cache->base == 0) - return; +static void +hppa_fallback_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct hppa_frame_cache *info = + hppa_fallback_frame_cache (next_frame, this_cache); + hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind hppa_fallback_frame_unwind = +{ + NORMAL_FRAME, + hppa_fallback_frame_this_id, + hppa_fallback_frame_prev_register +}; - (*this_id) = frame_id_build (cache->base, cache->pc); +static const struct frame_unwind * +hppa_fallback_unwind_sniffer (struct frame_info *next_frame) +{ + return &hppa_fallback_frame_unwind; } -static void -hppa32_frame_prev_register (struct frame_info *next_frame, void **this_cache, - int regnum, int *optimizedp, - enum lval_type *lvalp, CORE_ADDR *addrp, - int *realnump, void *valuep) +/* Stub frames, used for all kinds of call stubs. */ +struct hppa_stub_unwind_cache +{ + CORE_ADDR base; + struct trad_frame_saved_reg *saved_regs; +}; + +static struct hppa_stub_unwind_cache * +hppa_stub_frame_unwind_cache (struct frame_info *next_frame, + void **this_cache) { - struct hppa_frame_cache *cache = - hppa32_frame_cache (next_frame, this_cache); + struct gdbarch *gdbarch = get_frame_arch (next_frame); + struct hppa_stub_unwind_cache *info; + struct unwind_table_entry *u; - if (regnum == HPPA_PCOQ_TAIL_REGNUM) + if (*this_cache) + return *this_cache; + + info = FRAME_OBSTACK_ZALLOC (struct hppa_stub_unwind_cache); + *this_cache = info; + info->saved_regs = trad_frame_alloc_saved_regs (next_frame); + + info->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM); + + if (gdbarch_osabi (gdbarch) == GDB_OSABI_HPUX_SOM) { - if (valuep) - { - CORE_ADDR pc; + /* HPUX uses export stubs in function calls; the export stub clobbers + the return value of the caller, and, later restores it from the + stack. */ + u = find_unwind_entry (frame_pc_unwind (next_frame)); - /* Fetch the head of the program counter offset queue - (%pcoqh). */ - trad_frame_prev_register (next_frame, cache->saved_regs, - HPPA_PCOQ_HEAD_REGNUM, optimizedp, - lvalp, addrp, realnump, valuep); + if (u && u->stub_unwind.stub_type == EXPORT) + { + info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = info->base - 24; - /* Now compute its tail (%pcoqt) by adding four bytes such - that it points at the next instruction. */ - pc = extract_unsigned_integer (valuep, 4); - store_unsigned_integer (valuep, 4, pc + 4); + return info; } - - /* It's a computed value. */ - *optimizedp = 0; - *lvalp = not_lval; - *addrp = 0; - *realnump = -1; - return; } - trad_frame_prev_register (next_frame, cache->saved_regs, regnum, - optimizedp, lvalp, addrp, realnump, valuep); + /* By default we assume that stubs do not change the rp. */ + info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].realreg = HPPA_RP_REGNUM; + + return info; +} + +static void +hppa_stub_frame_this_id (struct frame_info *next_frame, + void **this_prologue_cache, + struct frame_id *this_id) +{ + struct hppa_stub_unwind_cache *info + = hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache); + *this_id = frame_id_build (info->base, frame_pc_unwind (next_frame)); } -static const struct frame_unwind hppa32_frame_unwind = +static void +hppa_stub_frame_prev_register (struct frame_info *next_frame, + void **this_prologue_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) { + struct hppa_stub_unwind_cache *info + = hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache); + hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind hppa_stub_frame_unwind = { NORMAL_FRAME, - hppa32_frame_this_id, - hppa32_frame_prev_register + hppa_stub_frame_this_id, + hppa_stub_frame_prev_register }; static const struct frame_unwind * -hppa32_frame_sniffer (struct frame_info *next_frame) +hppa_stub_unwind_sniffer (struct frame_info *next_frame) { - return &hppa32_frame_unwind; + CORE_ADDR pc = frame_pc_unwind (next_frame); + + if (pc == 0 + || IN_SOLIB_CALL_TRAMPOLINE (pc, NULL) + || IN_SOLIB_RETURN_TRAMPOLINE (pc, NULL)) + return &hppa_stub_frame_unwind; + return NULL; +} + +static struct frame_id +hppa_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + return frame_id_build (frame_unwind_register_unsigned (next_frame, + HPPA_SP_REGNUM), + frame_pc_unwind (next_frame)); } - static CORE_ADDR -hppa32_frame_base_address (struct frame_info *next_frame, void **this_cache) +hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { - struct hppa_frame_cache *cache = - hppa32_frame_cache (next_frame, this_cache); + return frame_unwind_register_signed (next_frame, HPPA_PCOQ_HEAD_REGNUM) & ~3; +} - return cache->base; +/* Instead of this nasty cast, add a method pvoid() that prints out a + host VOID data type (remember %p isn't portable). */ + +static CORE_ADDR +hppa_pointer_to_address_hack (void *ptr) +{ + gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr)); + return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr); } -static const struct frame_base hppa32_frame_base = +static void +unwind_command (char *exp, int from_tty) { - &hppa32_frame_unwind, - hppa32_frame_base_address, - hppa32_frame_base_address, - hppa32_frame_base_address -}; - + CORE_ADDR address; + struct unwind_table_entry *u; + + /* If we have an expression, evaluate it and use it as the address. */ + + if (exp != 0 && *exp != 0) + address = parse_and_eval_address (exp); + else + return; + + u = find_unwind_entry (address); + + if (!u) + { + printf_unfiltered ("Can't find unwind table entry for %s\n", exp); + return; + } + + printf_unfiltered ("unwind_table_entry (0x%s):\n", + paddr_nz (hppa_pointer_to_address_hack (u))); + + printf_unfiltered ("\tregion_start = "); + print_address (u->region_start, gdb_stdout); + gdb_flush (gdb_stdout); + + printf_unfiltered ("\n\tregion_end = "); + print_address (u->region_end, gdb_stdout); + gdb_flush (gdb_stdout); + +#define pif(FLD) if (u->FLD) printf_unfiltered (" "#FLD); + + printf_unfiltered ("\n\tflags ="); + pif (Cannot_unwind); + pif (Millicode); + pif (Millicode_save_sr0); + pif (Entry_SR); + pif (Args_stored); + pif (Variable_Frame); + pif (Separate_Package_Body); + pif (Frame_Extension_Millicode); + pif (Stack_Overflow_Check); + pif (Two_Instruction_SP_Increment); + pif (Ada_Region); + pif (Save_SP); + pif (Save_RP); + pif (Save_MRP_in_frame); + pif (extn_ptr_defined); + pif (Cleanup_defined); + pif (MPE_XL_interrupt_marker); + pif (HP_UX_interrupt_marker); + pif (Large_frame); + + putchar_unfiltered ('\n'); + +#define pin(FLD) printf_unfiltered ("\t"#FLD" = 0x%x\n", u->FLD); + + pin (Region_description); + pin (Entry_FR); + pin (Entry_GR); + pin (Total_frame_size); +} + +void +hppa_skip_permanent_breakpoint (void) +{ + /* To step over a breakpoint instruction on the PA takes some + fiddling with the instruction address queue. + + When we stop at a breakpoint, the IA queue front (the instruction + we're executing now) points at the breakpoint instruction, and + the IA queue back (the next instruction to execute) points to + whatever instruction we would execute after the breakpoint, if it + were an ordinary instruction. This is the case even if the + breakpoint is in the delay slot of a branch instruction. + + Clearly, to step past the breakpoint, we need to set the queue + front to the back. But what do we put in the back? What + instruction comes after that one? Because of the branch delay + slot, the next insn is always at the back + 4. */ + write_register (HPPA_PCOQ_HEAD_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM)); + write_register (HPPA_PCSQ_HEAD_REGNUM, read_register (HPPA_PCSQ_TAIL_REGNUM)); + + write_register (HPPA_PCOQ_TAIL_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM) + 4); + /* We can leave the tail's space the same, since there's no jump. */ +} + +int +hppa_pc_requires_run_before_use (CORE_ADDR pc) +{ + /* Sometimes we may pluck out a minimal symbol that has a negative address. + + An example of this occurs when an a.out is linked against a foo.sl. + The foo.sl defines a global bar(), and the a.out declares a signature + for bar(). However, the a.out doesn't directly call bar(), but passes + its address in another call. + + If you have this scenario and attempt to "break bar" before running, + gdb will find a minimal symbol for bar() in the a.out. But that + symbol's address will be negative. What this appears to denote is + an index backwards from the base of the procedure linkage table (PLT) + into the data linkage table (DLT), the end of which is contiguous + with the start of the PLT. This is clearly not a valid address for + us to set a breakpoint on. + + Note that one must be careful in how one checks for a negative address. + 0xc0000000 is a legitimate address of something in a shared text + segment, for example. Since I don't know what the possible range + is of these "really, truly negative" addresses that come from the + minimal symbols, I'm resorting to the gross hack of checking the + top byte of the address for all 1's. Sigh. */ + + return (!target_has_stack && (pc & 0xFF000000)); +} + +int +hppa_instruction_nullified (void) +{ + /* brobecker 2002/11/07: Couldn't we use a ULONGEST here? It would + avoid the type cast. I'm leaving it as is for now as I'm doing + semi-mechanical multiarching-related changes. */ + const int ipsw = (int) read_register (HPPA_IPSW_REGNUM); + const int flags = (int) read_register (HPPA_FLAGS_REGNUM); + + return ((ipsw & 0x00200000) && !(flags & 0x2)); +} + +/* Return the GDB type object for the "standard" data type of data + in register N. */ + +static struct type * +hppa32_register_type (struct gdbarch *gdbarch, int reg_nr) +{ + if (reg_nr < HPPA_FP4_REGNUM) + return builtin_type_uint32; + else + return builtin_type_ieee_single_big; +} + +/* Return the GDB type object for the "standard" data type of data + in register N. hppa64 version. */ + +static struct type * +hppa64_register_type (struct gdbarch *gdbarch, int reg_nr) +{ + if (reg_nr < HPPA_FP4_REGNUM) + return builtin_type_uint64; + else + return builtin_type_ieee_double_big; +} + +/* Return True if REGNUM is not a register available to the user + through ptrace(). */ + +static int +hppa_cannot_store_register (int regnum) +{ + return (regnum == 0 + || regnum == HPPA_PCSQ_HEAD_REGNUM + || (regnum >= HPPA_PCSQ_TAIL_REGNUM && regnum < HPPA_IPSW_REGNUM) + || (regnum > HPPA_IPSW_REGNUM && regnum < HPPA_FP4_REGNUM)); + +} + +static CORE_ADDR +hppa_smash_text_address (CORE_ADDR addr) +{ + /* The low two bits of the PC on the PA contain the privilege level. + Some genius implementing a (non-GCC) compiler apparently decided + this means that "addresses" in a text section therefore include a + privilege level, and thus symbol tables should contain these bits. + This seems like a bonehead thing to do--anyway, it seems to work + for our purposes to just ignore those bits. */ + + return (addr &= ~0x3); +} + +/* Get the ith function argument for the current function. */ +CORE_ADDR +hppa_fetch_pointer_argument (struct frame_info *frame, int argi, + struct type *type) +{ + CORE_ADDR addr; + get_frame_register (frame, HPPA_R0_REGNUM + 26 - argi, &addr); + return addr; +} static void -hppa_write_pc (CORE_ADDR pc, ptid_t ptid) +hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, + int regnum, void *buf) { - write_register_pid (HPPA_PCOQ_HEAD_REGNUM, pc, ptid); - write_register_pid (HPPA_PCOQ_TAIL_REGNUM, pc + 4, ptid); + ULONGEST tmp; + + regcache_raw_read_unsigned (regcache, regnum, &tmp); + if (regnum == HPPA_PCOQ_HEAD_REGNUM || regnum == HPPA_PCOQ_TAIL_REGNUM) + tmp &= ~0x3; + store_unsigned_integer (buf, sizeof(tmp), tmp); } - static CORE_ADDR -hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) +hppa_find_global_pointer (struct value *function) { - CORE_ADDR pc; + return 0; +} + +void +hppa_frame_prev_register_helper (struct frame_info *next_frame, + struct trad_frame_saved_reg saved_regs[], + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + if (regnum == HPPA_PCOQ_TAIL_REGNUM) + { + if (valuep) + { + CORE_ADDR pc; - pc = frame_unwind_register_unsigned (next_frame, HPPA_PCOQ_HEAD_REGNUM); - return hppa_addr_bits_remove (pc); + trad_frame_get_prev_register (next_frame, saved_regs, + HPPA_PCOQ_HEAD_REGNUM, optimizedp, + lvalp, addrp, realnump, valuep); + + pc = extract_unsigned_integer (valuep, 4); + store_unsigned_integer (valuep, 4, pc + 4); + } + + /* It's a computed value. */ + *optimizedp = 0; + *lvalp = not_lval; + *addrp = 0; + *realnump = -1; + return; + } + + trad_frame_get_prev_register (next_frame, saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); } +/* Here is a table of C type sizes on hppa with various compiles + and options. I measured this on PA 9000/800 with HP-UX 11.11 + and these compilers: + + /usr/ccs/bin/cc HP92453-01 A.11.01.21 + /opt/ansic/bin/cc HP92453-01 B.11.11.28706.GP + /opt/aCC/bin/aCC B3910B A.03.45 + gcc gcc 3.3.2 native hppa2.0w-hp-hpux11.11 + + cc : 1 2 4 4 8 : 4 8 -- : 4 4 + ansic +DA1.1 : 1 2 4 4 8 : 4 8 16 : 4 4 + ansic +DA2.0 : 1 2 4 4 8 : 4 8 16 : 4 4 + ansic +DA2.0W : 1 2 4 8 8 : 4 8 16 : 8 8 + acc +DA1.1 : 1 2 4 4 8 : 4 8 16 : 4 4 + acc +DA2.0 : 1 2 4 4 8 : 4 8 16 : 4 4 + acc +DA2.0W : 1 2 4 8 8 : 4 8 16 : 8 8 + gcc : 1 2 4 4 8 : 4 8 16 : 4 4 + + Each line is: + + compiler and options + char, short, int, long, long long + float, double, long double + char *, void (*)() + + So all these compilers use either ILP32 or LP64 model. + TODO: gcc has more options so it needs more investigation. + + For floating point types, see: + + http://docs.hp.com/hpux/pdf/B3906-90006.pdf + HP-UX floating-point guide, hpux 11.00 + + -- chastain 2003-12-18 */ + static struct gdbarch * -hppa32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) +hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch_tdep *tdep; struct gdbarch *gdbarch; + + /* Try to determine the ABI of the object we are loading. */ + if (info.abfd != NULL && info.osabi == GDB_OSABI_UNKNOWN) + { + /* If it's a SOM file, assume it's HP/UX SOM. */ + if (bfd_get_flavour (info.abfd) == bfd_target_som_flavour) + info.osabi = GDB_OSABI_HPUX_SOM; + } - /* If there is already a candidate, use it. */ + /* find a candidate among the list of pre-declared architectures. */ arches = gdbarch_list_lookup_by_info (arches, &info); if (arches != NULL) - return arches->gdbarch; + return (arches->gdbarch); - /* Allocate space for the new architecture. */ - tdep = XMALLOC (struct gdbarch_tdep); + /* If none found, then allocate and initialize one. */ + tdep = XZALLOC (struct gdbarch_tdep); gdbarch = gdbarch_alloc (&info, tdep); - set_gdbarch_long_double_bit (gdbarch, 128); - set_gdbarch_long_double_format (gdbarch, &floatformat_hppa_quad); + /* Determine from the bfd_arch_info structure if we are dealing with + a 32 or 64 bits architecture. If the bfd_arch_info is not available, + then default to a 32bit machine. */ + if (info.bfd_arch_info != NULL) + tdep->bytes_per_address = + info.bfd_arch_info->bits_per_address / info.bfd_arch_info->bits_per_byte; + else + tdep->bytes_per_address = 4; - set_gdbarch_num_regs (gdbarch, HPPA32_NUM_REGS); - set_gdbarch_register_name (gdbarch, hppa32_register_name); - set_gdbarch_register_type (gdbarch, hppa32_register_type); + tdep->find_global_pointer = hppa_find_global_pointer; - /* Register numbers of various important registers. */ - set_gdbarch_sp_regnum (gdbarch, HPPA_SP_REGNUM); /* %sp */ - set_gdbarch_pc_regnum (gdbarch, HPPA_PCOQ_HEAD_REGNUM); /* %pc */ + /* Some parts of the gdbarch vector depend on whether we are running + on a 32 bits or 64 bits target. */ + switch (tdep->bytes_per_address) + { + case 4: + set_gdbarch_num_regs (gdbarch, hppa32_num_regs); + set_gdbarch_register_name (gdbarch, hppa32_register_name); + set_gdbarch_register_type (gdbarch, hppa32_register_type); + break; + case 8: + set_gdbarch_num_regs (gdbarch, hppa64_num_regs); + set_gdbarch_register_name (gdbarch, hppa64_register_name); + set_gdbarch_register_type (gdbarch, hppa64_register_type); + break; + default: + internal_error (__FILE__, __LINE__, "Unsupported address size: %d", + tdep->bytes_per_address); + } - set_gdbarch_addr_bits_remove (gdbarch, hppa_addr_bits_remove); + set_gdbarch_long_bit (gdbarch, tdep->bytes_per_address * TARGET_CHAR_BIT); + set_gdbarch_ptr_bit (gdbarch, tdep->bytes_per_address * TARGET_CHAR_BIT); - set_gdbarch_skip_prologue (gdbarch, hppa32_skip_prologue); + /* The following gdbarch vector elements are the same in both ILP32 + and LP64, but might show differences some day. */ + set_gdbarch_long_long_bit (gdbarch, 64); + set_gdbarch_long_double_bit (gdbarch, 128); + set_gdbarch_long_double_format (gdbarch, &floatformat_ia64_quad_big); - /* Stack grows upward. */ + /* The following gdbarch vector elements do not depend on the address + size, or in any other gdbarch element previously set. */ + set_gdbarch_skip_prologue (gdbarch, hppa_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_greaterthan); - - set_gdbarch_breakpoint_from_pc (gdbarch, hppa_breakpoint_from_pc); + set_gdbarch_sp_regnum (gdbarch, HPPA_SP_REGNUM); + set_gdbarch_fp0_regnum (gdbarch, HPPA_FP0_REGNUM); + set_gdbarch_cannot_store_register (gdbarch, hppa_cannot_store_register); + set_gdbarch_cannot_fetch_register (gdbarch, hppa_cannot_store_register); + set_gdbarch_addr_bits_remove (gdbarch, hppa_smash_text_address); + set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address); + set_gdbarch_believe_pcc_promotion (gdbarch, 1); + set_gdbarch_read_pc (gdbarch, hppa_target_read_pc); + set_gdbarch_write_pc (gdbarch, hppa_target_write_pc); + + /* Helper for function argument information. */ + set_gdbarch_fetch_pointer_argument (gdbarch, hppa_fetch_pointer_argument); set_gdbarch_print_insn (gdbarch, print_insn_hppa); - set_gdbarch_unwind_pc (gdbarch, hppa_unwind_pc); - set_gdbarch_write_pc (gdbarch, hppa_write_pc); + /* When a hardware watchpoint triggers, we'll move the inferior past + it by removing all eventpoints; stepping past the instruction + that caused the trigger; reinserting eventpoints; and checking + whether any watched location changed. */ + set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); + + /* Inferior function call methods. */ + switch (tdep->bytes_per_address) + { + case 4: + set_gdbarch_push_dummy_call (gdbarch, hppa32_push_dummy_call); + set_gdbarch_frame_align (gdbarch, hppa32_frame_align); + set_gdbarch_convert_from_func_ptr_addr + (gdbarch, hppa32_convert_from_func_ptr_addr); + break; + case 8: + set_gdbarch_push_dummy_call (gdbarch, hppa64_push_dummy_call); + set_gdbarch_frame_align (gdbarch, hppa64_frame_align); + break; + default: + internal_error (__FILE__, __LINE__, "bad switch"); + } + + /* Struct return methods. */ + switch (tdep->bytes_per_address) + { + case 4: + set_gdbarch_return_value (gdbarch, hppa32_return_value); + break; + case 8: + set_gdbarch_return_value (gdbarch, hppa64_return_value); + break; + default: + internal_error (__FILE__, __LINE__, "bad switch"); + } + + set_gdbarch_breakpoint_from_pc (gdbarch, hppa_breakpoint_from_pc); + set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read); - frame_base_set_default (gdbarch, &hppa32_frame_base); + /* Frame unwind methods. */ + set_gdbarch_unwind_dummy_id (gdbarch, hppa_unwind_dummy_id); + set_gdbarch_unwind_pc (gdbarch, hppa_unwind_pc); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); - frame_unwind_append_sniffer (gdbarch, hppa32_frame_sniffer); + /* Hook in the default unwinders. */ + frame_unwind_append_sniffer (gdbarch, hppa_stub_unwind_sniffer); + frame_unwind_append_sniffer (gdbarch, hppa_frame_unwind_sniffer); + frame_unwind_append_sniffer (gdbarch, hppa_fallback_unwind_sniffer); return gdbarch; } - -/* Provide a prototype to silence -Wmissing-prototypes. */ -void _initialize_hppa_tdep (void); +static void +hppa_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + fprintf_unfiltered (file, "bytes_per_address = %d\n", + tdep->bytes_per_address); + fprintf_unfiltered (file, "elf = %s\n", tdep->is_elf ? "yes" : "no"); +} void _initialize_hppa_tdep (void) { - register_gdbarch_init (bfd_arch_hppa, hppa32_gdbarch_init); + struct cmd_list_element *c; + void break_at_finish_command (char *arg, int from_tty); + void tbreak_at_finish_command (char *arg, int from_tty); + void break_at_finish_at_depth_command (char *arg, int from_tty); + + gdbarch_register (bfd_arch_hppa, hppa_gdbarch_init, hppa_dump_tdep); + + hppa_objfile_priv_data = register_objfile_data (); + + add_cmd ("unwind", class_maintenance, unwind_command, + "Print unwind table entry at given address.", + &maintenanceprintlist); + + deprecate_cmd (add_com ("xbreak", class_breakpoint, + break_at_finish_command, + concat ("Set breakpoint at procedure exit. \n\ +Argument may be function name, or \"*\" and an address.\n\ +If function is specified, break at end of code for that function.\n\ +If an address is specified, break at the end of the function that contains \n\ +that exact address.\n", + "With no arg, uses current execution address of selected stack frame.\n\ +This is useful for breaking on return to a stack frame.\n\ +\n\ +Multiple breakpoints at one place are permitted, and useful if conditional.\n\ +\n\ +Do \"help breakpoints\" for info on other commands dealing with breakpoints.", NULL)), NULL); + deprecate_cmd (add_com_alias ("xb", "xbreak", class_breakpoint, 1), NULL); + deprecate_cmd (add_com_alias ("xbr", "xbreak", class_breakpoint, 1), NULL); + deprecate_cmd (add_com_alias ("xbre", "xbreak", class_breakpoint, 1), NULL); + deprecate_cmd (add_com_alias ("xbrea", "xbreak", class_breakpoint, 1), NULL); + + deprecate_cmd (c = add_com ("txbreak", class_breakpoint, + tbreak_at_finish_command, +"Set temporary breakpoint at procedure exit. Either there should\n\ +be no argument or the argument must be a depth.\n"), NULL); + set_cmd_completer (c, location_completer); + + if (xdb_commands) + deprecate_cmd (add_com ("bx", class_breakpoint, + break_at_finish_at_depth_command, +"Set breakpoint at procedure exit. Either there should\n\ +be no argument or the argument must be a depth.\n"), NULL); + + /* Debug this files internals. */ + deprecated_add_show_from_set + (add_set_cmd ("hppa", class_maintenance, var_zinteger, + &hppa_debug, "Set hppa debugging.\n\ +When non-zero, hppa specific debugging is enabled.", &setdebuglist), + &showdebuglist); } diff --git a/gnu/usr.bin/binutils/gdb/hppa-tdep.h b/gnu/usr.bin/binutils/gdb/hppa-tdep.h index 3f577dbd28e..26a7556a686 100644 --- a/gnu/usr.bin/binutils/gdb/hppa-tdep.h +++ b/gnu/usr.bin/binutils/gdb/hppa-tdep.h @@ -1,5 +1,4 @@ -/* Target-dependent definitions for PA-RISC. - +/* Common target dependent code for GDB on HPPA systems. Copyright 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -20,45 +19,188 @@ Boston, MA 02111-1307, USA. */ #ifndef HPPA_TDEP_H -#define HPPA_TDEP_H 1 +#define HPPA_TDEP_H struct trad_frame_saved_reg; -/* PA-RISC acrhitecture-specific information. */ - -struct gdbarch_tdep -{ - int dummy; -}; - -/* Register numbers of various important registers. */ +/* Register numbers of various important registers. + Note that some of these values are "real" register numbers, + and correspond to the general registers of the machine, + and some are "phony" register numbers which are too large + to be actual register numbers as far as the user is concerned + but do serve to get the desired values when passed to read_register. */ enum hppa_regnum { - HPPA_R0_REGNUM, /* %r0 */ - HPPA_R1_REGNUM, /* %r1 */ - HPPA_RP_REGNUM, /* %rp (%r2) */ - HPPA_R3_REGNUM, /* %r3 */ - HPPA_R18_REGNUM = 18, /* %r18 */ - HPPA_SP_REGNUM = 30, /* %sp (%r30) */ - HPPA_R31_REGNUM = 31, /* %r31 */ - HPPA_SAR_REGNUM = 32, - HPPA_PCOQ_HEAD_REGNUM, - HPPA_PCOQ_TAIL_REGNUM + HPPA_R0_REGNUM = 0, /* Doesn't actually exist, used as base for + other r registers. */ + HPPA_R1_REGNUM = 1, + HPPA_FLAGS_REGNUM = 0, /* Various status flags */ + HPPA_RP_REGNUM = 2, /* return pointer */ + HPPA_FP_REGNUM = 3, /* The ABI's frame pointer, when used */ + HPPA_SP_REGNUM = 30, /* Stack pointer. */ + HPPA_R31_REGNUM = 31, + HPPA_SAR_REGNUM = 32, /* Shift Amount Register */ + HPPA_IPSW_REGNUM = 41, /* Interrupt Processor Status Word */ + HPPA_PCOQ_HEAD_REGNUM = 33, /* instruction offset queue head */ + HPPA_PCSQ_HEAD_REGNUM = 34, /* instruction space queue head */ + HPPA_PCOQ_TAIL_REGNUM = 35, /* instruction offset queue tail */ + HPPA_PCSQ_TAIL_REGNUM = 36, /* instruction space queue tail */ + HPPA_EIEM_REGNUM = 37, /* External Interrupt Enable Mask */ + HPPA_IIR_REGNUM = 38, /* Interrupt Instruction Register */ + HPPA_ISR_REGNUM = 39, /* Interrupt Space Register */ + HPPA_IOR_REGNUM = 40, /* Interrupt Offset Register */ + HPPA_SR4_REGNUM = 43, /* space register 4 */ + HPPA_RCR_REGNUM = 51, /* Recover Counter (also known as cr0) */ + HPPA_PID0_REGNUM = 52, /* Protection ID */ + HPPA_PID1_REGNUM = 53, /* Protection ID */ + HPPA_PID2_REGNUM = 55, /* Protection ID */ + HPPA_PID3_REGNUM = 56, /* Protection ID */ + HPPA_CCR_REGNUM = 54, /* Coprocessor Configuration Register */ + HPPA_TR0_REGNUM = 57, /* Temporary Registers (cr24 -> cr31) */ + HPPA_CR27_REGNUM = 60, /* Base register for thread-local storage, cr27 */ + HPPA_FP0_REGNUM = 64, /* First floating-point. */ + HPPA_FP4_REGNUM = 72, + + HPPA_ARG0_REGNUM = 26, /* The first argument of a callee. */ + HPPA_ARG1_REGNUM = 25, /* The second argument of a callee. */ + HPPA_ARG2_REGNUM = 24, /* The third argument of a callee. */ + HPPA_ARG3_REGNUM = 23 /* The fourth argument of a callee. */ }; - -struct hppa_frame_cache +/* Target-dependent structure in gdbarch. */ +struct gdbarch_tdep { - /* Base address. */ - CORE_ADDR base; - CORE_ADDR pc; + /* The number of bytes in an address. For now, this field is designed + to allow us to differentiate hppa32 from hppa64 targets. */ + int bytes_per_address; - /* Frame size. */ - size_t frame_size; + /* Is this an ELF target? This can be 64-bit HP-UX, or a 32/64-bit GNU/Linux + system. */ + int is_elf; - /* Table of saved registers. */ - struct trad_frame_saved_reg *saved_regs; + /* Given a function address, try to find the global pointer for the + corresponding shared object. */ + CORE_ADDR (*find_global_pointer) (struct value *); }; -#endif /* hppa-tdep.h */ +/* + * Unwind table and descriptor. + */ + +struct unwind_table_entry + { + CORE_ADDR region_start; + CORE_ADDR region_end; + + unsigned int Cannot_unwind:1; /* 0 */ + unsigned int Millicode:1; /* 1 */ + unsigned int Millicode_save_sr0:1; /* 2 */ + unsigned int Region_description:2; /* 3..4 */ + unsigned int reserved1:1; /* 5 */ + unsigned int Entry_SR:1; /* 6 */ + unsigned int Entry_FR:4; /* number saved *//* 7..10 */ + unsigned int Entry_GR:5; /* number saved *//* 11..15 */ + unsigned int Args_stored:1; /* 16 */ + unsigned int Variable_Frame:1; /* 17 */ + unsigned int Separate_Package_Body:1; /* 18 */ + unsigned int Frame_Extension_Millicode:1; /* 19 */ + unsigned int Stack_Overflow_Check:1; /* 20 */ + unsigned int Two_Instruction_SP_Increment:1; /* 21 */ + unsigned int Ada_Region:1; /* 22 */ + unsigned int cxx_info:1; /* 23 */ + unsigned int cxx_try_catch:1; /* 24 */ + unsigned int sched_entry_seq:1; /* 25 */ + unsigned int reserved2:1; /* 26 */ + unsigned int Save_SP:1; /* 27 */ + unsigned int Save_RP:1; /* 28 */ + unsigned int Save_MRP_in_frame:1; /* 29 */ + unsigned int extn_ptr_defined:1; /* 30 */ + unsigned int Cleanup_defined:1; /* 31 */ + + unsigned int MPE_XL_interrupt_marker:1; /* 0 */ + unsigned int HP_UX_interrupt_marker:1; /* 1 */ + unsigned int Large_frame:1; /* 2 */ + unsigned int Pseudo_SP_Set:1; /* 3 */ + unsigned int reserved4:1; /* 4 */ + unsigned int Total_frame_size:27; /* 5..31 */ + + /* This is *NOT* part of an actual unwind_descriptor in an object + file. It is *ONLY* part of the "internalized" descriptors that + we create from those in a file. + */ + struct + { + unsigned int stub_type:4; /* 0..3 */ + unsigned int padding:28; /* 4..31 */ + } + stub_unwind; + }; + +/* HP linkers also generate unwinds for various linker-generated stubs. + GDB reads in the stubs from the $UNWIND_END$ subspace, then + "converts" them into normal unwind entries using some of the reserved + fields to store the stub type. */ + +/* The gaps represent linker stubs used in MPE and space for future + expansion. */ +enum unwind_stub_types + { + LONG_BRANCH = 1, + PARAMETER_RELOCATION = 2, + EXPORT = 10, + IMPORT = 11, + IMPORT_SHLIB = 12, + }; + +struct unwind_table_entry *find_unwind_entry (CORE_ADDR); + +/* We use the objfile->obj_private pointer for two things: + * 1. An unwind table; + * + * 2. A pointer to any associated shared library object. + * + * #defines are used to help refer to these objects. + */ + +/* Info about the unwind table associated with an object file. + * This is hung off of the "objfile->obj_private" pointer, and + * is allocated in the objfile's psymbol obstack. This allows + * us to have unique unwind info for each executable and shared + * library that we are debugging. + */ +struct hppa_unwind_info + { + struct unwind_table_entry *table; /* Pointer to unwind info */ + struct unwind_table_entry *cache; /* Pointer to last entry we found */ + int last; /* Index of last entry */ + }; + +struct hppa_objfile_private + { + struct hppa_unwind_info *unwind_info; /* a pointer */ + struct so_list *so_info; /* a pointer */ + CORE_ADDR dp; + }; + +extern const struct objfile_data *hppa_objfile_priv_data; + +int hppa_get_field (unsigned word, int from, int to); +int hppa_extract_5_load (unsigned int); +unsigned hppa_extract_5R_store (unsigned int); +unsigned hppa_extract_5r_store (unsigned int); +int hppa_extract_17 (unsigned int); +int hppa_extract_21 (unsigned); +int hppa_extract_14 (unsigned); +int hppa_low_sign_extend (unsigned int, unsigned int); +int hppa_sign_extend (unsigned int, unsigned int); +CORE_ADDR hppa_symbol_address(const char *sym); + +void +hppa_frame_prev_register_helper (struct frame_info *next_frame, + struct trad_frame_saved_reg *saved_regs, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep); + +#endif /* HPPA_TDEP_H */ diff --git a/gnu/usr.bin/binutils/gdb/hppabsd-nat.c b/gnu/usr.bin/binutils/gdb/hppabsd-nat.c index 4db3ab864de..fb53c967558 100644 --- a/gnu/usr.bin/binutils/gdb/hppabsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/hppabsd-nat.c @@ -35,12 +35,6 @@ hppabsd_gregset_supplies_p (int regnum) return (regnum >= HPPA_R0_REGNUM && regnum <= HPPA_PCOQ_TAIL_REGNUM); } -static int -hppabsd_fpregset_supplies_p (int regnum) -{ - return 0; -} - /* Supply the general-purpose registers stored in GREGS to REGCACHE. */ static void @@ -70,7 +64,7 @@ hppabsd_collect_gregset (const struct regcache *regcache, for (i = HPPA_R1_REGNUM; i <= HPPA_R31_REGNUM; i++) { if (regnum == -1 || regnum == i) - regcache_raw_collect (regcache, regnum, regs + i * 4); + regcache_raw_collect (regcache, i, regs + i * 4); } if (regnum == -1 || regnum == HPPA_SAR_REGNUM) @@ -95,7 +89,7 @@ fetch_inferior_registers (int regnum) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); hppabsd_supply_gregset (regcache, ®s); @@ -113,13 +107,13 @@ store_inferior_registers (int regnum) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); hppabsd_collect_gregset (current_regcache, ®s, regnum); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't write registers"); } } diff --git a/gnu/usr.bin/binutils/gdb/hppabsd-tdep.c b/gnu/usr.bin/binutils/gdb/hppabsd-tdep.c index f1e7cf56e18..0a54371527d 100644 --- a/gnu/usr.bin/binutils/gdb/hppabsd-tdep.c +++ b/gnu/usr.bin/binutils/gdb/hppabsd-tdep.c @@ -95,6 +95,9 @@ hppabsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_regset_from_core_section (gdbarch, hppabsd_regset_from_core_section); + /* OpenBSD and NetBSD use ELF. */ + tdep->is_elf = 1; + /* OpenBSD and NetBSD uses SVR4-style shared libraries. */ set_gdbarch_in_solib_call_trampoline (gdbarch, generic_in_solib_call_trampoline); diff --git a/gnu/usr.bin/binutils/gdb/hppah-nat.c b/gnu/usr.bin/binutils/gdb/hppah-nat.c index ea4015a8d32..3979ecef3b8 100644 --- a/gnu/usr.bin/binutils/gdb/hppah-nat.c +++ b/gnu/usr.bin/binutils/gdb/hppah-nat.c @@ -1,7 +1,7 @@ -/* Native support code for HPUX PA-RISC. - Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. +/* Native support code for HPUX PA-RISC, for GDB the GNU debugger. + + Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, + 1996, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. Contributed by the Center for Software Science at the University of Utah (pa-gdb-bugs@cs.utah.edu). @@ -32,13 +32,10 @@ #include "gdb_wait.h" #include "regcache.h" #include "gdb_string.h" +#include "infttrace.h" #include <signal.h> -extern int hpux_has_forked (int pid, int *childpid); -extern int hpux_has_vforked (int pid, int *childpid); -extern int hpux_has_execd (int pid, char **execd_pathname); -extern int hpux_has_syscall_event (int pid, enum target_waitkind *kind, - int *syscall_id); +#include "hppa-tdep.h" static CORE_ADDR text_end; @@ -98,7 +95,7 @@ store_inferior_registers (int regno) return; offset = 0; - len = DEPRECATED_REGISTER_RAW_SIZE (regno); + len = register_size (current_gdbarch, regno); /* Requests for register zero actually want the save_state's ss_flags member. As RM says: "Oh, what a hack!" */ @@ -109,17 +106,16 @@ store_inferior_registers (int regno) len = sizeof (ss.ss_flags); /* Note that ss_flags is always an int, no matter what - DEPRECATED_REGISTER_RAW_SIZE(0) says. Assuming all HP-UX - PA machines are big-endian, put it at the least - significant end of the value, and zap the rest of the - buffer. */ - offset = DEPRECATED_REGISTER_RAW_SIZE (0) - len; + register_size (0) says. Assuming all HP-UX PA machines + are big-endian, put it at the least significant end of + the value, and zap the rest of the buffer. */ + offset = register_size (current_gdbarch, 0) - len; } /* Floating-point registers come from the ss_fpblock area. */ - else if (regno >= FP0_REGNUM) + else if (regno >= HPPA_FP0_REGNUM) addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock) - + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (FP0_REGNUM))); + + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (HPPA_FP0_REGNUM))); /* Wide registers come from the ss_wide area. I think it's more PC to test (ss_flags & SS_WIDEREGS) to select @@ -145,7 +141,7 @@ store_inferior_registers (int regno) layering will not allow us to perform a 64bit register store. What a crock. */ - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM && len == 8) + if (regno == HPPA_PCOQ_HEAD_REGNUM || regno == HPPA_PCOQ_TAIL_REGNUM && len == 8) { CORE_ADDR temp; @@ -173,7 +169,7 @@ store_inferior_registers (int regno) /* Another crock. HPUX complains if you write a nonzero value to the high part of IPSW. What will it take for HP to catch a clue about building sensible interfaces? */ - if (regno == IPSW_REGNUM && len == 8) + if (regno == HPPA_IPSW_REGNUM && len == 8) *(int *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)] = 0; #endif @@ -193,7 +189,7 @@ store_inferior_registers (int regno) REGISTER_NAME (regno), err); /* If we fail to write the PC, give a true error instead of just a warning. */ - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) + if (regno == HPPA_PCOQ_HEAD_REGNUM || regno == HPPA_PCOQ_TAIL_REGNUM) perror_with_name (msg); else warning (msg); @@ -216,7 +212,7 @@ fetch_register (int regno) int i; offset = 0; - len = DEPRECATED_REGISTER_RAW_SIZE (regno); + len = register_size (current_gdbarch, regno); /* Requests for register zero actually want the save_state's ss_flags member. As RM says: "Oh, what a hack!" */ @@ -227,17 +223,17 @@ fetch_register (int regno) len = sizeof (ss.ss_flags); /* Note that ss_flags is always an int, no matter what - DEPRECATED_REGISTER_RAW_SIZE(0) says. Assuming all HP-UX PA - machines are big-endian, put it at the least significant end - of the value, and zap the rest of the buffer. */ - offset = DEPRECATED_REGISTER_RAW_SIZE (0) - len; + register_size (0) says. Assuming all HP-UX PA machines are + big-endian, put it at the least significant end of the value, + and zap the rest of the buffer. */ + offset = register_size (current_gdbarch, 0) - len; memset (buf, 0, sizeof (buf)); } /* Floating-point registers come from the ss_fpblock area. */ - else if (regno >= FP0_REGNUM) + else if (regno >= HPPA_FP0_REGNUM) addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock) - + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (FP0_REGNUM))); + + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (HPPA_FP0_REGNUM))); /* Wide registers come from the ss_wide area. I think it's more PC to test (ss_flags & SS_WIDEREGS) to select @@ -282,10 +278,10 @@ fetch_register (int regno) /* If we're reading an address from the instruction address queue, mask out the bottom two bits --- they contain the privilege level. */ - if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM) + if (regno == HPPA_PCOQ_HEAD_REGNUM || regno == HPPA_PCOQ_TAIL_REGNUM) buf[len - 1] &= ~0x3; - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regno, buf); } @@ -293,10 +289,10 @@ fetch_register (int regno) to debugger memory starting at MYADDR. Copy to inferior if WRITE is nonzero. - Returns the length copied, which is either the LEN argument or zero. - This xfer function does not do partial moves, since child_ops - doesn't allow memory operations to cross below us in the target stack - anyway. TARGET is ignored. */ + Returns the length copied, which is either the LEN argument or + zero. This xfer function does not do partial moves, since + deprecated_child_ops doesn't allow memory operations to cross below + us in the target stack anyway. TARGET is ignored. */ int child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, diff --git a/gnu/usr.bin/binutils/gdb/hpread.c b/gnu/usr.bin/binutils/gdb/hpread.c index 76e96961f9e..de1670aba07 100644 --- a/gnu/usr.bin/binutils/gdb/hpread.c +++ b/gnu/usr.bin/binutils/gdb/hpread.c @@ -37,6 +37,7 @@ #include "demangle.h" #include "somsolib.h" #include "gdb_assert.h" +#include "hppa-tdep.h" /* Private information attached to an objfile which we use to find and internalize the HP C debug symbols within that objfile. */ @@ -234,15 +235,12 @@ static void fixup_class_method_type static void hpread_adjust_bitoffsets (struct type *, int); +static int hpread_adjust_stack_address (CORE_ADDR func_addr); + static dnttpointer hpread_get_next_skip_over_anon_unions (int, dnttpointer, union dnttentry **, struct objfile *); -/* Global to indicate presence of HP-compiled objects, - in particular, SOM executable file with SOM debug info - Defined in symtab.c, used in hppa-tdep.c. */ -extern int hp_som_som_object_present; - /* Static used to indicate a class type that requires a fix-up of one of its method types */ static struct type *fixup_class = NULL; @@ -385,6 +383,7 @@ hpread_pxdb_needed (bfd *sym_bfd) if (header_section_size == (bfd_size_type) sizeof (DOC_info_PXDB_header)) { buf = alloca (sizeof (DOC_info_PXDB_header)); + memset (buf, 0, sizeof (DOC_info_PXDB_header)); if (!bfd_get_section_contents (sym_bfd, header_section, @@ -452,6 +451,7 @@ hpread_pxdb_needed (bfd *sym_bfd) { buf = alloca (sizeof (PXDB_header)); + memset (buf, 0, sizeof (PXDB_header)); if (!bfd_get_section_contents (sym_bfd, header_section, buf, 0, @@ -1668,7 +1668,7 @@ hpread_symfile_init (struct objfile *objfile) /* Allocate struct to keep track of the symfile */ objfile->sym_private = - xmmalloc (objfile->md, sizeof (struct hpread_symfile_info)); + xmalloc (sizeof (struct hpread_symfile_info)); memset (objfile->sym_private, 0, sizeof (struct hpread_symfile_info)); /* We haven't read in any types yet. */ @@ -2286,7 +2286,7 @@ hpread_symfile_finish (struct objfile *objfile) { if (objfile->sym_private != NULL) { - xmfree (objfile->md, objfile->sym_private); + xfree (objfile->sym_private); } } @@ -2875,7 +2875,7 @@ hpread_expand_symtab (struct objfile *objfile, int sym_offset, int sym_size, } current_objfile = NULL; - hp_som_som_object_present = 1; /* Indicate we've processed an HP SOM SOM file */ + deprecated_hp_som_som_object_present = 1; /* Indicate we've processed an HP SOM SOM file */ return end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile)); } @@ -3024,7 +3024,7 @@ hpread_lookup_type (dnttpointer hp_type, struct objfile *objfile) { DNTT_TYPE_VECTOR_LENGTH (objfile) = LNTT_SYMCOUNT (objfile) + GNTT_SYMCOUNT (objfile); DNTT_TYPE_VECTOR (objfile) = (struct type **) - xmmalloc (objfile->md, DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)); + xmalloc (DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)); memset (&DNTT_TYPE_VECTOR (objfile)[old_len], 0, (DNTT_TYPE_VECTOR_LENGTH (objfile) - old_len) * sizeof (struct type *)); @@ -3042,8 +3042,7 @@ hpread_lookup_type (dnttpointer hp_type, struct objfile *objfile) if (size_changed) { DNTT_TYPE_VECTOR (objfile) = (struct type **) - xmrealloc (objfile->md, - (char *) DNTT_TYPE_VECTOR (objfile), + xrealloc ((char *) DNTT_TYPE_VECTOR (objfile), (DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *))); memset (&DNTT_TYPE_VECTOR (objfile)[old_len], 0, @@ -3252,10 +3251,9 @@ hpread_read_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, if (paramp->dfparam.copyparam) { SYMBOL_VALUE (sym) = paramp->dfparam.location; -#ifdef HPREAD_ADJUST_STACK_ADDRESS SYMBOL_VALUE (sym) - += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile)); -#endif + += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile)); + /* This is likely a pass-by-invisible reference parameter, Hack on the symbol class to make GDB happy. */ /* ??rehrauer: This appears to be broken w/r/t to passing @@ -3431,10 +3429,9 @@ hpread_read_doc_function_type (dnttpointer hp_type, union dnttentry *dn_bufp, if (paramp->dfparam.copyparam) { SYMBOL_VALUE (sym) = paramp->dfparam.location; -#ifdef HPREAD_ADJUST_STACK_ADDRESS SYMBOL_VALUE (sym) - += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile)); -#endif + += hpread_adjust_stack_address(CURRENT_FUNCTION_VALUE (objfile)); + /* This is likely a pass-by-invisible reference parameter, Hack on the symbol class to make GDB happy. */ /* ??rehrauer: This appears to be broken w/r/t to passing @@ -3690,6 +3687,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -3768,6 +3766,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, n_templ_args++; /* Allocate and fill in a struct next_template */ t_new = (struct next_template *) alloca (sizeof (struct next_template)); + memset (t_new, 0, sizeof (struct next_template)); t_new->next = t_list; t_list = t_new; t_list->arg.name = VT (objfile) + fieldp->dtempl_arg.name; @@ -3908,6 +3907,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record this member function */ /* Note: alloca used; this will disappear on routine exit */ fn_new = (struct next_fn_field *) alloca (sizeof (struct next_fn_field)); + memset (fn_new, 0, sizeof (struct next_fn_field)); fn_new->next = fn_list; fn_list = fn_new; @@ -4025,6 +4025,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record this static member */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4055,6 +4056,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, warning ("Debug info inconsistent: FIELD of anonymous union doesn't have a_union bit set"); /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4086,6 +4088,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, warning ("Debug info inconsistent: SVAR field in anonymous union doesn't have a_union bit set"); /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4106,6 +4109,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, warning ("Debug info inconsistent: DVAR field in anonymous union doesn't have a_union bit set"); /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4154,6 +4158,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4237,6 +4242,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, break; i_new = (struct next_instantiation *) alloca (sizeof (struct next_instantiation)); + memset (i_new, 0, sizeof (struct next_instantiation)); i_new->next = i_list; i_list = i_new; i_list->t = hpread_type_lookup (field, objfile); @@ -5702,10 +5708,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, if (dn_bufp->dfparam.copyparam) { SYMBOL_VALUE (sym) = dn_bufp->dfparam.location; -#ifdef HPREAD_ADJUST_STACK_ADDRESS SYMBOL_VALUE (sym) - += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile)); -#endif + += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile)); } else SYMBOL_VALUE (sym) = dn_bufp->dfparam.location; @@ -5747,7 +5751,7 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, /* Thread-local variable. */ SYMBOL_CLASS (sym) = LOC_HP_THREAD_LOCAL_STATIC; - SYMBOL_BASEREG (sym) = CR27_REGNUM; + SYMBOL_BASEREG (sym) = HPPA_CR27_REGNUM; if (objfile->flags & OBJF_SHARED) { @@ -5759,11 +5763,14 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, * to "somsolib.c". But C lets us point to one. */ struct so_list *so; + struct hppa_objfile_private *priv; - if (objfile->obj_private == NULL) + priv = (struct hppa_objfile_private *) + objfile_data (objfile, hppa_objfile_priv_data); + if (priv == NULL) error ("Internal error in reading shared library information."); - so = ((obj_private_data_t *) (objfile->obj_private))->so_info; + so = ((struct hppa_objfile_private *) priv)->so_info; if (so == NULL) error ("Internal error in reading shared library information."); @@ -5786,10 +5793,8 @@ hpread_process_one_debug_symbol (union dnttentry *dn_bufp, char *name, SYMBOL_CLASS (sym) = LOC_LOCAL; SYMBOL_VALUE (sym) = dn_bufp->ddvar.location; -#ifdef HPREAD_ADJUST_STACK_ADDRESS SYMBOL_VALUE (sym) - += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile)); -#endif + += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile)); SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->ddvar.type, objfile); if (dn_bufp->ddvar.global) add_symbol_to_list (sym, &global_symbols); @@ -6269,6 +6274,24 @@ hpread_adjust_bitoffsets (struct type *type, int bits) TYPE_FIELD_BITPOS (type, i) -= bits; } +/* Return the adjustment necessary to make for addresses on the stack + as presented by hpread.c. + + This is necessary because of the stack direction on the PA and the + bizarre way in which someone (?) decided they wanted to handle + frame pointerless code in GDB. */ +int +hpread_adjust_stack_address (CORE_ADDR func_addr) +{ + struct unwind_table_entry *u; + + u = find_unwind_entry (func_addr); + if (!u) + return 0; + else + return u->Total_frame_size << 3; +} + /* Because of quirks in HP compilers' treatment of anonymous unions inside classes, we have to chase through a chain of threaded FIELD entries. If we encounter an anonymous union in the chain, we must recursively skip over diff --git a/gnu/usr.bin/binutils/gdb/hpux-thread.c b/gnu/usr.bin/binutils/gdb/hpux-thread.c index 242d3a39a09..e9f6cfb6b6e 100644 --- a/gnu/usr.bin/binutils/gdb/hpux-thread.c +++ b/gnu/usr.bin/binutils/gdb/hpux-thread.c @@ -1,5 +1,8 @@ -/* Low level interface for debugging HPUX/DCE threads for GDB, the GNU debugger. - Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Low level interface for debugging HPUX/DCE threads for GDB, the GNU + debugger. + + Copyright 1996, 1998, 1999, 2000, 2001, 2004 Free Software + Foundation, Inc. This file is part of GDB. @@ -45,7 +48,6 @@ #include "gdbcore.h" extern int child_suppress_run; -extern struct target_ops child_ops; /* target vector for inftarg.c */ extern void _initialize_hpux_thread (void); @@ -134,7 +136,7 @@ find_tcb (ptid_t ptid) static void hpux_thread_open (char *arg, int from_tty) { - child_ops.to_open (arg, from_tty); + deprecated_child_ops.to_open (arg, from_tty); } /* Attach to process PID, then initialize for debugging it @@ -143,7 +145,7 @@ hpux_thread_open (char *arg, int from_tty) static void hpux_thread_attach (char *args, int from_tty) { - child_ops.to_attach (args, from_tty); + deprecated_child_ops.to_attach (args, from_tty); /* XXX - might want to iterate over all the threads and register them. */ } @@ -159,7 +161,7 @@ hpux_thread_attach (char *args, int from_tty) static void hpux_thread_detach (char *args, int from_tty) { - child_ops.to_detach (args, from_tty); + deprecated_child_ops.to_detach (args, from_tty); } /* Resume execution of process PID. If STEP is nozero, then @@ -186,7 +188,7 @@ hpux_thread_resume (ptid_t ptid, int step, enum target_signal signo) } #endif - child_ops.to_resume (ptid, step, signo); + deprecated_child_ops.to_resume (ptid, step, signo); cached_thread = 0; @@ -209,7 +211,7 @@ hpux_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (!ptid_equal (ptid, minus_one_ptid)) ptid = main_ptid; - rtnval = child_ops.to_wait (ptid, ourstatus); + rtnval = deprecated_child_ops.to_wait (ptid, ourstatus); rtnval = find_active_thread (); @@ -260,7 +262,7 @@ hpux_thread_fetch_registers (int regno) if (tcb_ptr->state == cma__c_state_running) { - child_ops.to_fetch_registers (regno); + deprecated_child_ops.to_fetch_registers (regno); do_cleanups (old_chain); @@ -281,7 +283,7 @@ hpux_thread_fetch_registers (int regno) for (regno = first_regno; regno <= last_regno; regno++) { if (regmap[regno] == -1) - child_ops.to_fetch_registers (regno); + deprecated_child_ops.to_fetch_registers (regno); else { unsigned char buf[MAX_REGISTER_SIZE]; @@ -291,15 +293,15 @@ hpux_thread_fetch_registers (int regno) if (regno == FLAGS_REGNUM) /* Flags must be 0 to avoid bogus value for SS_INSYSCALL */ - memset (buf, '\000', DEPRECATED_REGISTER_RAW_SIZE (regno)); + memset (buf, '\000', register_size (current_gdbarch, regno)); else if (regno == SP_REGNUM) store_unsigned_integer (buf, sizeof sp, sp); else if (regno == PC_REGNUM) - read_memory (sp - 20, buf, DEPRECATED_REGISTER_RAW_SIZE (regno)); + read_memory (sp - 20, buf, register_size (current_gdbarch, regno)); else - read_memory (sp + regmap[regno], buf, DEPRECATED_REGISTER_RAW_SIZE (regno)); + read_memory (sp + regmap[regno], buf, register_size (current_gdbarch, regno)); - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regno, buf); } } @@ -322,7 +324,7 @@ hpux_thread_store_registers (int regno) if (tcb_ptr->state == cma__c_state_running) { - child_ops.to_store_registers (regno); + deprecated_child_ops.to_store_registers (regno); do_cleanups (old_chain); @@ -343,7 +345,7 @@ hpux_thread_store_registers (int regno) for (regno = first_regno; regno <= last_regno; regno++) { if (regmap[regno] == -1) - child_ops.to_store_registers (regno); + deprecated_child_ops.to_store_registers (regno); else { unsigned char buf[MAX_REGISTER_SIZE]; @@ -352,24 +354,24 @@ hpux_thread_store_registers (int regno) sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160; if (regno == FLAGS_REGNUM) - child_ops.to_store_registers (regno); /* Let lower layer handle this... */ + deprecated_child_ops.to_store_registers (regno); /* Let lower layer handle this... */ else if (regno == SP_REGNUM) { write_memory ((CORE_ADDR) & tcb_ptr->static_ctx.sp, &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)], - DEPRECATED_REGISTER_RAW_SIZE (regno)); + register_size (current_gdbarch, regno)); tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *) (extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)], - DEPRECATED_REGISTER_RAW_SIZE (regno)) + 160); + register_size (current_gdbarch, regno)) + 160); } else if (regno == PC_REGNUM) write_memory (sp - 20, &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)], - DEPRECATED_REGISTER_RAW_SIZE (regno)); + register_size (current_gdbarch, regno)); else write_memory (sp + regmap[regno], &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)], - DEPRECATED_REGISTER_RAW_SIZE (regno)); + register_size (current_gdbarch, regno)); } } @@ -385,7 +387,7 @@ hpux_thread_store_registers (int regno) static void hpux_thread_prepare_to_store (void) { - child_ops.to_prepare_to_store (); + deprecated_child_ops.to_prepare_to_store (); } static int @@ -401,7 +403,7 @@ hpux_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, inferior_ptid = main_ptid; retval = - child_ops.to_xfer_memory (memaddr, myaddr, len, dowrite, attribs, target); + deprecated_child_ops.deprecated_xfer_memory (memaddr, myaddr, len, dowrite, attribs, target); do_cleanups (old_chain); @@ -413,27 +415,28 @@ hpux_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, static void hpux_thread_files_info (struct target_ops *ignore) { - child_ops.to_files_info (ignore); + deprecated_child_ops.to_files_info (ignore); } static void hpux_thread_kill_inferior (void) { - child_ops.to_kill (); + deprecated_child_ops.to_kill (); } static void hpux_thread_notice_signals (ptid_t ptid) { - child_ops.to_notice_signals (ptid); + deprecated_child_ops.to_notice_signals (ptid); } /* Fork an inferior process, and start debugging it with /proc. */ static void -hpux_thread_create_inferior (char *exec_file, char *allargs, char **env) +hpux_thread_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { - child_ops.to_create_inferior (exec_file, allargs, env); + deprecated_child_ops.to_create_inferior (exec_file, allargs, env, from_tty); if (hpux_thread_active) { @@ -497,7 +500,7 @@ quit: static void hpux_thread_mourn_inferior (void) { - child_ops.to_mourn_inferior (); + deprecated_child_ops.to_mourn_inferior (); } /* Mark our target-struct as eligible for stray "run" and "attach" commands. */ @@ -517,7 +520,7 @@ hpux_thread_alive (ptid_t ptid) static void hpux_thread_stop (void) { - child_ops.to_stop (); + deprecated_child_ops.to_stop (); } /* Convert a pid to printable form. */ @@ -547,7 +550,7 @@ init_hpux_thread_ops (void) hpux_thread_ops.to_fetch_registers = hpux_thread_fetch_registers; hpux_thread_ops.to_store_registers = hpux_thread_store_registers; hpux_thread_ops.to_prepare_to_store = hpux_thread_prepare_to_store; - hpux_thread_ops.to_xfer_memory = hpux_thread_xfer_memory; + hpux_thread_ops.deprecated_xfer_memory = hpux_thread_xfer_memory; hpux_thread_ops.to_files_info = hpux_thread_files_info; hpux_thread_ops.to_insert_breakpoint = memory_insert_breakpoint; hpux_thread_ops.to_remove_breakpoint = memory_remove_breakpoint; @@ -581,6 +584,6 @@ _initialize_hpux_thread (void) child_suppress_run = 1; /* Hook into new_objfile notification. */ - target_new_objfile_chain = target_new_objfile_hook; - target_new_objfile_hook = hpux_thread_new_objfile; + target_new_objfile_chain = deprecated_target_new_objfile_hook; + deprecated_target_new_objfile_hook = hpux_thread_new_objfile; } diff --git a/gnu/usr.bin/binutils/gdb/i386-interix-nat.c b/gnu/usr.bin/binutils/gdb/i386-interix-nat.c deleted file mode 100644 index 91b9be29319..00000000000 --- a/gnu/usr.bin/binutils/gdb/i386-interix-nat.c +++ /dev/null @@ -1,190 +0,0 @@ -/* Native-dependent code for Interix running on i386's, for GDB. - Copyright 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 <sys/procfs.h> -#include <inferior.h> -#include <fcntl.h> - -#include <i386-tdep.h> -#include "gdb_string.h" -#include "gdbcore.h" -#include "gregset.h" -#include "regcache.h" - -typedef unsigned long greg_t; - -/* This is a duplicate of the table in i386-linux-nat.c. */ - -static int regmap[] = { - EAX, ECX, EDX, EBX, - UESP, EBP, ESI, EDI, - EIP, EFL, CS, SS, - DS, ES, FS, GS, -}; - -/* Forward declarations. */ -extern void _initialize_core_interix (void); -extern initialize_file_ftype _initialize_core_interix; - -/* Given a pointer to a general register set in /proc format (gregset_t *), - unpack the register contents and supply them as gdb's idea of the current - register values. */ - -void -supply_gregset (gregset_t *gregsetp) -{ - int regi; - greg_t *regp = (greg_t *) & gregsetp->gregs; - - for (regi = 0; regi < I386_NUM_GREGS; regi++) - { - supply_register (regi, (char *) (regp + regmap[regi])); - } -} - -/* Store GDB's value for REGNO in *GREGSETP. If REGNO is -1, do all - of them. */ - -void -fill_gregset (gregset_t *gregsetp, int regno) -{ - int regi; - greg_t *regp = (greg_t *) gregsetp->gregs; - - for (regi = 0; regi < I386_NUM_GREGS; regi++) - if (regno == -1 || regi == regno) - regcache_collect (regi, (void *) (regp + regmap[regi])); -} - -/* Fill GDB's register file with the floating-point register values in - *FPREGSETP. */ - -void -supply_fpregset (fpregset_t *fpregsetp) -{ - i387_supply_fsave (current_regcache, -1, fpregsetp); -} - -/* Given a pointer to a floating point register set in (fpregset_t *) - format, update all of the registers from gdb's idea of the current - floating point register set. */ - -void -fill_fpregset (fpregset_t *fpregsetp, int regno) -{ - i387_fill_fsave ((char *) fpregsetp, regno); -} - -/* Read the values of either the general register set (WHICH equals 0) - or the floating point register set (WHICH equals 2) from the core - file data (pointed to by CORE_REG_SECT), and update gdb's idea of - their current values. The CORE_REG_SIZE parameter is compared to - the size of the gregset or fpgregset structures (as appropriate) to - validate the size of the structure from the core file. The - REG_ADDR parameter is ignored. */ - -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, - CORE_ADDR reg_addr) -{ - gdb_gregset_t gregset; - gdb_fpregset_t fpregset; - - if (which == 0) - { - if (core_reg_size != sizeof (gregset)) - { - warning ("wrong size gregset struct in core file"); - } - else - { - memcpy ((char *) &gregset, core_reg_sect, sizeof (gregset)); - supply_gregset (&gregset); - } - } - else if (which == 2) - { - if (core_reg_size != sizeof (fpregset)) - { - warning ("wrong size fpregset struct in core file"); - } - else - { - memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset)); - supply_fpregset (&fpregset); - } - } -} - -#include <setjmp.h> - -static struct core_fns interix_core_fns = -{ - bfd_target_coff_flavour, /* core_flavour (more or less) */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - -void -_initialize_core_interix (void) -{ - add_core_fns (&interix_core_fns); -} - -/* We don't have a /proc/pid/file or /proc/pid/exe to read a link from, - so read it from the same place ps gets the name. */ - -char * -child_pid_to_exec_file (int pid) -{ - char *path; - char *buf; - int fd, c; - char *p; - - xasprintf (&path, "/proc/%d/stat", pid); - buf = xcalloc (MAXPATHLEN + 1, sizeof (char)); - make_cleanup (xfree, path); - make_cleanup (xfree, buf); - - fd = open (path, O_RDONLY); - - if (fd < 0) - return NULL; - - /* Skip over "Argv0\t". */ - lseek (fd, 6, SEEK_SET); - - c = read (fd, buf, MAXPATHLEN); - close (fd); - - if (c < 0) - return NULL; - - buf[c] = '\0'; /* Ensure null termination. */ - p = strchr (buf, '\n'); - if (p != NULL) - *p = '\0'; - - return buf; -} diff --git a/gnu/usr.bin/binutils/gdb/i386-interix-tdep.c b/gnu/usr.bin/binutils/gdb/i386-interix-tdep.c deleted file mode 100644 index 0d2af2f0cf2..00000000000 --- a/gnu/usr.bin/binutils/gdb/i386-interix-tdep.c +++ /dev/null @@ -1,358 +0,0 @@ -/* Target-dependent code for Interix running on i386's, for GDB. - Copyright 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 "arch-utils.h" - -#include "frame.h" -#include "gdb_string.h" -#include "gdb-stabs.h" -#include "gdbcore.h" -#include "gdbtypes.h" -#include "i386-tdep.h" -#include "inferior.h" -#include "libbfd.h" -#include "objfiles.h" -#include "osabi.h" -#include "regcache.h" - -/* offsetof (mcontext_t, gregs.gregs[EBP]) */ -static const int mcontext_EBP_greg_offset = 180; - -/* offsetof (mcontext_t, gregs.gregs[EIP]) */ -static const int mcontext_EIP_greg_offset = 184; - -/* offsetof (mcontext_t, gregs.gregs[UESP]) */ -static const int mcontext_UESP_greg_offset = 196; - -/* offsetof (mcontext_t, gregs.reserved[1]) */ -static const int mcontext_syscall_greg_offset = 4; - -/* offsetof (_JUMP_BUFFER, Eip) */ -static const int jump_buffer_Eip_offset = 20; - -/* See procfs.c and *interix*.h in config/[alpha,i386]. */ -/* ??? These should be static, but this needs a bit of work before this - can be done. */ -CORE_ADDR tramp_start; -CORE_ADDR tramp_end; -CORE_ADDR null_start; -CORE_ADDR null_end; -int winver; /* Windows NT version number */ - -/* Forward declarations. */ -extern void _initialize_i386_interix_tdep (void); -extern initialize_file_ftype _initialize_i386_interix_tdep; - -/* Adjust the section offsets in an objfile structure so that it's correct - for the type of symbols being read (or undo it with the _restore - arguments). - - If main programs ever start showing up at other than the default Image - Base, this is where that would likely be applied. */ - -void -pei_adjust_objfile_offsets (struct objfile *objfile, - enum objfile_adjusts type) -{ - int i; - CORE_ADDR symbols_offset; - - switch (type) - { - case adjust_for_symtab: - symbols_offset = NONZERO_LINK_BASE (objfile->obfd); - break; - case adjust_for_symtab_restore: - symbols_offset = -NONZERO_LINK_BASE (objfile->obfd); - break; - case adjust_for_stabs: - case adjust_for_stabs_restore: - case adjust_for_dwarf: - case adjust_for_dwarf_restore: - default: - return; - } - - for (i = 0; i < objfile->num_sections; i++) - { - (objfile->section_offsets)->offsets[i] += symbols_offset; - } -} - -static int -i386_interix_pc_in_sigtramp (CORE_ADDR pc, char *name) -{ - /* This is sufficient, where used, but is NOT a complete test; There - is more in DEPRECATED_INIT_EXTRA_FRAME_INFO - (a.k.a. interix_back_one_frame). */ - return ((pc >= tramp_start && pc < tramp_end) - || (pc >= null_start && pc < null_end)); -} - -static int -i386_interix_in_solib_call_trampoline (CORE_ADDR pc, char *name) -{ - return i386_pe_skip_trampoline_code (pc, name); -} - -static CORE_ADDR -i386_interix_skip_trampoline_code (CORE_ADDR pc) -{ - return i386_pe_skip_trampoline_code (pc, 0); -} - -static int -i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe) -{ - /* In the context where this is used, we get the saved PC before we've - successfully unwound far enough to be sure what we've got (it may - be a signal handler caller). If we're dealing with a signal - handler caller, this will return valid, which is fine. If not, - it'll make the correct test. */ - return ((get_frame_type (thisframe) == SIGTRAMP_FRAME) - || (chain != 0 - && !deprecated_inside_entry_file (read_memory_integer - (thisframe->frame + 4, 4)))); -} - -/* We want to find the previous frame, which on Interix is tricky when - signals are involved; set frame->frame appropriately, and also get - the pc and tweak tye frame's type; this replaces a boatload of - nested macros, as well. */ -static void -i386_interix_back_one_frame (int fromleaf, struct frame_info *frame) -{ - CORE_ADDR ra; - CORE_ADDR fm; - CORE_ADDR context; - long t; - - if (frame == NULL) - internal_error (__FILE__, __LINE__, "unexpected NULL frame"); - - if (fromleaf) - { - frame->pc = DEPRECATED_SAVED_PC_AFTER_CALL (frame->next); - return; - } - - if (!frame->next) - { - frame->pc = read_pc (); - - /* Part of the signal stuff... See below. */ - if (stopped_by_random_signal) - { - /* We know we're in a system call mini-frame; was it - NullApi or something else? */ - ra = DEPRECATED_SAVED_PC_AFTER_CALL (frame); - if (ra >= null_start && ra < null_end) - deprecated_set_frame_type (frame, SIGTRAMP_FRAME); - /* There might also be an indirect call to the mini-frame, - putting one more return address on the stack. (XP only, - I think?) This can't (reasonably) return the address of the - signal handler caller unless it's that situation, so this - is safe. */ - ra = read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4); - if (ra >= null_start && ra < null_end) - deprecated_set_frame_type (frame, SIGTRAMP_FRAME); - } - return; - } - - if (!(get_frame_type (frame->next) == SIGTRAMP_FRAME)) - { - frame->pc = read_memory_integer (frame->next->frame + 4, 4); - return; - } - - /* This is messy (actually AWFUL)... The "trampoline" might be 2, 3 - or all 5 entities on the frame. - - Chunk 1 will be present when we're actually in a signal handler. - Chunk 2 will be present when an asynchronous signal (one that - didn't come in with a system call) is present. - We may not (yet) be in the handler, if we're just returning - from the call. - When we're actually in a handler taken from an asynchronous - signal, both will be present. - - Chunk 1: - PdxSignalDeliverer's frame - + Context struct -- not accounted for in any frame - - Chunk 2: - + PdxNullPosixApi's frame - + PdxNullApiCaller's frame - + Context struct = 0x230 not accounted for in any frame - - The symbol names come from examining objdumps of psxdll.dll; - they don't appear in the runtime image. - - For gdb's purposes, we can pile all this into one frame. */ - - ra = frame->next->pc; - /* Are we already pointing at PdxNullPosixApi? We are if - this is a signal frame, we're at next-to-top, and were stopped - by a random signal (if it wasn't the right address under - these circumstances, we wouldn't be here at all by tests above - on the prior frame). */ - if (frame->next->next == NULL && stopped_by_random_signal) - { - /* We're pointing at the frame FOR PdxNullApi. */ - fm = frame->frame; - } - else - { - /* No... We must be pointing at the frame that was called - by PdxSignalDeliverer; back up across the whole mess. */ - - /* Extract the frame for PdxSignalDeliverer. Note: - DEPRECATED_FRAME_CHAIN used the "old" frame pointer because - we were a deliverer. Get the address of the context record - that's on here frameless. */ - context = read_memory_integer (frame->frame, 4); /* an Arg */ - - /* Now extract the frame pointer contained in the context. */ - fm = read_memory_integer (context + mcontext_EBP_greg_offset, 4); - - ra = read_memory_integer (context + mcontext_EIP_greg_offset, 4); - - /* We need to know if we're in a system call because we'll be - in a syscall mini-frame, if so, and the rules are different. */ - t = (long) read_memory_integer (context + mcontext_syscall_greg_offset, - 4); - /* t contains 0 if running free, 1 if blocked on a system call, - and 2 if blocked on an exception message (e.g. a trap); - we don't expect to get here with a 2. */ - if (t != 1) - { - /* Not at a system call, therefore it can't be NullApi. */ - frame->pc = ra; - frame->frame = fm; - return; - } - - /* It's a system call... Mini frame, then look for NullApi. */ - /* Get the RA (on the stack) associated with this... It's - a system call mini-frame. */ - ra = read_memory_integer (context + mcontext_UESP_greg_offset, 4); - - if (winver >= 51) - { - /* Newer versions of Windows NT interpose another return - address (but no other "stack frame" stuff) that we need - to simply ignore here. */ - ra += 4; - } - - ra = read_memory_integer (ra, 4); - - if (!(ra >= null_start && ra < null_end)) - { - /* No Null API present; we're done. */ - frame->pc = ra; - frame->frame = fm; - return; - } - } - - /* At this point, we're looking at the frame for PdxNullPosixApi, - in either case. - - PdxNullPosixApi is called by PdxNullApiCaller (which in turn - is called by _PdxNullApiCaller (note the _).) - PdxNullPosixApiCaller (no _) is a frameless function. - - The saved frame pointer is as fm, but it's not of interest - to us because it skips us over the saved context, which is - the wrong thing to do, because it skips the interrrupted - routine! PdxNullApiCaller takes as its only argument the - address of the context of the interrupded function (which - is really in no frame, but jammed on the stack by the system) - - So: fm+0: saved bp - fm+4: return address to _PdxNullApiCaller - fm+8: arg to PdxNullApiCaller pushed by _Pdx... */ - - fm = read_memory_integer (fm + 0x8, 4); - - /* Extract the second context record. */ - - ra = read_memory_integer (fm + mcontext_EIP_greg_offset, 4); - fm = read_memory_integer (fm + mcontext_EBP_greg_offset, 4); - - frame->frame = fm; - frame->pc = ra; - - return; -} - -static CORE_ADDR -i386_interix_frame_saved_pc (struct frame_info *fi) -{ - /* Assume that we've already unwound enough to have the caller's address - if we're dealing with a signal handler caller (And if that fails, - return 0). */ - if ((get_frame_type (fi) == SIGTRAMP_FRAME)) - return fi->next ? fi->next->pc : 0; - else - return read_memory_integer (fi->frame + 4, 4); -} - -static void -i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - - tdep->struct_return = reg_struct_return; - tdep->jb_pc_offset = jump_buffer_Eip_offset; - - set_gdbarch_pc_in_sigtramp (gdbarch, i386_interix_pc_in_sigtramp); - set_gdbarch_in_solib_call_trampoline (gdbarch, - i386_interix_in_solib_call_trampoline); - set_gdbarch_skip_trampoline_code (gdbarch, - i386_interix_skip_trampoline_code); - set_gdbarch_deprecated_init_extra_frame_info (gdbarch, i386_interix_back_one_frame); - set_gdbarch_deprecated_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid); - set_gdbarch_deprecated_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc); - set_gdbarch_name_of_malloc (gdbarch, "_malloc"); -} - -static enum gdb_osabi -i386_interix_osabi_sniffer (bfd * abfd) -{ - char *target_name = bfd_get_target (abfd); - - if (strcmp (target_name, "pei-i386") == 0) - return GDB_OSABI_INTERIX; - - return GDB_OSABI_UNKNOWN; -} - -void -_initialize_i386_interix_tdep (void) -{ - gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour, - i386_interix_osabi_sniffer); - - gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_INTERIX, - i386_interix_init_abi); -} diff --git a/gnu/usr.bin/binutils/gdb/i386-tdep.c b/gnu/usr.bin/binutils/gdb/i386-tdep.c index e1ce81fcf0c..d5cd111c901 100644 --- a/gnu/usr.bin/binutils/gdb/i386-tdep.c +++ b/gnu/usr.bin/binutils/gdb/i386-tdep.c @@ -51,8 +51,7 @@ #include "i386-tdep.h" #include "i387-tdep.h" -/* Names of the registers. The first 10 registers match the register - numbering scheme used by GCC for stabs and DWARF. */ +/* Register names. */ static char *i386_register_names[] = { @@ -71,7 +70,7 @@ static char *i386_register_names[] = static const int i386_num_register_names = ARRAY_SIZE (i386_register_names); -/* MMX registers. */ +/* Register names for MMX pseudo-registers. */ static char *i386_mmx_names[] = { @@ -152,31 +151,38 @@ i386_fpc_regnum_p (int regnum) return (I387_FCTRL_REGNUM <= regnum && regnum < I387_XMM0_REGNUM); } -/* Return the name of register REG. */ +/* Return the name of register REGNUM. */ const char * -i386_register_name (int reg) +i386_register_name (int regnum) { - if (i386_mmx_regnum_p (current_gdbarch, reg)) - return i386_mmx_names[reg - I387_MM0_REGNUM]; + if (i386_mmx_regnum_p (current_gdbarch, regnum)) + return i386_mmx_names[regnum - I387_MM0_REGNUM]; - if (reg >= 0 && reg < i386_num_register_names) - return i386_register_names[reg]; + if (regnum >= 0 && regnum < i386_num_register_names) + return i386_register_names[regnum]; return NULL; } -/* Convert stabs register number REG to the appropriate register +/* Convert a dbx register number REG to the appropriate register number used by GDB. */ static int -i386_stab_reg_to_regnum (int reg) +i386_dbx_reg_to_regnum (int reg) { - /* This implements what GCC calls the "default" register map. */ + /* This implements what GCC calls the "default" register map + (dbx_register_map[]). */ + if (reg >= 0 && reg <= 7) { - /* General-purpose registers. */ - return reg; + /* General-purpose registers. The debug info calls %ebp + register 4, and %esp register 5. */ + if (reg == 4) + return 5; + else if (reg == 5) + return 4; + else return reg; } else if (reg >= 12 && reg <= 19) { @@ -198,13 +204,16 @@ i386_stab_reg_to_regnum (int reg) return NUM_REGS + NUM_PSEUDO_REGS; } -/* Convert DWARF register number REG to the appropriate register - number used by GDB. */ +/* Convert SVR4 register number REG to the appropriate register number + used by GDB. */ static int -i386_dwarf_reg_to_regnum (int reg) +i386_svr4_reg_to_regnum (int reg) { - /* The DWARF register numbering includes %eip and %eflags, and + /* This implements the GCC register map that tries to be compatible + with the SVR4 C compiler for DWARF (svr4_dbx_register_map[]). */ + + /* The SVR4 register numbering includes %eip and %eflags, and numbers the floating point registers differently. */ if (reg >= 0 && reg <= 9) { @@ -218,8 +227,8 @@ i386_dwarf_reg_to_regnum (int reg) } else if (reg >= 21) { - /* The SSE and MMX registers have identical numbers as in stabs. */ - return i386_stab_reg_to_regnum (reg); + /* The SSE and MMX registers have the same numbers as with dbx. */ + return i386_dbx_reg_to_regnum (reg); } /* This will hopefully provoke a warning. */ @@ -463,21 +472,123 @@ i386_skip_probe (CORE_ADDR pc) return pc; } +/* Maximum instruction length we need to handle. */ +#define I386_MAX_INSN_LEN 6 + +/* Instruction description. */ +struct i386_insn +{ + size_t len; + unsigned char insn[I386_MAX_INSN_LEN]; + unsigned char mask[I386_MAX_INSN_LEN]; +}; + +/* Search for the instruction at PC in the list SKIP_INSNS. Return + the first instruction description that matches. Otherwise, return + NULL. */ + +static struct i386_insn * +i386_match_insn (CORE_ADDR pc, struct i386_insn *skip_insns) +{ + struct i386_insn *insn; + unsigned char op; + + op = read_memory_unsigned_integer (pc, 1); + + for (insn = skip_insns; insn->len > 0; insn++) + { + if ((op & insn->mask[0]) == insn->insn[0]) + { + unsigned char buf[I386_MAX_INSN_LEN - 1]; + size_t i; + + gdb_assert (insn->len > 1); + gdb_assert (insn->len <= I386_MAX_INSN_LEN); + + read_memory (pc + 1, buf, insn->len - 1); + for (i = 1; i < insn->len; i++) + { + if ((buf[i - 1] & insn->mask[i]) != insn->insn[i]) + break; + + return insn; + } + } + } + + return NULL; +} + +/* Some special instructions that might be migrated by GCC into the + part of the prologue that sets up the new stack frame. Because the + stack frame hasn't been setup yet, no registers have been saved + yet, and only the scratch registers %eax, %ecx and %edx can be + touched. */ + +struct i386_insn i386_frame_setup_skip_insns[] = +{ + /* Check for `movb imm8, r' and `movl imm32, r'. + + ??? Should we handle 16-bit operand-sizes here? */ + + /* `movb imm8, %al' and `movb imm8, %ah' */ + /* `movb imm8, %cl' and `movb imm8, %ch' */ + { 2, { 0xb0, 0x00 }, { 0xfa, 0x00 } }, + /* `movb imm8, %dl' and `movb imm8, %dh' */ + { 2, { 0xb2, 0x00 }, { 0xfb, 0x00 } }, + /* `movl imm32, %eax' and `movl imm32, %ecx' */ + { 5, { 0xb8 }, { 0xfe } }, + /* `movl imm32, %edx' */ + { 5, { 0xba }, { 0xff } }, + + /* Check for `mov imm32, r32'. Note that there is an alternative + encoding for `mov m32, %eax'. + + ??? Should we handle SIB adressing here? + ??? Should we handle 16-bit operand-sizes here? */ + + /* `movl m32, %eax' */ + { 5, { 0xa1 }, { 0xff } }, + /* `movl m32, %eax' and `mov; m32, %ecx' */ + { 6, { 0x89, 0x05 }, {0xff, 0xf7 } }, + /* `movl m32, %edx' */ + { 6, { 0x89, 0x15 }, {0xff, 0xff } }, + + /* Check for `xorl r32, r32' and the equivalent `subl r32, r32'. + Because of the symmetry, there are actually two ways to encode + these instructions; opcode bytes 0x29 and 0x2b for `subl' and + opcode bytes 0x31 and 0x33 for `xorl'. */ + + /* `subl %eax, %eax' */ + { 2, { 0x29, 0xc0 }, { 0xfd, 0xff } }, + /* `subl %ecx, %ecx' */ + { 2, { 0x29, 0xc9 }, { 0xfd, 0xff } }, + /* `subl %edx, %edx' */ + { 2, { 0x29, 0xd2 }, { 0xfd, 0xff } }, + /* `xorl %eax, %eax' */ + { 2, { 0x31, 0xc0 }, { 0xfd, 0xff } }, + /* `xorl %ecx, %ecx' */ + { 2, { 0x31, 0xc9 }, { 0xfd, 0xff } }, + /* `xorl %edx, %edx' */ + { 2, { 0x31, 0xd2 }, { 0xfd, 0xff } }, + { 0 } +}; + /* Check whether PC points at a code that sets up a new stack frame. If so, it updates CACHE and returns the address of the first - instruction after the sequence that sets removes the "hidden" - argument from the stack or CURRENT_PC, whichever is smaller. - Otherwise, return PC. */ + instruction after the sequence that sets up the frame or LIMIT, + whichever is smaller. If we don't recognize the code, return PC. */ static CORE_ADDR -i386_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR current_pc, +i386_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR limit, struct i386_frame_cache *cache) { + struct i386_insn *insn; unsigned char op; int skip = 0; - if (current_pc <= pc) - return current_pc; + if (limit <= pc) + return limit; op = read_memory_unsigned_integer (pc, 1); @@ -487,65 +598,48 @@ i386_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR current_pc, starts this instruction sequence. */ cache->saved_regs[I386_EBP_REGNUM] = 0; cache->sp_offset += 4; + pc++; /* If that's all, return now. */ - if (current_pc <= pc + 1) - return current_pc; - - op = read_memory_unsigned_integer (pc + 1, 1); - - /* Check for some special instructions that might be migrated - by GCC into the prologue. We check for - - xorl %ebx, %ebx - xorl %ecx, %ecx - xorl %edx, %edx - xorl %eax, %eax - - and the equivalent - - subl %ebx, %ebx - subl %ecx, %ecx - subl %edx, %edx - subl %eax, %eax + if (limit <= pc) + return limit; - Because of the symmetry, there are actually two ways to - encode these instructions; with opcode bytes 0x29 and 0x2b - for `subl' and opcode bytes 0x31 and 0x33 for `xorl'. + /* Check for some special instructions that might be migrated by + GCC into the prologue and skip them. At this point in the + prologue, code should only touch the scratch registers %eax, + %ecx and %edx, so while the number of posibilities is sheer, + it is limited. Make sure we only skip these instructions if we later see the `movl %esp, %ebp' that actually sets up the frame. */ - while (op == 0x29 || op == 0x2b || op == 0x31 || op == 0x33) + while (pc + skip < limit) { - op = read_memory_unsigned_integer (pc + skip + 2, 1); - switch (op) - { - case 0xdb: /* %ebx */ - case 0xc9: /* %ecx */ - case 0xd2: /* %edx */ - case 0xc0: /* %eax */ - skip += 2; - break; - default: - return pc + 1; - } + insn = i386_match_insn (pc + skip, i386_frame_setup_skip_insns); + if (insn == NULL) + break; - op = read_memory_unsigned_integer (pc + skip + 1, 1); + skip += insn->len; } + /* If that's all, return now. */ + if (limit <= pc + skip) + return limit; + + op = read_memory_unsigned_integer (pc + skip, 1); + /* Check for `movl %esp, %ebp' -- can be written in two ways. */ switch (op) { case 0x8b: - if (read_memory_unsigned_integer (pc + skip + 2, 1) != 0xec) - return pc + 1; + if (read_memory_unsigned_integer (pc + skip + 1, 1) != 0xec) + return pc; break; case 0x89: - if (read_memory_unsigned_integer (pc + skip + 2, 1) != 0xe5) - return pc + 1; + if (read_memory_unsigned_integer (pc + skip + 1, 1) != 0xe5) + return pc; break; default: - return pc + 1; + return pc; } /* OK, we actually have a frame. We just don't know how large @@ -553,49 +647,49 @@ i386_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR current_pc, necessary. We also now commit to skipping the special instructions mentioned before. */ cache->locals = 0; - pc += skip; + pc += (skip + 2); /* If that's all, return now. */ - if (current_pc <= pc + 3) - return current_pc; + if (limit <= pc) + return limit; /* Check for stack adjustment subl $XXX, %esp - NOTE: You can't subtract a 16 bit immediate from a 32 bit + NOTE: You can't subtract a 16-bit immediate from a 32-bit reg, so we don't have to worry about a data16 prefix. */ - op = read_memory_unsigned_integer (pc + 3, 1); + op = read_memory_unsigned_integer (pc, 1); if (op == 0x83) { - /* `subl' with 8 bit immediate. */ - if (read_memory_unsigned_integer (pc + 4, 1) != 0xec) + /* `subl' with 8-bit immediate. */ + if (read_memory_unsigned_integer (pc + 1, 1) != 0xec) /* Some instruction starting with 0x83 other than `subl'. */ - return pc + 3; + return pc; - /* `subl' with signed byte immediate (though it wouldn't make - sense to be negative). */ - cache->locals = read_memory_integer (pc + 5, 1); - return pc + 6; + /* `subl' with signed 8-bit immediate (though it wouldn't + make sense to be negative). */ + cache->locals = read_memory_integer (pc + 2, 1); + return pc + 3; } else if (op == 0x81) { - /* Maybe it is `subl' with a 32 bit immedediate. */ - if (read_memory_unsigned_integer (pc + 4, 1) != 0xec) + /* Maybe it is `subl' with a 32-bit immediate. */ + if (read_memory_unsigned_integer (pc + 1, 1) != 0xec) /* Some instruction starting with 0x81 other than `subl'. */ - return pc + 3; + return pc; - /* It is `subl' with a 32 bit immediate. */ - cache->locals = read_memory_integer (pc + 5, 4); - return pc + 9; + /* It is `subl' with a 32-bit immediate. */ + cache->locals = read_memory_integer (pc + 2, 4); + return pc + 6; } else { /* Some instruction other than `subl'. */ - return pc + 3; + return pc; } } - else if (op == 0xc8) /* enter $XXX */ + else if (op == 0xc8) /* enter */ { cache->locals = read_memory_unsigned_integer (pc + 1, 2); return pc + 4; @@ -648,9 +742,9 @@ i386_analyze_register_saves (CORE_ADDR pc, CORE_ADDR current_pc, once used in the System V compiler). Local space is allocated just below the saved %ebp by either the - 'enter' instruction, or by "subl $<size>, %esp". 'enter' has a 16 - bit unsigned argument for space to allocate, and the 'addl' - instruction could have either a signed byte, or 32 bit immediate. + 'enter' instruction, or by "subl $<size>, %esp". 'enter' has a + 16-bit unsigned argument for space to allocate, and the 'addl' + instruction could have either a signed byte, or 32-bit immediate. Next, the registers used by this function are pushed. With the System V compiler they will always be in the order: %edi, %esi, @@ -741,7 +835,13 @@ i386_skip_prologue (CORE_ADDR start_pc) } } - return i386_follow_jump (pc); + /* If the function starts with a branch (to startup code at the end) + the last instruction should bring us back to the first + instruction of the real code. */ + if (i386_follow_jump (start_pc) != start_pc) + pc = i386_follow_jump (pc); + + return pc; } /* This function is 64-bit safe. */ @@ -1010,17 +1110,27 @@ static const struct frame_unwind i386_sigtramp_frame_unwind = static const struct frame_unwind * i386_sigtramp_frame_sniffer (struct frame_info *next_frame) { - CORE_ADDR pc = frame_pc_unwind (next_frame); - char *name; + struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (next_frame)); - /* We shouldn't even bother to try if the OSABI didn't register - a sigcontext_addr handler. */ - if (!gdbarch_tdep (current_gdbarch)->sigcontext_addr) + /* We shouldn't even bother if we don't have a sigcontext_addr + handler. */ + if (tdep->sigcontext_addr == NULL) return NULL; - find_pc_partial_function (pc, &name, NULL, NULL); - if (PC_IN_SIGTRAMP (pc, name)) - return &i386_sigtramp_frame_unwind; + if (tdep->sigtramp_p != NULL) + { + if (tdep->sigtramp_p (next_frame)) + return &i386_sigtramp_frame_unwind; + } + + if (tdep->sigtramp_start != 0) + { + CORE_ADDR pc = frame_pc_unwind (next_frame); + + gdb_assert (tdep->sigtramp_end != 0); + if (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end) + return &i386_sigtramp_frame_unwind; + } return NULL; } @@ -1094,7 +1204,7 @@ i386_get_longjmp_target (CORE_ADDR *pc) static CORE_ADDR -i386_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -1142,7 +1252,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, (i386_frame_this_id, i386_sigtramp_frame_this_id, i386_unwind_dummy_id). It's there, since all frame unwinders for a given target have to agree (within a certain margin) on the - defenition of the stack address of a frame. Otherwise + definition of the stack address of a frame. Otherwise frame_id_inner() won't work correctly. Since DWARF2/GCC uses the stack address *before* the function call as a frame's CFA. On the i386, when %ebp is used as a frame pointer, the offset @@ -1327,7 +1437,28 @@ i386_return_value (struct gdbarch *gdbarch, struct type *type, if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION) && !i386_reg_struct_return_p (gdbarch, type)) - return RETURN_VALUE_STRUCT_CONVENTION; + { + /* The System V ABI says that: + + "A function that returns a structure or union also sets %eax + to the value of the original address of the caller's area + before it returns. Thus when the caller receives control + again, the address of the returned object resides in register + %eax and can be used to access the object." + + So the ABI guarantees that we can always find the return + value just after the function has returned. */ + + if (readbuf) + { + ULONGEST addr; + + regcache_raw_read_unsigned (regcache, I386_EAX_REGNUM, &addr); + read_memory (addr, readbuf, TYPE_LENGTH (type)); + } + + return RETURN_VALUE_ABI_RETURNS_ADDRESS; + } /* This special case is for structures consisting of a single `float' or `double' member. These structures are returned in @@ -1514,7 +1645,7 @@ i386_register_to_value (struct frame_info *frame, int regnum, return; } - /* Read a value spread accross multiple registers. */ + /* Read a value spread across multiple registers. */ gdb_assert (len > 4 && len % 4 == 0); @@ -1546,7 +1677,7 @@ i386_value_to_register (struct frame_info *frame, int regnum, return; } - /* Write a value spread accross multiple registers. */ + /* Write a value spread across multiple registers. */ gdb_assert (len > 4 && len % 4 == 0); @@ -1562,15 +1693,15 @@ i386_value_to_register (struct frame_info *frame, int regnum, } } -/* Supply register REGNUM from the general-purpose register set REGSET - to register cache REGCACHE. If REGNUM is -1, do this for all - registers in REGSET. */ +/* Supply register REGNUM from the buffer specified by GREGS and LEN + in the general-purpose register set REGSET to register cache + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ void i386_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { - const struct gdbarch_tdep *tdep = regset->descr; + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); const char *regs = gregs; int i; @@ -1584,15 +1715,39 @@ i386_supply_gregset (const struct regset *regset, struct regcache *regcache, } } -/* Supply register REGNUM from the floating-point register set REGSET - to register cache REGCACHE. If REGNUM is -1, do this for all - registers in REGSET. */ +/* Collect register REGNUM from the register cache REGCACHE and store + it in the buffer specified by GREGS and LEN as described by the + general-purpose register set REGSET. If REGNUM is -1, do this for + all registers in REGSET. */ + +void +i386_collect_gregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *gregs, size_t len) +{ + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); + char *regs = gregs; + int i; + + gdb_assert (len == tdep->sizeof_gregset); + + for (i = 0; i < tdep->gregset_num_regs; i++) + { + if ((regnum == i || regnum == -1) + && tdep->gregset_reg_offset[i] != -1) + regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]); + } +} + +/* Supply register REGNUM from the buffer specified by FPREGS and LEN + in the floating-point register set REGSET to register cache + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ static void i386_supply_fpregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *fpregs, size_t len) { - const struct gdbarch_tdep *tdep = regset->descr; + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); if (len == I387_SIZEOF_FXSAVE) { @@ -1604,6 +1759,28 @@ i386_supply_fpregset (const struct regset *regset, struct regcache *regcache, i387_supply_fsave (regcache, regnum, fpregs); } +/* Collect register REGNUM from the register cache REGCACHE and store + it in the buffer specified by FPREGS and LEN as described by the + floating-point register set REGSET. If REGNUM is -1, do this for + all registers in REGSET. */ + +static void +i386_collect_fpregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *fpregs, size_t len) +{ + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); + + if (len == I387_SIZEOF_FXSAVE) + { + i387_collect_fxsave (regcache, regnum, fpregs); + return; + } + + gdb_assert (len == tdep->sizeof_fpregset); + i387_collect_fsave (regcache, regnum, fpregs); +} + /* Return the appropriate register set for the core section identified by SECT_NAME and SECT_SIZE. */ @@ -1616,11 +1793,8 @@ i386_regset_from_core_section (struct gdbarch *gdbarch, if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset) { if (tdep->gregset == NULL) - { - tdep->gregset = XMALLOC (struct regset); - tdep->gregset->descr = tdep; - tdep->gregset->supply_regset = i386_supply_gregset; - } + tdep->gregset = regset_alloc (gdbarch, i386_supply_gregset, + i386_collect_gregset); return tdep->gregset; } @@ -1629,11 +1803,8 @@ i386_regset_from_core_section (struct gdbarch *gdbarch, && sect_size == I387_SIZEOF_FXSAVE)) { if (tdep->fpregset == NULL) - { - tdep->fpregset = XMALLOC (struct regset); - tdep->fpregset->descr = tdep; - tdep->fpregset->supply_regset = i386_supply_fpregset; - } + tdep->fpregset = regset_alloc (gdbarch, i386_supply_fpregset, + i386_collect_fpregset); return tdep->fpregset; } @@ -1690,12 +1861,16 @@ i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name) } -/* Return non-zero if PC and NAME show that we are in a signal - trampoline. */ +/* Return whether the frame preceding NEXT_FRAME corresponds to a + sigtramp routine. */ static int -i386_pc_in_sigtramp (CORE_ADDR pc, char *name) +i386_sigtramp_p (struct frame_info *next_frame) { + CORE_ADDR pc = frame_pc_unwind (next_frame); + char *name; + + find_pc_partial_function (pc, &name, NULL, NULL); return (name && strcmp ("_sigtramp", name) == 0); } @@ -1725,11 +1900,18 @@ i386_print_insn (bfd_vma pc, struct disassemble_info *info) /* System V Release 4 (SVR4). */ +/* Return whether the frame preceding NEXT_FRAME corresponds to a SVR4 + sigtramp routine. */ + static int -i386_svr4_pc_in_sigtramp (CORE_ADDR pc, char *name) +i386_svr4_sigtramp_p (struct frame_info *next_frame) { + CORE_ADDR pc = frame_pc_unwind (next_frame); + char *name; + /* UnixWare uses _sigacthandler. The origin of the other symbols is currently unknown. */ + find_pc_partial_function (pc, &name, NULL, NULL); return (name && (strcmp ("_sigreturn", name) == 0 || strcmp ("_sigacthandler", name) == 0 || strcmp ("sigvechandler", name) == 0)); @@ -1752,23 +1934,13 @@ i386_svr4_sigcontext_addr (struct frame_info *next_frame) } -/* DJGPP. */ - -static int -i386_go32_pc_in_sigtramp (CORE_ADDR pc, char *name) -{ - /* DJGPP doesn't have any special frames for signal handlers. */ - return 0; -} - - /* Generic ELF. */ void i386_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - /* We typically use stabs-in-ELF with the DWARF register numbering. */ - set_gdbarch_stab_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum); + /* We typically use stabs-in-ELF with the SVR4 register numbering. */ + set_gdbarch_stab_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum); } /* System V Release 4 (SVR4). */ @@ -1785,7 +1957,7 @@ i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); - set_gdbarch_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp); + tdep->sigtramp_p = i386_svr4_sigtramp_p; tdep->sigcontext_addr = i386_svr4_sigcontext_addr; tdep->sc_pc_offset = 36 + 14 * 4; tdep->sc_sp_offset = 36 + 17 * 4; @@ -1800,7 +1972,8 @@ i386_go32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - set_gdbarch_pc_in_sigtramp (gdbarch, i386_go32_pc_in_sigtramp); + /* DJGPP doesn't have any special frames for signal handlers. */ + tdep->sigtramp_p = NULL; tdep->jb_pc_offset = 36; } @@ -1905,7 +2078,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->sizeof_fpregset = I387_SIZEOF_FSAVE; /* The default settings include the FPU registers, the MMX registers - and the SSE registers. This can be overidden for a specific ABI + and the SSE registers. This can be overridden for a specific ABI by adjusting the members `st0_regnum', `mm0_regnum' and `num_xmm_regs' of `struct gdbarch_tdep', otherwise the registers will show up in the output of "info all-registers". Ideally we @@ -1921,7 +2094,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->st0_regnum = I386_ST0_REGNUM; /* The MMX registers are implemented as pseudo-registers. Put off - caclulating the register number for %mm0 until we know the number + calculating the register number for %mm0 until we know the number of raw registers. */ tdep->mm0_regnum = 0; @@ -1932,6 +2105,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->struct_return = pcc_struct_return; tdep->sigtramp_start = 0; tdep->sigtramp_end = 0; + tdep->sigtramp_p = i386_sigtramp_p; tdep->sigcontext_addr = NULL; tdep->sc_reg_offset = NULL; tdep->sc_pc_offset = -1; @@ -1960,13 +2134,43 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_ps_regnum (gdbarch, I386_EFLAGS_REGNUM); /* %eflags */ set_gdbarch_fp0_regnum (gdbarch, I386_ST0_REGNUM); /* %st(0) */ - /* Use the "default" register numbering scheme for stabs and COFF. */ - set_gdbarch_stab_reg_to_regnum (gdbarch, i386_stab_reg_to_regnum); - set_gdbarch_sdb_reg_to_regnum (gdbarch, i386_stab_reg_to_regnum); - - /* Use the DWARF register numbering scheme for DWARF and DWARF 2. */ - set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum); - set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum); + /* NOTE: kettenis/20040418: GCC does have two possible register + numbering schemes on the i386: dbx and SVR4. These schemes + differ in how they number %ebp, %esp, %eflags, and the + floating-point registers, and are implemented by the arrays + dbx_register_map[] and svr4_dbx_register_map in + gcc/config/i386.c. GCC also defines a third numbering scheme in + gcc/config/i386.c, which it designates as the "default" register + map used in 64bit mode. This last register numbering scheme is + implemented in dbx64_register_map, and is used for AMD64; see + amd64-tdep.c. + + Currently, each GCC i386 target always uses the same register + numbering scheme across all its supported debugging formats + i.e. SDB (COFF), stabs and DWARF 2. This is because + gcc/sdbout.c, gcc/dbxout.c and gcc/dwarf2out.c all use the + DBX_REGISTER_NUMBER macro which is defined by each target's + respective config header in a manner independent of the requested + output debugging format. + + This does not match the arrangement below, which presumes that + the SDB and stabs numbering schemes differ from the DWARF and + DWARF 2 ones. The reason for this arrangement is that it is + likely to get the numbering scheme for the target's + default/native debug format right. For targets where GCC is the + native compiler (FreeBSD, NetBSD, OpenBSD, GNU/Linux) or for + targets where the native toolchain uses a different numbering + scheme for a particular debug format (stabs-in-ELF on Solaris) + the defaults below will have to be overridden, like + i386_elf_init_abi() does. */ + + /* Use the dbx register numbering scheme for stabs and COFF. */ + set_gdbarch_stab_reg_to_regnum (gdbarch, i386_dbx_reg_to_regnum); + set_gdbarch_sdb_reg_to_regnum (gdbarch, i386_dbx_reg_to_regnum); + + /* Use the SVR4 register numbering scheme for DWARF and DWARF 2. */ + set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum); /* We don't define ECOFF_REG_TO_REGNUM, since ECOFF doesn't seem to be in use on any of the supported i386 targets. */ @@ -1993,7 +2197,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_decr_pc_after_break (gdbarch, 1); set_gdbarch_frame_args_skip (gdbarch, 8); - set_gdbarch_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp); /* Wire in the MMX registers. */ set_gdbarch_num_pseudo_regs (gdbarch, i386_num_mmx_regs); @@ -2075,7 +2278,7 @@ _initialize_i386_tdep (void) Set the disassembly flavor, the valid values are \"att\" and \"intel\", \ and the default value is \"att\".", &setlist); - add_show_from_set (new_cmd, &showlist); + deprecated_add_show_from_set (new_cmd, &showlist); } /* Add the variable that controls the convention for returning @@ -2089,7 +2292,7 @@ and the default value is \"att\".", Set the convention for returning small structs, valid values \ are \"default\", \"pcc\" and \"reg\", and the default value is \"default\".", &setlist); - add_show_from_set (new_cmd, &showlist); + deprecated_add_show_from_set (new_cmd, &showlist); } gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour, diff --git a/gnu/usr.bin/binutils/gdb/i386gnu-nat.c b/gnu/usr.bin/binutils/gdb/i386gnu-nat.c index 7533f0965d5..023fbb7d6e8 100644 --- a/gnu/usr.bin/binutils/gdb/i386gnu-nat.c +++ b/gnu/usr.bin/binutils/gdb/i386gnu-nat.c @@ -1,5 +1,6 @@ /* Low level interface to i386 running the GNU Hurd. - Copyright 1992, 1995, 1996, 1998, 2000, 2001 + + Copyright 1992, 1995, 1996, 1998, 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -27,6 +28,7 @@ #include "gdb_assert.h" #include <errno.h> #include <stdio.h> +#include "gdb_string.h" #include <mach.h> #include <mach_error.h> @@ -59,8 +61,9 @@ static int reg_offset[] = #define REG_ADDR(state, regnum) ((char *)(state) + reg_offset[regnum]) -/* Get the whole floating-point state of THREAD and record the - values of the corresponding (pseudo) registers. */ +/* Get the whole floating-point state of THREAD and record the values + of the corresponding (pseudo) registers. */ + static void fetch_fpregs (struct proc *thread) { @@ -78,18 +81,15 @@ fetch_fpregs (struct proc *thread) } if (!state.initialized) - /* The floating-point state isn't initialized. */ { - int i; - - for (i = FP0_REGNUM; i <= FOP_REGNUM; i++) - supply_register (i, NULL); - - return; + /* The floating-point state isn't initialized. */ + i387_supply_fsave (current_regcache, -1, NULL); + } + else + { + /* Supply the floating-point registers. */ + i387_supply_fsave (current_regcache, -1, state.hw_state); } - - /* Supply the floating-point registers. */ - i387_supply_fsave (current_regcache, -1, state.hw_state); } #ifdef HAVE_SYS_PROCFS_H @@ -100,7 +100,7 @@ supply_gregset (gdb_gregset_t *gregs) { int i; for (i = 0; i < I386_NUM_GREGS; i++) - supply_register (i, REG_ADDR (gregs, i)); + regcache_raw_supply (current_regcache, i, REG_ADDR (gregs, i)); } void @@ -144,14 +144,15 @@ gnu_fetch_registers (int regno) proc_debug (thread, "fetching all register"); for (i = 0; i < I386_NUM_GREGS; i++) - supply_register (i, REG_ADDR (state, i)); + regcache_raw_supply (current_regcache, i, REG_ADDR (state, i)); thread->fetched_regs = ~0; } else { proc_debug (thread, "fetching register %s", REGISTER_NAME (regno)); - supply_register (regno, REG_ADDR (state, regno)); + regcache_raw_supply (current_regcache, regno, + REG_ADDR (state, regno)); thread->fetched_regs |= (1 << regno); } } @@ -201,6 +202,7 @@ store_fpregs (struct proc *thread, int regno) void gnu_store_registers (int regno) { + struct regcache *regcache = current_regcache; struct proc *thread; /* Make sure we know about new threads. */ @@ -242,23 +244,20 @@ gnu_store_registers (int regno) if ((thread->fetched_regs & (1 << check_regno)) && memcpy (REG_ADDR (&old_state, check_regno), REG_ADDR (state, check_regno), - DEPRECATED_REGISTER_RAW_SIZE (check_regno))) + register_size (current_gdbarch, check_regno))) /* Register CHECK_REGNO has changed! Ack! */ { warning ("Register %s changed after the thread was aborted", REGISTER_NAME (check_regno)); if (regno >= 0 && regno != check_regno) /* Update GDB's copy of the register. */ - supply_register (check_regno, REG_ADDR (state, check_regno)); + regcache_raw_supply (regcache, check_regno, + REG_ADDR (state, check_regno)); else warning ("... also writing this register! Suspicious..."); } } -#define fill(state, regno) \ - memcpy (REG_ADDR(state, regno), &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)], \ - DEPRECATED_REGISTER_RAW_SIZE (regno)) - if (regno == -1) { int i; @@ -266,15 +265,15 @@ gnu_store_registers (int regno) proc_debug (thread, "storing all registers"); for (i = 0; i < I386_NUM_GREGS; i++) - if (deprecated_register_valid[i]) - fill (state, i); + if (regcache_valid_p (regcache, i)) + regcache_raw_collect (regcache, i, REG_ADDR (state, i)); } else { proc_debug (thread, "storing register %s", REGISTER_NAME (regno)); - gdb_assert (deprecated_register_valid[regno]); - fill (state, regno); + gdb_assert (regcache_valid_p (regcache, regno)); + regcache_raw_collect (regcache, regno, REG_ADDR (state, regno)); } /* Restore the T bit. */ @@ -282,8 +281,6 @@ gnu_store_registers (int regno) ((struct i386_thread_state *)state)->efl |= trace; } -#undef fill - if (regno >= I386_NUM_GREGS || regno == -1) { proc_debug (thread, "storing floating-point registers"); diff --git a/gnu/usr.bin/binutils/gdb/i386ly-tdep.c b/gnu/usr.bin/binutils/gdb/i386ly-tdep.c index 2374b71aa1f..d749dc4e552 100644 --- a/gnu/usr.bin/binutils/gdb/i386ly-tdep.c +++ b/gnu/usr.bin/binutils/gdb/i386ly-tdep.c @@ -41,7 +41,7 @@ i386lynx_saved_pc_after_call (struct frame_info *frame) static const unsigned char call_inst[] = { 0x9a, 0, 0, 0, 0, 8, 0 }; /* lcall 0x8,0x0 */ - read_memory_nobpt (frame->pc - 7, opcode, 7); + deprecated_read_memory_nobpt (frame->pc - 7, opcode, 7); if (memcmp (opcode, call_inst, 7) == 0) return read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4); diff --git a/gnu/usr.bin/binutils/gdb/i386nbsd-nat.c b/gnu/usr.bin/binutils/gdb/i386nbsd-nat.c index 92da7e18dcd..22af0117e4e 100644 --- a/gnu/usr.bin/binutils/gdb/i386nbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/i386nbsd-nat.c @@ -22,8 +22,10 @@ #include "defs.h" #include "gdbcore.h" #include "regcache.h" +#include "target.h" #include "i386-tdep.h" +#include "i386bsd-nat.h" /* Support for debugging kernel virtual memory images. */ @@ -77,6 +79,9 @@ void _initialize_i386nbsd_nat (void); void _initialize_i386nbsd_nat (void) { + /* We've got nothing to add to the common *BSD/i386 target. */ + add_target (i386bsd_target ()); + /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (i386nbsd_supply_pcb); } diff --git a/gnu/usr.bin/binutils/gdb/i386v-nat.c b/gnu/usr.bin/binutils/gdb/i386v-nat.c index 678eabc346d..bae840626cd 100644 --- a/gnu/usr.bin/binutils/gdb/i386v-nat.c +++ b/gnu/usr.bin/binutils/gdb/i386v-nat.c @@ -35,10 +35,6 @@ #include "language.h" #include "gdbcore.h" -#ifdef USG -#include <sys/types.h> -#endif - #include <sys/param.h> #include <sys/dir.h> #include <signal.h> diff --git a/gnu/usr.bin/binutils/gdb/i386v4-nat.c b/gnu/usr.bin/binutils/gdb/i386v4-nat.c index 188f01b4c12..a2f3cd323ea 100644 --- a/gnu/usr.bin/binutils/gdb/i386v4-nat.c +++ b/gnu/usr.bin/binutils/gdb/i386v4-nat.c @@ -1,6 +1,7 @@ -/* Native-dependent code for SVR4 Unix running on i386's. +/* Native-dependent code for Unix SVR4 running on i386's. + Copyright 1988, 1989, 1991, 1992, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -95,7 +96,7 @@ static int regmap[] = EAX, ECX, EDX, EBX, UESP, EBP, ESI, EDI, EIP, EFL, CS, SS, - DS, ES, FS, GS, + DS, ES, FS, GS }; /* Fill GDB's register array with the general-purpose register values @@ -105,25 +106,25 @@ void supply_gregset (gregset_t *gregsetp) { greg_t *regp = (greg_t *) gregsetp; - int i; + int regnum; - for (i = 0; i < I386_NUM_GREGS; i++) - supply_register (i, (char *) (regp + regmap[i])); + for (regnum = 0; regnum < I386_NUM_GREGS; regnum++) + regcache_raw_supply (current_regcache, regnum, regp + regmap[regnum]); } -/* Fill register REGNO (if it is a general-purpose register) in - *GREGSETPS with the value in GDB's register array. If REGNO is -1, +/* Fill register REGNUM (if it is a general-purpose register) in + *GREGSETPS with the value in GDB's register array. If REGNUM is -1, do this for all registers. */ void -fill_gregset (gregset_t *gregsetp, int regno) +fill_gregset (gregset_t *gregsetp, int regnum) { greg_t *regp = (greg_t *) gregsetp; int i; for (i = 0; i < I386_NUM_GREGS; i++) - if (regno == -1 || regno == i) - regcache_collect (i, regp + regmap[i]); + if (regnum == -1 || regnum == i) + regcache_raw_collect (current_regcache, i, regp + regmap[i]); } #endif /* HAVE_GREGSET_T */ diff --git a/gnu/usr.bin/binutils/gdb/i387-tdep.c b/gnu/usr.bin/binutils/gdb/i387-tdep.c index 21386fb13f0..04b43df0b26 100644 --- a/gnu/usr.bin/binutils/gdb/i387-tdep.c +++ b/gnu/usr.bin/binutils/gdb/i387-tdep.c @@ -121,7 +121,7 @@ static void print_i387_status_word (unsigned int status, struct ui_file *file) { fprintf_filtered (file, "Status Word: %s", - local_hex_string_custom (status, "04")); + hex_string_custom (status, 4)); fputs_filtered (" ", file); fprintf_filtered (file, " %s", (status & 0x0001) ? "IE" : " "); fprintf_filtered (file, " %s", (status & 0x0002) ? "DE" : " "); @@ -151,7 +151,7 @@ static void print_i387_control_word (unsigned int control, struct ui_file *file) { fprintf_filtered (file, "Control Word: %s", - local_hex_string_custom (control, "04")); + hex_string_custom (control, 4)); fputs_filtered (" ", file); fprintf_filtered (file, " %s", (control & 0x0001) ? "IM" : " "); fprintf_filtered (file, " %s", (control & 0x0002) ? "DM" : " "); @@ -276,15 +276,15 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, print_i387_status_word (fstat, file); print_i387_control_word (fctrl, file); fprintf_filtered (file, "Tag Word: %s\n", - local_hex_string_custom (ftag, "04")); + hex_string_custom (ftag, 4)); fprintf_filtered (file, "Instruction Pointer: %s:", - local_hex_string_custom (fiseg, "02")); - fprintf_filtered (file, "%s\n", local_hex_string_custom (fioff, "08")); + hex_string_custom (fiseg, 2)); + fprintf_filtered (file, "%s\n", hex_string_custom (fioff, 8)); fprintf_filtered (file, "Operand Pointer: %s:", - local_hex_string_custom (foseg, "02")); - fprintf_filtered (file, "%s\n", local_hex_string_custom (fooff, "08")); + hex_string_custom (foseg, 2)); + fprintf_filtered (file, "%s\n", hex_string_custom (fooff, 8)); fprintf_filtered (file, "Opcode: %s\n", - local_hex_string_custom (fop ? (fop | 0xd800) : 0, "04")); + hex_string_custom (fop ? (fop | 0xd800) : 0, 4)); #undef I387_ST0_REGNUM } @@ -340,7 +340,6 @@ i387_value_to_register (struct frame_info *frame, int regnum, put_frame_register (frame, regnum, to); } - /* Handle FSAVE and FXSAVE formats. */ @@ -391,9 +390,11 @@ i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave) gdb_assert (tdep->st0_regnum >= I386_ST0_REGNUM); - /* Define I387_ST0_REGNUM such that we use the proper definitions - for REGCACHE's architecture. */ + /* Define I387_ST0_REGNUM and I387_NUM_XMM_REGS such that we use the + proper definitions for REGCACHE's architecture. */ + #define I387_ST0_REGNUM tdep->st0_regnum +#define I387_NUM_XMM_REGS tdep->num_xmm_regs for (i = I387_ST0_REGNUM; i < I387_XMM0_REGNUM; i++) if (regnum == -1 || regnum == i) @@ -420,18 +421,31 @@ i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave) else regcache_raw_supply (regcache, i, FSAVE_ADDR (regs, i)); } + + /* Provide dummy values for the SSE registers. */ + for (i = I387_XMM0_REGNUM; i < I387_MXCSR_REGNUM; i++) + if (regnum == -1 || regnum == i) + regcache_raw_supply (regcache, i, NULL); + if (regnum == -1 || regnum == I387_MXCSR_REGNUM) + { + char buf[4]; + + store_unsigned_integer (buf, 4, 0x1f80); + regcache_raw_supply (regcache, I387_MXCSR_REGNUM, buf); + } + #undef I387_ST0_REGNUM +#undef I387_NUM_XMM_REGS } /* Fill register REGNUM (if it is a floating-point register) in *FSAVE - with the value in GDB's register cache. If REGNUM is -1, do this - for all registers. This function doesn't touch any of the reserved - bits in *FSAVE. */ + with the value from REGCACHE. If REGNUM is -1, do this for all + registers. This function doesn't touch any of the reserved bits in + *FSAVE. */ void -i387_fill_fsave (void *fsave, int regnum) +i387_collect_fsave (const struct regcache *regcache, int regnum, void *fsave) { - struct regcache *regcache = current_regcache; struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); char *regs = fsave; int i; @@ -468,6 +482,17 @@ i387_fill_fsave (void *fsave, int regnum) } #undef I387_ST0_REGNUM } + +/* Fill register REGNUM (if it is a floating-point register) in *FSAVE + with the value in GDB's register cache. If REGNUM is -1, do this + for all registers. This function doesn't touch any of the reserved + bits in *FSAVE. */ + +void +i387_fill_fsave (void *fsave, int regnum) +{ + i387_collect_fsave (current_regcache, regnum, fsave); +} /* At fxsave_offset[REGNUM] you'll find the offset to the location in diff --git a/gnu/usr.bin/binutils/gdb/infcall.c b/gnu/usr.bin/binutils/gdb/infcall.c index d6a774a6fc0..ec4f11a0136 100644 --- a/gnu/usr.bin/binutils/gdb/infcall.c +++ b/gnu/usr.bin/binutils/gdb/infcall.c @@ -35,6 +35,7 @@ #include "command.h" #include "gdb_string.h" #include "infcall.h" +#include "dummy-frame.h" /* NOTE: cagney/2003-04-16: What's the future of this code? @@ -205,8 +206,9 @@ find_function_addr (struct value *function, struct type **retval_type) else error ("Invalid data type for function to be called."); - *retval_type = value_type; - return funaddr + FUNCTION_START_OFFSET; + if (retval_type != NULL) + *retval_type = value_type; + return funaddr + DEPRECATED_FUNCTION_START_OFFSET; } /* Call breakpoint_auto_delete on the current contents of the bpstat @@ -219,90 +221,6 @@ breakpoint_auto_delete_contents (void *arg) } static CORE_ADDR -legacy_push_dummy_code (struct gdbarch *gdbarch, - CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, - struct value **args, int nargs, - struct type *value_type, - CORE_ADDR *real_pc, CORE_ADDR *bp_addr) -{ - /* CALL_DUMMY is an array of words (DEPRECATED_REGISTER_SIZE), but - each word is in host byte order. Before calling - DEPRECATED_FIX_CALL_DUMMY, we byteswap it and remove any extra - bytes which might exist because ULONGEST is bigger than - DEPRECATED_REGISTER_SIZE. */ - /* NOTE: This is pretty wierd, as the call dummy is actually a - sequence of instructions. But CISC machines will have to pack - the instructions into DEPRECATED_REGISTER_SIZE units (and so will - RISC machines for which INSTRUCTION_SIZE is not - DEPRECATED_REGISTER_SIZE). */ - /* NOTE: This is pretty stupid. CALL_DUMMY should be in strict - target byte order. */ - CORE_ADDR start_sp; - ULONGEST *dummy = alloca (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS); - int sizeof_dummy1 = (DEPRECATED_REGISTER_SIZE - * DEPRECATED_SIZEOF_CALL_DUMMY_WORDS - / sizeof (ULONGEST)); - char *dummy1 = alloca (sizeof_dummy1); - memcpy (dummy, DEPRECATED_CALL_DUMMY_WORDS, - DEPRECATED_SIZEOF_CALL_DUMMY_WORDS); - if (INNER_THAN (1, 2)) - { - /* Stack grows down */ - sp -= sizeof_dummy1; - start_sp = sp; - } - else - { - /* Stack grows up */ - start_sp = sp; - sp += sizeof_dummy1; - } - /* NOTE: cagney/2002-09-10: Don't bother re-adjusting the stack - after allocating space for the call dummy. A target can specify - a SIZEOF_DUMMY1 (via DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) such - that all local alignment requirements are met. */ - /* Create a call sequence customized for this function and the - number of arguments for it. */ - { - int i; - for (i = 0; i < (int) (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0])); - i++) - store_unsigned_integer (&dummy1[i * DEPRECATED_REGISTER_SIZE], - DEPRECATED_REGISTER_SIZE, - (ULONGEST) dummy[i]); - } - /* NOTE: cagney/2003-04-22: This computation of REAL_PC, BP_ADDR and - DUMMY_ADDR is pretty messed up. It comes from constant tinkering - with the values. Instead a DEPRECATED_FIX_CALL_DUMMY replacement - (PUSH_DUMMY_BREAKPOINT?) should just do everything. */ - if (!gdbarch_push_dummy_call_p (current_gdbarch)) - { -#ifdef GDB_TARGET_IS_HPPA - (*real_pc) = DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, - args, value_type, using_gcc); -#else - if (DEPRECATED_FIX_CALL_DUMMY_P ()) - { - /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true? */ - DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args, - value_type, using_gcc); - } - (*real_pc) = start_sp; -#endif - } - /* Yes, the offset is applied to the real_pc and not the dummy addr. - Ulgh! Blame the HP/UX target. */ - (*bp_addr) = (*real_pc) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET; - /* Yes, the offset is applied to the real_pc and not the - dummy_addr. Ulgh! Blame the HP/UX target. */ - (*real_pc) += DEPRECATED_CALL_DUMMY_START_OFFSET; - write_memory (start_sp, (char *) dummy1, sizeof_dummy1); - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) - generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1); - return sp; -} - -static CORE_ADDR generic_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, @@ -338,8 +256,8 @@ generic_push_dummy_code (struct gdbarch *gdbarch, return sp; } -/* Provide backward compatibility. Once DEPRECATED_FIX_CALL_DUMMY is - eliminated, this can be simplified. */ +/* For CALL_DUMMY_ON_STACK, push a breakpoint sequence that the called + function returns to. */ static CORE_ADDR push_dummy_code (struct gdbarch *gdbarch, @@ -351,10 +269,6 @@ push_dummy_code (struct gdbarch *gdbarch, if (gdbarch_push_dummy_code_p (gdbarch)) return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr); - else if (DEPRECATED_FIX_CALL_DUMMY_P () - && !gdbarch_push_dummy_call_p (gdbarch)) - return legacy_push_dummy_code (gdbarch, sp, funaddr, using_gcc, - args, nargs, value_type, real_pc, bp_addr); else return generic_push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr); @@ -393,8 +307,11 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) CORE_ADDR funaddr; int using_gcc; /* Set to version of gcc in use, or zero if not gcc */ CORE_ADDR real_pc; - struct type *ftype = check_typedef (SYMBOL_TYPE (function)); + struct type *ftype = check_typedef (VALUE_TYPE (function)); CORE_ADDR bp_addr; + struct regcache *caller_regcache; + struct cleanup *caller_regcache_cleanup; + struct frame_id dummy_id; if (!target_has_execution) noprocess (); @@ -412,34 +329,12 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) inf_status = save_inferior_status (1); inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status); - if (DEPRECATED_PUSH_DUMMY_FRAME_P ()) - { - /* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the - inferior registers (and frame_pop() for restoring them). (At - least on most machines) they are saved on the stack in the - inferior. */ - DEPRECATED_PUSH_DUMMY_FRAME; - } - else - { - /* FIXME: cagney/2003-02-26: Step zero of this little tinker is - to extract the generic dummy frame code from the architecture - vector. Hence this direct call. - - A follow-on change is to modify this interface so that it takes - thread OR frame OR ptid as a parameter, and returns a dummy - frame handle. The handle can then be used further down as a - parameter to generic_save_dummy_frame_tos(). Hmm, thinking - about it, since everything is ment to be using generic dummy - frames, why not even use some of the dummy frame code to here - - do a regcache dup and then pass the duped regcache, along with - all the other stuff, at one single point. - - In fact, you can even save the structure's return address in the - dummy frame and fix one of those nasty lost struct return edge - conditions. */ - generic_push_dummy_frame (); - } + /* Save the caller's registers so that they can be restored once the + callee returns. To allow nested calls the registers are (further + down) pushed onto a dummy frame stack. Include a cleanup (which + is tossed once the regcache has been pushed). */ + caller_regcache = frame_save_as_regcache (get_current_frame ()); + caller_regcache_cleanup = make_cleanup_regcache_xfree (caller_regcache); /* Ensure that the initial SP is correctly aligned. */ { @@ -550,18 +445,6 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) } break; case AT_ENTRY_POINT: - if (DEPRECATED_FIX_CALL_DUMMY_P () - && !gdbarch_push_dummy_call_p (current_gdbarch)) - { - /* Sigh. Some targets use DEPRECATED_FIX_CALL_DUMMY to - shove extra stuff onto the stack or into registers. That - code should be in PUSH_DUMMY_CALL, however, in the mean - time ... */ - /* If the target is manipulating DUMMY1, it looses big time. */ - void *dummy1 = NULL; - DEPRECATED_FIX_CALL_DUMMY (dummy1, sp, funaddr, nargs, args, - value_type, using_gcc); - } real_pc = funaddr; dummy_addr = entry_point_address (); /* Make certain that the address points at real code, and not a @@ -601,11 +484,6 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) internal_error (__FILE__, __LINE__, "bad switch"); } - if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES) - /* Save where the breakpoint is going to be inserted so that the - dummy-frame code is later able to re-identify it. */ - generic_save_call_dummy_addr (bp_addr, bp_addr + 1); - if (nargs < TYPE_NFIELDS (ftype)) error ("too few arguments in function call"); @@ -696,14 +574,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i])); len = TYPE_LENGTH (arg_type); - if (DEPRECATED_STACK_ALIGN_P ()) - /* MVS 11/22/96: I think at least some of this - stack_align code is really broken. Better to let - PUSH_ARGUMENTS adjust the stack in a target-defined - manner. */ - aligned_len = DEPRECATED_STACK_ALIGN (len); - else - aligned_len = len; + aligned_len = len; if (INNER_THAN (1, 2)) { /* stack grows downward */ @@ -739,10 +610,6 @@ You must use a pointer to function type variable. Command ignored.", arg_name); if (struct_return) { int len = TYPE_LENGTH (value_type); - if (DEPRECATED_STACK_ALIGN_P ()) - /* NOTE: cagney/2003-03-22: Should rely on frame align, rather - than stack align to force the alignment of the stack. */ - len = DEPRECATED_STACK_ALIGN (len); if (INNER_THAN (1, 2)) { /* Stack grows downward. Align STRUCT_ADDR and SP after @@ -772,7 +639,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); /* When there is no push_dummy_call method, should this code simply error out. That would the implementation of this method for all ABIs (which is probably a good thing). */ - sp = gdbarch_push_dummy_call (current_gdbarch, funaddr, current_regcache, + sp = gdbarch_push_dummy_call (current_gdbarch, function, current_regcache, bp_addr, nargs, args, sp, struct_return, struct_addr); else if (DEPRECATED_PUSH_ARGUMENTS_P ()) @@ -780,114 +647,46 @@ You must use a pointer to function type variable. Command ignored.", arg_name); sp = DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr); else - sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr); - - if (DEPRECATED_PUSH_RETURN_ADDRESS_P ()) - /* for targets that use no CALL_DUMMY */ - /* There are a number of targets now which actually don't write - any CALL_DUMMY instructions into the target, but instead just - save the machine state, push the arguments, and jump directly - to the callee function. Since this doesn't actually involve - executing a JSR/BSR instruction, the return address must be set - up by hand, either by pushing onto the stack or copying into a - return-address register as appropriate. Formerly this has been - done in PUSH_ARGUMENTS, but that's overloading its - functionality a bit, so I'm making it explicit to do it here. */ - /* NOTE: cagney/2003-04-22: The first parameter ("real_pc") has - been replaced with zero, it turns out that no implementation - used that parameter. This occured because the value being - supplied - the address of the called function's entry point - instead of the address of the breakpoint that the called - function should return to - wasn't useful. */ - sp = DEPRECATED_PUSH_RETURN_ADDRESS (0, sp); - - /* NOTE: cagney/2003-03-23: Diable this code when there is a - push_dummy_call() method. Since that method will have already - handled any alignment issues, the code below is entirely - redundant. */ - if (!gdbarch_push_dummy_call_p (current_gdbarch) - && DEPRECATED_STACK_ALIGN_P () && !INNER_THAN (1, 2)) - { - /* If stack grows up, we must leave a hole at the bottom, note - that sp already has been advanced for the arguments! */ - sp = DEPRECATED_STACK_ALIGN (sp); - } + error ("This target does not support function calls"); - /* Store the address at which the structure is supposed to be - written. */ - /* NOTE: 2003-03-24: Since PUSH_ARGUMENTS can (and typically does) - store the struct return address, this call is entirely redundant. */ - if (struct_return && DEPRECATED_STORE_STRUCT_RETURN_P ()) - DEPRECATED_STORE_STRUCT_RETURN (struct_addr, sp); - - /* Write the stack pointer. This is here because the statements - above might fool with it. On SPARC, this write also stores the - register window into the right place in the new stack frame, - which otherwise wouldn't happen (see store_inferior_registers in - sparc-nat.c). */ - /* NOTE: cagney/2003-03-23: Since the architecture method - push_dummy_call() should have already stored the stack pointer - (as part of creating the fake call frame), and none of the code - following that call adjusts the stack-pointer value, the below - call is entirely redundant. */ - if (DEPRECATED_DUMMY_WRITE_SP_P ()) - DEPRECATED_DUMMY_WRITE_SP (sp); - - if (gdbarch_unwind_dummy_id_p (current_gdbarch)) - { - /* Sanity. The exact same SP value is returned by - PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by - unwind_dummy_id to form the frame ID's stack address. */ - gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES); - generic_save_dummy_frame_tos (sp); - } - else if (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ()) - DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp); + /* Set up a frame ID for the dummy frame so we can pass it to + set_momentary_breakpoint. We need to give the breakpoint a frame + ID so that the breakpoint code can correctly re-identify the + dummy breakpoint. */ + /* Sanity. The exact same SP value is returned by PUSH_DUMMY_CALL, + saved as the dummy-frame TOS, and used by unwind_dummy_id to form + the frame ID's stack address. */ + dummy_id = frame_id_build (sp, bp_addr); - /* Now proceed, having reached the desired place. */ - clear_proceed_status (); - /* Create a momentary breakpoint at the return address of the inferior. That way it breaks when it returns. */ { struct breakpoint *bpt; struct symtab_and_line sal; - struct frame_id frame; init_sal (&sal); /* initialize to zeroes */ sal.pc = bp_addr; sal.section = find_pc_overlay (sal.pc); - /* Set up a frame ID for the dummy frame so we can pass it to - set_momentary_breakpoint. We need to give the breakpoint a - frame ID so that the breakpoint code can correctly re-identify - the dummy breakpoint. */ - if (gdbarch_unwind_dummy_id_p (current_gdbarch)) - { - /* Sanity. The exact same SP value is returned by - PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by - unwind_dummy_id to form the frame ID's stack address. */ - gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES); - frame = frame_id_build (sp, sal.pc); - } - else - { - /* The assumption here is that push_dummy_call() returned the - stack part of the frame ID. Unfortunately, many older - architectures were, via a convoluted mess, relying on the - poorly defined and greatly overloaded - DEPRECATED_TARGET_READ_FP or DEPRECATED_FP_REGNUM to supply - the value. */ - if (DEPRECATED_TARGET_READ_FP_P ()) - frame = frame_id_build (DEPRECATED_TARGET_READ_FP (), sal.pc); - else if (DEPRECATED_FP_REGNUM >= 0) - frame = frame_id_build (read_register (DEPRECATED_FP_REGNUM), sal.pc); - else - frame = frame_id_build (sp, sal.pc); - } - bpt = set_momentary_breakpoint (sal, frame, bp_call_dummy); + /* Sanity. The exact same SP value is returned by + PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by + unwind_dummy_id to form the frame ID's stack address. */ + bpt = set_momentary_breakpoint (sal, dummy_id, bp_call_dummy); bpt->disposition = disp_del; } + /* Everything's ready, push all the info needed to restore the + caller (and identify the dummy-frame) onto the dummy-frame + stack. */ + dummy_frame_push (caller_regcache, &dummy_id); + discard_cleanups (caller_regcache_cleanup); + + /* - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - + If you're looking to implement asynchronous dummy-frames, then + just below is the place to chop this function in two.. */ + + /* Now proceed, having reached the desired place. */ + clear_proceed_status (); + /* Execute a "stack dummy", a piece of code stored in the stack by the debugger to be executed in the inferior. @@ -947,7 +746,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name); { /* Can't use a cleanup here. It is discarded, instead use an alloca. */ - char *tmp = xstrprintf ("at %s", local_hex_string (funaddr)); + char *tmp = xstrprintf ("at %s", hex_string (funaddr)); char *a = alloca (strlen (tmp) + 1); strcpy (a, tmp); xfree (tmp); @@ -1037,9 +836,14 @@ the function call).", name); leave the RETBUF alone. */ do_cleanups (inf_status_cleanup); - /* Figure out the value returned by the function. */ - if (struct_return) - { + /* Figure out the value returned by the function, return that. */ + { + struct value *retval; + if (TYPE_CODE (value_type) == TYPE_CODE_VOID) + /* If the function returns void, don't bother fetching the + return value. */ + retval = allocate_value (value_type); + else if (struct_return) /* NOTE: cagney/2003-09-27: This assumes that PUSH_DUMMY_CALL has correctly stored STRUCT_ADDR in the target. In the past that hasn't been the case, the old MIPS PUSH_ARGUMENTS @@ -1048,18 +852,21 @@ the function call).", name); you're seeing problems with values being returned using the "struct return convention", check that PUSH_DUMMY_CALL isn't playing tricks. */ - struct value *retval = value_at (value_type, struct_addr, NULL); - do_cleanups (retbuf_cleanup); - return retval; - } - else - { - /* The non-register case was handled above. */ - struct value *retval = register_value_being_returned (value_type, - retbuf); - do_cleanups (retbuf_cleanup); - return retval; - } + retval = value_at (value_type, struct_addr, NULL); + else + { + /* This code only handles "register convention". */ + retval = allocate_value (value_type); + gdb_assert (gdbarch_return_value (current_gdbarch, value_type, + NULL, NULL, NULL) + == RETURN_VALUE_REGISTER_CONVENTION); + gdbarch_return_value (current_gdbarch, value_type, retbuf, + VALUE_CONTENTS_RAW (retval) /*read*/, + NULL /*write*/); + } + do_cleanups (retbuf_cleanup); + return retval; + } } void _initialize_infcall (void); @@ -1069,7 +876,8 @@ _initialize_infcall (void) { add_setshow_boolean_cmd ("coerce-float-to-double", class_obscure, &coerce_float_to_double_p, "\ -Set coercion of floats to doubles when calling functions\n\ +Set coercion of floats to doubles when calling functions.", "\ +Show coercion of floats to doubles when calling functions", "\ Variables of type float should generally be converted to doubles before\n\ calling an unprototyped function, and left alone when calling a prototyped\n\ function. However, some older debug info formats do not provide enough\n\ @@ -1077,27 +885,17 @@ information to determine that a function is prototyped. If this flag is\n\ set, GDB will perform the conversion for a function it considers\n\ unprototyped.\n\ The default is to perform the conversion.\n", "\ -Show coercion of floats to doubles when calling functions\n\ -Variables of type float should generally be converted to doubles before\n\ -calling an unprototyped function, and left alone when calling a prototyped\n\ -function. However, some older debug info formats do not provide enough\n\ -information to determine that a function is prototyped. If this flag is\n\ -set, GDB will perform the conversion for a function it considers\n\ -unprototyped.\n\ -The default is to perform the conversion.\n", +Coercion of floats to doubles when calling functions is %s.", NULL, NULL, &setlist, &showlist); add_setshow_boolean_cmd ("unwindonsignal", no_class, &unwind_on_signal_p, "\ -Set unwinding of stack if a signal is received while in a call dummy.\n\ +Set unwinding of stack if a signal is received while in a call dummy.", "\ +Show unwinding of stack if a signal is received while in a call dummy.", "\ The unwindonsignal lets the user determine what gdb should do if a signal\n\ is received while in a function called from gdb (call dummy). If set, gdb\n\ unwinds the stack and restore the context to what as it was before the call.\n\ The default is to stop in the frame where the signal was received.", "\ -Set unwinding of stack if a signal is received while in a call dummy.\n\ -The unwindonsignal lets the user determine what gdb should do if a signal\n\ -is received while in a function called from gdb (call dummy). If set, gdb\n\ -unwinds the stack and restore the context to what as it was before the call.\n\ -The default is to stop in the frame where the signal was received.", +Unwinding of stack if a signal is received while in a call dummy is %s.", NULL, NULL, &setlist, &showlist); } diff --git a/gnu/usr.bin/binutils/gdb/infcmd.c b/gnu/usr.bin/binutils/gdb/infcmd.c index 6e74f4e5431..afa07c474f0 100644 --- a/gnu/usr.bin/binutils/gdb/infcmd.c +++ b/gnu/usr.bin/binutils/gdb/infcmd.c @@ -186,10 +186,6 @@ CORE_ADDR step_range_end; /* Exclusive */ struct frame_id step_frame_id; -/* Our notion of the current stack pointer. */ - -CORE_ADDR step_sp; - enum step_over_calls_kind step_over_calls; /* If stepping, nonzero means step count is > 1 @@ -379,13 +375,14 @@ tty_command (char *file, int from_tty) inferior_io_terminal = savestring (file, strlen (file)); } -static void -run_command (char *args, int from_tty) -{ - char *exec_file; - - dont_repeat (); +/* Kill the inferior if already running. This function is designed + to be called when we are about to start the execution of the program + from the beginning. Ask the user to confirm that he wants to restart + the program being debugged when FROM_TTY is non-null. */ +void +kill_if_already_running (int from_tty) +{ if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution) { if (from_tty @@ -398,7 +395,16 @@ Start it from the beginning? ")) #endif init_wait_for_inferior (); } +} + +static void +run_command (char *args, int from_tty) +{ + char *exec_file; + + dont_repeat (); + kill_if_already_running (from_tty); clear_breakpoint_hit_counts (); /* Purge old solib objfiles. */ @@ -428,7 +434,7 @@ Start it from the beginning? ")) if (!args) { - if (event_loop_p && target_can_async_p ()) + if (target_can_async_p ()) async_disable_stdin (); } else @@ -437,12 +443,12 @@ Start it from the beginning? ")) /* If we get a request for running in the bg but the target doesn't support it, error out. */ - if (event_loop_p && async_exec && !target_can_async_p ()) + if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we don't get a request of running in the bg, then we need to simulate synchronous (fg) execution. */ - if (event_loop_p && !async_exec && target_can_async_p ()) + if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); @@ -473,7 +479,7 @@ Start it from the beginning? ")) /* We call get_inferior_args() because we might need to compute the value now. */ target_create_inferior (exec_file, get_inferior_args (), - environ_vector (inferior_environ)); + environ_vector (inferior_environ), from_tty); } @@ -485,6 +491,29 @@ run_no_args_command (char *args, int from_tty) } +/* Start the execution of the program up until the beginning of the main + program. */ + +static void +start_command (char *args, int from_tty) +{ + /* Some languages such as Ada need to search inside the program + minimal symbols for the location where to put the temporary + breakpoint before starting. */ + if (!have_minimal_symbols ()) + error ("No symbol table loaded. Use the \"file\" command."); + + /* If the inferior is already running, we want to ask the user if we + should restart it or not before we insert the temporary breakpoint. + This makes sure that this command doesn't have any side effect if + the user changes its mind. */ + kill_if_already_running (from_tty); + + /* Insert the temporary breakpoint, and run... */ + tbreak_command (main_name (), 0); + run_command (args, from_tty); +} + void continue_command (char *proc_count_exp, int from_tty) { @@ -497,12 +526,12 @@ continue_command (char *proc_count_exp, int from_tty) /* If we must run in the background, but the target can't do it, error out. */ - if (event_loop_p && async_exec && !target_can_async_p ()) + if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ - if (event_loop_p && !async_exec && target_can_async_p ()) + if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); @@ -591,12 +620,12 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) /* If we get a request for running in the bg but the target doesn't support it, error out. */ - if (event_loop_p && async_exec && !target_can_async_p ()) + if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we don't get a request of running in the bg, then we need to simulate synchronous (fg) execution. */ - if (event_loop_p && !async_exec && target_can_async_p ()) + if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); @@ -607,14 +636,14 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) if (!single_inst || skip_subroutines) /* leave si command alone */ { enable_longjmp_breakpoint (); - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) cleanups = make_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); else make_exec_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); } /* In synchronous case, all is well, just use the regular for loop. */ - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) { for (; count > 0; count--) { @@ -624,7 +653,6 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) if (!frame) /* Avoid coredump here. Why tho? */ error ("No current frame"); step_frame_id = get_frame_id (frame); - step_sp = read_sp (); if (!single_inst) { @@ -673,7 +701,7 @@ which has no line number information.\n", name); and handle them one at the time, through step_once(). */ else { - if (event_loop_p && target_can_async_p ()) + if (target_can_async_p ()) step_once (skip_subroutines, single_inst, count); } } @@ -724,7 +752,6 @@ step_once (int skip_subroutines, int single_inst, int count) if (!frame) /* Avoid coredump here. Why tho? */ error ("No current frame"); step_frame_id = get_frame_id (frame); - step_sp = read_sp (); if (!single_inst) { @@ -801,12 +828,12 @@ jump_command (char *arg, int from_tty) /* If we must run in the background, but the target can't do it, error out. */ - if (event_loop_p && async_exec && !target_can_async_p ()) + if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ - if (event_loop_p && !async_exec && target_can_async_p ()) + if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); @@ -977,7 +1004,6 @@ until_next_command (int from_tty) step_over_calls = STEP_OVER_ALL; step_frame_id = get_frame_id (frame); - step_sp = read_sp (); step_multi = 0; /* Only one call to proceed */ @@ -998,12 +1024,12 @@ until_command (char *arg, int from_tty) /* If we must run in the background, but the target can't do it, error out. */ - if (event_loop_p && async_exec && !target_can_async_p ()) + if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ - if (event_loop_p && !async_exec && target_can_async_p ()) + if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution */ async_disable_stdin (); @@ -1032,12 +1058,12 @@ advance_command (char *arg, int from_tty) /* If we must run in the background, but the target can't do it, error out. */ - if (event_loop_p && async_exec && !target_can_async_p ()) + if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ - if (event_loop_p && !async_exec && target_can_async_p ()) + if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution. */ async_disable_stdin (); @@ -1046,80 +1072,62 @@ advance_command (char *arg, int from_tty) until_break_command (arg, from_tty, 1); } - /* Print the result of a function at the end of a 'finish' command. */ static void print_return_value (int struct_return, struct type *value_type) { + struct gdbarch *gdbarch = current_gdbarch; struct cleanup *old_chain; struct ui_stream *stb; struct value *value; - if (!struct_return) - { - /* The return value can be found in the inferior's registers. */ - value = register_value_being_returned (value_type, stop_registers); - } - /* FIXME: cagney/2004-01-17: When both return_value and - extract_returned_value_address are available, should use that to - find the address of and then extract the returned value. */ + gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID); + /* FIXME: 2003-09-27: When returning from a nested inferior function call, it's possible (with no help from the architecture vector) to locate and return/print a "struct return" value. This is just a more complicated case of what is already being done in in the inferior function call code. In fact, when inferior function calls are made async, this will likely be made the norm. */ - else if (gdbarch_return_value_p (current_gdbarch)) - /* We cannot determine the contents of the structure because it is - on the stack, and we don't know where, since we did not - initiate the call, as opposed to the call_function_by_hand - case. */ + + switch (gdbarch_return_value (gdbarch, value_type, NULL, NULL, NULL)) + { + case RETURN_VALUE_REGISTER_CONVENTION: + case RETURN_VALUE_ABI_RETURNS_ADDRESS: + value = allocate_value (value_type); + CHECK_TYPEDEF (value_type); + gdbarch_return_value (current_gdbarch, value_type, stop_registers, + VALUE_CONTENTS_RAW (value), NULL); + break; + case RETURN_VALUE_STRUCT_CONVENTION: + value = NULL; + break; + default: + internal_error (__FILE__, __LINE__, "bad switch"); + } + + if (value) + { + /* Print it. */ + stb = ui_out_stream_new (uiout); + old_chain = make_cleanup_ui_out_stream_delete (stb); + ui_out_text (uiout, "Value returned is "); + ui_out_field_fmt (uiout, "gdb-result-var", "$%d", + record_latest_value (value)); + ui_out_text (uiout, " = "); + value_print (value, stb->stream, 0, Val_no_prettyprint); + ui_out_field_stream (uiout, "return-value", stb); + ui_out_text (uiout, "\n"); + do_cleanups (old_chain); + } + else { - gdb_assert (gdbarch_return_value (current_gdbarch, value_type, - NULL, NULL, NULL) - == RETURN_VALUE_STRUCT_CONVENTION); ui_out_text (uiout, "Value returned has type: "); ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type)); ui_out_text (uiout, "."); ui_out_text (uiout, " Cannot determine contents\n"); - return; } - else - { - if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()) - { - CORE_ADDR addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (stop_registers); - if (!addr) - error ("Function return value unknown."); - value = value_at (value_type, addr, NULL); - } - else - { - /* It is "struct return" yet the value is being extracted, - presumably from registers, using EXTRACT_RETURN_VALUE. - This doesn't make sense. Unfortunately, the legacy - interfaces allowed this behavior. Sigh! */ - value = allocate_value (value_type); - CHECK_TYPEDEF (value_type); - /* If the function returns void, don't bother fetching the - return value. */ - EXTRACT_RETURN_VALUE (value_type, stop_registers, - VALUE_CONTENTS_RAW (value)); - } - } - - /* Print it. */ - stb = ui_out_stream_new (uiout); - old_chain = make_cleanup_ui_out_stream_delete (stb); - ui_out_text (uiout, "Value returned is "); - ui_out_field_fmt (uiout, "gdb-result-var", "$%d", - record_latest_value (value)); - ui_out_text (uiout, " = "); - value_print (value, stb->stream, 0, Val_no_prettyprint); - ui_out_field_stream (uiout, "return-value", stb); - ui_out_text (uiout, "\n"); - do_cleanups (old_chain); } /* Stuff that needs to be done by the finish command after the target @@ -1191,12 +1199,12 @@ finish_command (char *arg, int from_tty) /* If we must run in the background, but the target can't do it, error out. */ - if (event_loop_p && async_exec && !target_can_async_p ()) + if (async_exec && !target_can_async_p ()) error ("Asynchronous execution not supported on this target."); /* If we are not asked to run in the bg, then prepare to run in the foreground, synchronously. */ - if (event_loop_p && !async_exec && target_can_async_p ()) + if (!async_exec && target_can_async_p ()) { /* Simulate synchronous execution. */ async_disable_stdin (); @@ -1220,7 +1228,7 @@ finish_command (char *arg, int from_tty) breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame), bp_finish); - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) old_chain = make_cleanup_delete_breakpoint (breakpoint); else old_chain = make_exec_cleanup_delete_breakpoint (breakpoint); @@ -1234,15 +1242,14 @@ finish_command (char *arg, int from_tty) if (from_tty) { printf_filtered ("Run till exit from "); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 0); + print_stack_frame (get_selected_frame (), 1, LOCATION); } /* If running asynchronously and the target support asynchronous execution, set things up for the rest of the finish command to be completed later on, when gdb has detected that the target has stopped, in fetch_inferior_event. */ - if (event_loop_p && target_can_async_p ()) + if (target_can_async_p ()) { arg1 = (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg)); @@ -1265,7 +1272,7 @@ finish_command (char *arg, int from_tty) /* Do this only if not running asynchronously or if the target cannot do async execution. Otherwise, complete this command when the target actually stops, in fetch_inferior_event. */ - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) { /* Did we stop at our breakpoint? */ if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL @@ -1310,7 +1317,7 @@ program_info (char *args, int from_tty) target_files_info (); printf_filtered ("Program stopped at %s.\n", - local_hex_string ((unsigned long) stop_pc)); + hex_string ((unsigned long) stop_pc)); if (stop_step) printf_filtered ("It stopped after being stepped.\n"); else if (num != 0) @@ -1505,14 +1512,7 @@ default_print_registers_info (struct gdbarch *gdbarch, { int i; const int numregs = NUM_REGS + NUM_PSEUDO_REGS; - char raw_buffer[MAX_REGISTER_SIZE]; - char virtual_buffer[MAX_REGISTER_SIZE]; - - if (DEPRECATED_DO_REGISTERS_INFO_P ()) - { - DEPRECATED_DO_REGISTERS_INFO (regnum, print_all); - return; - } + char buffer[MAX_REGISTER_SIZE]; for (i = 0; i < numregs; i++) { @@ -1546,60 +1546,44 @@ default_print_registers_info (struct gdbarch *gdbarch, print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file); /* Get the data in raw format. */ - if (! frame_register_read (frame, i, raw_buffer)) + if (! frame_register_read (frame, i, buffer)) { fprintf_filtered (file, "*value not available*\n"); continue; } - /* FIXME: cagney/2002-08-03: This code shouldn't be necessary. - The function frame_register_read() should have returned the - pre-cooked register so no conversion is necessary. */ - /* Convert raw data to virtual format if necessary. */ - if (DEPRECATED_REGISTER_CONVERTIBLE_P () - && DEPRECATED_REGISTER_CONVERTIBLE (i)) - { - DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i), - raw_buffer, virtual_buffer); - } - else - { - memcpy (virtual_buffer, raw_buffer, - DEPRECATED_REGISTER_VIRTUAL_SIZE (i)); - } - /* If virtual format is floating, print it that way, and in raw hex. */ if (TYPE_CODE (register_type (current_gdbarch, i)) == TYPE_CODE_FLT) { int j; - val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), buffer, 0, 0, file, 0, 1, 0, Val_pretty_default); fprintf_filtered (file, "\t(raw 0x"); - for (j = 0; j < DEPRECATED_REGISTER_RAW_SIZE (i); j++) + for (j = 0; j < register_size (current_gdbarch, i); j++) { int idx; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) idx = j; else - idx = DEPRECATED_REGISTER_RAW_SIZE (i) - 1 - j; - fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]); + idx = register_size (current_gdbarch, i) - 1 - j; + fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]); } fprintf_filtered (file, ")"); } else { /* Print the register in hex. */ - val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), buffer, 0, 0, file, 'x', 1, 0, Val_pretty_default); /* If not a vector register, print it also according to its natural format. */ if (TYPE_VECTOR (register_type (current_gdbarch, i)) == 0) { fprintf_filtered (file, "\t"); - val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), buffer, 0, 0, file, 0, 1, 0, Val_pretty_default); } } @@ -1798,9 +1782,6 @@ attach_command (char *args, int from_tty) based on what modes we are starting it with. */ target_terminal_init (); - /* Install inferior's terminal modes. */ - target_terminal_inferior (); - /* Set up execution context to know that we should return from wait_for_inferior as soon as the target reports a stop. */ init_wait_for_inferior (); @@ -1843,6 +1824,11 @@ attach_command (char *args, int from_tty) symbol_file_add_main (full_exec_path, from_tty); } } + else + { + reopen_exec_file (); + reread_symbols (); + } #ifdef SOLIB_ADD /* Add shared library symbols from the newly attached process, if any. */ @@ -1854,10 +1840,13 @@ attach_command (char *args, int from_tty) */ target_post_attach (PIDGET (inferior_ptid)); + /* Install inferior's terminal modes. */ + target_terminal_inferior (); + normal_stop (); - if (attach_hook) - attach_hook (); + if (deprecated_attach_hook) + deprecated_attach_hook (); } /* @@ -1879,8 +1868,8 @@ detach_command (char *args, int from_tty) #if defined(SOLIB_RESTART) SOLIB_RESTART (); #endif - if (detach_hook) - detach_hook (); + if (deprecated_detach_hook) + deprecated_detach_hook (); } /* Disconnect from the current target without resuming it (leaving it @@ -1899,8 +1888,8 @@ disconnect_command (char *args, int from_tty) #if defined(SOLIB_RESTART) SOLIB_RESTART (); #endif - if (detach_hook) - detach_hook (); + if (deprecated_detach_hook) + deprecated_detach_hook (); } /* Stop the execution of the target while running in async mode, in @@ -1908,7 +1897,7 @@ disconnect_command (char *args, int from_tty) void interrupt_target_command (char *args, int from_tty) { - if (event_loop_p && target_can_async_p ()) + if (target_can_async_p ()) { dont_repeat (); /* Not for the faint of heart */ target_stop (); @@ -1975,7 +1964,7 @@ Follow this command with any number of args, to be passed to the program.", &setlist); set_cmd_completer (c, filename_completer); set_cmd_sfunc (c, notice_args_set); - c = add_show_from_set (c, &showlist); + c = deprecated_add_show_from_set (c, &showlist); set_cmd_sfunc (c, notice_args_read); c = add_cmd @@ -2129,6 +2118,13 @@ use \"set args\" without arguments."); add_com ("R", class_run, run_no_args_command, "Start debugged program with no arguments."); + c = add_com ("start", class_run, start_command, + "\ +Run the debugged program until the beginning of the main procedure.\n\ +You may specify arguments to give to your program, just as with the\n\ +\"run\" command."); + set_cmd_completer (c, filename_completer); + add_com ("interrupt", class_run, interrupt_target_command, "Interrupt the execution of the debugged program."); diff --git a/gnu/usr.bin/binutils/gdb/inferior.h b/gnu/usr.bin/binutils/gdb/inferior.h index b36dcd45b1d..4a8f62932ee 100644 --- a/gnu/usr.bin/binutils/gdb/inferior.h +++ b/gnu/usr.bin/binutils/gdb/inferior.h @@ -176,10 +176,6 @@ extern void generic_target_write_pc (CORE_ADDR, ptid_t); extern CORE_ADDR read_sp (void); -extern void deprecated_write_sp (CORE_ADDR); - -extern CORE_ADDR deprecated_read_fp (void); - extern CORE_ADDR unsigned_pointer_to_address (struct type *type, const void *buf); extern void unsigned_address_to_pointer (struct type *type, void *buf, @@ -241,7 +237,7 @@ int ptrace_wait (ptid_t, int *); extern void child_resume (ptid_t, int, enum target_signal); #ifndef PTRACE_ARG3_TYPE -#define PTRACE_ARG3_TYPE int /* Correct definition for most systems. */ +#define PTRACE_ARG3_TYPE PTRACE_TYPE_ARG3 #endif extern int call_ptrace (int, int, PTRACE_ARG3_TYPE, int); @@ -364,10 +360,6 @@ extern CORE_ADDR step_range_end; /* Exclusive */ extern struct frame_id step_frame_id; -/* Our notion of the current stack pointer. */ - -extern CORE_ADDR step_sp; - /* 1 means step over all subroutine calls. -1 means step over calls to undebuggable functions. */ @@ -440,38 +432,6 @@ extern int attach_flag; #define AT_ENTRY_POINT 4 #define AT_SYMBOL 5 -/* FIXME: cagney/2000-04-17: gdbarch should manage this. The default - shouldn't be necessary. */ - -#if !defined PUSH_DUMMY_FRAME -#define PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "PUSH_DUMMY_FRAME"), 0) -#endif - -#if !defined STORE_STRUCT_RETURN -#define STORE_STRUCT_RETURN(a1,a2) (internal_error (__FILE__, __LINE__, "STORE_STRUCT_RETURN"), 0) -#endif - - -/* Are we in a call dummy? */ - -/* NOTE: cagney/2002-11-24: Targets need to both switch to generic - dummy frames, and use generic_pc_in_call_dummy(). The generic - version should be able to handle all cases since that code works by - saving the address of the dummy's breakpoint (where ever it is). */ - -extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc, - CORE_ADDR sp, - CORE_ADDR frame_address); - -/* NOTE: cagney/2002-11-24: Targets need to both switch to generic - dummy frames, and use generic_pc_in_call_dummy(). The generic - version should be able to handle all cases since that code works by - saving the address of the dummy's breakpoint (where ever it is). */ - -extern int deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, - CORE_ADDR sp, - CORE_ADDR frame_address); - /* If STARTUP_WITH_SHELL is set, GDB's "run" will attempts to start up the debugee under a shell. This is in order for argument-expansion to occur. E.g., diff --git a/gnu/usr.bin/binutils/gdb/inflow.c b/gnu/usr.bin/binutils/gdb/inflow.c index 35cd79968b9..eb5c89bda57 100644 --- a/gnu/usr.bin/binutils/gdb/inflow.c +++ b/gnu/usr.bin/binutils/gdb/inflow.c @@ -42,6 +42,10 @@ #include <sys/ioctl.h> #endif +#ifndef O_NOCTTY +#define O_NOCTTY 0 +#endif + #if defined (SIGIO) && defined (FASYNC) && defined (FD_SET) && defined (F_SETOWN) static void handle_sigio (int); #endif @@ -537,12 +541,7 @@ new_tty (void) #endif /* Now open the specified new terminal. */ - -#ifdef USE_O_NOCTTY tty = open (inferior_thisrun_terminal, O_RDWR | O_NOCTTY); -#else - tty = open (inferior_thisrun_terminal, O_RDWR); -#endif if (tty == -1) { print_sys_errmsg (inferior_thisrun_terminal, errno); @@ -595,9 +594,9 @@ kill_command (char *arg, int from_tty) if (deprecated_selected_frame == NULL) fputs_filtered ("No selected stack frame.\n", gdb_stdout); else - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); } + bfd_cache_close_all (); } /* Call set_sigint_trap when you need to pass a signal on to an attached diff --git a/gnu/usr.bin/binutils/gdb/infptrace.c b/gnu/usr.bin/binutils/gdb/infptrace.c index ef86f90cf2e..ec4ad1628ac 100644 --- a/gnu/usr.bin/binutils/gdb/infptrace.c +++ b/gnu/usr.bin/binutils/gdb/infptrace.c @@ -1,6 +1,6 @@ /* Low level Unix child interface to ptrace, for GDB when running under Unix. Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1998, 1999, 2000, 2001, 2002 + 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -21,96 +21,36 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" +#include "command.h" #include "frame.h" +#include "gdbcore.h" #include "inferior.h" -#include "target.h" -#include "gdb_string.h" #include "regcache.h" +#include "target.h" +#include "gdb_assert.h" #include "gdb_wait.h" - -#include "command.h" - -#ifdef USG -#include <sys/types.h> -#endif +#include "gdb_string.h" #include <sys/param.h> #include "gdb_dirent.h" #include <signal.h> #include <sys/ioctl.h> -#ifdef HAVE_PTRACE_H -#include <ptrace.h> -#else -#ifdef HAVE_SYS_PTRACE_H -#include <sys/ptrace.h> -#endif -#endif - -#if !defined (PT_READ_I) -#define PT_READ_I 1 /* Read word from text space */ -#endif -#if !defined (PT_READ_D) -#define PT_READ_D 2 /* Read word from data space */ -#endif -#if !defined (PT_READ_U) -#define PT_READ_U 3 /* Read word from kernel user struct */ -#endif -#if !defined (PT_WRITE_I) -#define PT_WRITE_I 4 /* Write word to text space */ -#endif -#if !defined (PT_WRITE_D) -#define PT_WRITE_D 5 /* Write word to data space */ -#endif -#if !defined (PT_WRITE_U) -#define PT_WRITE_U 6 /* Write word to kernel user struct */ -#endif -#if !defined (PT_CONTINUE) -#define PT_CONTINUE 7 /* Continue after signal */ -#endif -#if !defined (PT_STEP) -#define PT_STEP 9 /* Set flag for single stepping */ -#endif -#if !defined (PT_KILL) -#define PT_KILL 8 /* Send child a SIGKILL signal */ -#endif - -#ifndef PT_ATTACH -#define PT_ATTACH PTRACE_ATTACH -#endif -#ifndef PT_DETACH -#define PT_DETACH PTRACE_DETACH -#endif +#include "gdb_ptrace.h" -#include "gdbcore.h" -#ifndef NO_SYS_FILE +#ifdef HAVE_SYS_FILE_H #include <sys/file.h> #endif -#if 0 -/* Don't think this is used anymore. On the sequent (not sure whether it's - dynix or ptx or both), it is included unconditionally by sys/user.h and - not protected against multiple inclusion. */ -#include "gdb_stat.h" -#endif #if !defined (FETCH_INFERIOR_REGISTERS) #include <sys/user.h> /* Probably need to poke the user structure */ -#if defined (KERNEL_U_ADDR_BSD) -#include <a.out.h> /* For struct nlist */ -#endif /* KERNEL_U_ADDR_BSD. */ #endif /* !FETCH_INFERIOR_REGISTERS */ #if !defined (CHILD_XFER_MEMORY) static void udot_info (char *, int); #endif -#if !defined (FETCH_INFERIOR_REGISTERS) -static void fetch_register (int); -static void store_register (int); -#endif - -void _initialize_kernel_u_addr (void); void _initialize_infptrace (void); @@ -133,7 +73,7 @@ call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data) if (request == PT_SETTRC) { errno = 0; -#if !defined (FIVE_ARG_PTRACE) +#ifndef PTRACE_TYPE_ARG5 pt_status = ptrace (PT_SETTRC, pid, addr, data); #else /* Deal with HPUX 8.0 braindamage. We never use the @@ -170,7 +110,7 @@ call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data) saved_errno = errno; errno = 0; #endif -#if !defined (FIVE_ARG_PTRACE) +#ifndef PTRACE_TYPE_ARG5 pt_status = ptrace (request, pid, addr, data); #else /* Deal with HPUX 8.0 braindamage. We never use the @@ -189,7 +129,7 @@ call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data) } -#if defined (DEBUG_PTRACE) || defined (FIVE_ARG_PTRACE) +#if defined (DEBUG_PTRACE) || defined (PTRACE_TYPE_ARG5) /* For the rest of the file, use an extra level of indirection */ /* This lets us breakpoint usefully on call_ptrace. */ #define ptrace call_ptrace @@ -198,17 +138,24 @@ call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data) /* Wait for a process to finish, possibly running a target-specific hook before returning. */ +/* NOTE: cagney: 2004-09-29: Dependant on the native configuration, + "hppah-nat.c" may either call this or infttrace.c's implementation + of ptrace_wait. See "hppahpux.mh". */ + int ptrace_wait (ptid_t ptid, int *status) { int wstate; wstate = wait (status); - target_post_wait (pid_to_ptid (wstate), *status); return wstate; } -#ifndef KILL_INFERIOR +#ifndef DEPRECATED_KILL_INFERIOR +/* NOTE: cagney/2004-09-12: Instead of definining this macro, code + should call inf_ptrace_target to get a basic ptrace target and then + locally update any necessary methods. See ppcnbsd-nat.c. */ + void kill_inferior (void) { @@ -226,13 +173,16 @@ kill_inferior (void) The kill call causes problems under hpux10, so it's been removed; if this causes problems we'll deal with them as they arise. */ - ptrace (PT_KILL, pid, (PTRACE_ARG3_TYPE) 0, 0); - ptrace_wait (null_ptid, &status); + ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3) 0, 0); + wait (&status); target_mourn_inferior (); } -#endif /* KILL_INFERIOR */ +#endif /* DEPRECATED_KILL_INFERIOR */ -#ifndef CHILD_RESUME +#ifndef DEPRECATED_CHILD_RESUME +/* NOTE: cagney/2004-09-12: Instead of definining this macro, code + should call inf_ptrace_target to get a basic ptrace target and then + locally update any necessary methods. See ppcnbsd-nat.c. */ /* Resume execution of the inferior process. If STEP is nonzero, single-step it. @@ -241,245 +191,199 @@ kill_inferior (void) void child_resume (ptid_t ptid, int step, enum target_signal signal) { + int request = PT_CONTINUE; int pid = PIDGET (ptid); - errno = 0; - if (pid == -1) /* Resume all threads. */ /* I think this only gets used in the non-threaded case, where "resume all threads" and "resume inferior_ptid" are the same. */ pid = PIDGET (inferior_ptid); - /* An address of (PTRACE_ARG3_TYPE)1 tells ptrace to continue from where - it was. (If GDB wanted it to start some other way, we have already - written a new PC value to the child.) - - If this system does not support PT_STEP, a higher level function will - have called single_step() to transmute the step request into a - continue request (by setting breakpoints on all possible successor - instructions), so we don't have to worry about that here. */ - if (step) { - if (SOFTWARE_SINGLE_STEP_P ()) - internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Make sure this doesn't happen. */ - else - ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1, - target_signal_to_host (signal)); + /* If this system does not support PT_STEP, a higher level + function will have called single_step() to transmute the step + request into a continue request (by setting breakpoints on + all possible successor instructions), so we don't have to + worry about that here. */ + + gdb_assert (!SOFTWARE_SINGLE_STEP_P ()); + request = PT_STEP; } - else - ptrace (PT_CONTINUE, pid, (PTRACE_ARG3_TYPE) 1, - target_signal_to_host (signal)); - if (errno) - { - perror_with_name ("ptrace"); - } + /* An address of (PTRACE_TYPE_ARG3)1 tells ptrace to continue from + where it was. If GDB wanted it to start some other way, we have + already written a new PC value to the child. */ + + errno = 0; + ptrace (request, pid, (PTRACE_TYPE_ARG3)1, target_signal_to_host (signal)); + if (errno != 0) + perror_with_name ("ptrace"); } -#endif /* CHILD_RESUME */ +#endif /* DEPRECATED_CHILD_RESUME */ -#ifdef ATTACH_DETACH /* Start debugging the process whose number is PID. */ + int attach (int pid) { +#ifdef PT_ATTACH errno = 0; - ptrace (PT_ATTACH, pid, (PTRACE_ARG3_TYPE) 0, 0); - if (errno) + ptrace (PT_ATTACH, pid, (PTRACE_TYPE_ARG3) 0, 0); + if (errno != 0) perror_with_name ("ptrace"); attach_flag = 1; return pid; +#else + error ("This system does not support attaching to a process"); +#endif } -/* Stop debugging the process whose number is PID - and continue it with signal number SIGNAL. - SIGNAL = 0 means just continue it. */ +/* Stop debugging the process whose number is PID and continue it with + signal number SIGNAL. SIGNAL = 0 means just continue it. */ void detach (int signal) { +#ifdef PT_DETACH + int pid = PIDGET (inferior_ptid); + errno = 0; - ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1, - signal); - if (errno) - print_sys_errmsg ("ptrace", errno); + ptrace (PT_DETACH, pid, (PTRACE_TYPE_ARG3) 1, signal); + if (errno != 0) + perror_with_name ("ptrace"); attach_flag = 0; +#else + error ("This system does not support detaching from a process"); +#endif } -#endif /* ATTACH_DETACH */ -/* Default the type of the ptrace transfer to int. */ -#ifndef PTRACE_XFER_TYPE -#define PTRACE_XFER_TYPE int -#endif -/* KERNEL_U_ADDR is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ -#if defined (KERNEL_U_ADDR_BSD) && !defined (FETCH_INFERIOR_REGISTERS) -/* Get kernel_u_addr using BSD-style nlist(). */ -CORE_ADDR kernel_u_addr; -#endif /* KERNEL_U_ADDR_BSD. */ +#ifndef FETCH_INFERIOR_REGISTERS -void -_initialize_kernel_u_addr (void) -{ -#if defined (KERNEL_U_ADDR_BSD) && !defined (FETCH_INFERIOR_REGISTERS) - struct nlist names[2]; - - names[0].n_un.n_name = "_u"; - names[1].n_un.n_name = NULL; - if (nlist ("/vmunix", names) == 0) - kernel_u_addr = names[0].n_value; - else - internal_error (__FILE__, __LINE__, - "Unable to get kernel u area address."); -#endif /* KERNEL_U_ADDR_BSD. */ -} - -#if !defined (FETCH_INFERIOR_REGISTERS) +/* U_REGS_OFFSET is the offset of the registers within the u area. */ +#ifndef U_REGS_OFFSET -#if !defined (offsetof) +#ifndef offsetof #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) #endif -/* U_REGS_OFFSET is the offset of the registers within the u area. */ -#if !defined (U_REGS_OFFSET) #define U_REGS_OFFSET \ ptrace (PT_READ_U, PIDGET (inferior_ptid), \ - (PTRACE_ARG3_TYPE) (offsetof (struct user, u_ar0)), 0) \ + (PTRACE_TYPE_ARG3) (offsetof (struct user, u_ar0)), 0) \ - KERNEL_U_ADDR #endif -/* Fetch one register. */ +/* Fetch register REGNUM from the inferior. */ static void -fetch_register (int regno) +fetch_register (int regnum) { - /* This isn't really an address. But ptrace thinks of it as one. */ - CORE_ADDR regaddr; - char mess[128]; /* For messages */ - int i; - unsigned int offset; /* Offset of registers within the u area. */ - char buf[MAX_REGISTER_SIZE]; - int tid; + CORE_ADDR addr; + size_t size; + PTRACE_TYPE_RET *buf; + int tid, i; - if (CANNOT_FETCH_REGISTER (regno)) + if (CANNOT_FETCH_REGISTER (regnum)) { - memset (buf, '\0', DEPRECATED_REGISTER_RAW_SIZE (regno)); /* Supply zeroes */ - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regnum, NULL); return; } - /* Overload thread id onto process id */ - if ((tid = TIDGET (inferior_ptid)) == 0) - tid = PIDGET (inferior_ptid); /* no thread id, just use process id */ + /* GNU/Linux LWP ID's are process ID's. */ + tid = TIDGET (inferior_ptid); + if (tid == 0) + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ - offset = U_REGS_OFFSET; + /* This isn't really an address. But ptrace thinks of it as one. */ + addr = register_addr (regnum, U_REGS_OFFSET); + size = register_size (current_gdbarch, regnum); + + gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0); + buf = alloca (size); - regaddr = register_addr (regno, offset); - for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE)) + /* Read the register contents from the inferior a chuck at the time. */ + for (i = 0; i < size / sizeof (PTRACE_TYPE_RET); i++) { errno = 0; - *(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid, - (PTRACE_ARG3_TYPE) regaddr, 0); - regaddr += sizeof (PTRACE_XFER_TYPE); + buf[i] = ptrace (PT_READ_U, tid, (PTRACE_TYPE_ARG3) addr, 0); if (errno != 0) - { - sprintf (mess, "reading register %s (#%d)", - REGISTER_NAME (regno), regno); - perror_with_name (mess); - } + error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regnum), + regnum, safe_strerror (errno)); + + addr += sizeof (PTRACE_TYPE_RET); } - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regnum, buf); } - -/* Fetch register values from the inferior. - If REGNO is negative, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ +/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this + for all registers. */ void -fetch_inferior_registers (int regno) +fetch_inferior_registers (int regnum) { - if (regno >= 0) - { - fetch_register (regno); - } + if (regnum == -1) + for (regnum = 0; regnum < NUM_REGS; regnum++) + fetch_register (regnum); else - { - for (regno = 0; regno < NUM_REGS; regno++) - { - fetch_register (regno); - } - } + fetch_register (regnum); } -/* Store one register. */ +/* Store register REGNUM into the inferior. */ static void -store_register (int regno) +store_register (int regnum) { - /* This isn't really an address. But ptrace thinks of it as one. */ - CORE_ADDR regaddr; - char mess[128]; /* For messages */ - int i; - unsigned int offset; /* Offset of registers within the u area. */ - int tid; - char buf[MAX_REGISTER_SIZE]; + CORE_ADDR addr; + size_t size; + PTRACE_TYPE_RET *buf; + int tid, i; - if (CANNOT_STORE_REGISTER (regno)) - { - return; - } - - /* Overload thread id onto process id */ - if ((tid = TIDGET (inferior_ptid)) == 0) - tid = PIDGET (inferior_ptid); /* no thread id, just use process id */ + if (CANNOT_STORE_REGISTER (regnum)) + return; - offset = U_REGS_OFFSET; + /* GNU/Linux LWP ID's are process ID's. */ + tid = TIDGET (inferior_ptid); + if (tid == 0) + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ - regaddr = register_addr (regno, offset); + /* This isn't really an address. But ptrace thinks of it as one. */ + addr = register_addr (regnum, U_REGS_OFFSET); + size = register_size (current_gdbarch, regnum); - /* Put the contents of regno into a local buffer */ - regcache_collect (regno, buf); + gdb_assert ((size % sizeof (PTRACE_TYPE_RET)) == 0); + buf = alloca (size); - /* Store the local buffer into the inferior a chunk at the time. */ - for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE)) + /* Write the register contents into the inferior a chunk at the time. */ + regcache_raw_collect (current_regcache, regnum, buf); + for (i = 0; i < size / sizeof (PTRACE_TYPE_RET); i++) { errno = 0; - ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr, - *(PTRACE_XFER_TYPE *) (buf + i)); - regaddr += sizeof (PTRACE_XFER_TYPE); + ptrace (PT_WRITE_U, tid, (PTRACE_TYPE_ARG3) addr, buf[i]); if (errno != 0) - { - sprintf (mess, "writing register %s (#%d)", - REGISTER_NAME (regno), regno); - perror_with_name (mess); - } + error ("Couldn't write register %s (#%d): %s.", REGISTER_NAME (regnum), + regnum, safe_strerror (errno)); + + addr += sizeof (PTRACE_TYPE_RET); } } -/* Store our register values back into the inferior. - If REGNO is negative, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ +/* Store register REGNUM back into the inferior. If REGNUM is -1, do + this for all registers (including the floating point registers). */ void -store_inferior_registers (int regno) +store_inferior_registers (int regnum) { - if (regno >= 0) - { - store_register (regno); - } + if (regnum == -1) + for (regnum = 0; regnum < NUM_REGS; regnum++) + store_register (regnum); else - { - for (regno = 0; regno < NUM_REGS; regno++) - { - store_register (regno); - } - } + store_register (regnum); } -#endif /* !defined (FETCH_INFERIOR_REGISTERS). */ + +#endif /* not FETCH_INFERIOR_REGISTERS. */ /* Set an upper limit on alloca. */ @@ -499,8 +403,8 @@ store_inferior_registers (int regno) Returns the length copied, which is either the LEN argument or zero. This xfer function does not do partial moves, since - child_ops doesn't allow memory operations to cross below us in the - target stack anyway. */ + deprecated_child_ops doesn't allow memory operations to cross below + us in the target stack anyway. */ int child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, @@ -508,12 +412,12 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, { int i; /* Round starting address down to longword boundary. */ - CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); + CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET); /* Round ending address up; get number of longwords that makes. */ - int count = ((((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) - / sizeof (PTRACE_XFER_TYPE)); - int alloc = count * sizeof (PTRACE_XFER_TYPE); - PTRACE_XFER_TYPE *buffer; + int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1) + / sizeof (PTRACE_TYPE_RET)); + int alloc = count * sizeof (PTRACE_TYPE_RET); + PTRACE_TYPE_RET *buffer; struct cleanup *old_chain = NULL; #ifdef PT_IO @@ -550,11 +454,11 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, /* Allocate buffer of that many longwords. */ if (len < GDB_MAX_ALLOCA) { - buffer = (PTRACE_XFER_TYPE *) alloca (alloc); + buffer = (PTRACE_TYPE_RET *) alloca (alloc); } else { - buffer = (PTRACE_XFER_TYPE *) xmalloc (alloc); + buffer = (PTRACE_TYPE_RET *) xmalloc (alloc); old_chain = make_cleanup (xfree, buffer); } @@ -562,54 +466,51 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, { /* Fill start and end extra bytes of buffer with existing memory data. */ - if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE)) + if (addr != memaddr || len < (int) sizeof (PTRACE_TYPE_RET)) { /* Need part of initial word -- fetch it. */ buffer[0] = ptrace (PT_READ_I, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) addr, 0); + (PTRACE_TYPE_ARG3) addr, 0); } if (count > 1) /* FIXME, avoid if even boundary. */ { buffer[count - 1] = ptrace (PT_READ_I, PIDGET (inferior_ptid), - ((PTRACE_ARG3_TYPE) - (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))), 0); + ((PTRACE_TYPE_ARG3) + (addr + (count - 1) * sizeof (PTRACE_TYPE_RET))), 0); } /* Copy data to be written over corresponding part of buffer. */ - memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), + memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)), myaddr, len); /* Write the entire buffer. */ - for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) + for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET)) { errno = 0; ptrace (PT_WRITE_D, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) addr, buffer[i]); + (PTRACE_TYPE_ARG3) addr, buffer[i]); if (errno) { /* Using the appropriate one (I or D) is necessary for Gould NP1, at least. */ errno = 0; ptrace (PT_WRITE_I, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) addr, buffer[i]); + (PTRACE_TYPE_ARG3) addr, buffer[i]); } if (errno) return 0; } -#ifdef CLEAR_INSN_CACHE - CLEAR_INSN_CACHE (); -#endif } else { /* Read all the longwords. */ - for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) + for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET)) { errno = 0; buffer[i] = ptrace (PT_READ_I, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) addr, 0); + (PTRACE_TYPE_ARG3) addr, 0); if (errno) return 0; QUIT; @@ -617,7 +518,7 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, /* Copy appropriate bytes out of the buffer. */ memcpy (myaddr, - (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), + (char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)), len); } @@ -661,7 +562,7 @@ udot_info (char *dummy1, int dummy2) } printf_filtered ("%s:", paddr (udot_off)); } - udot_val = ptrace (PT_READ_U, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) udot_off, 0); + udot_val = ptrace (PT_READ_U, PIDGET (inferior_ptid), (PTRACE_TYPE_ARG3) udot_off, 0); if (errno != 0) { sprintf (mess, "\nreading user struct at offset 0x%s", diff --git a/gnu/usr.bin/binutils/gdb/infrun.c b/gnu/usr.bin/binutils/gdb/infrun.c index 6bbee5e8176..7cf9953044a 100644 --- a/gnu/usr.bin/binutils/gdb/infrun.c +++ b/gnu/usr.bin/binutils/gdb/infrun.c @@ -60,8 +60,6 @@ static void resume_cleanups (void *); static int hook_stop_stub (void *); -static void delete_breakpoint_current_contents (void *); - static int restore_selected_frame (void *); static void build_infrun (void); @@ -163,14 +161,6 @@ static int may_follow_exec = MAY_FOLLOW_EXEC; #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) 0 #endif -/* On MIPS16, a function that returns a floating point value may call - a library helper function to copy the return value to a floating point - register. The IGNORE_HELPER_CALL macro returns non-zero if we - should ignore (i.e. step over) this function call. */ -#ifndef IGNORE_HELPER_CALL -#define IGNORE_HELPER_CALL(pc) 0 -#endif - /* On some systems, the PC may be left pointing at an instruction that won't actually be executed. This is usually indicated by a bit in the PSW. If we find ourselves in such a state, then we step the target beyond the @@ -264,14 +254,6 @@ static int trap_expected; static int stop_on_solib_events; #endif -#ifdef HP_OS_BUG -/* Nonzero if the next time we try to continue the inferior, it will - step one instruction and generate a spurious trace trap. - This is used to compensate for a bug in HP-UX. */ - -static int trap_expected_after_continue; -#endif - /* Nonzero means expecting a trace trap and should stop the inferior and return silently when it happens. */ @@ -305,7 +287,6 @@ static int breakpoints_failed; static int stop_print_frame; static struct breakpoint *step_resume_breakpoint = NULL; -static struct breakpoint *through_sigtramp_breakpoint = NULL; /* On some platforms (e.g., HP-UX), hardware watchpoints have bad interactions with an inferior that is running a kernel function @@ -316,8 +297,8 @@ static struct breakpoint *through_sigtramp_breakpoint = NULL; static int number_of_threads_in_syscalls; /* This is a cached copy of the pid/waitstatus of the last event - returned by target_wait()/target_wait_hook(). This information is - returned by get_last_target_status(). */ + returned by target_wait()/deprecated_target_wait_hook(). This + information is returned by get_last_target_status(). */ static ptid_t target_last_wait_ptid; static struct target_waitstatus target_last_waitstatus; @@ -423,9 +404,6 @@ follow_exec (int pid, char *execd_pathname) step_range_start = 0; step_range_end = 0; - /* If there was one, it's gone now. */ - through_sigtramp_breakpoint = NULL; - /* What is this a.out's name? */ printf_unfiltered ("Executing new program: %s\n", execd_pathname); @@ -506,14 +484,15 @@ static const char *scheduler_enums[] = { static void set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c) { - /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones - the set command passed as a parameter. The clone operation will - include (BUG?) any ``set'' command callback, if present. - Commands like ``info set'' call all the ``show'' command - callbacks. Unfortunately, for ``show'' commands cloned from - ``set'', this includes callbacks belonging to ``set'' commands. - Making this worse, this only occures if add_show_from_set() is - called after add_cmd_sfunc() (BUG?). */ + /* NOTE: cagney/2002-03-17: The deprecated_add_show_from_set() + function clones the set command passed as a parameter. The clone + operation will include (BUG?) any ``set'' command callback, if + present. Commands like ``info set'' call all the ``show'' + command callbacks. Unfortunately, for ``show'' commands cloned + from ``set'', this includes callbacks belonging to ``set'' + commands. Making this worse, this only occures if + deprecated_add_show_from_set() is called after add_cmd_sfunc() + (BUG?). */ if (cmd_type (c) == set_cmd) if (!target_can_lock_scheduler) { @@ -572,11 +551,6 @@ resume (int step, enum target_signal sig) singlestep_ptid = inferior_ptid; } - /* Handle any optimized stores to the inferior NOW... */ -#ifdef DO_DEFERRED_STORES - DO_DEFERRED_STORES; -#endif - /* If there were any forks/vforks/execs that were caught and are now to be followed, then do so. */ switch (pending_follow.kind) @@ -606,9 +580,9 @@ resume (int step, enum target_signal sig) resume_ptid = RESUME_ALL; /* Default */ - if ((step || singlestep_breakpoints_inserted_p) && - (stepping_past_singlestep_breakpoint - || (!breakpoints_inserted && breakpoint_here_p (read_pc ())))) + if ((step || singlestep_breakpoints_inserted_p) + && (stepping_past_singlestep_breakpoint + || (!breakpoints_inserted && breakpoint_here_p (read_pc ())))) { /* Stepping past a breakpoint without inserting breakpoints. Make sure only the current thread gets to step, so that @@ -618,9 +592,9 @@ resume (int step, enum target_signal sig) resume_ptid = inferior_ptid; } - if ((scheduler_mode == schedlock_on) || - (scheduler_mode == schedlock_step && - (step || singlestep_breakpoints_inserted_p))) + if ((scheduler_mode == schedlock_on) + || (scheduler_mode == schedlock_step + && (step || singlestep_breakpoints_inserted_p))) { /* User-settable 'scheduler' mode requires solo thread resume. */ resume_ptid = inferior_ptid; @@ -675,8 +649,8 @@ prepare_to_proceed (void) /* Make sure we were stopped either at a breakpoint, or because of a Ctrl-C. */ if (wait_status.kind != TARGET_WAITKIND_STOPPED - || (wait_status.value.sig != TARGET_SIGNAL_TRAP && - wait_status.value.sig != TARGET_SIGNAL_INT)) + || (wait_status.value.sig != TARGET_SIGNAL_TRAP + && wait_status.value.sig != TARGET_SIGNAL_INT)) { return 0; } @@ -700,15 +674,15 @@ prepare_to_proceed (void) select_frame (get_current_frame ()); } - /* We return 1 to indicate that there is a breakpoint here, - so we need to step over it before continuing to avoid - hitting it straight away. */ - if (breakpoint_here_p (wait_pc)) - return 1; + /* We return 1 to indicate that there is a breakpoint here, + so we need to step over it before continuing to avoid + hitting it straight away. */ + if (breakpoint_here_p (wait_pc)) + return 1; } return 0; - + } /* Record the pc of the program the last time it stopped. This is @@ -779,18 +753,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) if (prepare_to_proceed () && breakpoint_here_p (read_pc ())) oneproc = 1; -#ifdef HP_OS_BUG - if (trap_expected_after_continue) - { - /* If (step == 0), a trap will be automatically generated after - the first instruction is executed. Force step one - instruction to clear this condition. This should not occur - if step is nonzero, but it is harmless in that case. */ - oneproc = 1; - trap_expected_after_continue = 0; - } -#endif /* HP_OS_BUG */ - if (oneproc) /* We will get a trace trap after one instruction. Continue it automatically and insert breakpoints then. */ @@ -799,7 +761,7 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) { insert_breakpoints (); /* If we get here there was no call to error() in - insert breakpoints -- so they were inserted. */ + insert breakpoints -- so they were inserted. */ breakpoints_inserted = 1; } @@ -837,7 +799,7 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) cannot be read unless the inferior is stopped. At that point, we are not guaranteed the inferior is stopped and so the read_pc () call can fail. Setting the prev_pc value here ensures the value is - updated correctly when the inferior is stopped. */ + updated correctly when the inferior is stopped. */ prev_pc = read_pc (); /* Resume inferior. */ @@ -847,7 +809,7 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) and in any case decode why it stopped, and act accordingly. */ /* Do this only if we are not using the event loop, or if the target does not support asynchronous execution. */ - if (!event_loop_p || !target_can_async_p ()) + if (!target_can_async_p ()) { wait_for_inferior (); normal_stop (); @@ -891,9 +853,6 @@ init_wait_for_inferior (void) /* These are meaningless until the first time through wait_for_inferior. */ prev_pc = 0; -#ifdef HP_OS_BUG - trap_expected_after_continue = 0; -#endif breakpoints_inserted = 0; breakpoint_init_inferior (inf_starting); @@ -910,17 +869,6 @@ init_wait_for_inferior (void) stepping_past_singlestep_breakpoint = 0; } - -static void -delete_breakpoint_current_contents (void *arg) -{ - struct breakpoint **breakpointp = (struct breakpoint **) arg; - if (*breakpointp != NULL) - { - delete_breakpoint (*breakpointp); - *breakpointp = NULL; - } -} /* This enum encodes possible reasons for doing a target_wait, so that wfi can call target_wait in one place. (Ultimately the call will be @@ -966,17 +914,15 @@ struct execution_control_state CORE_ADDR stop_func_end; char *stop_func_name; struct symtab_and_line sal; - int remove_breakpoints_on_following_step; int current_line; struct symtab *current_symtab; int handling_longjmp; /* FIXME */ ptid_t ptid; ptid_t saved_inferior_ptid; - int update_step_sp; + int step_after_step_resume_breakpoint; int stepping_through_solib_after_catch; bpstat stepping_through_solib_catchpoints; int enable_hw_watchpoints_after_wait; - int stepping_through_sigtramp; int new_thread_event; struct target_waitstatus tmpstatus; enum infwait_states infwait_state; @@ -986,12 +932,12 @@ struct execution_control_state void init_execution_control_state (struct execution_control_state *ecs); -static void handle_step_into_function (struct execution_control_state *ecs); void handle_inferior_event (struct execution_control_state *ecs); -static void check_sigtramp2 (struct execution_control_state *ecs); static void step_into_function (struct execution_control_state *ecs); -static void step_over_function (struct execution_control_state *ecs); +static void insert_step_resume_breakpoint_at_frame (struct frame_info *step_frame); +static void insert_step_resume_breakpoint_at_sal (struct symtab_and_line sr_sal, + struct frame_id sr_id); static void stop_stepping (struct execution_control_state *ecs); static void prepare_to_wait (struct execution_control_state *ecs); static void keep_going (struct execution_control_state *ecs); @@ -1013,8 +959,6 @@ wait_for_inferior (void) old_cleanups = make_cleanup (delete_step_resume_breakpoint, &step_resume_breakpoint); - make_cleanup (delete_breakpoint_current_contents, - &through_sigtramp_breakpoint); /* wfi still stays in a loop, so it's OK just to take the address of a local to get the ecs pointer. */ @@ -1038,8 +982,8 @@ wait_for_inferior (void) while (1) { - if (target_wait_hook) - ecs->ptid = target_wait_hook (ecs->waiton_ptid, ecs->wp); + if (deprecated_target_wait_hook) + ecs->ptid = deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp); else ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp); @@ -1075,8 +1019,6 @@ fetch_inferior_event (void *client_data) { old_cleanups = make_exec_cleanup (delete_step_resume_breakpoint, &step_resume_breakpoint); - make_exec_cleanup (delete_breakpoint_current_contents, - &through_sigtramp_breakpoint); /* Fill in with reasonable starting values. */ init_execution_control_state (async_ecs); @@ -1095,9 +1037,9 @@ fetch_inferior_event (void *client_data) registers_changed (); } - if (target_wait_hook) + if (deprecated_target_wait_hook) async_ecs->ptid = - target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp); + deprecated_target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp); else async_ecs->ptid = target_wait (async_ecs->waiton_ptid, async_ecs->wp); @@ -1126,13 +1068,11 @@ init_execution_control_state (struct execution_control_state *ecs) { /* ecs->another_trap? */ ecs->random_signal = 0; - ecs->remove_breakpoints_on_following_step = 0; + ecs->step_after_step_resume_breakpoint = 0; ecs->handling_longjmp = 0; /* FIXME */ - ecs->update_step_sp = 0; ecs->stepping_through_solib_after_catch = 0; ecs->stepping_through_solib_catchpoints = NULL; ecs->enable_hw_watchpoints_after_wait = 0; - ecs->stepping_through_sigtramp = 0; ecs->sal = find_pc_line (prev_pc, 0); ecs->current_line = ecs->sal.line; ecs->current_symtab = ecs->sal.symtab; @@ -1141,22 +1081,10 @@ init_execution_control_state (struct execution_control_state *ecs) ecs->wp = &(ecs->ws); } -/* Call this function before setting step_resume_breakpoint, as a - sanity check. There should never be more than one step-resume - breakpoint per thread, so we should never be setting a new - step_resume_breakpoint when one is already active. */ -static void -check_for_old_step_resume_breakpoint (void) -{ - if (step_resume_breakpoint) - warning - ("GDB bug: infrun.c (wait_for_inferior): dropping old step_resume breakpoint"); -} - /* Return the cached copy of the last pid/waitstatus returned by - target_wait()/target_wait_hook(). The data is actually cached by - handle_inferior_event(), which gets called immediately after - target_wait()/target_wait_hook(). */ + target_wait()/deprecated_target_wait_hook(). The data is actually + cached by handle_inferior_event(), which gets called immediately + after target_wait()/deprecated_target_wait_hook(). */ void get_last_target_status (ptid_t *ptidp, struct target_waitstatus *status) @@ -1181,155 +1109,30 @@ context_switch (struct execution_control_state *ecs) /* Save infrun state for the old thread. */ save_infrun_state (inferior_ptid, prev_pc, trap_expected, step_resume_breakpoint, - through_sigtramp_breakpoint, step_range_start, + step_range_start, step_range_end, &step_frame_id, ecs->handling_longjmp, ecs->another_trap, ecs->stepping_through_solib_after_catch, ecs->stepping_through_solib_catchpoints, - ecs->stepping_through_sigtramp, - ecs->current_line, ecs->current_symtab, step_sp); + ecs->current_line, ecs->current_symtab); /* Load infrun state for the new thread. */ load_infrun_state (ecs->ptid, &prev_pc, &trap_expected, &step_resume_breakpoint, - &through_sigtramp_breakpoint, &step_range_start, + &step_range_start, &step_range_end, &step_frame_id, &ecs->handling_longjmp, &ecs->another_trap, &ecs->stepping_through_solib_after_catch, &ecs->stepping_through_solib_catchpoints, - &ecs->stepping_through_sigtramp, - &ecs->current_line, &ecs->current_symtab, &step_sp); + &ecs->current_line, &ecs->current_symtab); } inferior_ptid = ecs->ptid; } -/* Wrapper for PC_IN_SIGTRAMP that takes care of the need to find the - function's name. - - In a classic example of "left hand VS right hand", "infrun.c" was - trying to improve GDB's performance by caching the result of calls - to calls to find_pc_partial_funtion, while at the same time - find_pc_partial_function was also trying to ramp up performance by - caching its most recent return value. The below makes the the - function find_pc_partial_function solely responsibile for - performance issues (the local cache that relied on a global - variable - arrrggg - deleted). - - Using the testsuite and gcov, it was found that dropping the local - "infrun.c" cache and instead relying on find_pc_partial_function - increased the number of calls to 12000 (from 10000), but the number - of times find_pc_partial_function's cache missed (this is what - matters) was only increased by only 4 (to 3569). (A quick back of - envelope caculation suggests that the extra 2000 function calls - @1000 extra instructions per call make the 1 MIP VAX testsuite run - take two extra seconds, oops :-) - - Long term, this function can be eliminated, replaced by the code: - get_frame_type(current_frame()) == SIGTRAMP_FRAME (for new - architectures this is very cheap). */ - -static int -pc_in_sigtramp (CORE_ADDR pc) -{ - char *name; - find_pc_partial_function (pc, &name, NULL, NULL); - return PC_IN_SIGTRAMP (pc, name); -} - -/* Handle the inferior event in the cases when we just stepped - into a function. */ - -static void -handle_step_into_function (struct execution_control_state *ecs) -{ - CORE_ADDR real_stop_pc; - - if ((step_over_calls == STEP_OVER_NONE) - || ((step_range_end == 1) - && in_prologue (prev_pc, ecs->stop_func_start))) - { - /* I presume that step_over_calls is only 0 when we're - supposed to be stepping at the assembly language level - ("stepi"). Just stop. */ - /* Also, maybe we just did a "nexti" inside a prolog, - so we thought it was a subroutine call but it was not. - Stop as well. FENN */ - stop_step = 1; - print_stop_reason (END_STEPPING_RANGE, 0); - stop_stepping (ecs); - return; - } - - if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc)) - { - /* We're doing a "next". */ - - if (pc_in_sigtramp (stop_pc) - && frame_id_inner (step_frame_id, - frame_id_build (read_sp (), 0))) - /* We stepped out of a signal handler, and into its - calling trampoline. This is misdetected as a - subroutine call, but stepping over the signal - trampoline isn't such a bad idea. In order to do that, - we have to ignore the value in step_frame_id, since - that doesn't represent the frame that'll reach when we - return from the signal trampoline. Otherwise we'll - probably continue to the end of the program. */ - step_frame_id = null_frame_id; - - step_over_function (ecs); - keep_going (ecs); - return; - } - - /* If we are in a function call trampoline (a stub between - the calling routine and the real function), locate the real - function. That's what tells us (a) whether we want to step - into it at all, and (b) what prologue we want to run to - the end of, if we do step into it. */ - real_stop_pc = skip_language_trampoline (stop_pc); - if (real_stop_pc == 0) - real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); - if (real_stop_pc != 0) - ecs->stop_func_start = real_stop_pc; - - /* If we have line number information for the function we - are thinking of stepping into, step into it. - - If there are several symtabs at that PC (e.g. with include - files), just want to know whether *any* of them have line - numbers. find_pc_line handles this. */ - { - struct symtab_and_line tmp_sal; - - tmp_sal = find_pc_line (ecs->stop_func_start, 0); - if (tmp_sal.line != 0) - { - step_into_function (ecs); - return; - } - } - - /* If we have no line number and the step-stop-if-no-debug - is set, we stop the step so that the user has a chance to - switch in assembly mode. */ - if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug) - { - stop_step = 1; - print_stop_reason (END_STEPPING_RANGE, 0); - stop_stepping (ecs); - return; - } - - step_over_function (ecs); - keep_going (ecs); - return; -} - static void adjust_pc_after_break (struct execution_control_state *ecs) { - CORE_ADDR stop_pc; + CORE_ADDR breakpoint_pc; /* If this target does not decrement the PC after breakpoints, then we have nothing to do. */ @@ -1343,14 +1146,14 @@ adjust_pc_after_break (struct execution_control_state *ecs) affected by DECR_PC_AFTER_BREAK. Other waitkinds which are implemented by software breakpoints should be handled through the normal breakpoint layer. - + NOTE drow/2004-01-31: On some targets, breakpoints may generate different signals (SIGILL or SIGEMT for instance), but it is less clear where the PC is pointing afterwards. It may not match DECR_PC_AFTER_BREAK. I don't know any specific target that generates these signals at breakpoints (the code has been in GDB since at least 1992) so I can not guess how to handle them here. - + In earlier versions of GDB, a target with HAVE_NONSTEPPABLE_WATCHPOINTS would have the PC after hitting a watchpoint affected by DECR_PC_AFTER_BREAK. I haven't found any target with both of these set @@ -1363,46 +1166,61 @@ adjust_pc_after_break (struct execution_control_state *ecs) if (ecs->ws.value.sig != TARGET_SIGNAL_TRAP) return; - /* Find the location where (if we've hit a breakpoint) the breakpoint would - be. */ - stop_pc = read_pc_pid (ecs->ptid) - DECR_PC_AFTER_BREAK; - - /* If we're software-single-stepping, then assume this is a breakpoint. - NOTE drow/2004-01-17: This doesn't check that the PC matches, or that - we're even in the right thread. The software-single-step code needs - some modernization. - - If we're not software-single-stepping, then we first check that there - is an enabled software breakpoint at this address. If there is, and - we weren't using hardware-single-step, then we've hit the breakpoint. - - If we were using hardware-single-step, we check prev_pc; if we just - stepped over an inserted software breakpoint, then we should decrement - the PC and eventually report hitting the breakpoint. The prev_pc check - prevents us from decrementing the PC if we just stepped over a jump - instruction and landed on the instruction after a breakpoint. - - The last bit checks that we didn't hit a breakpoint in a signal handler - without an intervening stop in sigtramp, which is detected by a new - stack pointer value below any usual function calling stack adjustments. - - NOTE drow/2004-01-17: I'm not sure that this is necessary. The check - predates checking for software single step at the same time. Also, - if we've moved into a signal handler we should have seen the - signal. */ - - if ((SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) - || (software_breakpoint_inserted_here_p (stop_pc) - && !(currently_stepping (ecs) - && prev_pc != stop_pc - && !(step_range_end && INNER_THAN (read_sp (), (step_sp - 16)))))) - write_pc_pid (stop_pc, ecs->ptid); + /* Find the location where (if we've hit a breakpoint) the + breakpoint would be. */ + breakpoint_pc = read_pc_pid (ecs->ptid) - DECR_PC_AFTER_BREAK; + + if (SOFTWARE_SINGLE_STEP_P ()) + { + /* When using software single-step, a SIGTRAP can only indicate + an inserted breakpoint. This actually makes things + easier. */ + if (singlestep_breakpoints_inserted_p) + /* When software single stepping, the instruction at [prev_pc] + is never a breakpoint, but the instruction following + [prev_pc] (in program execution order) always is. Assume + that following instruction was reached and hence a software + breakpoint was hit. */ + write_pc_pid (breakpoint_pc, ecs->ptid); + else if (software_breakpoint_inserted_here_p (breakpoint_pc)) + /* The inferior was free running (i.e., no single-step + breakpoints inserted) and it hit a software breakpoint. */ + write_pc_pid (breakpoint_pc, ecs->ptid); + } + else + { + /* When using hardware single-step, a SIGTRAP is reported for + both a completed single-step and a software breakpoint. Need + to differentiate between the two as the latter needs + adjusting but the former does not. */ + if (currently_stepping (ecs)) + { + if (prev_pc == breakpoint_pc + && software_breakpoint_inserted_here_p (breakpoint_pc)) + /* Hardware single-stepped a software breakpoint (as + occures when the inferior is resumed with PC pointing + at not-yet-hit software breakpoint). Since the + breakpoint really is executed, the inferior needs to be + backed up to the breakpoint address. */ + write_pc_pid (breakpoint_pc, ecs->ptid); + } + else + { + if (software_breakpoint_inserted_here_p (breakpoint_pc)) + /* The inferior was free running (i.e., no hardware + single-step and no possibility of a false SIGTRAP) and + hit a software breakpoint. */ + write_pc_pid (breakpoint_pc, ecs->ptid); + } + } } /* Given an execution control state that has been freshly filled in by an event from the inferior, figure out what it means and take appropriate action. */ +int stepped_after_stopped_by_watchpoint; + void handle_inferior_event (struct execution_control_state *ecs) { @@ -1411,8 +1229,8 @@ handle_inferior_event (struct execution_control_state *ecs) isn't used, then you're wrong! The macro STOPPED_BY_WATCHPOINT, defined in the file "config/pa/nm-hppah.h", accesses the variable indirectly. Mutter something rude about the HP merge. */ - int stepped_after_stopped_by_watchpoint; int sw_single_step_trap_p = 0; + int stopped_by_watchpoint = -1; /* Mark as unknown. */ /* Cache the last pid/waitstatus. */ target_last_wait_ptid = ecs->ptid; @@ -1469,6 +1287,7 @@ handle_inferior_event (struct execution_control_state *ecs) /* If it's a new process, add it to the thread database */ ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid) + && !ptid_equal (ecs->ptid, minus_one_ptid) && !in_thread_list (ecs->ptid)); if (ecs->ws.kind != TARGET_WAITKIND_EXITED @@ -1479,31 +1298,6 @@ handle_inferior_event (struct execution_control_state *ecs) ui_out_text (uiout, "[New "); ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid)); ui_out_text (uiout, "]\n"); - -#if 0 - /* NOTE: This block is ONLY meant to be invoked in case of a - "thread creation event"! If it is invoked for any other - sort of event (such as a new thread landing on a breakpoint), - the event will be discarded, which is almost certainly - a bad thing! - - To avoid this, the low-level module (eg. target_wait) - should call in_thread_list and add_thread, so that the - new thread is known by the time we get here. */ - - /* We may want to consider not doing a resume here in order - to give the user a chance to play with the new thread. - It might be good to make that a user-settable option. */ - - /* At this point, all threads are stopped (happens - automatically in either the OS or the native code). - Therefore we need to continue all threads in order to - make progress. */ - - target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0); - prepare_to_wait (ecs); - return; -#endif } switch (ecs->ws.kind) @@ -1526,20 +1320,20 @@ handle_inferior_event (struct execution_control_state *ecs) breakpoint_re_set. */ target_terminal_ours_for_output (); /* NOTE: cagney/2003-11-25: Make certain that the target - stack's section table is kept up-to-date. Architectures, - (e.g., PPC64), use the section table to perform - operations such as address => section name and hence - require the table to contain all sections (including - those found in shared libraries). */ + stack's section table is kept up-to-date. Architectures, + (e.g., PPC64), use the section table to perform + operations such as address => section name and hence + require the table to contain all sections (including + those found in shared libraries). */ /* NOTE: cagney/2003-11-25: Pass current_target and not - exec_ops to SOLIB_ADD. This is because current GDB is - only tooled to propagate section_table changes out from - the "current_target" (see target_resize_to_sections), and - not up from the exec stratum. This, of course, isn't - right. "infrun.c" should only interact with the - exec/process stratum, instead relying on the target stack - to propagate relevant changes (stop, section table - changed, ...) up to other layers. */ + exec_ops to SOLIB_ADD. This is because current GDB is + only tooled to propagate section_table changes out from + the "current_target" (see target_resize_to_sections), and + not up from the exec stratum. This, of course, isn't + right. "infrun.c" should only interact with the + exec/process stratum, instead relying on the target stack + to propagate relevant changes (stop, section table + changed, ...) up to other layers. */ SOLIB_ADD (NULL, 0, ¤t_target, auto_solib_add); target_terminal_inferior (); @@ -1602,7 +1396,7 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = read_pc (); - stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid); + stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0); ecs->random_signal = !bpstat_explains_signal (stop_bpstat); @@ -1619,8 +1413,8 @@ handle_inferior_event (struct execution_control_state *ecs) stop_signal = TARGET_SIGNAL_TRAP; /* NOTE drow/2002-12-05: This code should be pushed down into the - target_wait function. Until then following vfork on HP/UX 10.20 - is probably broken by this. Of course, it's broken anyway. */ + target_wait function. Until then following vfork on HP/UX 10.20 + is probably broken by this. Of course, it's broken anyway. */ /* Is this a target which reports multiple exec events per actual call to exec()? (HP-UX using ptrace does, for example.) If so, ignore all but the last one. Just resume the exec'r, and wait @@ -1651,7 +1445,7 @@ handle_inferior_event (struct execution_control_state *ecs) ecs->saved_inferior_ptid = inferior_ptid; inferior_ptid = ecs->ptid; - stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid); + stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0); ecs->random_signal = !bpstat_explains_signal (stop_bpstat); inferior_ptid = ecs->saved_inferior_ptid; @@ -1725,12 +1519,12 @@ handle_inferior_event (struct execution_control_state *ecs) /* We had an event in the inferior, but we are not interested in handling it at this level. The lower layers have already done what needs to be done, if anything. - - One of the possible circumstances for this is when the - inferior produces output for the console. The inferior has - not stopped, and we are ignoring the event. Another possible - circumstance is any event which the lower level knows will be - reported multiple times without an intervening resume. */ + + One of the possible circumstances for this is when the + inferior produces output for the console. The inferior has + not stopped, and we are ignoring the event. Another possible + circumstance is any event which the lower level knows will be + reported multiple times without an intervening resume. */ case TARGET_WAITKIND_IGNORE: prepare_to_wait (ecs); return; @@ -1754,17 +1548,18 @@ handle_inferior_event (struct execution_control_state *ecs) if (stepping_past_singlestep_breakpoint) { - gdb_assert (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p); + gdb_assert (SOFTWARE_SINGLE_STEP_P () + && singlestep_breakpoints_inserted_p); gdb_assert (ptid_equal (singlestep_ptid, ecs->ptid)); gdb_assert (!ptid_equal (singlestep_ptid, saved_singlestep_ptid)); stepping_past_singlestep_breakpoint = 0; /* We've either finished single-stepping past the single-step - breakpoint, or stopped for some other reason. It would be nice if - we could tell, but we can't reliably. */ + breakpoint, or stopped for some other reason. It would be nice if + we could tell, but we can't reliably. */ if (stop_signal == TARGET_SIGNAL_TRAP) - { + { /* Pull the single step breakpoints out of the target. */ SOFTWARE_SINGLE_STEP (0, 0); singlestep_breakpoints_inserted_p = 0; @@ -1773,8 +1568,8 @@ handle_inferior_event (struct execution_control_state *ecs) ecs->ptid = saved_singlestep_ptid; context_switch (ecs); - if (context_hook) - context_hook (pid_to_thread_id (ecs->ptid)); + if (deprecated_context_hook) + deprecated_context_hook (pid_to_thread_id (ecs->ptid)); resume (1, TARGET_SIGNAL_0); prepare_to_wait (ecs); @@ -1818,130 +1613,78 @@ handle_inferior_event (struct execution_control_state *ecs) } if (thread_hop_needed) - { - int remove_status; + { + int remove_status; - /* Saw a breakpoint, but it was hit by the wrong thread. - Just continue. */ + /* Saw a breakpoint, but it was hit by the wrong thread. + Just continue. */ - if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) - { - /* Pull the single step breakpoints out of the target. */ - SOFTWARE_SINGLE_STEP (0, 0); - singlestep_breakpoints_inserted_p = 0; - } + if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) + { + /* Pull the single step breakpoints out of the target. */ + SOFTWARE_SINGLE_STEP (0, 0); + singlestep_breakpoints_inserted_p = 0; + } - remove_status = remove_breakpoints (); - /* Did we fail to remove breakpoints? If so, try - to set the PC past the bp. (There's at least - one situation in which we can fail to remove - the bp's: On HP-UX's that use ttrace, we can't - change the address space of a vforking child - process until the child exits (well, okay, not - then either :-) or execs. */ - if (remove_status != 0) - { - /* FIXME! This is obviously non-portable! */ - write_pc_pid (stop_pc + 4, ecs->ptid); - /* We need to restart all the threads now, - * unles we're running in scheduler-locked mode. - * Use currently_stepping to determine whether to - * step or continue. - */ - /* FIXME MVS: is there any reason not to call resume()? */ - if (scheduler_mode == schedlock_on) - target_resume (ecs->ptid, - currently_stepping (ecs), TARGET_SIGNAL_0); - else - target_resume (RESUME_ALL, - currently_stepping (ecs), TARGET_SIGNAL_0); - prepare_to_wait (ecs); - return; - } + remove_status = remove_breakpoints (); + /* Did we fail to remove breakpoints? If so, try + to set the PC past the bp. (There's at least + one situation in which we can fail to remove + the bp's: On HP-UX's that use ttrace, we can't + change the address space of a vforking child + process until the child exits (well, okay, not + then either :-) or execs. */ + if (remove_status != 0) + { + /* FIXME! This is obviously non-portable! */ + write_pc_pid (stop_pc + 4, ecs->ptid); + /* We need to restart all the threads now, + * unles we're running in scheduler-locked mode. + * Use currently_stepping to determine whether to + * step or continue. + */ + /* FIXME MVS: is there any reason not to call resume()? */ + if (scheduler_mode == schedlock_on) + target_resume (ecs->ptid, + currently_stepping (ecs), TARGET_SIGNAL_0); else - { /* Single step */ - breakpoints_inserted = 0; - if (!ptid_equal (inferior_ptid, ecs->ptid)) - context_switch (ecs); - ecs->waiton_ptid = ecs->ptid; - ecs->wp = &(ecs->ws); - ecs->another_trap = 1; - - ecs->infwait_state = infwait_thread_hop_state; - keep_going (ecs); - registers_changed (); - return; - } + target_resume (RESUME_ALL, + currently_stepping (ecs), TARGET_SIGNAL_0); + prepare_to_wait (ecs); + return; + } + else + { /* Single step */ + breakpoints_inserted = 0; + if (!ptid_equal (inferior_ptid, ecs->ptid)) + context_switch (ecs); + ecs->waiton_ptid = ecs->ptid; + ecs->wp = &(ecs->ws); + ecs->another_trap = 1; + + ecs->infwait_state = infwait_thread_hop_state; + keep_going (ecs); + registers_changed (); + return; + } } else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p) - { - sw_single_step_trap_p = 1; - ecs->random_signal = 0; - } + { + sw_single_step_trap_p = 1; + ecs->random_signal = 0; + } } else ecs->random_signal = 1; /* See if something interesting happened to the non-current thread. If - so, then switch to that thread, and eventually give control back to - the user. - - Note that if there's any kind of pending follow (i.e., of a fork, - vfork or exec), we don't want to do this now. Rather, we'll let - the next resume handle it. */ - if (!ptid_equal (ecs->ptid, inferior_ptid) && - (pending_follow.kind == TARGET_WAITKIND_SPURIOUS)) + so, then switch to that thread. */ + if (!ptid_equal (ecs->ptid, inferior_ptid)) { - int printed = 0; - - /* If it's a random signal for a non-current thread, notify user - if he's expressed an interest. */ - if (ecs->random_signal && signal_print[stop_signal]) - { -/* ??rehrauer: I don't understand the rationale for this code. If the - inferior will stop as a result of this signal, then the act of handling - the stop ought to print a message that's couches the stoppage in user - terms, e.g., "Stopped for breakpoint/watchpoint". If the inferior - won't stop as a result of the signal -- i.e., if the signal is merely - a side-effect of something GDB's doing "under the covers" for the - user, such as stepping threads over a breakpoint they shouldn't stop - for -- then the message seems to be a serious annoyance at best. - - For now, remove the message altogether. */ -#if 0 - printed = 1; - target_terminal_ours_for_output (); - printf_filtered ("\nProgram received signal %s, %s.\n", - target_signal_to_name (stop_signal), - target_signal_to_string (stop_signal)); - gdb_flush (gdb_stdout); -#endif - } - - /* If it's not SIGTRAP and not a signal we want to stop for, then - continue the thread. */ - - if (stop_signal != TARGET_SIGNAL_TRAP && !signal_stop[stop_signal]) - { - if (printed) - target_terminal_inferior (); - - /* Clear the signal if it should not be passed. */ - if (signal_program[stop_signal] == 0) - stop_signal = TARGET_SIGNAL_0; - - target_resume (ecs->ptid, 0, stop_signal); - prepare_to_wait (ecs); - return; - } - - /* It's a SIGTRAP or a signal we're interested in. Switch threads, - and fall into the rest of wait_for_inferior(). */ - context_switch (ecs); - if (context_hook) - context_hook (pid_to_thread_id (ecs->ptid)); + if (deprecated_context_hook) + deprecated_context_hook (pid_to_thread_id (ecs->ptid)); flush_cached_frames (); } @@ -2019,7 +1762,7 @@ handle_inferior_event (struct execution_control_state *ecs) /* It may be possible to simply continue after a watchpoint. */ if (HAVE_CONTINUABLE_WATCHPOINT) - STOPPED_BY_WATCHPOINT (ecs->ws); + stopped_by_watchpoint = STOPPED_BY_WATCHPOINT (ecs->ws); ecs->stop_func_start = 0; ecs->stop_func_end = 0; @@ -2028,7 +1771,7 @@ handle_inferior_event (struct execution_control_state *ecs) will both be 0 if it doesn't work. */ find_pc_partial_function (stop_pc, &ecs->stop_func_name, &ecs->stop_func_start, &ecs->stop_func_end); - ecs->stop_func_start += FUNCTION_START_OFFSET; + ecs->stop_func_start += DEPRECATED_FUNCTION_START_OFFSET; ecs->another_trap = 0; bpstat_clear (&stop_bpstat); stop_step = 0; @@ -2058,12 +1801,11 @@ handle_inferior_event (struct execution_control_state *ecs) stack. */ if (stop_signal == TARGET_SIGNAL_TRAP - || (breakpoints_inserted && - (stop_signal == TARGET_SIGNAL_ILL - || stop_signal == TARGET_SIGNAL_SEGV - || stop_signal == TARGET_SIGNAL_EMT)) - || stop_soon == STOP_QUIETLY - || stop_soon == STOP_QUIETLY_NO_SIGSTOP) + || (breakpoints_inserted + && (stop_signal == TARGET_SIGNAL_ILL + || stop_signal == TARGET_SIGNAL_SEGV + || stop_signal == TARGET_SIGNAL_EMT)) + || stop_soon == STOP_QUIETLY || stop_soon == STOP_QUIETLY_NO_SIGSTOP) { if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap) { @@ -2092,20 +1834,15 @@ handle_inferior_event (struct execution_control_state *ecs) return; } - /* Don't even think about breakpoints - if just proceeded over a breakpoint. - - However, if we are trying to proceed over a breakpoint - and end up in sigtramp, then through_sigtramp_breakpoint - will be set and we should check whether we've hit the - step breakpoint. */ - if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected - && through_sigtramp_breakpoint == NULL) + /* Don't even think about breakpoints if just proceeded over a + breakpoint. */ + if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected) bpstat_clear (&stop_bpstat); else { /* See if there is a breakpoint at the current PC. */ - stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid); + stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, + stopped_by_watchpoint); /* Following in case break condition called a function. */ @@ -2113,13 +1850,13 @@ handle_inferior_event (struct execution_control_state *ecs) } /* NOTE: cagney/2003-03-29: These two checks for a random signal - at one stage in the past included checks for an inferior - function call's call dummy's return breakpoint. The original - comment, that went with the test, read: + at one stage in the past included checks for an inferior + function call's call dummy's return breakpoint. The original + comment, that went with the test, read: - ``End of a stack dummy. Some systems (e.g. Sony news) give - another signal besides SIGTRAP, so check here as well as - above.'' + ``End of a stack dummy. Some systems (e.g. Sony news) give + another signal besides SIGTRAP, so check here as well as + above.'' If someone ever tries to get get call dummys on a non-executable stack to work (where the target would stop @@ -2128,9 +1865,9 @@ handle_inferior_event (struct execution_control_state *ecs) enabled when momentary breakpoints were not being used, I suspect that it won't be the case. - NOTE: kettenis/2004-02-05: Indeed such checks don't seem to - be necessary for call dummies on a non-executable stack on - SPARC. */ + NOTE: kettenis/2004-02-05: Indeed such checks don't seem to + be necessary for call dummies on a non-executable stack on + SPARC. */ if (stop_signal == TARGET_SIGNAL_TRAP) ecs->random_signal @@ -2183,39 +1920,41 @@ process_event_stop_test: if (signal_program[stop_signal] == 0) stop_signal = TARGET_SIGNAL_0; - /* I'm not sure whether this needs to be check_sigtramp2 or - whether it could/should be keep_going. - - This used to jump to step_over_function if we are stepping, - which is wrong. - - Suppose the user does a `next' over a function call, and while - that call is in progress, the inferior receives a signal for - which GDB does not stop (i.e., signal_stop[SIG] is false). In - that case, when we reach this point, there is already a - step-resume breakpoint established, right where it should be: - immediately after the function call the user is "next"-ing - over. If we call step_over_function now, two bad things - happen: - - - we'll create a new breakpoint, at wherever the current - frame's return address happens to be. That could be - anywhere, depending on what function call happens to be on - the top of the stack at that point. Point is, it's probably - not where we need it. - - - the existing step-resume breakpoint (which is at the correct - address) will get orphaned: step_resume_breakpoint will point - to the new breakpoint, and the old step-resume breakpoint - will never be cleaned up. - - The old behavior was meant to help HP-UX single-step out of - sigtramps. It would place the new breakpoint at prev_pc, which - was certainly wrong. I don't know the details there, so fixing - this probably breaks that. As with anything else, it's up to - the HP-UX maintainer to furnish a fix that doesn't break other - platforms. --JimB, 20 May 1999 */ - check_sigtramp2 (ecs); + if (prev_pc == read_pc () + && !breakpoints_inserted + && breakpoint_here_p (read_pc ()) + && step_resume_breakpoint == NULL) + { + /* We were just starting a new sequence, attempting to + single-step off of a breakpoint and expecting a SIGTRAP. + Intead this signal arrives. This signal will take us out + of the stepping range so GDB needs to remember to, when + the signal handler returns, resume stepping off that + breakpoint. */ + /* To simplify things, "continue" is forced to use the same + code paths as single-step - set a breakpoint at the + signal return address and then, once hit, step off that + breakpoint. */ + insert_step_resume_breakpoint_at_frame (get_current_frame ()); + ecs->step_after_step_resume_breakpoint = 1; + } + else if (step_range_end != 0 + && stop_signal != TARGET_SIGNAL_0 + && stop_pc >= step_range_start && stop_pc < step_range_end + && frame_id_eq (get_frame_id (get_current_frame ()), + step_frame_id)) + { + /* The inferior is about to take a signal that will take it + out of the single step range. Set a breakpoint at the + current PC (which is presumably where the signal handler + will eventually return) and then allow the inferior to + run free. + + Note that this is only needed for a signal delivered + while in the single-step range. Nested signals aren't a + problem as they eventually all return. */ + insert_step_resume_breakpoint_at_frame (get_current_frame ()); + } keep_going (ecs); return; } @@ -2230,9 +1969,6 @@ process_event_stop_test: if (what.call_dummy) { stop_stack_dummy = 1; -#ifdef HP_OS_BUG - trap_expected_after_continue = 1; -#endif } switch (what.main_action) @@ -2256,21 +1992,8 @@ process_event_stop_test: { delete_step_resume_breakpoint (&step_resume_breakpoint); } - /* Not sure whether we need to blow this away too, but probably - it is like the step-resume breakpoint. */ - if (through_sigtramp_breakpoint != NULL) - { - delete_breakpoint (through_sigtramp_breakpoint); - through_sigtramp_breakpoint = NULL; - } -#if 0 - /* FIXME - Need to implement nested temporary breakpoints */ - if (step_over_calls > 0) - set_longjmp_resume_breakpoint (jmp_buf_pc, get_current_frame ()); - else -#endif /* 0 */ - set_longjmp_resume_breakpoint (jmp_buf_pc, null_frame_id); + set_longjmp_resume_breakpoint (jmp_buf_pc, null_frame_id); ecs->handling_longjmp = 1; /* FIXME */ keep_going (ecs); return; @@ -2279,17 +2002,6 @@ process_event_stop_test: case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE: remove_breakpoints (); breakpoints_inserted = 0; -#if 0 - /* FIXME - Need to implement nested temporary breakpoints */ - if (step_over_calls - && (frame_id_inner (get_frame_id (get_current_frame ()), - step_frame_id))) - { - ecs->another_trap = 1; - keep_going (ecs); - return; - } -#endif /* 0 */ disable_longjmp_breakpoint (); ecs->handling_longjmp = 0; /* FIXME */ if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME) @@ -2310,9 +2022,8 @@ process_event_stop_test: case BPSTAT_WHAT_STOP_NOISY: stop_print_frame = 1; - /* We are about to nuke the step_resume_breakpoint and - through_sigtramp_breakpoint via the cleanup chain, so - no need to worry about it here. */ + /* We are about to nuke the step_resume_breakpointt via the + cleanup chain, so no need to worry about it here. */ stop_stepping (ecs); return; @@ -2320,9 +2031,8 @@ process_event_stop_test: case BPSTAT_WHAT_STOP_SILENT: stop_print_frame = 0; - /* We are about to nuke the step_resume_breakpoint and - through_sigtramp_breakpoint via the cleanup chain, so - no need to worry about it here. */ + /* We are about to nuke the step_resume_breakpoin via the + cleanup chain, so no need to worry about it here. */ stop_stepping (ecs); return; @@ -2351,13 +2061,21 @@ process_event_stop_test: bpstat_find_step_resume_breakpoint (stop_bpstat); } delete_step_resume_breakpoint (&step_resume_breakpoint); + if (ecs->step_after_step_resume_breakpoint) + { + /* Back when the step-resume breakpoint was inserted, we + were trying to single-step off a breakpoint. Go back + to doing that. */ + ecs->step_after_step_resume_breakpoint = 0; + remove_breakpoints (); + breakpoints_inserted = 0; + ecs->another_trap = 1; + keep_going (ecs); + return; + } break; case BPSTAT_WHAT_THROUGH_SIGTRAMP: - if (through_sigtramp_breakpoint) - delete_breakpoint (through_sigtramp_breakpoint); - through_sigtramp_breakpoint = NULL; - /* If were waiting for a trap, hitting the step_resume_break doesn't count as getting it. */ if (trap_expected) @@ -2381,20 +2099,20 @@ process_event_stop_test: breakpoint_re_set. */ target_terminal_ours_for_output (); /* NOTE: cagney/2003-11-25: Make certain that the target - stack's section table is kept up-to-date. Architectures, - (e.g., PPC64), use the section table to perform - operations such as address => section name and hence - require the table to contain all sections (including - those found in shared libraries). */ + stack's section table is kept up-to-date. Architectures, + (e.g., PPC64), use the section table to perform + operations such as address => section name and hence + require the table to contain all sections (including + those found in shared libraries). */ /* NOTE: cagney/2003-11-25: Pass current_target and not - exec_ops to SOLIB_ADD. This is because current GDB is - only tooled to propagate section_table changes out from - the "current_target" (see target_resize_to_sections), and - not up from the exec stratum. This, of course, isn't - right. "infrun.c" should only interact with the - exec/process stratum, instead relying on the target stack - to propagate relevant changes (stop, section table - changed, ...) up to other layers. */ + exec_ops to SOLIB_ADD. This is because current GDB is + only tooled to propagate section_table changes out from + the "current_target" (see target_resize_to_sections), and + not up from the exec stratum. This, of course, isn't + right. "infrun.c" should only interact with the + exec/process stratum, instead relying on the target stack + to propagate relevant changes (stop, section table + changed, ...) up to other layers. */ SOLIB_ADD (NULL, 0, ¤t_target, auto_solib_add); target_terminal_inferior (); @@ -2422,8 +2140,8 @@ process_event_stop_test: the call that caused this catchpoint to trigger. That gives the user a more useful vantage from which to examine their program's state. */ - else if (what.main_action == - BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK) + else if (what.main_action + == BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK) { /* ??rehrauer: If I could figure out how to get the right return PC from here, we could just set a temp @@ -2501,9 +2219,6 @@ process_event_stop_test: /* Having a step-resume breakpoint overrides anything else having to do with stepping commands until that breakpoint is reached. */ - /* I'm not sure whether this needs to be check_sigtramp2 or - whether it could/should be keep_going. */ - check_sigtramp2 (ecs); keep_going (ecs); return; } @@ -2511,9 +2226,6 @@ process_event_stop_test: if (step_range_end == 0) { /* Likewise if we aren't even stepping. */ - /* I'm not sure whether this needs to be check_sigtramp2 or - whether it could/should be keep_going. */ - check_sigtramp2 (ecs); keep_going (ecs); return; } @@ -2525,9 +2237,6 @@ process_event_stop_test: within it! */ if (stop_pc >= step_range_start && stop_pc < step_range_end) { - /* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal. - So definately need to check for sigtramp here. */ - check_sigtramp2 (ecs); keep_going (ecs); return; } @@ -2552,131 +2261,136 @@ process_event_stop_test: init_sal (&sr_sal); sr_sal.pc = pc_after_resolver; - check_for_old_step_resume_breakpoint (); - step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); - if (breakpoints_inserted) - insert_breakpoints (); + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); } keep_going (ecs); return; } - /* We can't update step_sp every time through the loop, because - reading the stack pointer would slow down stepping too much. - But we can update it every time we leave the step range. */ - ecs->update_step_sp = 1; + if (step_range_end != 1 + && (step_over_calls == STEP_OVER_UNDEBUGGABLE + || step_over_calls == STEP_OVER_ALL) + && get_frame_type (get_current_frame ()) == SIGTRAMP_FRAME) + { + /* The inferior, while doing a "step" or "next", has ended up in + a signal trampoline (either by a signal being delivered or by + the signal handler returning). Just single-step until the + inferior leaves the trampoline (either by calling the handler + or returning). */ + keep_going (ecs); + return; + } - /* Did we just take a signal? */ - if (pc_in_sigtramp (stop_pc) - && !pc_in_sigtramp (prev_pc) - && INNER_THAN (read_sp (), step_sp)) + if (frame_id_eq (frame_unwind_id (get_current_frame ()), step_frame_id)) { - /* We've just taken a signal; go until we are back to - the point where we took it and one more. */ + /* It's a subroutine call. */ + CORE_ADDR real_stop_pc; - /* Note: The test above succeeds not only when we stepped - into a signal handler, but also when we step past the last - statement of a signal handler and end up in the return stub - of the signal handler trampoline. To distinguish between - these two cases, check that the frame is INNER_THAN the - previous one below. pai/1997-09-11 */ + if ((step_over_calls == STEP_OVER_NONE) + || ((step_range_end == 1) + && in_prologue (prev_pc, ecs->stop_func_start))) + { + /* I presume that step_over_calls is only 0 when we're + supposed to be stepping at the assembly language level + ("stepi"). Just stop. */ + /* Also, maybe we just did a "nexti" inside a prolog, so we + thought it was a subroutine call but it was not. Stop as + well. FENN */ + stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + return; + } +#ifdef DEPRECATED_IGNORE_HELPER_CALL + /* On MIPS16, a function that returns a floating point value may + call a library helper function to copy the return value to a + floating point register. The DEPRECATED_IGNORE_HELPER_CALL + macro returns non-zero if we should ignore (i.e. step over) + this function call. */ + /* FIXME: cagney/2004-07-21: These custom ``ignore frame when + stepping'' function attributes (SIGTRAMP_FRAME, + DEPRECATED_IGNORE_HELPER_CALL, SKIP_TRAMPOLINE_CODE, + skip_language_trampoline frame, et.al.) need to be replaced + with generic attributes bound to the frame's function. */ + if (DEPRECATED_IGNORE_HELPER_CALL (stop_pc)) + { + /* We're doing a "next", set a breakpoint at callee's return + address (the address at which the caller will + resume). */ + insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ())); + keep_going (ecs); + return; + } +#endif + if (step_over_calls == STEP_OVER_ALL) + { + /* We're doing a "next", set a breakpoint at callee's return + address (the address at which the caller will + resume). */ + insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ())); + keep_going (ecs); + return; + } + /* If we are in a function call trampoline (a stub between the + calling routine and the real function), locate the real + function. That's what tells us (a) whether we want to step + into it at all, and (b) what prologue we want to run to the + end of, if we do step into it. */ + real_stop_pc = skip_language_trampoline (stop_pc); + if (real_stop_pc == 0) + real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc); + if (real_stop_pc != 0) + ecs->stop_func_start = real_stop_pc; + + if (IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start)) + { + struct symtab_and_line sr_sal; + init_sal (&sr_sal); + sr_sal.pc = ecs->stop_func_start; + + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); + keep_going (ecs); + return; + } + + /* If we have line number information for the function we are + thinking of stepping into, step into it. + + If there are several symtabs at that PC (e.g. with include + files), just want to know whether *any* of them have line + numbers. find_pc_line handles this. */ { - struct frame_id current_frame = get_frame_id (get_current_frame ()); + struct symtab_and_line tmp_sal; - if (frame_id_inner (current_frame, step_frame_id)) + tmp_sal = find_pc_line (ecs->stop_func_start, 0); + if (tmp_sal.line != 0) { - /* We have just taken a signal; go until we are back to - the point where we took it and one more. */ - - /* This code is needed at least in the following case: - The user types "next" and then a signal arrives (before - the "next" is done). */ - - /* Note that if we are stopped at a breakpoint, then we need - the step_resume breakpoint to override any breakpoints at - the same location, so that we will still step over the - breakpoint even though the signal happened. */ - struct symtab_and_line sr_sal; - - init_sal (&sr_sal); - sr_sal.symtab = NULL; - sr_sal.line = 0; - sr_sal.pc = prev_pc; - /* We could probably be setting the frame to - step_frame_id; I don't think anyone thought to try it. */ - check_for_old_step_resume_breakpoint (); - step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); - if (breakpoints_inserted) - insert_breakpoints (); - } - else - { - /* We just stepped out of a signal handler and into - its calling trampoline. - - Normally, we'd call step_over_function from - here, but for some reason GDB can't unwind the - stack correctly to find the real PC for the point - user code where the signal trampoline will return - -- FRAME_SAVED_PC fails, at least on HP-UX 10.20. - But signal trampolines are pretty small stubs of - code, anyway, so it's OK instead to just - single-step out. Note: assuming such trampolines - don't exhibit recursion on any platform... */ - find_pc_partial_function (stop_pc, &ecs->stop_func_name, - &ecs->stop_func_start, - &ecs->stop_func_end); - /* Readjust stepping range */ - step_range_start = ecs->stop_func_start; - step_range_end = ecs->stop_func_end; - ecs->stepping_through_sigtramp = 1; + step_into_function (ecs); + return; } } + /* If we have no line number and the step-stop-if-no-debug is + set, we stop the step so that the user has a chance to switch + in assembly mode. */ + if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug) + { + stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + return; + } - /* If this is stepi or nexti, make sure that the stepping range - gets us past that instruction. */ - if (step_range_end == 1) - /* FIXME: Does this run afoul of the code below which, if - we step into the middle of a line, resets the stepping - range? */ - step_range_end = (step_range_start = prev_pc) + 1; - - ecs->remove_breakpoints_on_following_step = 1; + /* Set a breakpoint at callee's return address (the address at + which the caller will resume). */ + insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ())); keep_going (ecs); return; } - if (((stop_pc == ecs->stop_func_start /* Quick test */ - || in_prologue (stop_pc, ecs->stop_func_start)) - && !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) - || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name) - || ecs->stop_func_name == 0) - { - /* It's a subroutine call. */ - handle_step_into_function (ecs); - return; - } - - /* We've wandered out of the step range. */ - - ecs->sal = find_pc_line (stop_pc, 0); - - if (step_range_end == 1) - { - /* It is stepi or nexti. We always want to stop stepping after - one instruction. */ - stop_step = 1; - print_stop_reason (END_STEPPING_RANGE, 0); - stop_stepping (ecs); - return; - } - /* If we're in the return path from a shared library trampoline, we want to proceed through the trampoline when stepping. */ if (IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) @@ -2693,14 +2407,11 @@ process_event_stop_test: init_sal (&sr_sal); /* initialize to zeroes */ sr_sal.pc = real_stop_pc; sr_sal.section = find_pc_overlay (sr_sal.pc); - /* Do not specify what the fp should be when we stop - since on some machines the prologue - is where the new fp value is established. */ - check_for_old_step_resume_breakpoint (); - step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); - if (breakpoints_inserted) - insert_breakpoints (); + + /* Do not specify what the fp should be when we stop since + on some machines the prologue is where the new fp value + is established. */ + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); /* Restart without fiddling with the step ranges or other state. */ @@ -2709,6 +2420,50 @@ process_event_stop_test: } } + /* NOTE: tausq/2004-05-24: This if block used to be done before all + the trampoline processing logic, however, there are some trampolines + that have no names, so we should do trampoline handling first. */ + if (step_over_calls == STEP_OVER_UNDEBUGGABLE + && ecs->stop_func_name == NULL) + { + /* The inferior just stepped into, or returned to, an + undebuggable function (where there is no symbol, not even a + minimal symbol, corresponding to the address where the + inferior stopped). Since we want to skip this kind of code, + we keep going until the inferior returns from this + function. */ + if (step_stop_if_no_debug) + { + /* If we have no line number and the step-stop-if-no-debug + is set, we stop the step so that the user has a chance to + switch in assembly mode. */ + stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + return; + } + else + { + /* Set a breakpoint at callee's return address (the address + at which the caller will resume). */ + insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ())); + keep_going (ecs); + return; + } + } + + if (step_range_end == 1) + { + /* It is stepi or nexti. We always want to stop stepping after + one instruction. */ + stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + return; + } + + ecs->sal = find_pc_line (stop_pc, 0); + if (ecs->sal.line == 0) { /* We have no line number information. That means to stop @@ -2769,15 +2524,15 @@ process_event_stop_test: stackless leaf function. I think the logic should instead look at the unwound frame ID has that should give a more robust indication of what happened. */ - if (step-ID == current-ID) - still stepping in same function; - else if (step-ID == unwind (current-ID)) - stepped into a function; - else - stepped out of a function; - /* Of course this assumes that the frame ID unwind code is robust - and we're willing to introduce frame unwind logic into this - function. Fortunately, those days are nearly upon us. */ + if (step - ID == current - ID) + still stepping in same function; + else if (step - ID == unwind (current - ID)) + stepped into a function; + else + stepped out of a function; + /* Of course this assumes that the frame ID unwind code is robust + and we're willing to introduce frame unwind logic into this + function. Fortunately, those days are nearly upon us. */ #endif { struct frame_id current_frame = get_frame_id (get_current_frame ()); @@ -2793,50 +2548,13 @@ process_event_stop_test: static int currently_stepping (struct execution_control_state *ecs) { - return ((through_sigtramp_breakpoint == NULL - && !ecs->handling_longjmp + return ((!ecs->handling_longjmp && ((step_range_end && step_resume_breakpoint == NULL) || trap_expected)) || ecs->stepping_through_solib_after_catch || bpstat_should_step ()); } -static void -check_sigtramp2 (struct execution_control_state *ecs) -{ - if (trap_expected - && pc_in_sigtramp (stop_pc) - && !pc_in_sigtramp (prev_pc) - && INNER_THAN (read_sp (), step_sp)) - { - /* What has happened here is that we have just stepped the - inferior with a signal (because it is a signal which - shouldn't make us stop), thus stepping into sigtramp. - - So we need to set a step_resume_break_address breakpoint and - continue until we hit it, and then step. FIXME: This should - be more enduring than a step_resume breakpoint; we should - know that we will later need to keep going rather than - re-hitting the breakpoint here (see the testsuite, - gdb.base/signals.exp where it says "exceedingly difficult"). */ - - struct symtab_and_line sr_sal; - - init_sal (&sr_sal); /* initialize to zeroes */ - sr_sal.pc = prev_pc; - sr_sal.section = find_pc_overlay (sr_sal.pc); - /* We perhaps could set the frame if we kept track of what the - frame corresponding to prev_pc was. But we don't, so don't. */ - through_sigtramp_breakpoint = - set_momentary_breakpoint (sr_sal, null_frame_id, bp_through_sigtramp); - if (breakpoints_inserted) - insert_breakpoints (); - - ecs->remove_breakpoints_on_following_step = 1; - ecs->another_trap = 1; - } -} - /* Subroutine call with source code we should not step over. Do step to the first line of code in it. */ @@ -2867,7 +2585,7 @@ step_into_function (struct execution_control_state *ecs) ``ecs->stop_func_start == stop_pc'' will never succeed. Adjust ecs->stop_func_start to an address at which a breakpoint may be legitimately placed. - + Note: kevinb/2004-01-19: On FR-V, if this adjustment is not made, GDB will enter an infinite loop when stepping through optimized code consisting of VLIW instructions which contain @@ -2877,12 +2595,12 @@ step_into_function (struct execution_control_state *ecs) set, GDB will adjust the breakpoint address to the beginning of the VLIW instruction. Thus, we need to make the corresponding adjustment here when computing the stop address. */ - + if (gdbarch_adjust_breakpoint_address_p (current_gdbarch)) { ecs->stop_func_start = gdbarch_adjust_breakpoint_address (current_gdbarch, - ecs->stop_func_start); + ecs->stop_func_start); } if (ecs->stop_func_start == stop_pc) @@ -2899,14 +2617,11 @@ step_into_function (struct execution_control_state *ecs) init_sal (&sr_sal); /* initialize to zeroes */ sr_sal.pc = ecs->stop_func_start; sr_sal.section = find_pc_overlay (ecs->stop_func_start); + /* Do not specify what the fp should be when we stop since on some machines the prologue is where the new fp value is established. */ - check_for_old_step_resume_breakpoint (); - step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume); - if (breakpoints_inserted) - insert_breakpoints (); + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); /* And make sure stepping stops right away then. */ step_range_end = step_range_start; @@ -2914,75 +2629,48 @@ step_into_function (struct execution_control_state *ecs) keep_going (ecs); } -/* We've just entered a callee, and we wish to resume until it returns - to the caller. Setting a step_resume breakpoint on the return - address will catch a return from the callee. - - However, if the callee is recursing, we want to be careful not to - catch returns of those recursive calls, but only of THIS instance - of the call. +/* Insert a "step resume breakpoint" at SR_SAL with frame ID SR_ID. + This is used to both functions and to skip over code. */ + +static void +insert_step_resume_breakpoint_at_sal (struct symtab_and_line sr_sal, + struct frame_id sr_id) +{ + /* There should never be more than one step-resume breakpoint per + thread, so we should never be setting a new + step_resume_breakpoint when one is already active. */ + gdb_assert (step_resume_breakpoint == NULL); + step_resume_breakpoint = set_momentary_breakpoint (sr_sal, sr_id, + bp_step_resume); + if (breakpoints_inserted) + insert_breakpoints (); +} + +/* Insert a "step resume breakpoint" at RETURN_FRAME.pc. This is used + to skip a function (next, skip-no-debug) or signal. It's assumed + that the function/signal handler being skipped eventually returns + to the breakpoint inserted at RETURN_FRAME.pc. + + For the skip-function case, the function may have been reached by + either single stepping a call / return / signal-return instruction, + or by hitting a breakpoint. In all cases, the RETURN_FRAME belongs + to the skip-function's caller. - To do this, we set the step_resume bp's frame to our current - caller's frame (step_frame_id, which is set by the "next" or - "until" command, before execution begins). */ + For the signals case, this is called with the interrupted + function's frame. The signal handler, when it returns, will resume + the interrupted function at RETURN_FRAME.pc. */ static void -step_over_function (struct execution_control_state *ecs) +insert_step_resume_breakpoint_at_frame (struct frame_info *return_frame) { struct symtab_and_line sr_sal; init_sal (&sr_sal); /* initialize to zeros */ - /* NOTE: cagney/2003-04-06: - - At this point the equality get_frame_pc() == get_frame_func() - should hold. This may make it possible for this code to tell the - frame where it's function is, instead of the reverse. This would - avoid the need to search for the frame's function, which can get - very messy when there is no debug info available (look at the - heuristic find pc start code found in targets like the MIPS). */ - - /* NOTE: cagney/2003-04-06: - - The intent of DEPRECATED_SAVED_PC_AFTER_CALL was to: - - - provide a very light weight equivalent to frame_unwind_pc() - (nee FRAME_SAVED_PC) that avoids the prologue analyzer - - - avoid handling the case where the PC hasn't been saved in the - prologue analyzer - - Unfortunately, not five lines further down, is a call to - get_frame_id() and that is guarenteed to trigger the prologue - analyzer. - - The `correct fix' is for the prologe analyzer to handle the case - where the prologue is incomplete (PC in prologue) and, - consequently, the return pc has not yet been saved. It should be - noted that the prologue analyzer needs to handle this case - anyway: frameless leaf functions that don't save the return PC; - single stepping through a prologue. - - The d10v handles all this by bailing out of the prologue analsis - when it reaches the current instruction. */ - - if (DEPRECATED_SAVED_PC_AFTER_CALL_P ()) - sr_sal.pc = ADDR_BITS_REMOVE (DEPRECATED_SAVED_PC_AFTER_CALL (get_current_frame ())); - else - sr_sal.pc = ADDR_BITS_REMOVE (frame_pc_unwind (get_current_frame ())); + sr_sal.pc = ADDR_BITS_REMOVE (get_frame_pc (return_frame)); sr_sal.section = find_pc_overlay (sr_sal.pc); - check_for_old_step_resume_breakpoint (); - step_resume_breakpoint = - set_momentary_breakpoint (sr_sal, get_frame_id (get_current_frame ()), - bp_step_resume); - - if (frame_id_p (step_frame_id) - && !IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc)) - step_resume_breakpoint->frame_id = step_frame_id; - - if (breakpoints_inserted) - insert_breakpoints (); + insert_step_resume_breakpoint_at_sal (sr_sal, get_frame_id (return_frame)); } static void @@ -3002,10 +2690,6 @@ keep_going (struct execution_control_state *ecs) /* Save the pc before execution, to compare with pc after stop. */ prev_pc = read_pc (); /* Might have been DECR_AFTER_BREAK */ - if (ecs->update_step_sp) - step_sp = read_sp (); - ecs->update_step_sp = 0; - /* If we did not do break;, it means we should keep running the inferior and not return to debugger. */ @@ -3025,22 +2709,9 @@ keep_going (struct execution_control_state *ecs) The signal was SIGTRAP, e.g. it was our signal, but we decided we should resume from it. - We're going to run this baby now! + We're going to run this baby now! */ - Insert breakpoints now, unless we are trying to one-proceed - past a breakpoint. */ - /* If we've just finished a special step resume and we don't - want to hit a breakpoint, pull em out. */ - if (step_resume_breakpoint == NULL - && through_sigtramp_breakpoint == NULL - && ecs->remove_breakpoints_on_following_step) - { - ecs->remove_breakpoints_on_following_step = 0; - remove_breakpoints (); - breakpoints_inserted = 0; - } - else if (!breakpoints_inserted && - (through_sigtramp_breakpoint != NULL || !ecs->another_trap)) + if (!breakpoints_inserted && !ecs->another_trap) { breakpoints_failed = insert_breakpoints (); if (breakpoints_failed) @@ -3306,8 +2977,8 @@ normal_stop (void) { case PRINT_UNKNOWN: /* FIXME: cagney/2002-12-01: Given that a frame ID does - (or should) carry around the function and does (or - should) use that when doing a frame comparison. */ + (or should) carry around the function and does (or + should) use that when doing a frame comparison. */ if (stop_step && frame_id_eq (step_frame_id, get_frame_id (get_current_frame ())) @@ -3343,7 +3014,7 @@ normal_stop (void) LOCATION: Print only location SRC_AND_LOC: Print location and source line */ if (do_frame_printing) - print_stack_frame (deprecated_selected_frame, -1, source_flag); + print_stack_frame (get_selected_frame (), 0, source_flag); /* Display the auto-display expressions. */ do_displays (); @@ -3372,7 +3043,7 @@ normal_stop (void) done: annotate_stopped (); - observer_notify_normal_stop (); + observer_notify_normal_stop (stop_bpstat); } static int @@ -3773,7 +3444,7 @@ void write_inferior_status_register (struct inferior_status *inf_status, int regno, LONGEST val) { - int size = DEPRECATED_REGISTER_RAW_SIZE (regno); + int size = register_size (current_gdbarch, regno); void *buf = alloca (size); store_signed_integer (buf, size, val); regcache_raw_write (inf_status->registers, regno, buf); @@ -4167,7 +3838,7 @@ of the program stops.", &cmdlist); signal_print[TARGET_SIGNAL_CANCEL] = 0; #ifdef SOLIB_ADD - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("stop-on-solib-events", class_support, var_zinteger, (char *) &stop_on_solib_events, "Set stopping for shared library events.\n\ @@ -4186,7 +3857,7 @@ A fork or vfork creates a new process. follow-fork-mode can be:\n\ child - the new process is debugged after a fork\n\ The unfollowed process will continue to run.\n\ By default, the debugger will follow the parent process.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); c = add_set_enum_cmd ("scheduler-locking", class_run, scheduler_enums, /* array of string names */ &scheduler_mode, /* current mode */ @@ -4198,7 +3869,7 @@ step == scheduler locked during every single-step operation.\n\ Other threads may run while stepping over a function call ('next').", &setlist); set_cmd_sfunc (c, set_schedlock_func); /* traps on target vector */ - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); c = add_set_cmd ("step-mode", class_run, var_boolean, (char *) &step_stop_if_no_debug, @@ -4206,7 +3877,7 @@ step == scheduler locked during every single-step operation.\n\ function without debug line information will stop at the first\n\ instruction of that function. Otherwise, the function is skipped and\n\ the step command stops at a different source line.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); /* ptid initializations */ null_ptid = ptid_build (0, 0, 0); diff --git a/gnu/usr.bin/binutils/gdb/inftarg.c b/gnu/usr.bin/binutils/gdb/inftarg.c index a6f40ec12c2..e9ace23a17f 100644 --- a/gnu/usr.bin/binutils/gdb/inftarg.c +++ b/gnu/usr.bin/binutils/gdb/inftarg.c @@ -34,7 +34,7 @@ #include <signal.h> #include <sys/types.h> #include <fcntl.h> - +#include "observer.h" #include "gdb_wait.h" #include "inflow.h" @@ -53,10 +53,6 @@ static void child_prepare_to_store (void); static ptid_t child_wait (ptid_t, struct target_waitstatus *); #endif /* CHILD_WAIT */ -#if !defined(CHILD_POST_WAIT) -void child_post_wait (ptid_t, int); -#endif - static void child_open (char *, int); static void child_files_info (struct target_ops *); @@ -73,7 +69,7 @@ static void ptrace_me (void); static void ptrace_him (int); -static void child_create_inferior (char *, char *, char **); +static void child_create_inferior (char *, char *, char **, int); static void child_mourn_inferior (void); @@ -89,8 +85,6 @@ static void init_child_ops (void); extern char **environ; -struct target_ops child_ops; - int child_suppress_run = 0; /* Non-zero if inftarg should pretend not to be a runnable target. Used by targets that can sit atop inftarg, such as HPUX @@ -119,7 +113,7 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) attached process. */ set_sigio_trap (); - pid = ptrace_wait (inferior_ptid, &status); + pid = wait (&status); save_errno = errno; @@ -161,17 +155,6 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) } #endif /* CHILD_WAIT */ -#if !defined(CHILD_POST_WAIT) -void -child_post_wait (ptid_t ptid, int wait_status) -{ - /* This version of Unix doesn't require a meaningful "post wait" - operation. - */ -} -#endif - - #ifndef CHILD_THREAD_ALIVE /* Check to see if the given thread is alive. @@ -194,46 +177,40 @@ child_thread_alive (ptid_t ptid) static void child_attach (char *args, int from_tty) { + char *exec_file; + int pid; + char *dummy; + if (!args) error_no_arg ("process-id to attach"); -#ifndef ATTACH_DETACH - error ("Can't attach to a process on this machine."); -#else - { - char *exec_file; - int pid; - char *dummy; - - dummy = args; - pid = strtol (args, &dummy, 0); - /* Some targets don't set errno on errors, grrr! */ - if ((pid == 0) && (args == dummy)) + dummy = args; + pid = strtol (args, &dummy, 0); + /* Some targets don't set errno on errors, grrr! */ + if ((pid == 0) && (args == dummy)) error ("Illegal process-id: %s\n", args); + + if (pid == getpid ()) /* Trying to masturbate? */ + error ("I refuse to debug myself!"); + + if (from_tty) + { + exec_file = (char *) get_exec_file (0); + + if (exec_file) + printf_unfiltered ("Attaching to program: %s, %s\n", exec_file, + target_pid_to_str (pid_to_ptid (pid))); + else + printf_unfiltered ("Attaching to %s\n", + target_pid_to_str (pid_to_ptid (pid))); + + gdb_flush (gdb_stdout); + } - if (pid == getpid ()) /* Trying to masturbate? */ - error ("I refuse to debug myself!"); - - if (from_tty) - { - exec_file = (char *) get_exec_file (0); - - if (exec_file) - printf_unfiltered ("Attaching to program: %s, %s\n", exec_file, - target_pid_to_str (pid_to_ptid (pid))); - else - printf_unfiltered ("Attaching to %s\n", - target_pid_to_str (pid_to_ptid (pid))); - - gdb_flush (gdb_stdout); - } - - attach (pid); - - inferior_ptid = pid_to_ptid (pid); - push_target (&child_ops); - } -#endif /* ATTACH_DETACH */ + attach (pid); + + inferior_ptid = pid_to_ptid (pid); + push_target (&deprecated_child_ops); } #if !defined(CHILD_POST_ATTACH) @@ -256,31 +233,25 @@ child_post_attach (int pid) static void child_detach (char *args, int from_tty) { -#ifdef ATTACH_DETACH - { - int siggnal = 0; - int pid = PIDGET (inferior_ptid); - - if (from_tty) - { - char *exec_file = get_exec_file (0); - if (exec_file == 0) - exec_file = ""; - printf_unfiltered ("Detaching from program: %s, %s\n", exec_file, - target_pid_to_str (pid_to_ptid (pid))); - gdb_flush (gdb_stdout); - } - if (args) - siggnal = atoi (args); - - detach (siggnal); - - inferior_ptid = null_ptid; - unpush_target (&child_ops); - } -#else - error ("This version of Unix does not support detaching a process."); -#endif + int siggnal = 0; + int pid = PIDGET (inferior_ptid); + + if (from_tty) + { + char *exec_file = get_exec_file (0); + if (exec_file == 0) + exec_file = ""; + printf_unfiltered ("Detaching from program: %s, %s\n", exec_file, + target_pid_to_str (pid_to_ptid (pid))); + gdb_flush (gdb_stdout); + } + if (args) + siggnal = atoi (args); + + detach (siggnal); + + inferior_ptid = null_ptid; + unpush_target (&deprecated_child_ops); } /* Get ready to modify the registers array. On machines which store @@ -319,7 +290,7 @@ static void ptrace_me (void) { /* "Trace me, Dr. Memory!" */ - call_ptrace (0, 0, (PTRACE_ARG3_TYPE) 0, 0); + call_ptrace (0, 0, (PTRACE_TYPE_ARG3) 0, 0); } /* Stub function which causes the GDB that runs it, to start ptrace-ing @@ -328,7 +299,7 @@ ptrace_me (void) static void ptrace_him (int pid) { - push_target (&child_ops); + push_target (&deprecated_child_ops); /* On some targets, there must be some explicit synchronization between the parent and child processes after the debugger @@ -356,7 +327,8 @@ ptrace_him (int pid) ENV is the environment vector to pass. Errors reported with error(). */ static void -child_create_inferior (char *exec_file, char *allargs, char **env) +child_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { #ifdef HPUXHPPA fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, pre_fork_inferior, NULL); @@ -364,6 +336,7 @@ child_create_inferior (char *exec_file, char *allargs, char **env) fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, NULL, NULL); #endif /* We are at the first instruction we care about. */ + observer_notify_inferior_created (¤t_target, from_tty); /* Pedal to the metal... */ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0); } @@ -489,7 +462,7 @@ child_has_exited (int pid, int wait_status, int *exit_status) static void child_mourn_inferior (void) { - unpush_target (&child_ops); + unpush_target (&deprecated_child_ops); generic_mourn_inferior (); } @@ -567,7 +540,7 @@ child_xfer_partial (struct target_ops *ops, enum target_object object, return child_xfer_memory (offset, readbuf, len, 0/*write*/, NULL, ops); if (writebuf) - return child_xfer_memory (offset, readbuf, len, 1/*write*/, + return child_xfer_memory (offset, (void *) writebuf, len, 1/*write*/, NULL, ops); return -1; @@ -608,76 +581,57 @@ child_pid_to_str (ptid_t ptid) static void init_child_ops (void) { - child_ops.to_shortname = "child"; - child_ops.to_longname = "Unix child process"; - child_ops.to_doc = "Unix child process (started by the \"run\" command)."; - child_ops.to_open = child_open; - child_ops.to_attach = child_attach; - child_ops.to_post_attach = child_post_attach; - child_ops.to_detach = child_detach; - child_ops.to_resume = child_resume; - child_ops.to_wait = child_wait; - child_ops.to_post_wait = child_post_wait; - child_ops.to_fetch_registers = fetch_inferior_registers; - child_ops.to_store_registers = store_inferior_registers; - child_ops.to_prepare_to_store = child_prepare_to_store; - child_ops.to_xfer_memory = child_xfer_memory; - child_ops.to_xfer_partial = child_xfer_partial; - child_ops.to_files_info = child_files_info; - child_ops.to_insert_breakpoint = memory_insert_breakpoint; - child_ops.to_remove_breakpoint = memory_remove_breakpoint; - child_ops.to_terminal_init = terminal_init_inferior; - child_ops.to_terminal_inferior = terminal_inferior; - child_ops.to_terminal_ours_for_output = terminal_ours_for_output; - child_ops.to_terminal_save_ours = terminal_save_ours; - child_ops.to_terminal_ours = terminal_ours; - child_ops.to_terminal_info = child_terminal_info; - child_ops.to_kill = kill_inferior; - child_ops.to_create_inferior = child_create_inferior; - child_ops.to_post_startup_inferior = child_post_startup_inferior; - child_ops.to_acknowledge_created_inferior = child_acknowledge_created_inferior; - child_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint; - child_ops.to_remove_fork_catchpoint = child_remove_fork_catchpoint; - child_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint; - child_ops.to_remove_vfork_catchpoint = child_remove_vfork_catchpoint; - child_ops.to_follow_fork = child_follow_fork; - child_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint; - child_ops.to_remove_exec_catchpoint = child_remove_exec_catchpoint; - child_ops.to_reported_exec_events_per_exec_call = child_reported_exec_events_per_exec_call; - child_ops.to_has_exited = child_has_exited; - child_ops.to_mourn_inferior = child_mourn_inferior; - child_ops.to_can_run = child_can_run; - child_ops.to_thread_alive = child_thread_alive; - child_ops.to_pid_to_str = child_pid_to_str; - child_ops.to_stop = child_stop; - child_ops.to_enable_exception_callback = child_enable_exception_callback; - child_ops.to_get_current_exception_event = child_get_current_exception_event; - child_ops.to_pid_to_exec_file = child_pid_to_exec_file; - child_ops.to_stratum = process_stratum; - child_ops.to_has_all_memory = 1; - child_ops.to_has_memory = 1; - child_ops.to_has_stack = 1; - child_ops.to_has_registers = 1; - child_ops.to_has_execution = 1; - child_ops.to_magic = OPS_MAGIC; -} - -/* Take over the 'find_mapped_memory' vector from inftarg.c. */ -extern void -inftarg_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR, - unsigned long, - int, int, int, - void *), - void *)) -{ - child_ops.to_find_memory_regions = func; -} - -/* Take over the 'make_corefile_notes' vector from inftarg.c. */ -extern void -inftarg_set_make_corefile_notes (char * (*func) (bfd *, int *)) -{ - child_ops.to_make_corefile_notes = func; + deprecated_child_ops.to_shortname = "child"; + deprecated_child_ops.to_longname = "Unix child process"; + deprecated_child_ops.to_doc = "Unix child process (started by the \"run\" command)."; + deprecated_child_ops.to_open = child_open; + deprecated_child_ops.to_attach = child_attach; + deprecated_child_ops.to_post_attach = child_post_attach; + deprecated_child_ops.to_detach = child_detach; + deprecated_child_ops.to_resume = child_resume; + deprecated_child_ops.to_wait = child_wait; + deprecated_child_ops.to_fetch_registers = fetch_inferior_registers; + deprecated_child_ops.to_store_registers = store_inferior_registers; + deprecated_child_ops.to_prepare_to_store = child_prepare_to_store; + deprecated_child_ops.deprecated_xfer_memory = child_xfer_memory; + deprecated_child_ops.to_xfer_partial = child_xfer_partial; + deprecated_child_ops.to_files_info = child_files_info; + deprecated_child_ops.to_insert_breakpoint = memory_insert_breakpoint; + deprecated_child_ops.to_remove_breakpoint = memory_remove_breakpoint; + deprecated_child_ops.to_terminal_init = terminal_init_inferior; + deprecated_child_ops.to_terminal_inferior = terminal_inferior; + deprecated_child_ops.to_terminal_ours_for_output = terminal_ours_for_output; + deprecated_child_ops.to_terminal_save_ours = terminal_save_ours; + deprecated_child_ops.to_terminal_ours = terminal_ours; + deprecated_child_ops.to_terminal_info = child_terminal_info; + deprecated_child_ops.to_kill = kill_inferior; + deprecated_child_ops.to_create_inferior = child_create_inferior; + deprecated_child_ops.to_post_startup_inferior = child_post_startup_inferior; + deprecated_child_ops.to_acknowledge_created_inferior = child_acknowledge_created_inferior; + deprecated_child_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint; + deprecated_child_ops.to_remove_fork_catchpoint = child_remove_fork_catchpoint; + deprecated_child_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint; + deprecated_child_ops.to_remove_vfork_catchpoint = child_remove_vfork_catchpoint; + deprecated_child_ops.to_follow_fork = child_follow_fork; + deprecated_child_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint; + deprecated_child_ops.to_remove_exec_catchpoint = child_remove_exec_catchpoint; + deprecated_child_ops.to_reported_exec_events_per_exec_call = child_reported_exec_events_per_exec_call; + deprecated_child_ops.to_has_exited = child_has_exited; + deprecated_child_ops.to_mourn_inferior = child_mourn_inferior; + deprecated_child_ops.to_can_run = child_can_run; + deprecated_child_ops.to_thread_alive = child_thread_alive; + deprecated_child_ops.to_pid_to_str = child_pid_to_str; + deprecated_child_ops.to_stop = child_stop; + deprecated_child_ops.to_enable_exception_callback = child_enable_exception_callback; + deprecated_child_ops.to_get_current_exception_event = child_get_current_exception_event; + deprecated_child_ops.to_pid_to_exec_file = child_pid_to_exec_file; + deprecated_child_ops.to_stratum = process_stratum; + deprecated_child_ops.to_has_all_memory = 1; + deprecated_child_ops.to_has_memory = 1; + deprecated_child_ops.to_has_stack = 1; + deprecated_child_ops.to_has_registers = 1; + deprecated_child_ops.to_has_execution = 1; + deprecated_child_ops.to_magic = OPS_MAGIC; } void @@ -702,5 +656,5 @@ _initialize_inftarg (void) #endif init_child_ops (); - add_target (&child_ops); + add_target (&deprecated_child_ops); } diff --git a/gnu/usr.bin/binutils/gdb/irix5-nat.c b/gnu/usr.bin/binutils/gdb/irix5-nat.c index 93727a65289..5cf60555f04 100644 --- a/gnu/usr.bin/binutils/gdb/irix5-nat.c +++ b/gnu/usr.bin/binutils/gdb/irix5-nat.c @@ -1,6 +1,8 @@ /* Native support for the SGI Iris running IRIX version 5, for GDB. - Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, - 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + + Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, + 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin. Implemented for Irix 4.x by Garrett A. Wollman. @@ -56,23 +58,24 @@ supply_gregset (gregset_t *gregsetp) { int regi; greg_t *regp = &(*gregsetp)[0]; - int gregoff = sizeof (greg_t) - mips_regsize (current_gdbarch); + int gregoff = sizeof (greg_t) - mips_isa_regsize (current_gdbarch); static char zerobuf[32] = {0}; for (regi = 0; regi <= CTX_RA; regi++) - supply_register (regi, (char *) (regp + regi) + gregoff); - - supply_register (mips_regnum (current_gdbarch)->pc, - (char *) (regp + CTX_EPC) + gregoff); - supply_register (mips_regnum (current_gdbarch)->hi, - (char *) (regp + CTX_MDHI) + gregoff); - supply_register (mips_regnum (current_gdbarch)->lo, - (char *) (regp + CTX_MDLO) + gregoff); - supply_register (mips_regnum (current_gdbarch)->cause, - (char *) (regp + CTX_CAUSE) + gregoff); + regcache_raw_supply (current_regcache, regi, + (char *) (regp + regi) + gregoff); + + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->pc, + (char *) (regp + CTX_EPC) + gregoff); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->hi, + (char *) (regp + CTX_MDHI) + gregoff); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->lo, + (char *) (regp + CTX_MDLO) + gregoff); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->cause, + (char *) (regp + CTX_CAUSE) + gregoff); /* Fill inaccessible registers with zero. */ - supply_register (mips_regnum (current_gdbarch)->badvaddr, zerobuf); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->badvaddr, zerobuf); } void @@ -89,28 +92,28 @@ fill_gregset (gregset_t *gregsetp, int regno) if ((regno == -1) || (regno == regi)) *(regp + regi) = extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)], - DEPRECATED_REGISTER_RAW_SIZE (regi)); + register_size (current_gdbarch, regi)); if ((regno == -1) || (regno == PC_REGNUM)) *(regp + CTX_EPC) = extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], - DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->pc)); + register_size (current_gdbarch, mips_regnum (current_gdbarch)->pc)); if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->cause)) *(regp + CTX_CAUSE) = extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->cause)], - DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->cause)); + register_size (current_gdbarch, mips_regnum (current_gdbarch)->cause)); if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->hi)) *(regp + CTX_MDHI) = extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], - DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->hi)); + register_size (current_gdbarch, mips_regnum (current_gdbarch)->hi)); if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->lo)) *(regp + CTX_MDLO) = extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], - DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->lo)); + register_size (current_gdbarch, mips_regnum (current_gdbarch)->lo)); } /* @@ -130,15 +133,17 @@ supply_fpregset (fpregset_t *fpregsetp) /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */ for (regi = 0; regi < 32; regi++) - supply_register (FP0_REGNUM + regi, - (char *) &fpregsetp->fp_r.fp_regs[regi]); + regcache_raw_supply (current_regcache, FP0_REGNUM + regi, + (char *) &fpregsetp->fp_r.fp_regs[regi]); - supply_register (mips_regnum (current_gdbarch)->fp_control_status, - (char *) &fpregsetp->fp_csr); + regcache_raw_supply (current_regcache, + mips_regnum (current_gdbarch)->fp_control_status, + (char *) &fpregsetp->fp_csr); /* FIXME: how can we supply FCRIR? SGI doesn't tell us. */ - supply_register (mips_regnum (current_gdbarch)->fp_implementation_revision, - zerobuf); + regcache_raw_supply (current_regcache, + mips_regnum (current_gdbarch)->fp_implementation_revision, + zerobuf); } void @@ -155,7 +160,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) { from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)]; to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]); - memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi)); + memcpy (to, from, register_size (current_gdbarch, regi)); } } @@ -205,12 +210,12 @@ static void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, CORE_ADDR reg_addr) { - if (core_reg_size == DEPRECATED_REGISTER_BYTES) + if (core_reg_size == deprecated_register_bytes ()) { memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size); } - else if (mips_regsize (current_gdbarch) == 4 && - core_reg_size == (2 * mips_regsize (current_gdbarch)) * NUM_REGS) + else if (mips_isa_regsize (current_gdbarch) == 4 && + core_reg_size == (2 * mips_isa_regsize (current_gdbarch)) * NUM_REGS) { /* This is a core file from a N32 executable, 64 bits are saved for all registers. */ @@ -228,7 +233,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, *dstp++ = *srcp++; *dstp++ = *srcp++; *dstp++ = *srcp++; - if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 4) + if (register_size (current_gdbarch, regno) == 4) { /* copying 4 bytes from eight bytes? I don't see how this can be right... */ @@ -277,5 +282,5 @@ static struct core_fns irix5_core_fns = void _initialize_core_irix5 (void) { - add_core_fns (&irix5_core_fns); + deprecated_add_core_fns (&irix5_core_fns); } diff --git a/gnu/usr.bin/binutils/gdb/language.c b/gnu/usr.bin/binutils/gdb/language.c index bc00b473a6c..cdf35ea6bb6 100644 --- a/gnu/usr.bin/binutils/gdb/language.c +++ b/gnu/usr.bin/binutils/gdb/language.c @@ -578,131 +578,6 @@ binop_result_type (struct value *v1, struct value *v2) } #endif /* 0 */ - - -/* This page contains functions that return format strings for - printf for printing out numbers in different formats */ - -/* Returns the appropriate printf format for hexadecimal - numbers. */ -char * -local_hex_format_custom (char *pre) -{ - static char form[50]; - - strcpy (form, local_hex_format_prefix ()); - strcat (form, "%"); - strcat (form, pre); - strcat (form, local_hex_format_specifier ()); - strcat (form, local_hex_format_suffix ()); - return form; -} - -/* Converts a LONGEST to custom hexadecimal and stores it in a static - string. Returns a pointer to this string. */ -char * -local_hex_string (LONGEST num) -{ - return local_hex_string_custom (num, "l"); -} - -/* Converts a LONGEST number to custom hexadecimal and stores it in a static - string. Returns a pointer to this string. Note that the width parameter - should end with "l", e.g. "08l" as with calls to local_hex_string_custom */ - -char * -local_hex_string_custom (LONGEST num, char *width) -{ -#define RESULT_BUF_LEN 50 - static char res2[RESULT_BUF_LEN]; - char format[RESULT_BUF_LEN]; - int field_width; - int num_len; - int num_pad_chars; - char *pad_char; /* string with one character */ - int pad_on_left; - char *parse_ptr; - char temp_nbr_buf[RESULT_BUF_LEN]; - - /* Use phex_nz to print the number into a string, then - build the result string from local_hex_format_prefix, padding and - the hex representation as indicated by "width". */ - strcpy (temp_nbr_buf, phex_nz (num, sizeof (num))); - /* parse width */ - parse_ptr = width; - pad_on_left = 1; - pad_char = " "; - if (*parse_ptr == '-') - { - parse_ptr++; - pad_on_left = 0; - } - if (*parse_ptr == '0') - { - parse_ptr++; - if (pad_on_left) - pad_char = "0"; /* If padding is on the right, it is blank */ - } - field_width = atoi (parse_ptr); - num_len = strlen (temp_nbr_buf); - num_pad_chars = field_width - strlen (temp_nbr_buf); /* possibly negative */ - - if (strlen (local_hex_format_prefix ()) + num_len + num_pad_chars - >= RESULT_BUF_LEN) /* paranoia */ - internal_error (__FILE__, __LINE__, - "local_hex_string_custom: insufficient space to store result"); - - strcpy (res2, local_hex_format_prefix ()); - if (pad_on_left) - { - while (num_pad_chars > 0) - { - strcat (res2, pad_char); - num_pad_chars--; - } - } - strcat (res2, temp_nbr_buf); - if (!pad_on_left) - { - while (num_pad_chars > 0) - { - strcat (res2, pad_char); - num_pad_chars--; - } - } - return res2; - -} /* local_hex_string_custom */ - -/* Returns the appropriate printf format for octal - numbers. */ -char * -local_octal_format_custom (char *pre) -{ - static char form[50]; - - strcpy (form, local_octal_format_prefix ()); - strcat (form, "%"); - strcat (form, pre); - strcat (form, local_octal_format_specifier ()); - strcat (form, local_octal_format_suffix ()); - return form; -} - -/* Returns the appropriate printf format for decimal numbers. */ -char * -local_decimal_format_custom (char *pre) -{ - static char form[50]; - - strcpy (form, local_decimal_format_prefix ()); - strcat (form, "%"); - strcat (form, pre); - strcat (form, local_decimal_format_specifier ()); - strcat (form, local_decimal_format_suffix ()); - return form; -} - #if 0 /* This page contains functions that are used in type/range checking. They all return zero if the type/range check fails. @@ -1176,6 +1051,16 @@ language_demangle (const struct language_defn *current_language, return NULL; } +/* Return class name from physname or NULL. */ +char * +language_class_name_from_physname (const struct language_defn *current_language, + const char *physname) +{ + if (current_language != NULL && current_language->la_class_name_from_physname) + return current_language->la_class_name_from_physname (physname); + return NULL; +} + /* Return the default string containing the list of characters delimiting words. This is a reasonable default value that most languages should be able to use. */ @@ -1258,27 +1143,38 @@ static char *unk_lang_demangle (const char *mangled, int options) return cplus_demangle (mangled, options); } - -static struct type **const (unknown_builtin_types[]) = +static char *unk_lang_class_name (const char *mangled) { - 0 -}; + return NULL; +} + static const struct op_print unk_op_print_tab[] = { {NULL, OP_NULL, PREC_NULL, 0} }; +static void +unknown_language_arch_info (struct gdbarch *gdbarch, + struct language_arch_info *lai) +{ + lai->string_char_type = builtin_type (gdbarch)->builtin_char; + lai->primitive_type_vector = GDBARCH_OBSTACK_CALLOC (gdbarch, 1, + struct type *); +} + const struct language_defn unknown_language_defn = { "unknown", language_unknown, - &unknown_builtin_types[0], + NULL, range_check_off, type_check_off, + array_row_major, case_sensitive_on, &exp_descriptor_standard, unk_lang_parser, unk_lang_error, + null_post_parser, unk_lang_printchar, /* Print character constant */ unk_lang_printstr, unk_lang_emit_char, @@ -1291,15 +1187,13 @@ const struct language_defn unknown_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ unk_lang_demangle, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + unk_lang_class_name, /* Language specific class_name_from_physname */ unk_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, + unknown_language_arch_info, /* la_language_arch_info. */ LANG_MAGIC }; @@ -1308,13 +1202,15 @@ const struct language_defn auto_language_defn = { "auto", language_auto, - &unknown_builtin_types[0], + NULL, range_check_off, type_check_off, + array_row_major, case_sensitive_on, &exp_descriptor_standard, unk_lang_parser, unk_lang_error, + null_post_parser, unk_lang_printchar, /* Print character constant */ unk_lang_printstr, unk_lang_emit_char, @@ -1327,15 +1223,13 @@ const struct language_defn auto_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ unk_lang_demangle, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + unk_lang_class_name, /* Language specific class_name_from_physname */ unk_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, + unknown_language_arch_info, /* la_language_arch_info. */ LANG_MAGIC }; @@ -1343,13 +1237,15 @@ const struct language_defn local_language_defn = { "local", language_auto, - &unknown_builtin_types[0], + NULL, range_check_off, type_check_off, case_sensitive_on, + array_row_major, &exp_descriptor_standard, unk_lang_parser, unk_lang_error, + null_post_parser, unk_lang_printchar, /* Print character constant */ unk_lang_printstr, unk_lang_emit_char, @@ -1362,18 +1258,86 @@ const struct language_defn local_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ unk_lang_demangle, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"0%lo", "0", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0x%lx", "0x", "x", ""}, /* Hex format info */ + unk_lang_class_name, /* Language specific class_name_from_physname */ unk_op_print_tab, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, + unknown_language_arch_info, /* la_language_arch_info. */ LANG_MAGIC }; +/* Per-architecture language information. */ + +static struct gdbarch_data *language_gdbarch_data; + +struct language_gdbarch +{ + /* A vector of per-language per-architecture info. Indexed by "enum + language". */ + struct language_arch_info arch_info[nr_languages]; +}; + +static void * +language_gdbarch_post_init (struct gdbarch *gdbarch) +{ + struct language_gdbarch *l; + int i; + + l = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct language_gdbarch); + for (i = 0; i < languages_size; i++) + { + if (languages[i] != NULL + && languages[i]->la_language_arch_info != NULL) + languages[i]->la_language_arch_info + (gdbarch, l->arch_info + languages[i]->la_language); + } + return l; +} + +struct type * +language_string_char_type (const struct language_defn *la, + struct gdbarch *gdbarch) +{ + struct language_gdbarch *ld = gdbarch_data (gdbarch, + language_gdbarch_data); + if (ld->arch_info[la->la_language].string_char_type != NULL) + return ld->arch_info[la->la_language].string_char_type; + else + return (*la->string_char_type); +} + +struct type * +language_lookup_primitive_type_by_name (const struct language_defn *la, + struct gdbarch *gdbarch, + const char *name) +{ + struct language_gdbarch *ld = gdbarch_data (gdbarch, + language_gdbarch_data); + if (ld->arch_info[la->la_language].primitive_type_vector != NULL) + { + struct type *const *p; + for (p = ld->arch_info[la->la_language].primitive_type_vector; + (*p) != NULL; + p++) + { + if (strcmp (TYPE_NAME (*p), name) == 0) + return (*p); + } + } + else + { + struct type **const *p; + for (p = current_language->la_builtin_type_vector; *p != NULL; p++) + { + if (strcmp (TYPE_NAME (**p), name) == 0) + return (**p); + } + } + return (NULL); +} + /* Initialize the language routines */ void @@ -1381,13 +1345,16 @@ _initialize_language (void) { struct cmd_list_element *set, *show; + language_gdbarch_data + = gdbarch_data_register_post_init (language_gdbarch_post_init); + /* GDB commands for language specific stuff */ set = add_set_cmd ("language", class_support, var_string_noescape, (char *) &language, "Set the current source language.", &setlist); - show = add_show_from_set (set, &showlist); + show = deprecated_add_show_from_set (set, &showlist); set_cmd_cfunc (set, set_language_command); set_cmd_cfunc (show, show_language_command); @@ -1407,7 +1374,7 @@ _initialize_language (void) (char *) &type, "Set type checking. (on/warn/off/auto)", &setchecklist); - show = add_show_from_set (set, &showchecklist); + show = deprecated_add_show_from_set (set, &showchecklist); set_cmd_cfunc (set, set_type_command); set_cmd_cfunc (show, show_type_command); @@ -1415,7 +1382,7 @@ _initialize_language (void) (char *) &range, "Set range checking. (on/warn/off/auto)", &setchecklist); - show = add_show_from_set (set, &showchecklist); + show = deprecated_add_show_from_set (set, &showchecklist); set_cmd_cfunc (set, set_range_command); set_cmd_cfunc (show, show_range_command); @@ -1424,7 +1391,7 @@ _initialize_language (void) "Set case sensitivity in name search. (on/off/auto)\n\ For Fortran the default is off; for other languages the default is on.", &setlist); - show = add_show_from_set (set, &showlist); + show = deprecated_add_show_from_set (set, &showlist); set_cmd_cfunc (set, set_case_command); set_cmd_cfunc (show, show_case_command); diff --git a/gnu/usr.bin/binutils/gdb/language.h b/gnu/usr.bin/binutils/gdb/language.h index 8ed9fb08417..1a54f05f29e 100644 --- a/gnu/usr.bin/binutils/gdb/language.h +++ b/gnu/usr.bin/binutils/gdb/language.h @@ -96,6 +96,17 @@ extern enum case_mode } case_mode; +/* array_ordering == + array_row_major: Arrays are in row major order + array_column_major: Arrays are in column major order.*/ + +extern enum array_ordering + { + array_row_major, array_column_major + } +array_ordering; + + /* case_sensitivity == case_sensitive_on: Case sensitivity in name matching is used case_sensitive_off: Case sensitivity in name matching is not used */ @@ -106,36 +117,25 @@ extern enum case_sensitivity } case_sensitivity; -/* Information for doing language dependent formatting of printed values. */ - -struct language_format_info - { - /* The format that can be passed directly to standard C printf functions - to generate a completely formatted value in the format appropriate for - the language. */ - - char *la_format; - - /* The prefix to be used when directly printing a value, or constructing - a standard C printf format. This generally is everything up to the - conversion specification (the part introduced by the '%' character - and terminated by the conversion specifier character). */ - - char *la_format_prefix; - - /* The conversion specifier. This is generally everything after the - field width and precision, typically only a single character such - as 'o' for octal format or 'x' for hexadecimal format. */ - - char *la_format_specifier; - - /* The suffix to be used when directly printing a value, or constructing - a standard C printf format. This generally is everything after the - conversion specification (the part introduced by the '%' character - and terminated by the conversion specifier character). */ - - char *la_format_suffix; /* Suffix for custom format string */ - }; +/* Per architecture (OS/ABI) language information. */ + +struct language_arch_info +{ + /* Its primitive types. This is a vector ended by a NULL pointer. + These types can be specified by name in parsing types in + expressions, regardless of whether the program being debugged + actually defines such a type. */ + struct type **primitive_type_vector; + /* Type of elements of strings. */ + struct type *string_char_type; +}; + +struct type *language_string_char_type (const struct language_defn *l, + struct gdbarch *gdbarch); + +struct type *language_lookup_primitive_type_by_name (const struct language_defn *l, + struct gdbarch *gdbarch, + const char *name); /* Structure tying together assorted information about a language. */ @@ -167,6 +167,9 @@ struct language_defn /* Default case sensitivity */ enum case_sensitivity la_case_sensitivity; + /* Multi-dimensional array ordering */ + enum array_ordering la_array_ordering; + /* Definitions related to expression printing, prefixifying, and dumping */ @@ -180,6 +183,14 @@ struct language_defn void (*la_error) (char *); + /* Given an expression *EXPP created by prefixifying the result of + la_parser, perform any remaining processing necessary to complete + its translation. *EXPP may change; la_post_parser is responsible + for releasing its previous contents, if necessary. If + VOID_CONTEXT_P, then no value is expected from the expression. */ + + void (*la_post_parser) (struct expression ** expp, int void_context_p); + void (*la_printchar) (int ch, struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, char *string, @@ -239,21 +250,8 @@ struct language_defn /* Return demangled language symbol, or NULL. */ char *(*la_demangle) (const char *mangled, int options); - /* Base 2 (binary) formats. */ - - struct language_format_info la_binary_format; - - /* Base 8 (octal) formats. */ - - struct language_format_info la_octal_format; - - /* Base 10 (decimal) formats */ - - struct language_format_info la_decimal_format; - - /* Base 16 (hexadecimal) formats */ - - struct language_format_info la_hex_format; + /* Return class name of a mangled method name or NULL. */ + char *(*la_class_name_from_physname) (const char *physname); /* Table for printing expressions */ @@ -273,6 +271,10 @@ struct language_defn /* The list of characters forming word boundaries. */ char *(*la_word_break_characters) (void); + /* The per-architecture (OS/ABI) language information. */ + void (*la_language_arch_info) (struct gdbarch *, + struct language_arch_info *); + /* Add fields above this point, so the magic number is always last. */ /* Magic number for compat checking */ @@ -353,47 +355,6 @@ extern enum language set_language (enum language); #define LA_VALUE_PRINT(val,stream,fmt,pretty) \ (current_language->la_value_print(val,stream,fmt,pretty)) -/* Return a format string for printf that will print a number in one of - the local (language-specific) formats. Result is static and is - overwritten by the next call. Takes printf options like "08" or "l" - (to produce e.g. %08x or %lx). */ - -#define local_binary_format() \ - (current_language->la_binary_format.la_format) -#define local_binary_format_prefix() \ - (current_language->la_binary_format.la_format_prefix) -#define local_binary_format_specifier() \ - (current_language->la_binary_format.la_format_specifier) -#define local_binary_format_suffix() \ - (current_language->la_binary_format.la_format_suffix) - -#define local_octal_format() \ - (current_language->la_octal_format.la_format) -#define local_octal_format_prefix() \ - (current_language->la_octal_format.la_format_prefix) -#define local_octal_format_specifier() \ - (current_language->la_octal_format.la_format_specifier) -#define local_octal_format_suffix() \ - (current_language->la_octal_format.la_format_suffix) - -#define local_decimal_format() \ - (current_language->la_decimal_format.la_format) -#define local_decimal_format_prefix() \ - (current_language->la_decimal_format.la_format_prefix) -#define local_decimal_format_specifier() \ - (current_language->la_decimal_format.la_format_specifier) -#define local_decimal_format_suffix() \ - (current_language->la_decimal_format.la_format_suffix) - -#define local_hex_format() \ - (current_language->la_hex_format.la_format) -#define local_hex_format_prefix() \ - (current_language->la_hex_format.la_format_prefix) -#define local_hex_format_specifier() \ - (current_language->la_hex_format.la_format_specifier) -#define local_hex_format_suffix() \ - (current_language->la_hex_format.la_format_suffix) - #define LA_PRINT_CHAR(ch, stream) \ (current_language->la_printchar(ch, stream)) #define LA_PRINT_STRING(stream, string, length, width, force_ellipses) \ @@ -412,17 +373,6 @@ extern enum language set_language (enum language); && ((c) < 0x7F || (c) >= 0xA0) \ && (!sevenbit_strings || (c) < 0x80)) -/* Return a format string for printf that will print a number in one of - the local (language-specific) formats. Result is static and is - overwritten by the next call. Takes printf options like "08" or "l" - (to produce e.g. %08x or %lx). */ - -extern char *local_decimal_format_custom (char *); /* language.c */ - -extern char *local_octal_format_custom (char *); /* language.c */ - -extern char *local_hex_format_custom (char *); /* language.c */ - #if 0 /* FIXME: cagney/2000-03-04: This function does not appear to be used. It can be deleted once 5.0 has been released. */ @@ -432,14 +382,6 @@ extern char *local_hex_format_custom (char *); /* language.c */ extern char *longest_raw_hex_string (LONGEST); #endif -/* Return a string that contains a number formatted in one of the local - (language-specific) formats. Result is static and is overwritten by - the next call. Takes printf options like "08l" or "l". */ - -extern char *local_hex_string (LONGEST); /* language.c */ - -extern char *local_hex_string_custom (LONGEST, char *); /* language.c */ - /* Type predicates */ extern int simple_type (struct type *); @@ -508,6 +450,10 @@ extern CORE_ADDR skip_language_trampoline (CORE_ADDR pc); extern char *language_demangle (const struct language_defn *current_language, const char *mangled, int options); +/* Return class name from physname, or NULL. */ +extern char *language_class_name_from_physname (const struct language_defn *, + const char *physname); + /* Splitting strings into words. */ extern char *default_word_break_characters (void); diff --git a/gnu/usr.bin/binutils/gdb/lin-lwp.c b/gnu/usr.bin/binutils/gdb/lin-lwp.c deleted file mode 100644 index df91aa76963..00000000000 --- a/gnu/usr.bin/binutils/gdb/lin-lwp.c +++ /dev/null @@ -1,1882 +0,0 @@ -/* Multi-threaded debugging support for GNU/Linux (LWP layer). - Copyright 2000, 2001, 2002, 2003 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 "gdb_assert.h" -#include "gdb_string.h" -#include <errno.h> -#include <signal.h> -#ifdef HAVE_TKILL_SYSCALL -#include <unistd.h> -#include <sys/syscall.h> -#endif -#include <sys/ptrace.h> -#include "gdb_wait.h" - -#include "gdbthread.h" -#include "inferior.h" -#include "target.h" -#include "regcache.h" -#include "gdbcmd.h" - -static int debug_lin_lwp; -extern char *strsignal (int sig); - -#include "linux-nat.h" - -/* On GNU/Linux there are no real LWP's. The closest thing to LWP's - are processes sharing the same VM space. A multi-threaded process - is basically a group of such processes. However, such a grouping - is almost entirely a user-space issue; the kernel doesn't enforce - such a grouping at all (this might change in the future). In - general, we'll rely on the threads library (i.e. the GNU/Linux - Threads library) to provide such a grouping. - - It is perfectly well possible to write a multi-threaded application - without the assistance of a threads library, by using the clone - system call directly. This module should be able to give some - rudimentary support for debugging such applications if developers - specify the CLONE_PTRACE flag in the clone system call, and are - using the Linux kernel 2.4 or above. - - Note that there are some peculiarities in GNU/Linux that affect - this code: - - - In general one should specify the __WCLONE flag to waitpid in - order to make it report events for any of the cloned processes - (and leave it out for the initial process). However, if a cloned - process has exited the exit status is only reported if the - __WCLONE flag is absent. Linux kernel 2.4 has a __WALL flag, but - we cannot use it since GDB must work on older systems too. - - - When a traced, cloned process exits and is waited for by the - debugger, the kernel reassigns it to the original parent and - keeps it around as a "zombie". Somehow, the GNU/Linux Threads - library doesn't notice this, which leads to the "zombie problem": - When debugged a multi-threaded process that spawns a lot of - threads will run out of processes, even if the threads exit, - because the "zombies" stay around. */ - -/* List of known LWPs. */ -static struct lwp_info *lwp_list; - -/* Number of LWPs in the list. */ -static int num_lwps; - -/* Non-zero if we're running in "threaded" mode. */ -static int threaded; - - -#define GET_LWP(ptid) ptid_get_lwp (ptid) -#define GET_PID(ptid) ptid_get_pid (ptid) -#define is_lwp(ptid) (GET_LWP (ptid) != 0) -#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) - -/* If the last reported event was a SIGTRAP, this variable is set to - the process id of the LWP/thread that got it. */ -ptid_t trap_ptid; - - -/* This module's target-specific operations. */ -static struct target_ops lin_lwp_ops; - -/* The standard child operations. */ -extern struct target_ops child_ops; - -/* Since we cannot wait (in lin_lwp_wait) for the initial process and - any cloned processes with a single call to waitpid, we have to use - the WNOHANG flag and call waitpid in a loop. To optimize - things a bit we use `sigsuspend' to wake us up when a process has - something to report (it will send us a SIGCHLD if it has). To make - this work we have to juggle with the signal mask. We save the - original signal mask such that we can restore it before creating a - new process in order to avoid blocking certain signals in the - inferior. We then block SIGCHLD during the waitpid/sigsuspend - loop. */ - -/* Original signal mask. */ -static sigset_t normal_mask; - -/* Signal mask for use with sigsuspend in lin_lwp_wait, initialized in - _initialize_lin_lwp. */ -static sigset_t suspend_mask; - -/* Signals to block to make that sigsuspend work. */ -static sigset_t blocked_mask; - - -/* Prototypes for local functions. */ -static int stop_wait_callback (struct lwp_info *lp, void *data); -static int lin_lwp_thread_alive (ptid_t ptid); - -/* Convert wait status STATUS to a string. Used for printing debug - messages only. */ - -static char * -status_to_str (int status) -{ - static char buf[64]; - - if (WIFSTOPPED (status)) - snprintf (buf, sizeof (buf), "%s (stopped)", - strsignal (WSTOPSIG (status))); - else if (WIFSIGNALED (status)) - snprintf (buf, sizeof (buf), "%s (terminated)", - strsignal (WSTOPSIG (status))); - else - snprintf (buf, sizeof (buf), "%d (exited)", WEXITSTATUS (status)); - - return buf; -} - -/* Initialize the list of LWPs. Note that this module, contrary to - what GDB's generic threads layer does for its thread list, - re-initializes the LWP lists whenever we mourn or detach (which - doesn't involve mourning) the inferior. */ - -static void -init_lwp_list (void) -{ - struct lwp_info *lp, *lpnext; - - for (lp = lwp_list; lp; lp = lpnext) - { - lpnext = lp->next; - xfree (lp); - } - - lwp_list = NULL; - num_lwps = 0; - threaded = 0; -} - -/* Add the LWP specified by PID to the list. If this causes the - number of LWPs to become larger than one, go into "threaded" mode. - Return a pointer to the structure describing the new LWP. */ - -static struct lwp_info * -add_lwp (ptid_t ptid) -{ - struct lwp_info *lp; - - gdb_assert (is_lwp (ptid)); - - lp = (struct lwp_info *) xmalloc (sizeof (struct lwp_info)); - - memset (lp, 0, sizeof (struct lwp_info)); - - lp->ptid = ptid; - - lp->next = lwp_list; - lwp_list = lp; - if (++num_lwps > 1) - threaded = 1; - - return lp; -} - -/* Remove the LWP specified by PID from the list. */ - -static void -delete_lwp (ptid_t ptid) -{ - struct lwp_info *lp, *lpprev; - - lpprev = NULL; - - for (lp = lwp_list; lp; lpprev = lp, lp = lp->next) - if (ptid_equal (lp->ptid, ptid)) - break; - - if (!lp) - return; - - /* We don't go back to "non-threaded" mode if the number of threads - becomes less than two. */ - num_lwps--; - - if (lpprev) - lpprev->next = lp->next; - else - lwp_list = lp->next; - - xfree (lp); -} - -/* Return a pointer to the structure describing the LWP corresponding - to PID. If no corresponding LWP could be found, return NULL. */ - -static struct lwp_info * -find_lwp_pid (ptid_t ptid) -{ - struct lwp_info *lp; - int lwp; - - if (is_lwp (ptid)) - lwp = GET_LWP (ptid); - else - lwp = GET_PID (ptid); - - for (lp = lwp_list; lp; lp = lp->next) - if (lwp == GET_LWP (lp->ptid)) - return lp; - - return NULL; -} - -/* Call CALLBACK with its second argument set to DATA for every LWP in - the list. If CALLBACK returns 1 for a particular LWP, return a - pointer to the structure describing that LWP immediately. - Otherwise return NULL. */ - -struct lwp_info * -iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data) -{ - struct lwp_info *lp, *lpnext; - - for (lp = lwp_list; lp; lp = lpnext) - { - lpnext = lp->next; - if ((*callback) (lp, data)) - return lp; - } - - return NULL; -} - - -#if 0 -static void -lin_lwp_open (char *args, int from_tty) -{ - push_target (&lin_lwp_ops); -} -#endif - -/* Attach to the LWP specified by PID. If VERBOSE is non-zero, print - a message telling the user that a new LWP has been added to the - process. */ - -void -lin_lwp_attach_lwp (ptid_t ptid, int verbose) -{ - struct lwp_info *lp; - - gdb_assert (is_lwp (ptid)); - - /* Make sure SIGCHLD is blocked. We don't want SIGCHLD events - to interrupt either the ptrace() or waitpid() calls below. */ - if (!sigismember (&blocked_mask, SIGCHLD)) - { - sigaddset (&blocked_mask, SIGCHLD); - sigprocmask (SIG_BLOCK, &blocked_mask, NULL); - } - - if (verbose) - printf_filtered ("[New %s]\n", target_pid_to_str (ptid)); - - lp = find_lwp_pid (ptid); - if (lp == NULL) - lp = add_lwp (ptid); - - /* We assume that we're already attached to any LWP that has an - id equal to the overall process id. */ - if (GET_LWP (ptid) != GET_PID (ptid)) - { - pid_t pid; - int status; - - if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0) - error ("Can't attach %s: %s", target_pid_to_str (ptid), - safe_strerror (errno)); - - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n", - target_pid_to_str (ptid)); - - pid = waitpid (GET_LWP (ptid), &status, 0); - if (pid == -1 && errno == ECHILD) - { - /* Try again with __WCLONE to check cloned processes. */ - pid = waitpid (GET_LWP (ptid), &status, __WCLONE); - lp->cloned = 1; - } - - gdb_assert (pid == GET_LWP (ptid) - && WIFSTOPPED (status) && WSTOPSIG (status)); - - child_post_attach (pid); - - lp->stopped = 1; - - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "LLAL: waitpid %s received %s\n", - target_pid_to_str (ptid), - status_to_str (status)); - } - } - else - { - /* We assume that the LWP representing the original process - is already stopped. Mark it as stopped in the data structure - that the lin-lwp layer uses to keep track of threads. Note - that this won't have already been done since the main thread - will have, we assume, been stopped by an attach from a - different layer. */ - lp->stopped = 1; - } -} - -static void -lin_lwp_attach (char *args, int from_tty) -{ - struct lwp_info *lp; - pid_t pid; - int status; - - /* FIXME: We should probably accept a list of process id's, and - attach all of them. */ - child_ops.to_attach (args, from_tty); - - /* Add the initial process as the first LWP to the list. */ - lp = add_lwp (BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid))); - - /* Make sure the initial process is stopped. The user-level threads - layer might want to poke around in the inferior, and that won't - work if things haven't stabilized yet. */ - pid = waitpid (GET_PID (inferior_ptid), &status, 0); - if (pid == -1 && errno == ECHILD) - { - warning ("%s is a cloned process", target_pid_to_str (inferior_ptid)); - - /* Try again with __WCLONE to check cloned processes. */ - pid = waitpid (GET_PID (inferior_ptid), &status, __WCLONE); - lp->cloned = 1; - } - - gdb_assert (pid == GET_PID (inferior_ptid) - && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP); - - lp->stopped = 1; - - /* Fake the SIGSTOP that core GDB expects. */ - lp->status = W_STOPCODE (SIGSTOP); - lp->resumed = 1; - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "LLA: waitpid %ld, faking SIGSTOP\n", (long) pid); - } -} - -static int -detach_callback (struct lwp_info *lp, void *data) -{ - gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status)); - - if (debug_lin_lwp && lp->status) - fprintf_unfiltered (gdb_stdlog, "DC: Pending %s for %s on detach.\n", - strsignal (WSTOPSIG (lp->status)), - target_pid_to_str (lp->ptid)); - - while (lp->signalled && lp->stopped) - { - errno = 0; - if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, - WSTOPSIG (lp->status)) < 0) - error ("Can't continue %s: %s", target_pid_to_str (lp->ptid), - safe_strerror (errno)); - - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "DC: PTRACE_CONTINUE (%s, 0, %s) (OK)\n", - target_pid_to_str (lp->ptid), - status_to_str (lp->status)); - - lp->stopped = 0; - lp->signalled = 0; - lp->status = 0; - /* FIXME drow/2003-08-26: There was a call to stop_wait_callback - here. But since lp->signalled was cleared above, - stop_wait_callback didn't do anything; the process was left - running. Shouldn't we be waiting for it to stop? - I've removed the call, since stop_wait_callback now does do - something when called with lp->signalled == 0. */ - - gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status)); - } - - /* We don't actually detach from the LWP that has an id equal to the - overall process id just yet. */ - if (GET_LWP (lp->ptid) != GET_PID (lp->ptid)) - { - errno = 0; - if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0, - WSTOPSIG (lp->status)) < 0) - error ("Can't detach %s: %s", target_pid_to_str (lp->ptid), - safe_strerror (errno)); - - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "PTRACE_DETACH (%s, %s, 0) (OK)\n", - target_pid_to_str (lp->ptid), - strsignal (WSTOPSIG (lp->status))); - - delete_lwp (lp->ptid); - } - - return 0; -} - -static void -lin_lwp_detach (char *args, int from_tty) -{ - iterate_over_lwps (detach_callback, NULL); - - /* Only the initial process should be left right now. */ - gdb_assert (num_lwps == 1); - - trap_ptid = null_ptid; - - /* Destroy LWP info; it's no longer valid. */ - init_lwp_list (); - - /* Restore the original signal mask. */ - sigprocmask (SIG_SETMASK, &normal_mask, NULL); - sigemptyset (&blocked_mask); - - inferior_ptid = pid_to_ptid (GET_PID (inferior_ptid)); - child_ops.to_detach (args, from_tty); -} - - -/* Resume LP. */ - -static int -resume_callback (struct lwp_info *lp, void *data) -{ - if (lp->stopped && lp->status == 0) - { - struct thread_info *tp; - - child_resume (pid_to_ptid (GET_LWP (lp->ptid)), 0, TARGET_SIGNAL_0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "RC: PTRACE_CONT %s, 0, 0 (resume sibling)\n", - target_pid_to_str (lp->ptid)); - lp->stopped = 0; - lp->step = 0; - } - - return 0; -} - -static int -resume_clear_callback (struct lwp_info *lp, void *data) -{ - lp->resumed = 0; - return 0; -} - -static int -resume_set_callback (struct lwp_info *lp, void *data) -{ - lp->resumed = 1; - return 0; -} - -static void -lin_lwp_resume (ptid_t ptid, int step, enum target_signal signo) -{ - struct lwp_info *lp; - int resume_all; - - /* A specific PTID means `step only this process id'. */ - resume_all = (PIDGET (ptid) == -1); - - if (resume_all) - iterate_over_lwps (resume_set_callback, NULL); - else - iterate_over_lwps (resume_clear_callback, NULL); - - /* If PID is -1, it's the current inferior that should be - handled specially. */ - if (PIDGET (ptid) == -1) - ptid = inferior_ptid; - - lp = find_lwp_pid (ptid); - if (lp) - { - ptid = pid_to_ptid (GET_LWP (lp->ptid)); - - /* Remember if we're stepping. */ - lp->step = step; - - /* Mark this LWP as resumed. */ - lp->resumed = 1; - - /* If we have a pending wait status for this thread, there is no - point in resuming the process. */ - if (lp->status) - { - /* FIXME: What should we do if we are supposed to continue - this thread with a signal? */ - gdb_assert (signo == TARGET_SIGNAL_0); - return; - } - - /* Mark LWP as not stopped to prevent it from being continued by - resume_callback. */ - lp->stopped = 0; - } - - if (resume_all) - iterate_over_lwps (resume_callback, NULL); - - child_resume (ptid, step, signo); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLR: %s %s, %s (resume event thread)\n", - step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT", - target_pid_to_str (ptid), - signo ? strsignal (signo) : "0"); -} - - -/* Issue kill to specified lwp. */ - -static int tkill_failed; - -static int -kill_lwp (int lwpid, int signo) -{ - errno = 0; - -/* Use tkill, if possible, in case we are using nptl threads. If tkill - fails, then we are not using nptl threads and we should be using kill. */ - -#ifdef HAVE_TKILL_SYSCALL - if (!tkill_failed) - { - int ret = syscall (__NR_tkill, lwpid, signo); - if (errno != ENOSYS) - return ret; - errno = 0; - tkill_failed = 1; - } -#endif - - return kill (lwpid, signo); -} - -/* Wait for LP to stop. Returns the wait status, or 0 if the LWP has - exited. */ - -static int -wait_lwp (struct lwp_info *lp) -{ - pid_t pid; - int status; - int thread_dead = 0; - - gdb_assert (!lp->stopped); - gdb_assert (lp->status == 0); - - pid = waitpid (GET_LWP (lp->ptid), &status, 0); - if (pid == -1 && errno == ECHILD) - { - pid = waitpid (GET_LWP (lp->ptid), &status, __WCLONE); - if (pid == -1 && errno == ECHILD) - { - /* The thread has previously exited. We need to delete it now - because in the case of NPTL threads, there won't be an - exit event unless it is the main thread. */ - thread_dead = 1; - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, "WL: %s vanished.\n", - target_pid_to_str (lp->ptid)); - } - } - - if (!thread_dead) - { - gdb_assert (pid == GET_LWP (lp->ptid)); - - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "WL: waitpid %s received %s\n", - target_pid_to_str (lp->ptid), - status_to_str (status)); - } - } - - /* Check if the thread has exited. */ - if (WIFEXITED (status) || WIFSIGNALED (status)) - { - thread_dead = 1; - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, "WL: %s exited.\n", - target_pid_to_str (lp->ptid)); - } - - if (thread_dead) - { - if (in_thread_list (lp->ptid)) - { - /* Core GDB cannot deal with us deleting the current thread. */ - if (!ptid_equal (lp->ptid, inferior_ptid)) - delete_thread (lp->ptid); - printf_unfiltered ("[%s exited]\n", - target_pid_to_str (lp->ptid)); - } - - delete_lwp (lp->ptid); - return 0; - } - - gdb_assert (WIFSTOPPED (status)); - - return status; -} - -/* Send a SIGSTOP to LP. */ - -static int -stop_callback (struct lwp_info *lp, void *data) -{ - if (!lp->stopped && !lp->signalled) - { - int ret; - - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "SC: kill %s **<SIGSTOP>**\n", - target_pid_to_str (lp->ptid)); - } - errno = 0; - ret = kill_lwp (GET_LWP (lp->ptid), SIGSTOP); - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "SC: lwp kill %d %s\n", - ret, - errno ? safe_strerror (errno) : "ERRNO-OK"); - } - - lp->signalled = 1; - gdb_assert (lp->status == 0); - } - - return 0; -} - -/* Wait until LP is stopped. If DATA is non-null it is interpreted as - a pointer to a set of signals to be flushed immediately. */ - -static int -stop_wait_callback (struct lwp_info *lp, void *data) -{ - sigset_t *flush_mask = data; - - if (!lp->stopped) - { - int status; - - status = wait_lwp (lp); - if (status == 0) - return 0; - - /* Ignore any signals in FLUSH_MASK. */ - if (flush_mask && sigismember (flush_mask, WSTOPSIG (status))) - { - if (!lp->signalled) - { - lp->stopped = 1; - return 0; - } - - errno = 0; - ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "PTRACE_CONT %s, 0, 0 (%s)\n", - target_pid_to_str (lp->ptid), - errno ? safe_strerror (errno) : "OK"); - - return stop_wait_callback (lp, flush_mask); - } - - if (WSTOPSIG (status) != SIGSTOP) - { - if (WSTOPSIG (status) == SIGTRAP) - { - /* If a LWP other than the LWP that we're reporting an - event for has hit a GDB breakpoint (as opposed to - some random trap signal), then just arrange for it to - hit it again later. We don't keep the SIGTRAP status - and don't forward the SIGTRAP signal to the LWP. We - will handle the current event, eventually we will - resume all LWPs, and this one will get its breakpoint - trap again. - - If we do not do this, then we run the risk that the - user will delete or disable the breakpoint, but the - thread will have already tripped on it. */ - - /* Now resume this LWP and get the SIGSTOP event. */ - errno = 0; - ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "PTRACE_CONT %s, 0, 0 (%s)\n", - target_pid_to_str (lp->ptid), - errno ? safe_strerror (errno) : "OK"); - - fprintf_unfiltered (gdb_stdlog, - "SWC: Candidate SIGTRAP event in %s\n", - target_pid_to_str (lp->ptid)); - } - /* Hold the SIGTRAP for handling by lin_lwp_wait. */ - stop_wait_callback (lp, data); - /* If there's another event, throw it back into the queue. */ - if (lp->status) - { - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "SWC: kill %s, %s\n", - target_pid_to_str (lp->ptid), - status_to_str ((int) status)); - } - kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status)); - } - /* Save the sigtrap event. */ - lp->status = status; - return 0; - } - else - { - /* The thread was stopped with a signal other than - SIGSTOP, and didn't accidentally trip a breakpoint. */ - - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "SWC: Pending event %s in %s\n", - status_to_str ((int) status), - target_pid_to_str (lp->ptid)); - } - /* Now resume this LWP and get the SIGSTOP event. */ - errno = 0; - ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "SWC: PTRACE_CONT %s, 0, 0 (%s)\n", - target_pid_to_str (lp->ptid), - errno ? safe_strerror (errno) : "OK"); - - /* Hold this event/waitstatus while we check to see if - there are any more (we still want to get that SIGSTOP). */ - stop_wait_callback (lp, data); - /* If the lp->status field is still empty, use it to hold - this event. If not, then this event must be returned - to the event queue of the LWP. */ - if (lp->status == 0) - lp->status = status; - else - { - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "SWC: kill %s, %s\n", - target_pid_to_str (lp->ptid), - status_to_str ((int) status)); - } - kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status)); - } - return 0; - } - } - else - { - /* We caught the SIGSTOP that we intended to catch, so - there's no SIGSTOP pending. */ - lp->stopped = 1; - lp->signalled = 0; - } - } - - return 0; -} - -/* Check whether PID has any pending signals in FLUSH_MASK. If so set - the appropriate bits in PENDING, and return 1 - otherwise return 0. */ - -static int -lin_lwp_has_pending (int pid, sigset_t *pending, sigset_t *flush_mask) -{ - sigset_t blocked, ignored; - int i; - - linux_proc_pending_signals (pid, pending, &blocked, &ignored); - - if (!flush_mask) - return 0; - - for (i = 1; i < NSIG; i++) - if (sigismember (pending, i)) - if (!sigismember (flush_mask, i) - || sigismember (&blocked, i) - || sigismember (&ignored, i)) - sigdelset (pending, i); - - if (sigisemptyset (pending)) - return 0; - - return 1; -} - -/* DATA is interpreted as a mask of signals to flush. If LP has - signals pending, and they are all in the flush mask, then arrange - to flush them. LP should be stopped, as should all other threads - it might share a signal queue with. */ - -static int -flush_callback (struct lwp_info *lp, void *data) -{ - sigset_t *flush_mask = data; - sigset_t pending, intersection, blocked, ignored; - int pid, status; - - /* Normally, when an LWP exits, it is removed from the LWP list. The - last LWP isn't removed till later, however. So if there is only - one LWP on the list, make sure it's alive. */ - if (lwp_list == lp && lp->next == NULL) - if (!lin_lwp_thread_alive (lp->ptid)) - return 0; - - /* Just because the LWP is stopped doesn't mean that new signals - can't arrive from outside, so this function must be careful of - race conditions. However, because all threads are stopped, we - can assume that the pending mask will not shrink unless we resume - the LWP, and that it will then get another signal. We can't - control which one, however. */ - - if (lp->status) - { - if (debug_lin_lwp) - printf_unfiltered ("FC: LP has pending status %06x\n", lp->status); - if (WIFSTOPPED (lp->status) && sigismember (flush_mask, WSTOPSIG (lp->status))) - lp->status = 0; - } - - while (lin_lwp_has_pending (GET_LWP (lp->ptid), &pending, flush_mask)) - { - int ret; - - errno = 0; - ret = ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stderr, - "FC: Sent PTRACE_CONT, ret %d %d\n", ret, errno); - - lp->stopped = 0; - stop_wait_callback (lp, flush_mask); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stderr, - "FC: Wait finished; saved status is %d\n", - lp->status); - } - - return 0; -} - -/* Return non-zero if LP has a wait status pending. */ - -static int -status_callback (struct lwp_info *lp, void *data) -{ - /* Only report a pending wait status if we pretend that this has - indeed been resumed. */ - return (lp->status != 0 && lp->resumed); -} - -/* Return non-zero if LP isn't stopped. */ - -static int -running_callback (struct lwp_info *lp, void *data) -{ - return (lp->stopped == 0 || (lp->status != 0 && lp->resumed)); -} - -/* Count the LWP's that have had events. */ - -static int -count_events_callback (struct lwp_info *lp, void *data) -{ - int *count = data; - - gdb_assert (count != NULL); - - /* Count only LWPs that have a SIGTRAP event pending. */ - if (lp->status != 0 - && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP) - (*count)++; - - return 0; -} - -/* Select the LWP (if any) that is currently being single-stepped. */ - -static int -select_singlestep_lwp_callback (struct lwp_info *lp, void *data) -{ - if (lp->step && lp->status != 0) - return 1; - else - return 0; -} - -/* Select the Nth LWP that has had a SIGTRAP event. */ - -static int -select_event_lwp_callback (struct lwp_info *lp, void *data) -{ - int *selector = data; - - gdb_assert (selector != NULL); - - /* Select only LWPs that have a SIGTRAP event pending. */ - if (lp->status != 0 - && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP) - if ((*selector)-- == 0) - return 1; - - return 0; -} - -static int -cancel_breakpoints_callback (struct lwp_info *lp, void *data) -{ - struct lwp_info *event_lp = data; - - /* Leave the LWP that has been elected to receive a SIGTRAP alone. */ - if (lp == event_lp) - return 0; - - /* If a LWP other than the LWP that we're reporting an event for has - hit a GDB breakpoint (as opposed to some random trap signal), - then just arrange for it to hit it again later. We don't keep - the SIGTRAP status and don't forward the SIGTRAP signal to the - LWP. We will handle the current event, eventually we will resume - all LWPs, and this one will get its breakpoint trap again. - - If we do not do this, then we run the risk that the user will - delete or disable the breakpoint, but the LWP will have already - tripped on it. */ - - if (lp->status != 0 - && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP - && breakpoint_inserted_here_p (read_pc_pid (lp->ptid) - - DECR_PC_AFTER_BREAK)) - { - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "CBC: Push back breakpoint for %s\n", - target_pid_to_str (lp->ptid)); - - /* Back up the PC if necessary. */ - if (DECR_PC_AFTER_BREAK) - write_pc_pid (read_pc_pid (lp->ptid) - DECR_PC_AFTER_BREAK, lp->ptid); - - /* Throw away the SIGTRAP. */ - lp->status = 0; - } - - return 0; -} - -/* Select one LWP out of those that have events pending. */ - -static void -select_event_lwp (struct lwp_info **orig_lp, int *status) -{ - int num_events = 0; - int random_selector; - struct lwp_info *event_lp; - - /* Record the wait status for the origional LWP. */ - (*orig_lp)->status = *status; - - /* Give preference to any LWP that is being single-stepped. */ - event_lp = iterate_over_lwps (select_singlestep_lwp_callback, NULL); - if (event_lp != NULL) - { - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "SEL: Select single-step %s\n", - target_pid_to_str (event_lp->ptid)); - } - else - { - /* No single-stepping LWP. Select one at random, out of those - which have had SIGTRAP events. */ - - /* First see how many SIGTRAP events we have. */ - iterate_over_lwps (count_events_callback, &num_events); - - /* Now randomly pick a LWP out of those that have had a SIGTRAP. */ - random_selector = (int) - ((num_events * (double) rand ()) / (RAND_MAX + 1.0)); - - if (debug_lin_lwp && num_events > 1) - fprintf_unfiltered (gdb_stdlog, - "SEL: Found %d SIGTRAP events, selecting #%d\n", - num_events, random_selector); - - event_lp = iterate_over_lwps (select_event_lwp_callback, - &random_selector); - } - - if (event_lp != NULL) - { - /* Switch the event LWP. */ - *orig_lp = event_lp; - *status = event_lp->status; - } - - /* Flush the wait status for the event LWP. */ - (*orig_lp)->status = 0; -} - -/* Return non-zero if LP has been resumed. */ - -static int -resumed_callback (struct lwp_info *lp, void *data) -{ - return lp->resumed; -} - -#ifdef CHILD_WAIT - -/* We need to override child_wait to support attaching to cloned - processes, since a normal wait (as done by the default version) - ignores those processes. */ - -/* Wait for child PTID to do something. Return id of the child, - minus_one_ptid in case of error; store status into *OURSTATUS. */ - -ptid_t -child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) -{ - int save_errno; - int status; - pid_t pid; - - do - { - set_sigint_trap (); /* Causes SIGINT to be passed on to the - attached process. */ - set_sigio_trap (); - - pid = waitpid (GET_PID (ptid), &status, 0); - if (pid == -1 && errno == ECHILD) - /* Try again with __WCLONE to check cloned processes. */ - pid = waitpid (GET_PID (ptid), &status, __WCLONE); - - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "CW: waitpid %ld received %s\n", - (long) pid, status_to_str (status)); - } - - save_errno = errno; - - /* Make sure we don't report an event for the exit of the - original program, if we've detached from it. */ - if (pid != -1 && !WIFSTOPPED (status) && pid != GET_PID (inferior_ptid)) - { - pid = -1; - save_errno = EINTR; - } - - /* Check for stop events reported by a process we didn't already - know about - in this case, anything other than inferior_ptid. - - If we're expecting to receive stopped processes after fork, - vfork, and clone events, then we'll just add the new one to - our list and go back to waiting for the event to be reported - - the stopped process might be returned from waitpid before - or after the event is. If we want to handle debugging of - CLONE_PTRACE processes we need to do more here, i.e. switch - to multi-threaded mode. */ - if (pid != -1 && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP - && pid != GET_PID (inferior_ptid)) - { - linux_record_stopped_pid (pid); - pid = -1; - save_errno = EINTR; - } - - clear_sigio_trap (); - clear_sigint_trap (); - } - while (pid == -1 && save_errno == EINTR); - - if (pid == -1) - { - warning ("Child process unexpectedly missing: %s", - safe_strerror (errno)); - - /* Claim it exited with unknown signal. */ - ourstatus->kind = TARGET_WAITKIND_SIGNALLED; - ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; - return minus_one_ptid; - } - - /* Handle GNU/Linux's extended waitstatus for trace events. */ - if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0) - return linux_handle_extended_wait (pid, status, ourstatus); - - store_waitstatus (ourstatus, status); - return pid_to_ptid (pid); -} - -#endif - -/* Stop an active thread, verify it still exists, then resume it. */ - -static int -stop_and_resume_callback (struct lwp_info *lp, void *data) -{ - struct lwp_info *ptr; - - if (!lp->stopped && !lp->signalled) - { - stop_callback (lp, NULL); - stop_wait_callback (lp, NULL); - /* Resume if the lwp still exists. */ - for (ptr = lwp_list; ptr; ptr = ptr->next) - if (lp == ptr) - { - resume_callback (lp, NULL); - resume_set_callback (lp, NULL); - } - } - return 0; -} - -static ptid_t -lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) -{ - struct lwp_info *lp = NULL; - int options = 0; - int status = 0; - pid_t pid = PIDGET (ptid); - sigset_t flush_mask; - - sigemptyset (&flush_mask); - - /* Make sure SIGCHLD is blocked. */ - if (!sigismember (&blocked_mask, SIGCHLD)) - { - sigaddset (&blocked_mask, SIGCHLD); - sigprocmask (SIG_BLOCK, &blocked_mask, NULL); - } - -retry: - - /* Make sure there is at least one LWP that has been resumed, at - least if there are any LWPs at all. */ - gdb_assert (num_lwps == 0 || iterate_over_lwps (resumed_callback, NULL)); - - /* First check if there is a LWP with a wait status pending. */ - if (pid == -1) - { - /* Any LWP that's been resumed will do. */ - lp = iterate_over_lwps (status_callback, NULL); - if (lp) - { - status = lp->status; - lp->status = 0; - - if (debug_lin_lwp && status) - fprintf_unfiltered (gdb_stdlog, - "LLW: Using pending wait status %s for %s.\n", - status_to_str (status), - target_pid_to_str (lp->ptid)); - } - - /* But if we don't fine one, we'll have to wait, and check both - cloned and uncloned processes. We start with the cloned - processes. */ - options = __WCLONE | WNOHANG; - } - else if (is_lwp (ptid)) - { - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: Waiting for specific LWP %s.\n", - target_pid_to_str (ptid)); - - /* We have a specific LWP to check. */ - lp = find_lwp_pid (ptid); - gdb_assert (lp); - status = lp->status; - lp->status = 0; - - if (debug_lin_lwp && status) - fprintf_unfiltered (gdb_stdlog, - "LLW: Using pending wait status %s for %s.\n", - status_to_str (status), - target_pid_to_str (lp->ptid)); - - /* If we have to wait, take into account whether PID is a cloned - process or not. And we have to convert it to something that - the layer beneath us can understand. */ - options = lp->cloned ? __WCLONE : 0; - pid = GET_LWP (ptid); - } - - if (status && lp->signalled) - { - /* A pending SIGSTOP may interfere with the normal stream of - events. In a typical case where interference is a problem, - we have a SIGSTOP signal pending for LWP A while - single-stepping it, encounter an event in LWP B, and take the - pending SIGSTOP while trying to stop LWP A. After processing - the event in LWP B, LWP A is continued, and we'll never see - the SIGTRAP associated with the last time we were - single-stepping LWP A. */ - - /* Resume the thread. It should halt immediately returning the - pending SIGSTOP. */ - registers_changed (); - child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, - TARGET_SIGNAL_0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: %s %s, 0, 0 (expect SIGSTOP)\n", - lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT", - target_pid_to_str (lp->ptid)); - lp->stopped = 0; - gdb_assert (lp->resumed); - - /* This should catch the pending SIGSTOP. */ - stop_wait_callback (lp, NULL); - } - - set_sigint_trap (); /* Causes SIGINT to be passed on to the - attached process. */ - set_sigio_trap (); - - while (status == 0) - { - pid_t lwpid; - - lwpid = waitpid (pid, &status, options); - if (lwpid > 0) - { - gdb_assert (pid == -1 || lwpid == pid); - - if (debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "LLW: waitpid %ld received %s\n", - (long) lwpid, status_to_str (status)); - } - - lp = find_lwp_pid (pid_to_ptid (lwpid)); - - /* Check for stop events reported by a process we didn't - already know about - anything not already in our LWP - list. - - If we're expecting to receive stopped processes after - fork, vfork, and clone events, then we'll just add the - new one to our list and go back to waiting for the event - to be reported - the stopped process might be returned - from waitpid before or after the event is. */ - if (WIFSTOPPED (status) && !lp) - { - linux_record_stopped_pid (lwpid); - status = 0; - continue; - } - - /* Make sure we don't report an event for the exit of an LWP not in - our list, i.e. not part of the current process. This can happen - if we detach from a program we original forked and then it - exits. */ - if (!WIFSTOPPED (status) && !lp) - { - status = 0; - continue; - } - - /* NOTE drow/2003-06-17: This code seems to be meant for debugging - CLONE_PTRACE processes which do not use the thread library - - otherwise we wouldn't find the new LWP this way. That doesn't - currently work, and the following code is currently unreachable - due to the two blocks above. If it's fixed some day, this code - should be broken out into a function so that we can also pick up - LWPs from the new interface. */ - if (!lp) - { - lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid))); - if (options & __WCLONE) - lp->cloned = 1; - - if (threaded) - { - gdb_assert (WIFSTOPPED (status) - && WSTOPSIG (status) == SIGSTOP); - lp->signalled = 1; - - if (!in_thread_list (inferior_ptid)) - { - inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid), - GET_PID (inferior_ptid)); - add_thread (inferior_ptid); - } - - add_thread (lp->ptid); - printf_unfiltered ("[New %s]\n", - target_pid_to_str (lp->ptid)); - } - } - - /* Check if the thread has exited. */ - if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1) - { - if (in_thread_list (lp->ptid)) - { - /* Core GDB cannot deal with us deleting the current - thread. */ - if (!ptid_equal (lp->ptid, inferior_ptid)) - delete_thread (lp->ptid); - printf_unfiltered ("[%s exited]\n", - target_pid_to_str (lp->ptid)); - } - - /* If this is the main thread, we must stop all threads and - verify if they are still alive. This is because in the nptl - thread model, there is no signal issued for exiting LWPs - other than the main thread. We only get the main thread - exit signal once all child threads have already exited. - If we stop all the threads and use the stop_wait_callback - to check if they have exited we can determine whether this - signal should be ignored or whether it means the end of the - debugged application, regardless of which threading model - is being used. */ - if (GET_PID (lp->ptid) == GET_LWP (lp->ptid)) - { - lp->stopped = 1; - iterate_over_lwps (stop_and_resume_callback, NULL); - } - - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: %s exited.\n", - target_pid_to_str (lp->ptid)); - - delete_lwp (lp->ptid); - - /* If there is at least one more LWP, then the exit signal - was not the end of the debugged application and should be - ignored. */ - if (num_lwps > 0) - { - /* Make sure there is at least one thread running. */ - gdb_assert (iterate_over_lwps (running_callback, NULL)); - - /* Discard the event. */ - status = 0; - continue; - } - } - - /* Check if the current LWP has previously exited. In the nptl - thread model, LWPs other than the main thread do not issue - signals when they exit so we must check whenever the thread - has stopped. A similar check is made in stop_wait_callback(). */ - if (num_lwps > 1 && !lin_lwp_thread_alive (lp->ptid)) - { - if (in_thread_list (lp->ptid)) - { - /* Core GDB cannot deal with us deleting the current - thread. */ - if (!ptid_equal (lp->ptid, inferior_ptid)) - delete_thread (lp->ptid); - printf_unfiltered ("[%s exited]\n", - target_pid_to_str (lp->ptid)); - } - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: %s exited.\n", - target_pid_to_str (lp->ptid)); - - delete_lwp (lp->ptid); - - /* Make sure there is at least one thread running. */ - gdb_assert (iterate_over_lwps (running_callback, NULL)); - - /* Discard the event. */ - status = 0; - continue; - } - - /* Make sure we don't report a SIGSTOP that we sent - ourselves in an attempt to stop an LWP. */ - if (lp->signalled - && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP) - { - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: Delayed SIGSTOP caught for %s.\n", - target_pid_to_str (lp->ptid)); - - /* This is a delayed SIGSTOP. */ - lp->signalled = 0; - - registers_changed (); - child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, - TARGET_SIGNAL_0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: %s %s, 0, 0 (discard SIGSTOP)\n", - lp->step ? - "PTRACE_SINGLESTEP" : "PTRACE_CONT", - target_pid_to_str (lp->ptid)); - - lp->stopped = 0; - gdb_assert (lp->resumed); - - /* Discard the event. */ - status = 0; - continue; - } - - break; - } - - if (pid == -1) - { - /* Alternate between checking cloned and uncloned processes. */ - options ^= __WCLONE; - - /* And suspend every time we have checked both. */ - if (options & __WCLONE) - sigsuspend (&suspend_mask); - } - - /* We shouldn't end up here unless we want to try again. */ - gdb_assert (status == 0); - } - - clear_sigio_trap (); - clear_sigint_trap (); - - gdb_assert (lp); - - /* Don't report signals that GDB isn't interested in, such as - signals that are neither printed nor stopped upon. Stopping all - threads can be a bit time-consuming so if we want decent - performance with heavily multi-threaded programs, especially when - they're using a high frequency timer, we'd better avoid it if we - can. */ - - if (WIFSTOPPED (status)) - { - int signo = target_signal_from_host (WSTOPSIG (status)); - - if (signal_stop_state (signo) == 0 - && signal_print_state (signo) == 0 - && signal_pass_state (signo) == 1) - { - /* FIMXE: kettenis/2001-06-06: Should we resume all threads - here? It is not clear we should. GDB may not expect - other threads to run. On the other hand, not resuming - newly attached threads may cause an unwanted delay in - getting them running. */ - registers_changed (); - child_resume (pid_to_ptid (GET_LWP (lp->ptid)), lp->step, signo); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: %s %s, %s (preempt 'handle')\n", - lp->step ? - "PTRACE_SINGLESTEP" : "PTRACE_CONT", - target_pid_to_str (lp->ptid), - signo ? strsignal (signo) : "0"); - lp->stopped = 0; - status = 0; - goto retry; - } - - if (signo == TARGET_SIGNAL_INT && signal_pass_state (signo) == 0) - { - /* If ^C/BREAK is typed at the tty/console, SIGINT gets - forwarded to the entire process group, that is, all LWP's - will receive it. Since we only want to report it once, - we try to flush it from all LWPs except this one. */ - sigaddset (&flush_mask, SIGINT); - } - } - - /* This LWP is stopped now. */ - lp->stopped = 1; - - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, "LLW: Candidate event %s in %s.\n", - status_to_str (status), target_pid_to_str (lp->ptid)); - - /* Now stop all other LWP's ... */ - iterate_over_lwps (stop_callback, NULL); - - /* ... and wait until all of them have reported back that they're no - longer running. */ - iterate_over_lwps (stop_wait_callback, &flush_mask); - iterate_over_lwps (flush_callback, &flush_mask); - - /* If we're not waiting for a specific LWP, choose an event LWP from - among those that have had events. Giving equal priority to all - LWPs that have had events helps prevent starvation. */ - if (pid == -1) - select_event_lwp (&lp, &status); - - /* Now that we've selected our final event LWP, cancel any - breakpoints in other LWPs that have hit a GDB breakpoint. See - the comment in cancel_breakpoints_callback to find out why. */ - iterate_over_lwps (cancel_breakpoints_callback, lp); - - /* If we're not running in "threaded" mode, we'll report the bare - process id. */ - - if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP) - { - trap_ptid = (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid))); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLW: trap_ptid is %s.\n", - target_pid_to_str (trap_ptid)); - } - else - trap_ptid = null_ptid; - - /* Handle GNU/Linux's extended waitstatus for trace events. */ - if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0) - { - linux_handle_extended_wait (ptid_get_pid (trap_ptid), - status, ourstatus); - return trap_ptid; - } - - store_waitstatus (ourstatus, status); - return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid))); -} - -static int -kill_callback (struct lwp_info *lp, void *data) -{ - errno = 0; - ptrace (PTRACE_KILL, GET_LWP (lp->ptid), 0, 0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "KC: PTRACE_KILL %s, 0, 0 (%s)\n", - target_pid_to_str (lp->ptid), - errno ? safe_strerror (errno) : "OK"); - - return 0; -} - -static int -kill_wait_callback (struct lwp_info *lp, void *data) -{ - pid_t pid; - - /* We must make sure that there are no pending events (delayed - SIGSTOPs, pending SIGTRAPs, etc.) to make sure the current - program doesn't interfere with any following debugging session. */ - - /* For cloned processes we must check both with __WCLONE and - without, since the exit status of a cloned process isn't reported - with __WCLONE. */ - if (lp->cloned) - { - do - { - pid = waitpid (GET_LWP (lp->ptid), NULL, __WCLONE); - if (pid != (pid_t) -1 && debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "KWC: wait %s received unknown.\n", - target_pid_to_str (lp->ptid)); - } - } - while (pid == GET_LWP (lp->ptid)); - - gdb_assert (pid == -1 && errno == ECHILD); - } - - do - { - pid = waitpid (GET_LWP (lp->ptid), NULL, 0); - if (pid != (pid_t) -1 && debug_lin_lwp) - { - fprintf_unfiltered (gdb_stdlog, - "KWC: wait %s received unk.\n", - target_pid_to_str (lp->ptid)); - } - } - while (pid == GET_LWP (lp->ptid)); - - gdb_assert (pid == -1 && errno == ECHILD); - return 0; -} - -static void -lin_lwp_kill (void) -{ - /* Kill all LWP's ... */ - iterate_over_lwps (kill_callback, NULL); - - /* ... and wait until we've flushed all events. */ - iterate_over_lwps (kill_wait_callback, NULL); - - target_mourn_inferior (); -} - -static void -lin_lwp_create_inferior (char *exec_file, char *allargs, char **env) -{ - child_ops.to_create_inferior (exec_file, allargs, env); -} - -static void -lin_lwp_mourn_inferior (void) -{ - trap_ptid = null_ptid; - - /* Destroy LWP info; it's no longer valid. */ - init_lwp_list (); - - /* Restore the original signal mask. */ - sigprocmask (SIG_SETMASK, &normal_mask, NULL); - sigemptyset (&blocked_mask); - - child_ops.to_mourn_inferior (); -} - -static int -lin_lwp_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, - struct mem_attrib *attrib, struct target_ops *target) -{ - struct cleanup *old_chain = save_inferior_ptid (); - int xfer; - - if (is_lwp (inferior_ptid)) - inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid)); - - xfer = linux_proc_xfer_memory (memaddr, myaddr, len, write, attrib, target); - if (xfer == 0) - xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target); - - do_cleanups (old_chain); - return xfer; -} - -static int -lin_lwp_thread_alive (ptid_t ptid) -{ - gdb_assert (is_lwp (ptid)); - - errno = 0; - ptrace (PTRACE_PEEKUSER, GET_LWP (ptid), 0, 0); - if (debug_lin_lwp) - fprintf_unfiltered (gdb_stdlog, - "LLTA: PTRACE_PEEKUSER %s, 0, 0 (%s)\n", - target_pid_to_str (ptid), - errno ? safe_strerror (errno) : "OK"); - if (errno) - return 0; - - return 1; -} - -static char * -lin_lwp_pid_to_str (ptid_t ptid) -{ - static char buf[64]; - - if (is_lwp (ptid)) - { - snprintf (buf, sizeof (buf), "LWP %ld", GET_LWP (ptid)); - return buf; - } - - return normal_pid_to_str (ptid); -} - -static void -init_lin_lwp_ops (void) -{ -#if 0 - lin_lwp_ops.to_open = lin_lwp_open; -#endif - lin_lwp_ops.to_shortname = "lwp-layer"; - lin_lwp_ops.to_longname = "lwp-layer"; - lin_lwp_ops.to_doc = "Low level threads support (LWP layer)"; - lin_lwp_ops.to_attach = lin_lwp_attach; - lin_lwp_ops.to_detach = lin_lwp_detach; - lin_lwp_ops.to_resume = lin_lwp_resume; - lin_lwp_ops.to_wait = lin_lwp_wait; - /* fetch_inferior_registers and store_inferior_registers will - honor the LWP id, so we can use them directly. */ - lin_lwp_ops.to_fetch_registers = fetch_inferior_registers; - lin_lwp_ops.to_store_registers = store_inferior_registers; - lin_lwp_ops.to_xfer_memory = lin_lwp_xfer_memory; - lin_lwp_ops.to_kill = lin_lwp_kill; - lin_lwp_ops.to_create_inferior = lin_lwp_create_inferior; - lin_lwp_ops.to_mourn_inferior = lin_lwp_mourn_inferior; - lin_lwp_ops.to_thread_alive = lin_lwp_thread_alive; - lin_lwp_ops.to_pid_to_str = lin_lwp_pid_to_str; - lin_lwp_ops.to_post_startup_inferior = child_post_startup_inferior; - lin_lwp_ops.to_post_attach = child_post_attach; - lin_lwp_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint; - lin_lwp_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint; - lin_lwp_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint; - - lin_lwp_ops.to_stratum = thread_stratum; - lin_lwp_ops.to_has_thread_control = tc_schedlock; - lin_lwp_ops.to_magic = OPS_MAGIC; -} - -static void -sigchld_handler (int signo) -{ - /* Do nothing. The only reason for this handler is that it allows - us to use sigsuspend in lin_lwp_wait above to wait for the - arrival of a SIGCHLD. */ -} - -void -_initialize_lin_lwp (void) -{ - struct sigaction action; - - extern void thread_db_init (struct target_ops *); - - init_lin_lwp_ops (); - add_target (&lin_lwp_ops); - thread_db_init (&lin_lwp_ops); - - /* Save the original signal mask. */ - sigprocmask (SIG_SETMASK, NULL, &normal_mask); - - action.sa_handler = sigchld_handler; - sigemptyset (&action.sa_mask); - action.sa_flags = 0; - sigaction (SIGCHLD, &action, NULL); - - /* Make sure we don't block SIGCHLD during a sigsuspend. */ - sigprocmask (SIG_SETMASK, NULL, &suspend_mask); - sigdelset (&suspend_mask, SIGCHLD); - - sigemptyset (&blocked_mask); - - add_show_from_set (add_set_cmd ("lin-lwp", no_class, var_zinteger, - (char *) &debug_lin_lwp, - "Set debugging of GNU/Linux lwp module.\n\ -Enables printf debugging output.\n", &setdebuglist), &showdebuglist); -} - - -/* FIXME: kettenis/2000-08-26: The stuff on this page is specific to - the GNU/Linux Threads library and therefore doesn't really belong - here. */ - -/* Read variable NAME in the target and return its value if found. - Otherwise return zero. It is assumed that the type of the variable - is `int'. */ - -static int -get_signo (const char *name) -{ - struct minimal_symbol *ms; - int signo; - - ms = lookup_minimal_symbol (name, NULL, NULL); - if (ms == NULL) - return 0; - - if (target_read_memory (SYMBOL_VALUE_ADDRESS (ms), (char *) &signo, - sizeof (signo)) != 0) - return 0; - - return signo; -} - -/* Return the set of signals used by the threads library in *SET. */ - -void -lin_thread_get_thread_signals (sigset_t *set) -{ - struct sigaction action; - int restart, cancel; - - sigemptyset (set); - - restart = get_signo ("__pthread_sig_restart"); - if (restart == 0) - return; - - cancel = get_signo ("__pthread_sig_cancel"); - if (cancel == 0) - return; - - sigaddset (set, restart); - sigaddset (set, cancel); - - /* The GNU/Linux Threads library makes terminating threads send a - special "cancel" signal instead of SIGCHLD. Make sure we catch - those (to prevent them from terminating GDB itself, which is - likely to be their default action) and treat them the same way as - SIGCHLD. */ - - action.sa_handler = sigchld_handler; - sigemptyset (&action.sa_mask); - action.sa_flags = 0; - sigaction (cancel, &action, NULL); - - /* We block the "cancel" signal throughout this code ... */ - sigaddset (&blocked_mask, cancel); - sigprocmask (SIG_BLOCK, &blocked_mask, NULL); - - /* ... except during a sigsuspend. */ - sigdelset (&suspend_mask, cancel); -} diff --git a/gnu/usr.bin/binutils/gdb/linux-proc.c b/gnu/usr.bin/binutils/gdb/linux-proc.c deleted file mode 100644 index 0a774593eda..00000000000 --- a/gnu/usr.bin/binutils/gdb/linux-proc.c +++ /dev/null @@ -1,737 +0,0 @@ -/* GNU/Linux specific methods for using the /proc file system. - - Copyright 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. */ - -#include "defs.h" -#include "inferior.h" -#include <sys/param.h> /* for MAXPATHLEN */ -#include <sys/procfs.h> /* for elf_gregset etc. */ -#include "gdb_stat.h" /* for struct stat */ -#include <ctype.h> /* for isdigit */ -#include <unistd.h> /* for open, pread64 */ -#include <fcntl.h> /* for O_RDONLY */ -#include "regcache.h" /* for registers_changed */ -#include "gregset.h" /* for gregset */ -#include "gdbcore.h" /* for get_exec_file */ -#include "gdbthread.h" /* for struct thread_info etc. */ -#include "elf-bfd.h" /* for elfcore_write_* */ -#include "cli/cli-decode.h" /* for add_info */ -#include "gdb_string.h" - -#include <signal.h> - -#include "linux-nat.h" - -#ifndef O_LARGEFILE -#define O_LARGEFILE 0 -#endif - -/* Function: child_pid_to_exec_file - * - * Accepts an integer pid - * Returns a string representing a file that can be opened - * to get the symbols for the child process. - */ - -char * -child_pid_to_exec_file (int pid) -{ - char *name1, *name2; - - name1 = xmalloc (MAXPATHLEN); - name2 = xmalloc (MAXPATHLEN); - make_cleanup (xfree, name1); - make_cleanup (xfree, name2); - memset (name2, 0, MAXPATHLEN); - - sprintf (name1, "/proc/%d/exe", pid); - if (readlink (name1, name2, MAXPATHLEN) > 0) - return name2; - else - return name1; -} - -/* Function: read_mappings - * - * Service function for corefiles and info proc. - */ - -static int -read_mapping (FILE *mapfile, - long long *addr, - long long *endaddr, - char *permissions, - long long *offset, - char *device, long long *inode, char *filename) -{ - int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx", - addr, endaddr, permissions, offset, device, inode); - - if (ret > 0 && ret != EOF && *inode != 0) - { - /* Eat everything up to EOL for the filename. This will prevent - weird filenames (such as one with embedded whitespace) from - confusing this code. It also makes this code more robust - in respect to annotations the kernel may add after the - filename. - - Note the filename is used for informational purposes only. */ - ret += fscanf (mapfile, "%[^\n]\n", filename); - } - else - { - filename[0] = '\0'; /* no filename */ - fscanf (mapfile, "\n"); - } - return (ret != 0 && ret != EOF); -} - -/* Function: linux_find_memory_regions - * - * Fills the "to_find_memory_regions" target vector. - * Lists the memory regions in the inferior for a corefile. - */ - -static int -linux_find_memory_regions (int (*func) (CORE_ADDR, - unsigned long, - int, int, int, void *), void *obfd) -{ - long long pid = PIDGET (inferior_ptid); - char mapsfilename[MAXPATHLEN]; - FILE *mapsfile; - long long addr, endaddr, size, offset, inode; - char permissions[8], device[8], filename[MAXPATHLEN]; - int read, write, exec; - int ret; - - /* Compose the filename for the /proc memory map, and open it. */ - sprintf (mapsfilename, "/proc/%lld/maps", pid); - if ((mapsfile = fopen (mapsfilename, "r")) == NULL) - error ("Could not open %s\n", mapsfilename); - - if (info_verbose) - fprintf_filtered (gdb_stdout, - "Reading memory regions from %s\n", mapsfilename); - - /* Now iterate until end-of-file. */ - while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0], - &offset, &device[0], &inode, &filename[0])) - { - size = endaddr - addr; - - /* Get the segment's permissions. */ - read = (strchr (permissions, 'r') != 0); - write = (strchr (permissions, 'w') != 0); - exec = (strchr (permissions, 'x') != 0); - - if (info_verbose) - { - fprintf_filtered (gdb_stdout, - "Save segment, %lld bytes at 0x%s (%c%c%c)", - size, paddr_nz (addr), - read ? 'r' : ' ', - write ? 'w' : ' ', exec ? 'x' : ' '); - if (filename && filename[0]) - fprintf_filtered (gdb_stdout, " for %s", filename); - fprintf_filtered (gdb_stdout, "\n"); - } - - /* Invoke the callback function to create the corefile segment. */ - func (addr, size, read, write, exec, obfd); - } - fclose (mapsfile); - return 0; -} - -/* Function: linux_do_thread_registers - * - * Records the thread's register state for the corefile note section. - */ - -static char * -linux_do_thread_registers (bfd *obfd, ptid_t ptid, - char *note_data, int *note_size) -{ - gdb_gregset_t gregs; - gdb_fpregset_t fpregs; -#ifdef FILL_FPXREGSET - gdb_fpxregset_t fpxregs; -#endif - unsigned long lwp = ptid_get_lwp (ptid); - - fill_gregset (&gregs, -1); - note_data = (char *) elfcore_write_prstatus (obfd, - note_data, - note_size, - lwp, - stop_signal, &gregs); - - fill_fpregset (&fpregs, -1); - note_data = (char *) elfcore_write_prfpreg (obfd, - note_data, - note_size, - &fpregs, sizeof (fpregs)); -#ifdef FILL_FPXREGSET - fill_fpxregset (&fpxregs, -1); - note_data = (char *) elfcore_write_prxfpreg (obfd, - note_data, - note_size, - &fpxregs, sizeof (fpxregs)); -#endif - return note_data; -} - -struct linux_corefile_thread_data -{ - bfd *obfd; - char *note_data; - int *note_size; - int num_notes; -}; - -/* Function: linux_corefile_thread_callback - * - * Called by gdbthread.c once per thread. - * Records the thread's register state for the corefile note section. - */ - -static int -linux_corefile_thread_callback (struct lwp_info *ti, void *data) -{ - struct linux_corefile_thread_data *args = data; - ptid_t saved_ptid = inferior_ptid; - - inferior_ptid = ti->ptid; - registers_changed (); - target_fetch_registers (-1); /* FIXME should not be necessary; - fill_gregset should do it automatically. */ - args->note_data = linux_do_thread_registers (args->obfd, - ti->ptid, - args->note_data, - args->note_size); - args->num_notes++; - inferior_ptid = saved_ptid; - registers_changed (); - target_fetch_registers (-1); /* FIXME should not be necessary; - fill_gregset should do it automatically. */ - return 0; -} - -/* Function: linux_do_registers - * - * Records the register state for the corefile note section. - */ - -static char * -linux_do_registers (bfd *obfd, ptid_t ptid, - char *note_data, int *note_size) -{ - registers_changed (); - target_fetch_registers (-1); /* FIXME should not be necessary; - fill_gregset should do it automatically. */ - return linux_do_thread_registers (obfd, - ptid_build (ptid_get_pid (inferior_ptid), - ptid_get_pid (inferior_ptid), - 0), - note_data, note_size); - return note_data; -} - -/* Function: linux_make_note_section - * - * Fills the "to_make_corefile_note" target vector. - * Builds the note section for a corefile, and returns it - * in a malloc buffer. - */ - -static char * -linux_make_note_section (bfd *obfd, int *note_size) -{ - struct linux_corefile_thread_data thread_args; - struct cleanup *old_chain; - char fname[16] = { '\0' }; - char psargs[80] = { '\0' }; - char *note_data = NULL; - ptid_t current_ptid = inferior_ptid; - char *auxv; - int auxv_len; - - if (get_exec_file (0)) - { - strncpy (fname, strrchr (get_exec_file (0), '/') + 1, sizeof (fname)); - strncpy (psargs, get_exec_file (0), sizeof (psargs)); - if (get_inferior_args ()) - { - strncat (psargs, " ", sizeof (psargs) - strlen (psargs)); - strncat (psargs, get_inferior_args (), - sizeof (psargs) - strlen (psargs)); - } - note_data = (char *) elfcore_write_prpsinfo (obfd, - note_data, - note_size, fname, psargs); - } - - /* Dump information for threads. */ - thread_args.obfd = obfd; - thread_args.note_data = note_data; - thread_args.note_size = note_size; - thread_args.num_notes = 0; - iterate_over_lwps (linux_corefile_thread_callback, &thread_args); - if (thread_args.num_notes == 0) - { - /* iterate_over_threads didn't come up with any threads; - just use inferior_ptid. */ - note_data = linux_do_registers (obfd, inferior_ptid, - note_data, note_size); - } - else - { - note_data = thread_args.note_data; - } - - auxv_len = target_auxv_read (¤t_target, &auxv); - if (auxv_len > 0) - { - note_data = elfcore_write_note (obfd, note_data, note_size, - "CORE", NT_AUXV, auxv, auxv_len); - xfree (auxv); - } - - make_cleanup (xfree, note_data); - return note_data; -} - -/* - * Function: linux_info_proc_cmd - * - * Implement the "info proc" command. - */ - -static void -linux_info_proc_cmd (char *args, int from_tty) -{ - long long pid = PIDGET (inferior_ptid); - FILE *procfile; - char **argv = NULL; - char buffer[MAXPATHLEN]; - char fname1[MAXPATHLEN], fname2[MAXPATHLEN]; - int cmdline_f = 1; - int cwd_f = 1; - int exe_f = 1; - int mappings_f = 0; - int environ_f = 0; - int status_f = 0; - int stat_f = 0; - int all = 0; - struct stat dummy; - - if (args) - { - /* Break up 'args' into an argv array. */ - if ((argv = buildargv (args)) == NULL) - nomem (0); - else - make_cleanup_freeargv (argv); - } - while (argv != NULL && *argv != NULL) - { - if (isdigit (argv[0][0])) - { - pid = strtoul (argv[0], NULL, 10); - } - else if (strncmp (argv[0], "mappings", strlen (argv[0])) == 0) - { - mappings_f = 1; - } - else if (strcmp (argv[0], "status") == 0) - { - status_f = 1; - } - else if (strcmp (argv[0], "stat") == 0) - { - stat_f = 1; - } - else if (strcmp (argv[0], "cmd") == 0) - { - cmdline_f = 1; - } - else if (strncmp (argv[0], "exe", strlen (argv[0])) == 0) - { - exe_f = 1; - } - else if (strcmp (argv[0], "cwd") == 0) - { - cwd_f = 1; - } - else if (strncmp (argv[0], "all", strlen (argv[0])) == 0) - { - all = 1; - } - else - { - /* [...] (future options here) */ - } - argv++; - } - if (pid == 0) - error ("No current process: you must name one."); - - sprintf (fname1, "/proc/%lld", pid); - if (stat (fname1, &dummy) != 0) - error ("No /proc directory: '%s'", fname1); - - printf_filtered ("process %lld\n", pid); - if (cmdline_f || all) - { - sprintf (fname1, "/proc/%lld/cmdline", pid); - if ((procfile = fopen (fname1, "r")) > 0) - { - fgets (buffer, sizeof (buffer), procfile); - printf_filtered ("cmdline = '%s'\n", buffer); - fclose (procfile); - } - else - warning ("unable to open /proc file '%s'", fname1); - } - if (cwd_f || all) - { - sprintf (fname1, "/proc/%lld/cwd", pid); - memset (fname2, 0, sizeof (fname2)); - if (readlink (fname1, fname2, sizeof (fname2)) > 0) - printf_filtered ("cwd = '%s'\n", fname2); - else - warning ("unable to read link '%s'", fname1); - } - if (exe_f || all) - { - sprintf (fname1, "/proc/%lld/exe", pid); - memset (fname2, 0, sizeof (fname2)); - if (readlink (fname1, fname2, sizeof (fname2)) > 0) - printf_filtered ("exe = '%s'\n", fname2); - else - warning ("unable to read link '%s'", fname1); - } - if (mappings_f || all) - { - sprintf (fname1, "/proc/%lld/maps", pid); - if ((procfile = fopen (fname1, "r")) > 0) - { - long long addr, endaddr, size, offset, inode; - char permissions[8], device[8], filename[MAXPATHLEN]; - - printf_filtered ("Mapped address spaces:\n\n"); - if (TARGET_ADDR_BIT == 32) - { - printf_filtered ("\t%10s %10s %10s %10s %7s\n", - "Start Addr", - " End Addr", - " Size", " Offset", "objfile"); - } - else - { - printf_filtered (" %18s %18s %10s %10s %7s\n", - "Start Addr", - " End Addr", - " Size", " Offset", "objfile"); - } - - while (read_mapping (procfile, &addr, &endaddr, &permissions[0], - &offset, &device[0], &inode, &filename[0])) - { - size = endaddr - addr; - - /* FIXME: carlton/2003-08-27: Maybe the printf_filtered - calls here (and possibly above) should be abstracted - out into their own functions? Andrew suggests using - a generic local_address_string instead to print out - the addresses; that makes sense to me, too. */ - - if (TARGET_ADDR_BIT == 32) - { - printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n", - (unsigned long) addr, /* FIXME: pr_addr */ - (unsigned long) endaddr, - (int) size, - (unsigned int) offset, - filename[0] ? filename : ""); - } - else - { - printf_filtered (" %#18lx %#18lx %#10x %#10x %7s\n", - (unsigned long) addr, /* FIXME: pr_addr */ - (unsigned long) endaddr, - (int) size, - (unsigned int) offset, - filename[0] ? filename : ""); - } - } - - fclose (procfile); - } - else - warning ("unable to open /proc file '%s'", fname1); - } - if (status_f || all) - { - sprintf (fname1, "/proc/%lld/status", pid); - if ((procfile = fopen (fname1, "r")) > 0) - { - while (fgets (buffer, sizeof (buffer), procfile) != NULL) - puts_filtered (buffer); - fclose (procfile); - } - else - warning ("unable to open /proc file '%s'", fname1); - } - if (stat_f || all) - { - sprintf (fname1, "/proc/%lld/stat", pid); - if ((procfile = fopen (fname1, "r")) > 0) - { - int itmp; - char ctmp; - - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Process: %d\n", itmp); - if (fscanf (procfile, "%s ", &buffer[0]) > 0) - printf_filtered ("Exec file: %s\n", buffer); - if (fscanf (procfile, "%c ", &ctmp) > 0) - printf_filtered ("State: %c\n", ctmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Parent process: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Process group: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Session id: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("TTY: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("TTY owner process group: %d\n", itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Flags: 0x%x\n", itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Minor faults (no memory page): %u\n", - (unsigned int) itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Minor faults, children: %u\n", - (unsigned int) itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Major faults (memory page faults): %u\n", - (unsigned int) itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Major faults, children: %u\n", - (unsigned int) itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("utime: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("stime: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("utime, children: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("stime, children: %d\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("jiffies remaining in current time slice: %d\n", - itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("'nice' value: %d\n", itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("jiffies until next timeout: %u\n", - (unsigned int) itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("jiffies until next SIGALRM: %u\n", - (unsigned int) itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("start time (jiffies since system boot): %d\n", - itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Virtual memory size: %u\n", - (unsigned int) itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Resident set size: %u\n", (unsigned int) itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("rlim: %u\n", (unsigned int) itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Start of text: 0x%x\n", itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("End of text: 0x%x\n", itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) - printf_filtered ("Start of stack: 0x%x\n", itmp); -#if 0 /* Don't know how architecture-dependent the rest is... - Anyway the signal bitmap info is available from "status". */ - if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */ - printf_filtered ("Kernel stack pointer: 0x%x\n", itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */ - printf_filtered ("Kernel instr pointer: 0x%x\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Pending signals bitmap: 0x%x\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Blocked signals bitmap: 0x%x\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Ignored signals bitmap: 0x%x\n", itmp); - if (fscanf (procfile, "%d ", &itmp) > 0) - printf_filtered ("Catched signals bitmap: 0x%x\n", itmp); - if (fscanf (procfile, "%u ", &itmp) > 0) /* FIXME arch? */ - printf_filtered ("wchan (system call): 0x%x\n", itmp); -#endif - fclose (procfile); - } - else - warning ("unable to open /proc file '%s'", fname1); - } -} - -void -_initialize_linux_proc (void) -{ - extern void inftarg_set_find_memory_regions (); - extern void inftarg_set_make_corefile_notes (); - - inftarg_set_find_memory_regions (linux_find_memory_regions); - inftarg_set_make_corefile_notes (linux_make_note_section); - - add_info ("proc", linux_info_proc_cmd, - "Show /proc process information about any running process.\n\ -Specify any process id, or use the program being debugged by default.\n\ -Specify any of the following keywords for detailed info:\n\ - mappings -- list of mapped memory regions.\n\ - stat -- list a bunch of random process info.\n\ - status -- list a different bunch of random process info.\n\ - all -- list all available /proc info."); -} - -int -linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write, - struct mem_attrib *attrib, struct target_ops *target) -{ - int fd, ret; - char filename[64]; - - if (write) - return 0; - - /* Don't bother for one word. */ - if (len < 3 * sizeof (long)) - return 0; - - /* We could keep this file open and cache it - possibly one - per thread. That requires some juggling, but is even faster. */ - sprintf (filename, "/proc/%d/mem", PIDGET (inferior_ptid)); - fd = open (filename, O_RDONLY | O_LARGEFILE); - if (fd == -1) - return 0; - - /* If pread64 is available, use it. It's faster if the kernel - supports it (only one syscall), and it's 64-bit safe even - on 32-bit platforms (for instance, SPARC debugging a SPARC64 - application). */ -#ifdef HAVE_PREAD64 - if (pread64 (fd, myaddr, len, addr) != len) -#else - if (lseek (fd, addr, SEEK_SET) == -1 || read (fd, myaddr, len) != len) -#endif - ret = 0; - else - ret = len; - - close (fd); - return ret; -} - -/* Parse LINE as a signal set and add its set bits to SIGS. */ - -static void -linux_proc_add_line_to_sigset (const char *line, sigset_t *sigs) -{ - int len = strlen (line) - 1; - const char *p; - int signum; - - if (line[len] != '\n') - error ("Could not parse signal set: %s", line); - - p = line; - signum = len * 4; - while (len-- > 0) - { - int digit; - - if (*p >= '0' && *p <= '9') - digit = *p - '0'; - else if (*p >= 'a' && *p <= 'f') - digit = *p - 'a' + 10; - else - error ("Could not parse signal set: %s", line); - - signum -= 4; - - if (digit & 1) - sigaddset (sigs, signum + 1); - if (digit & 2) - sigaddset (sigs, signum + 2); - if (digit & 4) - sigaddset (sigs, signum + 3); - if (digit & 8) - sigaddset (sigs, signum + 4); - - p++; - } -} - -/* Find process PID's pending signals from /proc/pid/status and set SIGS - to match. */ - -void -linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored) -{ - FILE *procfile; - char buffer[MAXPATHLEN], fname[MAXPATHLEN]; - int signum; - - sigemptyset (pending); - sigemptyset (blocked); - sigemptyset (ignored); - sprintf (fname, "/proc/%d/status", pid); - procfile = fopen (fname, "r"); - if (procfile == NULL) - error ("Could not open %s", fname); - - while (fgets (buffer, MAXPATHLEN, procfile) != NULL) - { - /* Normal queued signals are on the SigPnd line in the status - file. However, 2.6 kernels also have a "shared" pending queue - for delivering signals to a thread group, so check for a ShdPnd - line also. - - Unfortunately some Red Hat kernels include the shared pending queue - but not the ShdPnd status field. */ - - if (strncmp (buffer, "SigPnd:\t", 8) == 0) - linux_proc_add_line_to_sigset (buffer + 8, pending); - else if (strncmp (buffer, "ShdPnd:\t", 8) == 0) - linux_proc_add_line_to_sigset (buffer + 8, pending); - else if (strncmp (buffer, "SigBlk:\t", 8) == 0) - linux_proc_add_line_to_sigset (buffer + 8, blocked); - else if (strncmp (buffer, "SigIgn:\t", 8) == 0) - linux_proc_add_line_to_sigset (buffer + 8, ignored); - } - - fclose (procfile); -} diff --git a/gnu/usr.bin/binutils/gdb/lynx-nat.c b/gnu/usr.bin/binutils/gdb/lynx-nat.c index 7bfd40ee56e..1517cb5d2ec 100644 --- a/gnu/usr.bin/binutils/gdb/lynx-nat.c +++ b/gnu/usr.bin/binutils/gdb/lynx-nat.c @@ -313,7 +313,7 @@ fetch_inferior_registers (int regno) ptrace_fun = regno == SP_REGNUM ? PTRACE_PEEKUSP : PTRACE_PEEKTHREAD; #endif - for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (int)) + for (i = 0; i < register_size (current_gdbarch, regno); i += sizeof (int)) { unsigned int reg; @@ -325,7 +325,7 @@ fetch_inferior_registers (int regno) *(int *) &buf[i] = reg; } - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regno, buf); } } } @@ -362,7 +362,7 @@ store_inferior_registers (int regno) ptrace_fun = regno == SP_REGNUM ? PTRACE_POKEUSP : PTRACE_POKEUSER; #endif - for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (int)) + for (i = 0; i < register_size (current_gdbarch, regno); i += sizeof (int)) { unsigned int reg; @@ -593,8 +593,8 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, for (regno = 0; regno < NUM_REGS; regno++) if (regmap[regno] != -1) - supply_register (regno, core_reg_sect + offsetof (st_t, ec) - + regmap[regno]); + regcache_raw_supply (current_regcache, regno, + core_reg_sect + offsetof (st_t, ec) + regmap[regno]); #ifdef SPARC /* Fetching this register causes all of the I & L regs to be read from the @@ -620,5 +620,5 @@ static struct core_fns lynx_core_fns = void _initialize_core_lynx (void) { - add_core_fns (&lynx_core_fns); + deprecated_add_core_fns (&lynx_core_fns); } diff --git a/gnu/usr.bin/binutils/gdb/m2-lang.c b/gnu/usr.bin/binutils/gdb/m2-lang.c index e5b6b500e7c..fbb1fa30614 100644 --- a/gnu/usr.bin/binutils/gdb/m2-lang.c +++ b/gnu/usr.bin/binutils/gdb/m2-lang.c @@ -415,9 +415,11 @@ const struct language_defn m2_language_defn = range_check_on, type_check_on, case_sensitive_on, + array_row_major, &exp_descriptor_standard, m2_parse, /* parser */ m2_error, /* parser error function */ + null_post_parser, m2_printchar, /* Print character constant */ m2_printstr, /* function to print string constant */ m2_emit_char, /* Function to print a single character */ @@ -430,15 +432,13 @@ const struct language_defn m2_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"%loB", "", "o", "B"}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"0%lXH", "0", "X", "H"}, /* Hex format info */ + NULL, /* Language specific class_name_from_physname */ m2_op_print_tab, /* expression operators for printing */ 0, /* arrays are first-class (not c-style) */ 0, /* String lower bound */ &builtin_type_m2_char, /* Type of string elements */ default_word_break_characters, + NULL, /* FIXME: la_language_arch_info. */ LANG_MAGIC }; diff --git a/gnu/usr.bin/binutils/gdb/m68k-tdep.c b/gnu/usr.bin/binutils/gdb/m68k-tdep.c index 811985e38be..1ada90a4488 100644 --- a/gnu/usr.bin/binutils/gdb/m68k-tdep.c +++ b/gnu/usr.bin/binutils/gdb/m68k-tdep.c @@ -130,13 +130,90 @@ m68k_register_name (int regnum) return register_names[regnum]; } -/* We have basically two calling conventions. The old 68000 calling - convention and the newer calling convention specified by the SVR4 - psABI. The 68000 and the 68008/10 don't have any floating-point - support at all, so everything is returned in %d0/%d1. The SVR4 - calling convention specifies that floating-point return values are - passed in %fp0 and pointer return values in %a0 and integer values - in %d0/%d1. */ +/* Return nonzero if a value of type TYPE stored in register REGNUM + needs any special handling. */ + +static int +m68k_convert_register_p (int regnum, struct type *type) +{ + return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7); +} + +/* Read a value of type TYPE from register REGNUM in frame FRAME, and + return its contents in TO. */ + +static void +m68k_register_to_value (struct frame_info *frame, int regnum, + struct type *type, void *to) +{ + char from[M68K_MAX_REGISTER_SIZE]; + + /* We only support floating-point values. */ + if (TYPE_CODE (type) != TYPE_CODE_FLT) + { + warning ("Cannot convert floating-point register value " + "to non-floating-point type."); + return; + } + + /* Convert to TYPE. This should be a no-op if TYPE is equivalent to + the extended floating-point format used by the FPU. */ + get_frame_register (frame, regnum, from); + convert_typed_floating (from, builtin_type_m68881_ext, to, type); +} + +/* Write the contents FROM of a value of type TYPE into register + REGNUM in frame FRAME. */ + +static void +m68k_value_to_register (struct frame_info *frame, int regnum, + struct type *type, const void *from) +{ + char to[M68K_MAX_REGISTER_SIZE]; + + /* We only support floating-point values. */ + if (TYPE_CODE (type) != TYPE_CODE_FLT) + { + warning ("Cannot convert non-floating-point type " + "to floating-point register value."); + return; + } + + /* Convert from TYPE. This should be a no-op if TYPE is equivalent + to the extended floating-point format used by the FPU. */ + convert_typed_floating (from, type, to, builtin_type_m68881_ext); + put_frame_register (frame, regnum, to); +} + + +/* There is a fair number of calling conventions that are in somewhat + wide use. The 68000/08/10 don't support an FPU, not even as a + coprocessor. All function return values are stored in %d0/%d1. + Structures are returned in a static buffer, a pointer to which is + returned in %d0. This means that functions returning a structure + are not re-entrant. To avoid this problem some systems use a + convention where the caller passes a pointer to a buffer in %a1 + where the return values is to be stored. This convention is the + default, and is implemented in the function m68k_return_value. + + The 68020/030/040/060 do support an FPU, either as a coprocessor + (68881/2) or built-in (68040/68060). That's why System V release 4 + (SVR4) instroduces a new calling convention specified by the SVR4 + psABI. Integer values are returned in %d0/%d1, pointer return + values in %a0 and floating values in %fp0. When calling functions + returning a structure the caller should pass a pointer to a buffer + for the return value in %a0. This convention is implemented in the + function m68k_svr4_return_value, and by appropriately setting the + struct_value_regnum member of `struct gdbarch_tdep'. + + GNU/Linux returns values in the same way as SVR4 does, but uses %a1 + for passing the structure return value buffer. + + GCC can also generate code where small structures are returned in + %d0/%d1 instead of in memory by using -freg-struct-return. This is + the default on NetBSD a.out, OpenBSD and GNU/Linux and several + embedded systems. This convention is implemented by setting the + struct_return member of `struct gdbarch_tdep' to reg_struct_return. */ /* Read a function return value of TYPE from REGCACHE, and copy that into VALBUF. */ @@ -195,9 +272,9 @@ m68k_store_return_value (struct type *type, struct regcache *regcache, regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf); else if (len <= 8) { - regcache_raw_write_part (regcache, M68K_D1_REGNUM, 8 - len, + regcache_raw_write_part (regcache, M68K_D0_REGNUM, 8 - len, len - 4, valbuf); - regcache_raw_write (regcache, M68K_D0_REGNUM, + regcache_raw_write (regcache, M68K_D1_REGNUM, (char *) valbuf + (len - 4)); } else @@ -262,7 +339,7 @@ m68k_return_value (struct gdbarch *gdbarch, struct type *type, && !m68k_reg_struct_return_p (gdbarch, type)) return RETURN_VALUE_STRUCT_CONVENTION; - /* GCC places `long double' return values in memory. */ + /* GCC returns a `long double' in memory. */ if (code == TYPE_CODE_FLT && TYPE_LENGTH (type) == 12) return RETURN_VALUE_STRUCT_CONVENTION; @@ -283,7 +360,27 @@ m68k_svr4_return_value (struct gdbarch *gdbarch, struct type *type, if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION) && !m68k_reg_struct_return_p (gdbarch, type)) - return RETURN_VALUE_STRUCT_CONVENTION; + { + /* The System V ABI says that: + + "A function returning a structure or union also sets %a0 to + the value it finds in %a0. Thus when the caller receives + control again, the address of the returned object resides in + register %a0." + + So the ABI guarantees that we can always find the return + value just after the function has returned. */ + + if (readbuf) + { + ULONGEST addr; + + regcache_raw_read_unsigned (regcache, M68K_A0_REGNUM, &addr); + read_memory (addr, readbuf, TYPE_LENGTH (type)); + } + + return RETURN_VALUE_ABI_RETURNS_ADDRESS; + } /* This special case is for structures consisting of a single `float' or `double' member. These structures are returned in @@ -305,83 +402,15 @@ m68k_svr4_return_value (struct gdbarch *gdbarch, struct type *type, return RETURN_VALUE_REGISTER_CONVENTION; } - -/* A function that tells us whether the function invocation represented - by fi does not have a frame on the stack associated with it. If it - does not, FRAMELESS is set to 1, else 0. */ - -static int -m68k_frameless_function_invocation (struct frame_info *fi) -{ - if (get_frame_type (fi) == SIGTRAMP_FRAME) - return 0; - else - return legacy_frameless_look_for_prologue (fi); -} - -int -delta68_in_sigtramp (CORE_ADDR pc, char *name) -{ - if (name != NULL) - return strcmp (name, "_sigcode") == 0; - else - return 0; -} - -CORE_ADDR -delta68_frame_args_address (struct frame_info *frame_info) -{ - /* we assume here that the only frameless functions are the system calls - or other functions who do not put anything on the stack. */ - if (get_frame_type (frame_info) == SIGTRAMP_FRAME) - return get_frame_base (frame_info) + 12; - else if (legacy_frameless_look_for_prologue (frame_info)) - { - /* Check for an interrupted system call */ - if (get_next_frame (frame_info) && (get_frame_type (get_next_frame (frame_info)) == SIGTRAMP_FRAME)) - return get_frame_base (get_next_frame (frame_info)) + 16; - else - return get_frame_base (frame_info) + 4; - } - else - return get_frame_base (frame_info); -} - -CORE_ADDR -delta68_frame_saved_pc (struct frame_info *frame_info) -{ - return read_memory_unsigned_integer (delta68_frame_args_address (frame_info) - + 4, 4); -} - -int -delta68_frame_num_args (struct frame_info *fi) -{ - int val; - CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi); - int insn = read_memory_unsigned_integer (pc, 2); - val = 0; - if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ - val = read_memory_integer (pc + 2, 2); - else if ((insn & 0170777) == 0050217 /* addql #N, sp */ - || (insn & 0170777) == 0050117) /* addqw */ - { - val = (insn >> 9) & 7; - if (val == 0) - val = 8; - } - else if (insn == 0157774) /* addal #WW, sp */ - val = read_memory_integer (pc + 2, 4); - val >>= 2; - return val; -} + static CORE_ADDR -m68k_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); char buf[4]; int i; @@ -410,7 +439,7 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, if (struct_return) { store_unsigned_integer (buf, 4, struct_addr); - regcache_cooked_write (regcache, M68K_A1_REGNUM, buf); + regcache_cooked_write (regcache, tdep->struct_value_regnum, buf); } /* Store return address. */ @@ -934,10 +963,10 @@ supply_gregset (gregset_t *gregsetp) for (regi = 0; regi < R_PC; regi++) { - supply_register (regi, (char *) (regp + regi)); + regcache_raw_supply (current_regcache, regi, (char *) (regp + regi)); } - supply_register (PS_REGNUM, (char *) (regp + R_PS)); - supply_register (PC_REGNUM, (char *) (regp + R_PC)); + regcache_raw_supply (current_regcache, PS_REGNUM, (char *) (regp + R_PS)); + regcache_raw_supply (current_regcache, PC_REGNUM, (char *) (regp + R_PC)); } void @@ -949,12 +978,12 @@ fill_gregset (gregset_t *gregsetp, int regno) for (regi = 0; regi < R_PC; regi++) { if (regno == -1 || regno == regi) - regcache_collect (regi, regp + regi); + regcache_raw_collect (current_regcache, regi, regp + regi); } if (regno == -1 || regno == PS_REGNUM) - regcache_collect (PS_REGNUM, regp + R_PS); + regcache_raw_collect (current_regcache, PS_REGNUM, regp + R_PS); if (regno == -1 || regno == PC_REGNUM) - regcache_collect (PC_REGNUM, regp + R_PC); + regcache_raw_collect (current_regcache, PC_REGNUM, regp + R_PC); } #if defined (FP0_REGNUM) @@ -972,11 +1001,14 @@ supply_fpregset (fpregset_t *fpregsetp) for (regi = FP0_REGNUM; regi < M68K_FPC_REGNUM; regi++) { from = (char *) &(fpregsetp->f_fpregs[regi - FP0_REGNUM][0]); - supply_register (regi, from); + regcache_raw_supply (current_regcache, regi, from); } - supply_register (M68K_FPC_REGNUM, (char *) &(fpregsetp->f_pcr)); - supply_register (M68K_FPS_REGNUM, (char *) &(fpregsetp->f_psr)); - supply_register (M68K_FPI_REGNUM, (char *) &(fpregsetp->f_fpiaddr)); + regcache_raw_supply (current_regcache, M68K_FPC_REGNUM, + (char *) &(fpregsetp->f_pcr)); + regcache_raw_supply (current_regcache, M68K_FPS_REGNUM, + (char *) &(fpregsetp->f_psr)); + regcache_raw_supply (current_regcache, M68K_FPI_REGNUM, + (char *) &(fpregsetp->f_fpiaddr)); } /* Given a pointer to a floating point register set in /proc format @@ -992,14 +1024,18 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) for (regi = FP0_REGNUM; regi < M68K_FPC_REGNUM; regi++) { if (regno == -1 || regno == regi) - regcache_collect (regi, &fpregsetp->f_fpregs[regi - FP0_REGNUM][0]); + regcache_raw_collect (current_regcache, regi, + &fpregsetp->f_fpregs[regi - FP0_REGNUM][0]); } if (regno == -1 || regno == M68K_FPC_REGNUM) - regcache_collect (M68K_FPC_REGNUM, &fpregsetp->f_pcr); + regcache_raw_collect (current_regcache, M68K_FPC_REGNUM, + &fpregsetp->f_pcr); if (regno == -1 || regno == M68K_FPS_REGNUM) - regcache_collect (M68K_FPS_REGNUM, &fpregsetp->f_psr); + regcache_raw_collect (current_regcache, M68K_FPS_REGNUM, + &fpregsetp->f_psr); if (regno == -1 || regno == M68K_FPI_REGNUM) - regcache_collect (M68K_FPI_REGNUM, &fpregsetp->f_fpiaddr); + regcache_raw_collect (current_regcache, M68K_FPI_REGNUM, + &fpregsetp->f_fpiaddr); } #endif /* defined (FP0_REGNUM) */ @@ -1011,7 +1047,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) we extract the pc (JB_PC) that we will land at. The pc is copied into PC. This routine returns true on success. */ -int +static int m68k_get_longjmp_target (CORE_ADDR *pc) { char *buf; @@ -1048,7 +1084,13 @@ m68k_get_longjmp_target (CORE_ADDR *pc) void m68k_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + /* SVR4 uses a different calling convention. */ set_gdbarch_return_value (gdbarch, m68k_svr4_return_value); + + /* SVR4 uses %a0 instead of %a1. */ + tdep->struct_value_regnum = M68K_A0_REGNUM; } @@ -1078,12 +1120,10 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Stack grows down. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); - set_gdbarch_parm_boundary (gdbarch, 32); set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_decr_pc_after_break (gdbarch, 2); - set_gdbarch_deprecated_frameless_function_invocation (gdbarch, m68k_frameless_function_invocation); set_gdbarch_frame_args_skip (gdbarch, 8); set_gdbarch_register_type (gdbarch, m68k_register_type); @@ -1094,6 +1134,9 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM); set_gdbarch_ps_regnum (gdbarch, M68K_PS_REGNUM); set_gdbarch_fp0_regnum (gdbarch, M68K_FP0_REGNUM); + set_gdbarch_convert_register_p (gdbarch, m68k_convert_register_p); + set_gdbarch_register_to_value (gdbarch, m68k_register_to_value); + set_gdbarch_value_to_register (gdbarch, m68k_value_to_register); set_gdbarch_push_dummy_call (gdbarch, m68k_push_dummy_call); set_gdbarch_return_value (gdbarch, m68k_return_value); @@ -1107,7 +1150,8 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) #else tdep->jb_pc = -1; #endif - tdep->struct_return = pcc_struct_return; + tdep->struct_value_regnum = M68K_A1_REGNUM; + tdep->struct_return = reg_struct_return; /* Frame unwinder. */ set_gdbarch_unwind_dummy_id (gdbarch, m68k_unwind_dummy_id); diff --git a/gnu/usr.bin/binutils/gdb/m68k-tdep.h b/gnu/usr.bin/binutils/gdb/m68k-tdep.h index edb55137ca9..27a7feb24f8 100644 --- a/gnu/usr.bin/binutils/gdb/m68k-tdep.h +++ b/gnu/usr.bin/binutils/gdb/m68k-tdep.h @@ -70,6 +70,10 @@ struct gdbarch_tdep /* The size of each entry in the jump buffer. */ size_t jb_elt_size; + /* Register in which the address to store a structure value is + passed to a function. */ + int struct_value_regnum; + /* Convention for returning structures. */ enum struct_return struct_return; }; diff --git a/gnu/usr.bin/binutils/gdb/m68kbsd-nat.c b/gnu/usr.bin/binutils/gdb/m68kbsd-nat.c index 285c149428d..34e94b4e2f9 100644 --- a/gnu/usr.bin/binutils/gdb/m68kbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/m68kbsd-nat.c @@ -114,7 +114,7 @@ fetch_inferior_registers (int regnum) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); m68kbsd_supply_gregset (current_regcache, ®s); @@ -125,7 +125,7 @@ fetch_inferior_registers (int regnum) struct fpreg fpregs; if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't get floating point status"); m68kbsd_supply_fpregset (current_regcache, &fpregs); @@ -143,13 +143,13 @@ store_inferior_registers (int regnum) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); m68kbsd_collect_gregset (current_regcache, ®s, regnum); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't write registers"); } @@ -158,13 +158,13 @@ store_inferior_registers (int regnum) struct fpreg fpregs; if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't get floating point status"); m68kbsd_collect_fpregset (current_regcache, &fpregs, regnum); if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't write floating point status"); } } diff --git a/gnu/usr.bin/binutils/gdb/m68knbsd-nat.c b/gnu/usr.bin/binutils/gdb/m68knbsd-nat.c deleted file mode 100644 index 46172439a2f..00000000000 --- a/gnu/usr.bin/binutils/gdb/m68knbsd-nat.c +++ /dev/null @@ -1,103 +0,0 @@ -/* Native-dependent code for Motorola m68k's running NetBSD, for GDB. - Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001 - 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 <sys/types.h> -#include <sys/ptrace.h> -#include <machine/reg.h> -#include <machine/frame.h> -#include "inferior.h" -#include "gdbcore.h" -#include "regcache.h" - -void -fetch_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fp_registers; - - ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], &inferior_registers, - sizeof (inferior_registers)); - - ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof (inferior_fp_registers)); - - deprecated_registers_fetched (); -} - -void -store_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fp_registers; - - memcpy (&inferior_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], - sizeof (inferior_registers)); - ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - - memcpy (&inferior_fp_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - sizeof (inferior_fp_registers)); - ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); -} - -struct md_core -{ - struct reg intreg; - struct fpreg freg; -}; - -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, - CORE_ADDR ignore) -{ - struct md_core *core_reg = (struct md_core *) core_reg_sect; - - /* Integer registers */ - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], - &core_reg->intreg, sizeof (struct reg)); - /* Floating point registers */ - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - &core_reg->freg, sizeof (struct fpreg)); -} - -/* Register that we are able to handle m68knbsd core file formats. - FIXME: is this really bfd_target_unknown_flavour? */ - -static struct core_fns m68knbsd_core_fns = -{ - bfd_target_unknown_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - -void -_initialize_m68knbsd_nat (void) -{ - add_core_fns (&m68knbsd_core_fns); -} diff --git a/gnu/usr.bin/binutils/gdb/m68knbsd-tdep.c b/gnu/usr.bin/binutils/gdb/m68knbsd-tdep.c deleted file mode 100644 index 520d14fa47f..00000000000 --- a/gnu/usr.bin/binutils/gdb/m68knbsd-tdep.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Target-dependent code for NetBSD/i386, for GDB. - Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001 - 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 "gdbtypes.h" -#include "regcache.h" - -int -m68knbsd_use_struct_convention (int gcc_p, struct type *type) -{ - return !(TYPE_LENGTH (type) == 1 - || TYPE_LENGTH (type) == 2 - || TYPE_LENGTH (type) == 4 - || TYPE_LENGTH (type) == 8); -} diff --git a/gnu/usr.bin/binutils/gdb/m88k-tdep.c b/gnu/usr.bin/binutils/gdb/m88k-tdep.c index 215f1db825b..70378080208 100644 --- a/gnu/usr.bin/binutils/gdb/m88k-tdep.c +++ b/gnu/usr.bin/binutils/gdb/m88k-tdep.c @@ -344,7 +344,7 @@ m88k_store_arguments (struct regcache *regcache, int nargs, } static CORE_ADDR -m88k_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +m88k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -731,9 +731,9 @@ m88k_frame_prev_register (struct frame_info *next_frame, void **this_cache, { CORE_ADDR pc; - trad_frame_prev_register (next_frame, cache->saved_regs, - M88K_SXIP_REGNUM, optimizedp, - lvalp, addrp, realnump, valuep); + trad_frame_get_prev_register (next_frame, cache->saved_regs, + M88K_SXIP_REGNUM, optimizedp, + lvalp, addrp, realnump, valuep); pc = extract_unsigned_integer (valuep, 4); if (regnum == M88K_SFIP_REGNUM) @@ -749,8 +749,8 @@ m88k_frame_prev_register (struct frame_info *next_frame, void **this_cache, return; } - trad_frame_prev_register (next_frame, cache->saved_regs, regnum, - optimizedp, lvalp, addrp, realnump, valuep); + trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); } static const struct frame_unwind m88k_frame_unwind = diff --git a/gnu/usr.bin/binutils/gdb/m88kbsd-nat.c b/gnu/usr.bin/binutils/gdb/m88kbsd-nat.c index 02ecbdf04f0..472eb76d5b8 100644 --- a/gnu/usr.bin/binutils/gdb/m88kbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/m88kbsd-nat.c @@ -22,12 +22,14 @@ #include "defs.h" #include "inferior.h" #include "regcache.h" +#include "target.h" #include <sys/types.h> #include <sys/ptrace.h> #include <machine/reg.h> #include "m88k-tdep.h" +#include "inf-ptrace.h" /* Supply the general-purpose registers stored in GREGS to REGCACHE. */ @@ -62,13 +64,13 @@ m88kbsd_collect_gregset (const struct regcache *regcache, /* Fetch register REGNUM from the inferior. If REGNUM is -1, do this for all registers. */ -void -fetch_inferior_registers (int regnum) +static void +m88kbsd_fetch_inferior_registers (int regnum) { struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); m88kbsd_supply_gregset (current_regcache, ®s); @@ -77,18 +79,33 @@ fetch_inferior_registers (int regnum) /* Store register REGNUM back into the inferior. If REGNUM is -1, do this for all registers. */ -void -store_inferior_registers (int regnum) +static void +m88kbsd_store_inferior_registers (int regnum) { struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); m88kbsd_collect_gregset (current_regcache, ®s, regnum); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't write registers"); } + + +/* Provide a prototype to silence -Wmissing-prototypes. */ +void _initialize_m88kbsd_nat (void); + +void +_initialize_m88kbsd_nat (void) +{ + struct target_ops *t; + + t = inf_ptrace_target (); + t->to_fetch_registers = m88kbsd_fetch_inferior_registers; + t->to_store_registers = m88kbsd_store_inferior_registers; + add_target (t); +} diff --git a/gnu/usr.bin/binutils/gdb/main.c b/gnu/usr.bin/binutils/gdb/main.c index 7385cfdf20c..d331bc546ca 100644 --- a/gnu/usr.bin/binutils/gdb/main.c +++ b/gnu/usr.bin/binutils/gdb/main.c @@ -49,12 +49,6 @@ int display_time; int display_space; -/* Whether this is the async version or not. The async version is - invoked on the command line with the -nw --async options. In this - version, the usual command_loop is substituted by and event loop which - processes UI events asynchronously. */ -int event_loop_p = 1; - /* The selected interpreter. This will be used as a set command variable, so it should always be malloc'ed - since do_setshow_command will free it. */ @@ -163,9 +157,6 @@ captured_main (void *data) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - /* This needs to happen before the first use of malloc. */ - init_malloc (NULL); - #ifdef HAVE_SBRK lim_at_start = (char *) sbrk (0); #endif @@ -253,8 +244,6 @@ captured_main (void *data) }; static struct option long_options[] = { - {"async", no_argument, &event_loop_p, 1}, - {"noasync", no_argument, &event_loop_p, 0}, #if defined(TUI) {"tui", no_argument, 0, OPT_TUI}, #endif @@ -527,7 +516,7 @@ extern int gdbtk_test (char *); } /* Initialize all files. Give the interpreter a chance to take - control of the console via the init_ui_hook()) */ + control of the console via the deprecated_init_ui_hook(). */ gdb_init (argv[0]); /* Do these (and anything which might call wrap_here or *_filtered) @@ -737,6 +726,13 @@ extern int gdbtk_test (char *); if (batch) { + if (attach_flag) + /* Either there was a problem executing the command in the + batch file aborted early, or the batch file forgot to do an + explicit detach. Explicitly detach the inferior ensuring + that there are no zombies. */ + target_detach (NULL, 0); + /* We have hit the end of the batch file. */ exit (0); } @@ -779,10 +775,10 @@ extern int gdbtk_test (char *); /* GUIs generally have their own command loop, mainloop, or whatever. This is a good place to gain control because many error conditions will end up here via longjmp(). */ - if (command_loop_hook) - command_loop_hook (); + if (deprecated_command_loop_hook) + deprecated_command_loop_hook (); else - command_loop (); + deprecated_command_loop (); quit_command ((char *) 0, instream == stdin); } } diff --git a/gnu/usr.bin/binutils/gdb/maint.c b/gnu/usr.bin/binutils/gdb/maint.c index f105afa601d..6b4b067851e 100644 --- a/gnu/usr.bin/binutils/gdb/maint.c +++ b/gnu/usr.bin/binutils/gdb/maint.c @@ -308,7 +308,7 @@ maint_print_section_info (const char *name, flagword flags, printf_filtered (" 0x%s", paddr (addr)); printf_filtered ("->0x%s", paddr (endaddr)); printf_filtered (" at %s", - local_hex_string_custom ((unsigned long) filepos, "08l")); + hex_string_custom ((unsigned long) filepos, 8)); printf_filtered (": %s", name); print_bfd_flags (flags); printf_filtered ("\n"); @@ -609,8 +609,8 @@ maintenance_do_deprecate (char *text, int deprecate) /* Maintenance set/show framework. */ -static struct cmd_list_element *maintenance_set_cmdlist; -static struct cmd_list_element *maintenance_show_cmdlist; +struct cmd_list_element *maintenance_set_cmdlist; +struct cmd_list_element *maintenance_show_cmdlist; static void maintenance_set_cmd (char *args, int from_tty) @@ -848,20 +848,23 @@ testsuite can check the comamnd deprecator. You probably shouldn't use this,\n\ If you decide you want to use it: maintenance undeprecate 'commandname'", &maintenancelist); - add_show_from_set ( - add_set_cmd ("watchdog", class_maintenance, var_zinteger, (char *) &watchdog, - "Set watchdog timer.\n\ -When non-zero, this timeout is used instead of waiting forever for a target to\n\ -finish a low-level step or continue operation. If the specified amount of time\n\ -passes without a response from the target, an error occurs.", &setlist), - &showlist); + deprecated_add_show_from_set + (add_set_cmd ("watchdog", class_maintenance, var_zinteger, + (char *) &watchdog, + "Set watchdog timer.\n\ +When non-zero, this timeout is used instead of waiting forever for a target\n\ +to finish a low-level step or continue operation. If the specified amount\n\ +of time passes without a response from the target, an error occurs.", + &setlist), + &showlist); add_setshow_boolean_cmd ("profile", class_maintenance, - &maintenance_profile_p, - "Set internal profiling.\n" - "When enabled GDB is profiled.", - "Show internal profiling.\n", + &maintenance_profile_p, "\ +Set internal profiling.", "\ +Show internal profiling.", "\ +When enabled GDB is profiled.", "\ +Internal profiling is %s.", maintenance_set_profile_cmd, NULL, &maintenance_set_cmdlist, &maintenance_show_cmdlist); diff --git a/gnu/usr.bin/binutils/gdb/mdebugread.c b/gnu/usr.bin/binutils/gdb/mdebugread.c index 89d0282ecfd..e4a51c20055 100644 --- a/gnu/usr.bin/binutils/gdb/mdebugread.c +++ b/gnu/usr.bin/binutils/gdb/mdebugread.c @@ -76,10 +76,6 @@ typedef struct mips_extra_func_info #endif #endif -#ifdef USG -#include <sys/types.h> -#endif - #include "gdb_stat.h" #include "gdb_string.h" @@ -92,7 +88,6 @@ typedef struct mips_extra_func_info #include "aout/stab_gnu.h" /* STABS information */ #include "expression.h" -#include "language.h" /* For local_hex_string() */ extern void _initialize_mdebugread (void); @@ -321,10 +316,6 @@ static void handle_psymbol_enumerators (struct objfile *, FDR *, int, static char *mdebug_next_symbol_text (struct objfile *); -/* Address bounds for the signal trampoline in inferior, if any */ - -CORE_ADDR sigtramp_address, sigtramp_end; - /* Allocate zeroed memory */ static void * @@ -3274,7 +3265,7 @@ parse_partial_symbols (struct objfile *objfile) /* If we haven't found it yet, ignore it. It's probably some new type we don't know about yet. */ complaint (&symfile_complaints, "unknown symbol type %s", - local_hex_string (type_code)); /*CUR_SYMBOL_TYPE*/ + hex_string (type_code)); /*CUR_SYMBOL_TYPE*/ continue; } if (stabstring @@ -3605,13 +3596,6 @@ parse_partial_symbols (struct objfile *objfile) includes_used = 0; dependencies_used = 0; - if (objfile->ei.entry_point >= save_pst->textlow && - objfile->ei.entry_point < save_pst->texthigh) - { - objfile->ei.deprecated_entry_file_lowpc = save_pst->textlow; - objfile->ei.deprecated_entry_file_highpc = save_pst->texthigh; - } - /* The objfile has its functions reordered if this partial symbol table overlaps any other partial symbol table. We cannot assume a reordered objfile if a partial symbol table @@ -4751,126 +4735,6 @@ elfmdebug_build_psymtabs (struct objfile *objfile, install_minimal_symbols (objfile); do_cleanups (back_to); } - - -/* Things used for calling functions in the inferior. - These functions are exported to our companion - mips-tdep.c file and are here because they play - with the symbol-table explicitly. */ - -/* Sigtramp: make sure we have all the necessary information - about the signal trampoline code. Since the official code - from MIPS does not do so, we make up that information ourselves. - If they fix the library (unlikely) this code will neutralize itself. */ - -/* FIXME: This function is called only by mips-tdep.c. It needs to be - here because it calls functions defined in this file, but perhaps - this could be handled in a better way. Only compile it in when - tm-mips.h is included. */ - -#ifdef TM_MIPS_H - -void -fixup_sigtramp (void) -{ - struct symbol *s; - struct symtab *st; - struct block *b, *b0 = NULL; - - sigtramp_address = -1; - - /* We have to handle the following cases here: - a) The Mips library has a sigtramp label within sigvec. - b) Irix has a _sigtramp which we want to use, but it also has sigvec. */ - s = lookup_symbol ("sigvec", 0, VAR_DOMAIN, 0, NULL); - if (s != 0) - { - b0 = SYMBOL_BLOCK_VALUE (s); - s = lookup_symbol ("sigtramp", b0, VAR_DOMAIN, 0, NULL); - } - if (s == 0) - { - /* No sigvec or no sigtramp inside sigvec, try _sigtramp. */ - s = lookup_symbol ("_sigtramp", 0, VAR_DOMAIN, 0, NULL); - } - - /* But maybe this program uses its own version of sigvec */ - if (s == 0) - return; - - /* Did we or MIPSco fix the library ? */ - if (SYMBOL_CLASS (s) == LOC_BLOCK) - { - sigtramp_address = BLOCK_START (SYMBOL_BLOCK_VALUE (s)); - sigtramp_end = BLOCK_END (SYMBOL_BLOCK_VALUE (s)); - return; - } - - sigtramp_address = SYMBOL_VALUE (s); - sigtramp_end = sigtramp_address + 0x88; /* black magic */ - - /* But what symtab does it live in ? */ - st = find_pc_symtab (SYMBOL_VALUE (s)); - - /* - * Ok, there goes the fix: turn it into a procedure, with all the - * needed info. Note we make it a nested procedure of sigvec, - * which is the way the (assembly) code is actually written. - */ - SYMBOL_DOMAIN (s) = VAR_DOMAIN; - SYMBOL_CLASS (s) = LOC_BLOCK; - SYMBOL_TYPE (s) = init_type (TYPE_CODE_FUNC, 4, 0, (char *) NULL, - st->objfile); - TYPE_TARGET_TYPE (SYMBOL_TYPE (s)) = mdebug_type_void; - - /* Need a block to allocate MIPS_EFI_SYMBOL_NAME in */ - b = new_block (NON_FUNCTION_BLOCK); - SYMBOL_BLOCK_VALUE (s) = b; - BLOCK_START (b) = sigtramp_address; - BLOCK_END (b) = sigtramp_end; - BLOCK_FUNCTION (b) = s; - BLOCK_SUPERBLOCK (b) = BLOCK_SUPERBLOCK (b0); - add_block (b, st); - sort_blocks (st); - - /* Make a MIPS_EFI_SYMBOL_NAME entry for it */ - { - struct mips_extra_func_info *e = - ((struct mips_extra_func_info *) - xzalloc (sizeof (struct mips_extra_func_info))); - - e->numargs = 0; /* the kernel thinks otherwise */ - e->pdr.frameoffset = 32; - e->pdr.framereg = SP_REGNUM; - /* Note that setting pcreg is no longer strictly necessary as - mips_frame_saved_pc is now aware of signal handler frames. */ - e->pdr.pcreg = PC_REGNUM; - e->pdr.regmask = -2; - /* Offset to saved r31, in the sigtramp case the saved registers - are above the frame in the sigcontext. - We have 4 alignment bytes, 12 bytes for onstack, mask and pc, - 32 * 4 bytes for the general registers, 12 bytes for mdhi, mdlo, ownedfp - and 32 * 4 bytes for the floating point registers. */ - e->pdr.regoffset = 4 + 12 + 31 * 4; - e->pdr.fregmask = -1; - /* Offset to saved f30 (first saved *double* register). */ - e->pdr.fregoffset = 4 + 12 + 32 * 4 + 12 + 30 * 4; - e->pdr.isym = (long) s; - e->pdr.adr = sigtramp_address; - - current_objfile = st->objfile; /* Keep new_symbol happy */ - s = new_symbol (MIPS_EFI_SYMBOL_NAME); - SYMBOL_VALUE (s) = (long) e; - SYMBOL_DOMAIN (s) = LABEL_DOMAIN; - SYMBOL_CLASS (s) = LOC_CONST; - SYMBOL_TYPE (s) = mdebug_type_void; - current_objfile = NULL; - } - - dict_add_symbol (BLOCK_DICT (b), s); -} - -#endif /* TM_MIPS_H */ void _initialize_mdebugread (void) diff --git a/gnu/usr.bin/binutils/gdb/minimon.h b/gnu/usr.bin/binutils/gdb/minimon.h deleted file mode 100644 index 94fd774a375..00000000000 --- a/gnu/usr.bin/binutils/gdb/minimon.h +++ /dev/null @@ -1,601 +0,0 @@ -/* Definitions and macros for support of AMD's remote debugger, MiniMON. - Copyright 1990, 1991 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. */ - -/* - * Some basic types. FIXME, this should be done by declaring bitfield - * sizes in the structs. We can't portably depend on a "long int" being - * 32 bits, etc. - */ -typedef long int INT32; /* 32 bit integer */ -typedef unsigned long int UINT32; /* 32 bit integer (unsigned) */ -typedef unsigned long int ADDR32; /* 32 bit address */ -typedef unsigned long int INST32; /* 32 bit instruction */ -typedef long int BOOLEAN; /* Boolean value (32 bit) */ -typedef unsigned char BYTE; /* byte (8 bit) */ -typedef short int INT16; /* 16 bit integer */ -typedef unsigned short int UINT16; /* 16 bit integer (unsigned) */ - -/****************************************************************************/ -/************************* Message Information ******************************/ -/****************************************************************************/ - -/* - * Error codes - */ - -/* General errors */ -#define EMUSAGE 1 /* Bad args / flags */ -#define EMFAIL 2 /* Unrecoverable error */ -#define EMBADADDR 3 /* Illegal address */ -#define EMBADREG 4 /* Illegal register */ -#define EMSYNTAX 5 /* Illegal command syntax */ -#define EMACCESS 6 /* Could not access memory */ -#define EMALLOC 7 /* Could not allocate memory */ -#define EMTARGET 8 /* Unknown target type */ -#define EMHINIT 9 /* Could not initialize host */ -#define EMCOMM 10 /* Could not open communication channel */ - -/* Message errors */ -#define EMBADMSG 11 /* Unknown message type */ -#define EMMSG2BIG 12 /* Message to large for buffer */ -#define EMNOSEND 13 /* Could not send message */ -#define EMNORECV 14 /* Could not receive message */ - -#define EMRESET 15 /* Could not RESET target */ -#define EMCONFIG 16 /* Could not get target CONFIG */ -#define EMSTATUS 17 /* Could not get target STATUS */ -#define EMREAD 18 /* Could not READ target memory */ -#define EMWRITE 19 /* Could not WRITE target memory */ -#define EMBKPTSET 20 /* Could not set breakpoint */ -#define EMBKPTRM 21 /* Could not remove breakpoint */ -#define EMBKPTSTAT 22 /* Could not get breakpoint status */ -#define EMBKPTNONE 23 /* All breakpoints in use */ -#define EMBKPTUSED 24 /* Breakpoints already in use */ -#define EMCOPY 25 /* Could not COPY target memory */ -#define EMFILL 26 /* Could not FILL target memory */ -#define EMINIT 27 /* Could not initialize target memory */ -#define EMGO 28 /* Could not start execution */ -#define EMSTEP 29 /* Could not single step */ -#define EMBREAK 30 /* Could not BREAK */ -#define EMHIF 31 /* Could not perform HIF service */ -#define EMCHANNEL0 32 /* Could not read CHANNEL0 */ -#define EMCHANNEL1 33 /* Could not write CHANNEL1 */ - -/* COFF file loader errors */ -#define EMOPEN 34 /* Could not open COFF file */ -#define EMHDR 35 /* Could not read COFF header */ -#define EMMAGIC 36 /* Bad magic number */ -#define EMAOUT 37 /* Could not read COFF a.out header */ -#define EMSCNHDR 38 /* Could not read COFF section header */ -#define EMSCN 39 /* Could not read COFF section */ -#define EMCLOSE 40 /* Could not close COFF file */ - -/* Log file errors */ -#define EMLOGOPEN 41 /* Could not open log file */ -#define EMLOGREAD 42 /* Could not read log file */ -#define EMLOGWRITE 43 /* Could not write to log file */ -#define EMLOGCLOSE 44 /* Could not close log file */ - -/* Command file errors */ -#define EMCMDOPEN 45 /* Could not open command file */ -#define EMCMDREAD 46 /* Could not read command file */ -#define EMCMDWRITE 47 /* Could not write to command file */ -#define EMCMDCLOSE 48 /* Could not close comand file */ - -#define EMTIMEOUT 49 /* Host timed out waiting for a message */ -#define EMCOMMTYPE 50 /* A '-t' flag must be specified */ -#define EMCOMMERR 51 /* Communication error */ -#define EMBAUD 52 /* Invalid baud rate specified */ -/* - * Memory Spaces - */ -#define LOCAL_REG 0 /* Local processor register */ -#define GLOBAL_REG 1 /* Global processor register */ -#define SPECIAL_REG 2 /* Special processor register */ -#define TLB_REG 3 /* Translation Lookaside Buffer */ -#define COPROC_REG 4 /* Coprocessor register */ -#define I_MEM 5 /* Instruction Memory */ -#define D_MEM 6 /* Data Memory */ -#define I_ROM 7 /* Instruction ROM */ -#define D_ROM 8 /* Data ROM */ -#define I_O 9 /* Input/Output */ -#define I_CACHE 10 /* Instruction Cache */ -#define D_CACHE 11 /* Data Cache */ - -/* To supress warnings for zero length array definitions */ -#define DUMMY 1 - -/* - ** Host to target definitions - */ - -#define RESET 0 -#define CONFIG_REQ 1 -#define STATUS_REQ 2 -#define READ_REQ 3 -#define WRITE_REQ 4 -#define BKPT_SET 5 -#define BKPT_RM 6 -#define BKPT_STAT 7 -#define COPY 8 -#define FILL 9 -#define INIT 10 -#define GO 11 -#define STEP 12 -#define BREAK 13 - -#define HIF_CALL_RTN 64 -#define CHANNEL0 65 -#define CHANNEL1_ACK 66 - - -/* - ** Target to host definitions - */ - -#define RESET_ACK 32 -#define CONFIG 33 -#define STATUS 34 -#define READ_ACK 35 -#define WRITE_ACK 36 -#define BKPT_SET_ACK 37 -#define BKPT_RM_ACK 38 -#define BKPT_STAT_ACK 39 -#define COPY_ACK 40 -#define FILL_ACK 41 -#define INIT_ACK 42 -#define HALT 43 - -#define ERROR 63 - -#define HIF_CALL 96 -#define CHANNEL0_ACK 97 -#define CHANNEL1 98 - - -/* A "generic" message */ -struct generic_msg_t - { - INT32 code; /* generic */ - INT32 length; - BYTE byte[DUMMY]; - }; - - -/* A "generic" message (with an INT32 array) */ -struct generic_int32_msg_t - { - INT32 code; /* generic */ - INT32 length; - INT32 int32[DUMMY]; - }; - - -/* - ** Host to target messages - */ - -struct reset_msg_t - { - INT32 code; /* 0 */ - INT32 length; - }; - - -struct config_req_msg_t - { - INT32 code; /* 1 */ - INT32 length; - }; - - -struct status_req_msg_t - { - INT32 code; /* 2 */ - INT32 length; - }; - - -struct read_req_msg_t - { - INT32 code; /* 3 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 byte_count; - }; - - -struct write_req_msg_t - { - INT32 code; /* 4 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 byte_count; - BYTE data[DUMMY]; - }; - - -struct write_r_msg_t - { - INT32 code; /* 4 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 byte_count; - INT32 data[DUMMY]; - }; - - -struct bkpt_set_msg_t - { - INT32 code; /* 5 */ - INT32 length; - INT32 memory_space; - ADDR32 bkpt_addr; - INT32 pass_count; - INT32 bkpt_type; - }; - - -struct bkpt_rm_msg_t - { - INT32 code; /* 6 */ - INT32 length; - INT32 memory_space; - ADDR32 bkpt_addr; - }; - - -struct bkpt_stat_msg_t - { - INT32 code; /* 7 */ - INT32 length; - INT32 memory_space; - ADDR32 bkpt_addr; - }; - - -struct copy_msg_t - { - INT32 code; /* 8 */ - INT32 length; - INT32 source_space; - ADDR32 source_addr; - INT32 dest_space; - ADDR32 dest_addr; - INT32 byte_count; - }; - - -struct fill_msg_t - { - INT32 code; /* 9 */ - INT32 length; - INT32 memory_space; - ADDR32 start_addr; - INT32 fill_count; - INT32 byte_count; - BYTE fill_data[DUMMY]; - }; - - -struct init_msg_t - { - INT32 code; /* 10 */ - INT32 length; - ADDR32 text_start; - ADDR32 text_end; - ADDR32 data_start; - ADDR32 data_end; - ADDR32 entry_point; - INT32 mem_stack_size; - INT32 reg_stack_size; - ADDR32 arg_start; - INT32 os_control; - }; - - -struct go_msg_t - { - INT32 code; /* 11 */ - INT32 length; - }; - - -struct step_msg_t - { - INT32 code; /* 12 */ - INT32 length; - INT32 count; - }; - - -struct break_msg_t - { - INT32 code; /* 13 */ - INT32 length; - }; - - -struct hif_call_rtn_msg_t - { - INT32 code; /* 64 */ - INT32 length; - INT32 service_number; - INT32 gr121; - INT32 gr96; - INT32 gr97; - }; - - -struct channel0_msg_t - { - INT32 code; /* 65 */ - INT32 length; - BYTE data; - }; - - -struct channel1_ack_msg_t - { - INT32 code; /* 66 */ - INT32 length; - }; - - -/* - ** Target to host messages - */ - - -struct reset_ack_msg_t - { - INT32 code; /* 32 */ - INT32 length; - }; - - -struct config_msg_t - { - INT32 code; /* 33 */ - INT32 length; - INT32 processor_id; - INT32 version; - ADDR32 I_mem_start; - INT32 I_mem_size; - ADDR32 D_mem_start; - INT32 D_mem_size; - ADDR32 ROM_start; - INT32 ROM_size; - INT32 max_msg_size; - INT32 max_bkpts; - INT32 coprocessor; - INT32 reserved; - }; - - -struct status_msg_t - { - INT32 code; /* 34 */ - INT32 length; - INT32 msgs_sent; - INT32 msgs_received; - INT32 errors; - INT32 bkpts_hit; - INT32 bkpts_free; - INT32 traps; - INT32 fills; - INT32 spills; - INT32 cycles; - INT32 reserved; - }; - - -struct read_ack_msg_t - { - INT32 code; /* 35 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 byte_count; - BYTE data[DUMMY]; - }; - -struct read_r_ack_msg_t - { - INT32 code; /* 35 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 byte_count; - INT32 data[DUMMY]; - }; - - -struct write_ack_msg_t - { - INT32 code; /* 36 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 byte_count; - }; - - -struct bkpt_set_ack_msg_t - { - INT32 code; /* 37 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 pass_count; - INT32 bkpt_type; - }; - - -struct bkpt_rm_ack_msg_t - { - INT32 code; /* 38 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - }; - - -struct bkpt_stat_ack_msg_t - { - INT32 code; /* 39 */ - INT32 length; - INT32 memory_space; - ADDR32 address; - INT32 pass_count; - INT32 bkpt_type; - }; - - -struct copy_ack_msg_t - { - INT32 code; /* 40 */ - INT32 length; - INT32 source_space; - ADDR32 source_addr; - INT32 dest_space; - ADDR32 dest_addr; - INT32 byte_count; - }; - - -struct fill_ack_msg_t - { - INT32 code; /* 41 */ - INT32 length; - INT32 memory_space; - ADDR32 start_addr; - INT32 fill_count; - INT32 byte_count; - }; - - -struct init_ack_msg_t - { - INT32 code; /* 42 */ - INT32 length; - }; - - -struct halt_msg_t - { - INT32 code; /* 43 */ - INT32 length; - INT32 memory_space; - ADDR32 pc0; - ADDR32 pc1; - INT32 trap_number; - }; - - -struct error_msg_t - { - INT32 code; /* 63 */ - INT32 length; - INT32 error_code; - INT32 memory_space; - ADDR32 address; - }; - - -struct hif_call_msg_t - { - INT32 code; /* 96 */ - INT32 length; - INT32 service_number; - INT32 lr2; - INT32 lr3; - INT32 lr4; - }; - - -struct channel0_ack_msg_t - { - INT32 code; /* 97 */ - INT32 length; - }; - - -struct channel1_msg_t - { - INT32 code; /* 98 */ - INT32 length; - BYTE data[DUMMY]; - }; - - - -/* - ** Union all of the message types together - */ - -union msg_t - { - struct generic_msg_t generic_msg; - struct generic_int32_msg_t generic_int32_msg; - - struct reset_msg_t reset_msg; - struct config_req_msg_t config_req_msg; - struct status_req_msg_t status_req_msg; - struct read_req_msg_t read_req_msg; - struct write_req_msg_t write_req_msg; - struct write_r_msg_t write_r_msg; - struct bkpt_set_msg_t bkpt_set_msg; - struct bkpt_rm_msg_t bkpt_rm_msg; - struct bkpt_stat_msg_t bkpt_stat_msg; - struct copy_msg_t copy_msg; - struct fill_msg_t fill_msg; - struct init_msg_t init_msg; - struct go_msg_t go_msg; - struct step_msg_t step_msg; - struct break_msg_t break_msg; - - struct hif_call_rtn_msg_t hif_call_rtn_msg; - struct channel0_msg_t channel0_msg; - struct channel1_ack_msg_t channel1_ack_msg; - - struct reset_ack_msg_t reset_ack_msg; - struct config_msg_t config_msg; - struct status_msg_t status_msg; - struct read_ack_msg_t read_ack_msg; - struct read_r_ack_msg_t read_r_ack_msg; - struct write_ack_msg_t write_ack_msg; - struct bkpt_set_ack_msg_t bkpt_set_ack_msg; - struct bkpt_rm_ack_msg_t bkpt_rm_ack_msg; - struct bkpt_stat_ack_msg_t bkpt_stat_ack_msg; - struct copy_ack_msg_t copy_ack_msg; - struct fill_ack_msg_t fill_ack_msg; - struct init_ack_msg_t init_ack_msg; - struct halt_msg_t halt_msg; - - struct error_msg_t error_msg; - - struct hif_call_msg_t hif_call_msg; - struct channel0_ack_msg_t channel0_ack_msg; - struct channel1_msg_t channel1_msg; - }; diff --git a/gnu/usr.bin/binutils/gdb/minsyms.c b/gnu/usr.bin/binutils/gdb/minsyms.c index 83aef9d4428..635d0cc4a17 100644 --- a/gnu/usr.bin/binutils/gdb/minsyms.c +++ b/gnu/usr.bin/binutils/gdb/minsyms.c @@ -145,7 +145,15 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym, Note: One instance where there may be duplicate minimal symbols with the same name is when the symbol tables for a shared library and the symbol tables for an executable contain global symbols with the same - names (the dynamic linker deals with the duplication). */ + names (the dynamic linker deals with the duplication). + + It's also possible to have minimal symbols with different mangled + names, but identical demangled names. For example, the GNU C++ v3 + ABI requires the generation of two (or perhaps three) copies of + constructor functions --- "in-charge", "not-in-charge", and + "allocate" copies; destructors may be duplicated as well. + Obviously, there must be distinct mangled names for each of these, + but the demangled names are all the same: S::S or S::~S. */ struct minimal_symbol * lookup_minimal_symbol (const char *name, const char *sfile, @@ -580,26 +588,23 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address, struct msym_bunch *new; struct minimal_symbol *msymbol; - if (ms_type == mst_file_text) - { - /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into - the minimal symbols, because if there is also another symbol - at the same address (e.g. the first function of the file), - lookup_minimal_symbol_by_pc would have no way of getting the - right one. */ - if (name[0] == 'g' - && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0 - || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)) - return (NULL); + /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into + the minimal symbols, because if there is also another symbol + at the same address (e.g. the first function of the file), + lookup_minimal_symbol_by_pc would have no way of getting the + right one. */ + if (ms_type == mst_file_text && name[0] == 'g' + && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0 + || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)) + return (NULL); - { - const char *tempstring = name; - if (tempstring[0] == get_symbol_leading_char (objfile->obfd)) - ++tempstring; - if (strncmp (tempstring, "__gnu_compiled", 14) == 0) - return (NULL); - } - } + /* It's safe to strip the leading char here once, since the name + is also stored stripped in the minimal symbol table. */ + if (name[0] == get_symbol_leading_char (objfile->obfd)) + ++name; + + if (ms_type == mst_file_text && strncmp (name, "__gnu_compiled", 14) == 0) + return (NULL); if (msym_bunch_index == BUNCH_SIZE) { @@ -794,7 +799,7 @@ build_minimal_symbol_hash_tables (struct objfile *objfile) add_minsym_to_hash_table (msym, objfile->msymbol_hash); msym->demangled_hash_next = 0; - if (SYMBOL_DEMANGLED_NAME (msym) != NULL) + if (SYMBOL_SEARCH_NAME (msym) != SYMBOL_LINKAGE_NAME (msym)) add_minsym_to_demangled_hash_table (msym, objfile->msymbol_demangled_hash); } @@ -831,7 +836,6 @@ install_minimal_symbols (struct objfile *objfile) struct msym_bunch *bunch; struct minimal_symbol *msymbols; int alloc_count; - char leading_char; if (msym_count > 0) { @@ -859,18 +863,11 @@ install_minimal_symbols (struct objfile *objfile) each bunch is full. */ mcount = objfile->minimal_symbol_count; - leading_char = get_symbol_leading_char (objfile->obfd); for (bunch = msym_bunch; bunch != NULL; bunch = bunch->next) { for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++) - { - msymbols[mcount] = bunch->contents[bindex]; - if (SYMBOL_LINKAGE_NAME (&msymbols[mcount])[0] == leading_char) - { - SYMBOL_LINKAGE_NAME (&msymbols[mcount])++; - } - } + msymbols[mcount] = bunch->contents[bindex]; msym_bunch_index = BUNCH_SIZE; } diff --git a/gnu/usr.bin/binutils/gdb/mips-nat.c b/gnu/usr.bin/binutils/gdb/mips-nat.c deleted file mode 100644 index 626f770f18d..00000000000 --- a/gnu/usr.bin/binutils/gdb/mips-nat.c +++ /dev/null @@ -1,254 +0,0 @@ -/* Low level DECstation interface to ptrace, for GDB when running native. - Copyright 1988, 1989, 1991, 1992, 1993, 1995, 1996, 1999, 2000, 2001 - Free Software Foundation, Inc. - Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU - and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin. - - 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 "inferior.h" -#include "gdbcore.h" -#include "regcache.h" -#include <sys/ptrace.h> -#include <sys/types.h> -#include <sys/param.h> -#include <sys/user.h> -#undef JB_S0 -#undef JB_S1 -#undef JB_S2 -#undef JB_S3 -#undef JB_S4 -#undef JB_S5 -#undef JB_S6 -#undef JB_S7 -#undef JB_SP -#undef JB_S8 -#undef JB_PC -#undef JB_SR -#undef NJBREGS -#include <setjmp.h> /* For JB_XXX. */ - -/* Size of elements in jmpbuf */ - -#define JB_ELEMENT_SIZE 4 - -/* Map gdb internal register number to ptrace ``address''. - These ``addresses'' are defined in DECstation <sys/ptrace.h> */ - -static int -register_ptrace_addr (int regno) -{ - return (regno < 32 ? GPR_BASE + regno - : regno == mips_regnum (current_gdbarch)->pc ? PC - : regno == mips_regnum (current_gdbarch)->cause ? CAUSE - : regno == mips_regnum (current_gdbarch)->hi ? MMHI - : regno == mips_regnum (current_gdbarch)->lo ? MMLO - : regno == mips_regnum (current_gdbarch)->fp_control_status ? FPC_CSR - : regno == mips_regnum (current_gdbarch)->fp_implementation_revision ? FPC_EIR - : regno >= FP0_REGNUM ? FPR_BASE + (regno - FP0_REGNUM) - : 0); -} - -static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); - -/* Get all registers from the inferior */ - -void -fetch_inferior_registers (int regno) -{ - unsigned int regaddr; - char buf[MAX_REGISTER_SIZE]; - int i; - char zerobuf[MAX_REGISTER_SIZE]; - memset (zerobuf, 0, MAX_REGISTER_SIZE); - - deprecated_registers_fetched (); - - for (regno = 1; regno < NUM_REGS; regno++) - { - regaddr = register_ptrace_addr (regno); - for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (int)) - { - *(int *) &buf[i] = ptrace (PT_READ_U, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) regaddr, 0); - regaddr += sizeof (int); - } - supply_register (regno, buf); - } - - supply_register (ZERO_REGNUM, zerobuf); - /* Frame ptr reg must appear to be 0; it is faked by stack handling code. */ - supply_register (DEPRECATED_FP_REGNUM, zerobuf); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - unsigned int regaddr; - char buf[80]; - - if (regno > 0) - { - if (regno == ZERO_REGNUM || regno == PS_REGNUM - || regno == mips_regnum (current_gdbarch)->badvaddr - || regno == mips_regnum (current_gdbarch)->cause - || regno == mips_regnum (current_gdbarch)->fp_implementation_revision - || regno == DEPRECATED_FP_REGNUM - || (regno >= FIRST_EMBED_REGNUM && regno <= LAST_EMBED_REGNUM)) - return; - regaddr = register_ptrace_addr (regno); - errno = 0; - ptrace (PT_WRITE_U, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr, - read_register (regno)); - if (errno != 0) - { - sprintf (buf, "writing register number %d", regno); - perror_with_name (buf); - } - } - else - { - for (regno = 0; regno < NUM_REGS; regno++) - store_inferior_registers (regno); - } -} - - -/* Figure out where the longjmp will land. - We expect the first arg to be a pointer to the jmp_buf structure from which - we extract the pc (JB_PC) that we will land at. The pc is copied into PC. - This routine returns true on success. */ - -int -get_longjmp_target (CORE_ADDR *pc) -{ - CORE_ADDR jb_addr; - char *buf; - - buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT); - jb_addr = read_register (A0_REGNUM); - - if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf, - TARGET_PTR_BIT / TARGET_CHAR_BIT)) - return 0; - - *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT); - - return 1; -} - -/* Extract the register values out of the core file and store - them where `read_register' will find them. - - CORE_REG_SECT points to the register values themselves, read into memory. - CORE_REG_SIZE is the size of that area. - WHICH says which set of registers we are handling (0 = int, 2 = float - on machines where they are discontiguous). - REG_ADDR is the offset from u.u_ar0 to the register values relative to - core_reg_sect. This is used with old-fashioned core files to - locate the registers in a large upage-plus-stack ".reg" section. - Original upage address X is at location core_reg_sect+x+reg_addr. - */ - -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, - CORE_ADDR reg_addr) -{ - int regno; - unsigned int addr; - int bad_reg = -1; - reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */ - - char zerobuf[MAX_REGISTER_SIZE]; - memset (zerobuf, 0, MAX_REGISTER_SIZE); - - - /* If u.u_ar0 was an absolute address in the core file, relativize it now, - so we can use it as an offset into core_reg_sect. When we're done, - "register 0" will be at core_reg_sect+reg_ptr, and we can use - register_addr to offset to the other registers. If this is a modern - core file without a upage, reg_ptr will be zero and this is all a big - NOP. */ - if (reg_ptr > core_reg_size) -#ifdef KERNEL_U_ADDR - reg_ptr -= KERNEL_U_ADDR; -#else - error ("Old mips core file can't be processed on this machine."); -#endif - - for (regno = 0; regno < NUM_REGS; regno++) - { - addr = register_addr (regno, reg_ptr); - if (addr >= core_reg_size) - { - if (bad_reg < 0) - bad_reg = regno; - } - else - { - supply_register (regno, core_reg_sect + addr); - } - } - if (bad_reg >= 0) - { - error ("Register %s not found in core file.", REGISTER_NAME (bad_reg)); - } - supply_register (ZERO_REGNUM, zerobuf); - /* Frame ptr reg must appear to be 0; it is faked by stack handling code. */ - supply_register (DEPRECATED_FP_REGNUM, zerobuf); -} - -/* Return the address in the core dump or inferior of register REGNO. - BLOCKEND is the address of the end of the user structure. */ - -CORE_ADDR -register_addr (int regno, CORE_ADDR blockend) -{ - CORE_ADDR addr; - - if (regno < 0 || regno >= NUM_REGS) - error ("Invalid register number %d.", regno); - - REGISTER_U_ADDR (addr, blockend, regno); - - return addr; -} - - -/* Register that we are able to handle mips core file formats. - FIXME: is this really bfd_target_unknown_flavour? */ - -static struct core_fns mips_core_fns = -{ - bfd_target_unknown_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - -void -_initialize_core_mips (void) -{ - add_core_fns (&mips_core_fns); -} diff --git a/gnu/usr.bin/binutils/gdb/mips-tdep.c b/gnu/usr.bin/binutils/gdb/mips-tdep.c index cd37764eed9..4f249b8e439 100644 --- a/gnu/usr.bin/binutils/gdb/mips-tdep.c +++ b/gnu/usr.bin/binutils/gdb/mips-tdep.c @@ -53,10 +53,11 @@ #include "frame-unwind.h" #include "frame-base.h" #include "trad-frame.h" +#include "infcall.h" +#include "floatformat.h" static const struct objfile_data *mips_pdr_data; -static void set_reg_offset (CORE_ADDR *saved_regs, int regnum, CORE_ADDR off); static struct type *mips_register_type (struct gdbarch *gdbarch, int regnum); /* A useful bit in the CP0 status register (PS_REGNUM). */ @@ -107,8 +108,7 @@ static const char *size_enums[] = { }; /* Some MIPS boards don't support floating point while others only - support single-precision floating-point operations. See also - FP_REGISTER_DOUBLE. */ + support single-precision floating-point operations. */ enum mips_fpu_type { @@ -137,9 +137,6 @@ struct gdbarch_tdep enum mips_fpu_type mips_fpu_type; int mips_last_arg_regnum; int mips_last_fp_arg_regnum; - int mips_default_saved_regsize; - int mips_fp_register_double; - int mips_default_stack_argsize; int default_mask_address_p; /* Is the target using 64-bit raw integer registers but only storing a left-aligned 32-bit value in each? */ @@ -152,6 +149,32 @@ struct gdbarch_tdep const char **mips_processor_reg_names; }; +static int +n32n64_floatformat_always_valid (const struct floatformat *fmt, + const char *from) +{ + return 1; +} + +/* FIXME: brobecker/2004-08-08: Long Double values are 128 bit long. + They are implemented as a pair of 64bit doubles where the high + part holds the result of the operation rounded to double, and + the low double holds the difference between the exact result and + the rounded result. So "high" + "low" contains the result with + added precision. Unfortunately, the floatformat structure used + by GDB is not powerful enough to describe this format. As a temporary + measure, we define a 128bit floatformat that only uses the high part. + We lose a bit of precision but that's probably the best we can do + for now with the current infrastructure. */ + +static const struct floatformat floatformat_n32n64_long_double_big = +{ + floatformat_big, 128, 0, 1, 11, 1023, 2047, 12, 52, + floatformat_intbit_no, + "floatformat_ieee_double_big", + n32n64_floatformat_always_valid +}; + const struct mips_regnum * mips_regnum (struct gdbarch *gdbarch) { @@ -233,7 +256,7 @@ mips_abi (struct gdbarch *gdbarch) } int -mips_regsize (struct gdbarch *gdbarch) +mips_isa_regsize (struct gdbarch *gdbarch) { return (gdbarch_bfd_arch_info (gdbarch)->bits_per_word / gdbarch_bfd_arch_info (gdbarch)->bits_per_byte); @@ -241,16 +264,30 @@ mips_regsize (struct gdbarch *gdbarch) /* Return the currently configured (or set) saved register size. */ -static const char *mips_saved_regsize_string = size_auto; +static const char *mips_abi_regsize_string = size_auto; static unsigned int -mips_saved_regsize (struct gdbarch_tdep *tdep) +mips_abi_regsize (struct gdbarch *gdbarch) { - if (mips_saved_regsize_string == size_auto) - return tdep->mips_default_saved_regsize; - else if (mips_saved_regsize_string == size_64) + if (mips_abi_regsize_string == size_auto) + switch (mips_abi (gdbarch)) + { + case MIPS_ABI_EABI32: + case MIPS_ABI_O32: + return 4; + case MIPS_ABI_N32: + case MIPS_ABI_N64: + case MIPS_ABI_O64: + case MIPS_ABI_EABI64: + return 8; + case MIPS_ABI_UNKNOWN: + case MIPS_ABI_LAST: + default: + internal_error (__FILE__, __LINE__, "bad switch"); + } + else if (mips_abi_regsize_string == size_64) return 8; - else /* if (mips_saved_regsize_string == size_32) */ + else /* if (mips_abi_regsize_string == size_32) */ return 4; } @@ -363,22 +400,17 @@ mips2_fp_compat (void) return 0; } -/* Indicate that the ABI makes use of double-precision registers - provided by the FPU (rather than combining pairs of registers to - form double-precision values). See also MIPS_FPU_TYPE. */ -#define FP_REGISTER_DOUBLE (gdbarch_tdep (current_gdbarch)->mips_fp_register_double) - /* The amount of space reserved on the stack for registers. This is - different to MIPS_SAVED_REGSIZE as it determines the alignment of + different to MIPS_ABI_REGSIZE as it determines the alignment of data allocated after the registers have run out. */ static const char *mips_stack_argsize_string = size_auto; static unsigned int -mips_stack_argsize (struct gdbarch_tdep *tdep) +mips_stack_argsize (struct gdbarch *gdbarch) { if (mips_stack_argsize_string == size_auto) - return tdep->mips_default_stack_argsize; + return mips_abi_regsize (gdbarch); else if (mips_stack_argsize_string == size_64) return 8; else /* if (mips_stack_argsize_string == size_32) */ @@ -387,8 +419,12 @@ mips_stack_argsize (struct gdbarch_tdep *tdep) #define VM_MIN_ADDRESS (CORE_ADDR)0x400000 +struct mips_frame_cache; static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR, CORE_ADDR, - struct frame_info *, int); + struct frame_info *, + struct mips_frame_cache *); +static mips_extra_func_info_t non_heuristic_proc_desc (CORE_ADDR pc, + CORE_ADDR *addrptr); static CORE_ADDR heuristic_proc_start (CORE_ADDR); @@ -396,12 +432,7 @@ static CORE_ADDR read_next_frame_reg (struct frame_info *, int); static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *); -static mips_extra_func_info_t find_proc_desc (CORE_ADDR pc, - struct frame_info *next_frame, - int cur_frame); - -static CORE_ADDR after_prologue (CORE_ADDR pc, - mips_extra_func_info_t proc_desc); +static CORE_ADDR after_prologue (CORE_ADDR pc); static struct type *mips_float_register_type (void); static struct type *mips_double_register_type (void); @@ -623,15 +654,6 @@ static unsigned int heuristic_fence_post = 0; this will corrupt pdr.iline. Fortunately we don't use it. */ #define PROC_SYMBOL(proc) (*(struct symbol**)&(proc)->pdr.isym) #define _PROC_MAGIC_ 0x0F0F0F0F -#define PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym == _PROC_MAGIC_) -#define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_) - -struct linked_proc_info -{ - struct mips_extra_func_info info; - struct linked_proc_info *next; -} - *linked_proc_desc_table = NULL; /* Number of bytes of storage in the actual machine representation for register N. NOTE: This defines the pseudo register type so need to @@ -694,16 +716,16 @@ mips_register_type (struct gdbarch *gdbarch, int regnum) && (regnum % NUM_REGS) < mips_regnum (current_gdbarch)->fp0 + 32) { /* The floating-point registers raw, or cooked, always match - mips_regsize(), and also map 1:1, byte for byte. */ + mips_isa_regsize(), and also map 1:1, byte for byte. */ switch (gdbarch_byte_order (gdbarch)) { case BFD_ENDIAN_BIG: - if (mips_regsize (gdbarch) == 4) + if (mips_isa_regsize (gdbarch) == 4) return builtin_type_ieee_single_big; else return builtin_type_ieee_double_big; case BFD_ENDIAN_LITTLE: - if (mips_regsize (gdbarch) == 4) + if (mips_isa_regsize (gdbarch) == 4) return builtin_type_ieee_single_little; else return builtin_type_ieee_double_little; @@ -712,24 +734,38 @@ mips_register_type (struct gdbarch *gdbarch, int regnum) internal_error (__FILE__, __LINE__, "bad switch"); } } - else if (regnum >= - (NUM_REGS + mips_regnum (current_gdbarch)->fp_control_status) - && regnum <= NUM_REGS + LAST_EMBED_REGNUM) - /* The pseudo/cooked view of the embedded registers is always - 32-bit. The raw view is handled below. */ - return builtin_type_int32; - else if (regnum >= NUM_REGS && mips_regsize (gdbarch) - && gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p) - /* The target, while using a 64-bit register buffer, is only - transfering 32-bits of each integer register. Reflect this in - the cooked/pseudo register value. */ - return builtin_type_int32; - else if (mips_regsize (gdbarch) == 8) - /* 64-bit ISA. */ - return builtin_type_int64; + else if (regnum < NUM_REGS) + { + /* The raw or ISA registers. These are all sized according to + the ISA regsize. */ + if (mips_isa_regsize (gdbarch) == 4) + return builtin_type_int32; + else + return builtin_type_int64; + } else - /* 32-bit ISA. */ - return builtin_type_int32; + { + /* The cooked or ABI registers. These are sized according to + the ABI (with a few complications). */ + if (regnum >= (NUM_REGS + + mips_regnum (current_gdbarch)->fp_control_status) + && regnum <= NUM_REGS + LAST_EMBED_REGNUM) + /* The pseudo/cooked view of the embedded registers is always + 32-bit. The raw view is handled below. */ + return builtin_type_int32; + else if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p) + /* The target, while possibly using a 64-bit register buffer, + is only transfering 32-bits of each integer register. + Reflect this in the cooked/pseudo (ABI) register value. */ + return builtin_type_int32; + else if (mips_abi_regsize (gdbarch) == 4) + /* The ABI is restricted to 32-bit registers (the ISA could be + 32- or 64-bit). */ + return builtin_type_int32; + else + /* 64-bit ABI. */ + return builtin_type_int64; + } } /* TARGET_READ_SP -- Remove useless bits from the stack pointer. */ @@ -737,7 +773,7 @@ mips_register_type (struct gdbarch *gdbarch, int regnum) static CORE_ADDR mips_read_sp (void) { - return read_signed_register (SP_REGNUM); + return read_signed_register (MIPS_SP_REGNUM); } /* Should the upper word of 64-bit addresses be zeroed? */ @@ -805,7 +841,7 @@ pc_is_mips16 (bfd_vma memaddr) return 0; } -/* MIPS believes that the PC has a sign extended value. Perhaphs the +/* MIPS believes that the PC has a sign extended value. Perhaps the all registers should be sign extended for simplicity? */ static CORE_ADDR @@ -829,7 +865,7 @@ mips_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) static struct frame_id mips_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) { - return frame_id_build (frame_unwind_register_signed (next_frame, NUM_REGS + SP_REGNUM), + return frame_id_build (frame_unwind_register_signed (next_frame, NUM_REGS + MIPS_SP_REGNUM), frame_pc_unwind (next_frame)); } @@ -843,24 +879,54 @@ mips_write_pc (CORE_ADDR pc, ptid_t ptid) find the prologue, then return 0. */ static CORE_ADDR -after_prologue (CORE_ADDR pc, mips_extra_func_info_t proc_desc) +after_prologue (CORE_ADDR pc) { + mips_extra_func_info_t proc_desc; struct symtab_and_line sal; CORE_ADDR func_addr, func_end; + CORE_ADDR startaddr = 0; + + /* Pass a NULL next_frame to heuristic_proc_desc. We should not + attempt to read the stack pointer from the current machine state, + because the current machine state has nothing to do with the + information we need from the proc_desc; and the process may or + may not exist right now. */ + proc_desc = non_heuristic_proc_desc (pc, &startaddr); + if (proc_desc) + { + /* IF this is the topmost frame AND (this proc does not have + debugging information OR the PC is in the procedure prologue) + THEN create a "heuristic" proc_desc (by analyzing the actual + code) to replace the "official" proc_desc. */ + struct symtab_and_line val; + if (PROC_SYMBOL (proc_desc)) + { + val = find_pc_line (BLOCK_START + (SYMBOL_BLOCK_VALUE (PROC_SYMBOL (proc_desc))), + 0); + val.pc = val.end ? val.end : pc; + } + if (!PROC_SYMBOL (proc_desc) || pc < val.pc) + { + mips_extra_func_info_t found_heuristic = + heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), pc, NULL, NULL); + if (found_heuristic) + proc_desc = found_heuristic; + } + } + else + { + if (startaddr == 0) + startaddr = heuristic_proc_start (pc); - /* Pass cur_frame == 0 to find_proc_desc. We should not attempt - to read the stack pointer from the current machine state, because - the current machine state has nothing to do with the information - we need from the proc_desc; and the process may or may not exist - right now. */ - if (!proc_desc) - proc_desc = find_proc_desc (pc, NULL, 0); + proc_desc = heuristic_proc_desc (startaddr, pc, NULL, NULL); + } if (proc_desc) { /* If function is frameless, then we need to do it the hard way. I strongly suspect that frameless always means prologueless... */ - if (PROC_FRAME_REG (proc_desc) == SP_REGNUM + if (PROC_FRAME_REG (proc_desc) == MIPS_SP_REGNUM && PROC_FRAME_OFFSET (proc_desc) == 0) return 0; } @@ -879,63 +945,6 @@ after_prologue (CORE_ADDR pc, mips_extra_func_info_t proc_desc) return 0; } -/* Decode a MIPS32 instruction that saves a register in the stack, and - set the appropriate bit in the general register mask or float register mask - to indicate which register is saved. This is a helper function - for mips_find_saved_regs. */ - -static void -mips32_decode_reg_save (t_inst inst, unsigned long *gen_mask, - unsigned long *float_mask) -{ - int reg; - - if ((inst & 0xffe00000) == 0xafa00000 /* sw reg,n($sp) */ - || (inst & 0xffe00000) == 0xafc00000 /* sw reg,n($r30) */ - || (inst & 0xffe00000) == 0xffa00000) /* sd reg,n($sp) */ - { - /* It might be possible to use the instruction to - find the offset, rather than the code below which - is based on things being in a certain order in the - frame, but figuring out what the instruction's offset - is relative to might be a little tricky. */ - reg = (inst & 0x001f0000) >> 16; - *gen_mask |= (1 << reg); - } - else if ((inst & 0xffe00000) == 0xe7a00000 /* swc1 freg,n($sp) */ - || (inst & 0xffe00000) == 0xe7c00000 /* swc1 freg,n($r30) */ - || (inst & 0xffe00000) == 0xf7a00000) /* sdc1 freg,n($sp) */ - - { - reg = ((inst & 0x001f0000) >> 16); - *float_mask |= (1 << reg); - } -} - -/* Decode a MIPS16 instruction that saves a register in the stack, and - set the appropriate bit in the general register or float register mask - to indicate which register is saved. This is a helper function - for mips_find_saved_regs. */ - -static void -mips16_decode_reg_save (t_inst inst, unsigned long *gen_mask) -{ - if ((inst & 0xf800) == 0xd000) /* sw reg,n($sp) */ - { - int reg = mips16_to_32_reg[(inst & 0x700) >> 8]; - *gen_mask |= (1 << reg); - } - else if ((inst & 0xff00) == 0xf900) /* sd reg,n($sp) */ - { - int reg = mips16_to_32_reg[(inst & 0xe0) >> 5]; - *gen_mask |= (1 << reg); - } - else if ((inst & 0xff00) == 0x6200 /* sw $ra,n($sp) */ - || (inst & 0xff00) == 0xfa00) /* sd $ra,n($sp) */ - *gen_mask |= (1 << RA_REGNUM); -} - - /* Fetch and return instruction from the specified location. If the PC is odd, assume it's a MIPS16 instruction; otherwise MIPS32. */ @@ -953,7 +962,7 @@ mips_fetch_instruction (CORE_ADDR addr) } else instlen = MIPS_INSTLEN; - status = read_memory_nobpt (addr, buf, instlen); + status = deprecated_read_memory_nobpt (addr, buf, instlen); if (status) memory_error (status, addr); return extract_unsigned_integer (buf, instlen); @@ -968,26 +977,12 @@ mips16_fetch_instruction (CORE_ADDR addr) instlen = MIPS16_INSTLEN; addr = unmake_mips16_addr (addr); - status = read_memory_nobpt (addr, buf, instlen); - if (status) - memory_error (status, addr); - return extract_unsigned_integer (buf, instlen); -} - -static ULONGEST -mips32_fetch_instruction (CORE_ADDR addr) -{ - char buf[MIPS_INSTLEN]; - int instlen; - int status; - instlen = MIPS_INSTLEN; - status = read_memory_nobpt (addr, buf, instlen); + status = deprecated_read_memory_nobpt (addr, buf, instlen); if (status) memory_error (status, addr); return extract_unsigned_integer (buf, instlen); } - /* These the fields of 32 bit mips instructions */ #define mips32_op(x) (x >> 26) #define itype_op(x) (x >> 26) @@ -1148,7 +1143,7 @@ mips32_next_pc (CORE_ADDR pc) pc += 8; break; case 6: /* BLEZ, BLEZL */ - if (read_signed_register (itype_rs (inst) <= 0)) + if (read_signed_register (itype_rs (inst)) <= 0) pc += mips32_relative_offset (inst) + 4; else pc += 8; @@ -1156,7 +1151,7 @@ mips32_next_pc (CORE_ADDR pc) case 7: default: greater_branch: /* BGTZ, BGTZL */ - if (read_signed_register (itype_rs (inst) > 0)) + if (read_signed_register (itype_rs (inst)) > 0) pc += mips32_relative_offset (inst) + 4; else pc += 8; @@ -1487,6 +1482,7 @@ struct mips_frame_cache static struct mips_frame_cache * mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) { + CORE_ADDR startaddr = 0; mips_extra_func_info_t proc_desc; struct mips_frame_cache *cache; struct gdbarch *gdbarch = get_frame_arch (next_frame); @@ -1503,12 +1499,11 @@ mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); /* Get the mdebug proc descriptor. */ - proc_desc = find_proc_desc (frame_pc_unwind (next_frame), next_frame, 1); - if (proc_desc == NULL) - /* I'm not sure how/whether this can happen. Normally when we - can't find a proc_desc, we "synthesize" one using - heuristic_proc_desc and set the saved_regs right away. */ - return cache; + proc_desc = non_heuristic_proc_desc (frame_pc_unwind (next_frame), + &startaddr); + /* Must be true. This is only called when the sniffer detected a + proc descriptor. */ + gdb_assert (proc_desc != NULL); /* Extract the frame's base. */ cache->base = (frame_unwind_register_signed (next_frame, NUM_REGS + PROC_FRAME_REG (proc_desc)) @@ -1518,63 +1513,22 @@ mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) gen_mask = kernel_trap ? 0xFFFFFFFF : PROC_REG_MASK (proc_desc); float_mask = kernel_trap ? 0xFFFFFFFF : PROC_FREG_MASK (proc_desc); - /* In any frame other than the innermost or a frame interrupted by a - signal, we assume that all registers have been saved. This - assumes that all register saves in a function happen before the - first function call. */ - if (in_prologue (frame_pc_unwind (next_frame), PROC_LOW_ADDR (proc_desc)) - /* Not sure exactly what kernel_trap means, but if it means the - kernel saves the registers without a prologue doing it, we - better not examine the prologue to see whether registers - have been saved yet. */ - && !kernel_trap) - { - /* We need to figure out whether the registers that the - proc_desc claims are saved have been saved yet. */ - - CORE_ADDR addr; - - /* Bitmasks; set if we have found a save for the register. */ - unsigned long gen_save_found = 0; - unsigned long float_save_found = 0; - int mips16; - - /* If the address is odd, assume this is MIPS16 code. */ - addr = PROC_LOW_ADDR (proc_desc); - mips16 = pc_is_mips16 (addr); - - /* Scan through this function's instructions preceding the - current PC, and look for those that save registers. */ - while (addr < frame_pc_unwind (next_frame)) - { - if (mips16) - { - mips16_decode_reg_save (mips16_fetch_instruction (addr), - &gen_save_found); - addr += MIPS16_INSTLEN; - } - else - { - mips32_decode_reg_save (mips32_fetch_instruction (addr), - &gen_save_found, &float_save_found); - addr += MIPS_INSTLEN; - } - } - gen_mask = gen_save_found; - float_mask = float_save_found; - } + /* Must be true. The in_prologue case is left for the heuristic + unwinder. This is always used on kernel traps. */ + gdb_assert (!in_prologue (frame_pc_unwind (next_frame), PROC_LOW_ADDR (proc_desc)) + || kernel_trap); /* Fill in the offsets for the registers which gen_mask says were saved. */ { - CORE_ADDR reg_position = (cache->base - + PROC_REG_OFFSET (proc_desc)); + CORE_ADDR reg_position = (cache->base + PROC_REG_OFFSET (proc_desc)); int ireg; + for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1) if (gen_mask & 0x80000000) { cache->saved_regs[NUM_REGS + ireg].addr = reg_position; - reg_position -= mips_saved_regsize (tdep); + reg_position -= mips_abi_regsize (gdbarch); } } @@ -1595,7 +1549,7 @@ mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) CORE_ADDR reg_position = (cache->base + PROC_REG_OFFSET (proc_desc)); if (inst & 0x20) - reg_position -= mips_saved_regsize (tdep); + reg_position -= mips_abi_regsize (gdbarch); /* Check if the s0 and s1 registers were pushed on the stack. */ @@ -1604,7 +1558,7 @@ mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) for (reg = 16; reg < sreg_count + 16; reg++) { cache->saved_regs[NUM_REGS + reg].addr = reg_position; - reg_position -= mips_saved_regsize (tdep); + reg_position -= mips_abi_regsize (gdbarch); } } } @@ -1620,7 +1574,7 @@ mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1) if (float_mask & 0x80000000) { - if (mips_saved_regsize (tdep) == 4 + if (mips_abi_regsize (gdbarch) == 4 && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { /* On a big endian 32 bit ABI, floating point registers @@ -1647,15 +1601,15 @@ mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) loop). */ if ((ireg & 1)) cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg] - .addr = reg_position - mips_saved_regsize (tdep); + .addr = reg_position - mips_abi_regsize (gdbarch); else cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg] - .addr = reg_position + mips_saved_regsize (tdep); + .addr = reg_position + mips_abi_regsize (gdbarch); } else cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg] .addr = reg_position; - reg_position -= mips_saved_regsize (tdep); + reg_position -= mips_abi_regsize (gdbarch); } cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc] @@ -1663,7 +1617,7 @@ mips_mdebug_frame_cache (struct frame_info *next_frame, void **this_cache) } /* SP_REGNUM, contains the value and not the address. */ - trad_frame_set_value (cache->saved_regs, NUM_REGS + SP_REGNUM, cache->base); + trad_frame_set_value (cache->saved_regs, NUM_REGS + MIPS_SP_REGNUM, cache->base); return (*this_cache); } @@ -1686,8 +1640,8 @@ mips_mdebug_frame_prev_register (struct frame_info *next_frame, { struct mips_frame_cache *info = mips_mdebug_frame_cache (next_frame, this_cache); - trad_frame_prev_register (next_frame, info->saved_regs, regnum, - optimizedp, lvalp, addrp, realnump, valuep); + trad_frame_get_prev_register (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); } static const struct frame_unwind mips_mdebug_frame_unwind = @@ -1700,7 +1654,35 @@ static const struct frame_unwind mips_mdebug_frame_unwind = static const struct frame_unwind * mips_mdebug_frame_sniffer (struct frame_info *next_frame) { - return &mips_mdebug_frame_unwind; + CORE_ADDR pc = frame_pc_unwind (next_frame); + CORE_ADDR startaddr = 0; + mips_extra_func_info_t proc_desc; + int kernel_trap; + + /* Only use the mdebug frame unwinder on mdebug frames where all the + registers have been saved. Leave hard cases such as no mdebug or + in prologue for the heuristic unwinders. */ + + proc_desc = non_heuristic_proc_desc (pc, &startaddr); + if (proc_desc == NULL) + return NULL; + + /* Not sure exactly what kernel_trap means, but if it means the + kernel saves the registers without a prologue doing it, we better + not examine the prologue to see whether registers have been saved + yet. */ + kernel_trap = PROC_REG_MASK (proc_desc) & 1; + if (kernel_trap) + return &mips_mdebug_frame_unwind; + + /* In any frame other than the innermost or a frame interrupted by a + signal, we assume that all registers have been saved. This + assumes that all register saves in a function happen before the + first function call. */ + if (!in_prologue (pc, PROC_LOW_ADDR (proc_desc))) + return &mips_mdebug_frame_unwind; + + return NULL; } static CORE_ADDR @@ -1722,94 +1704,12 @@ static const struct frame_base mips_mdebug_frame_base = { static const struct frame_base * mips_mdebug_frame_base_sniffer (struct frame_info *next_frame) { - return &mips_mdebug_frame_base; -} - -static CORE_ADDR -read_next_frame_reg (struct frame_info *fi, int regno) -{ - /* Always a pseudo. */ - gdb_assert (regno >= NUM_REGS); - if (fi == NULL) - { - LONGEST val; - regcache_cooked_read_signed (current_regcache, regno, &val); - return val; - } - else if ((regno % NUM_REGS) == SP_REGNUM) - /* The SP_REGNUM is special, its value is stored in saved_regs. - In fact, it is so special that it can even only be fetched - using a raw register number! Once this code as been converted - to frame-unwind the problem goes away. */ - return frame_unwind_register_signed (fi, regno % NUM_REGS); - else - return frame_unwind_register_signed (fi, regno); - -} - -/* mips_addr_bits_remove - remove useless address bits */ - -static CORE_ADDR -mips_addr_bits_remove (CORE_ADDR addr) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - if (mips_mask_address_p (tdep) && (((ULONGEST) addr) >> 32 == 0xffffffffUL)) - /* This hack is a work-around for existing boards using PMON, the - simulator, and any other 64-bit targets that doesn't have true - 64-bit addressing. On these targets, the upper 32 bits of - addresses are ignored by the hardware. Thus, the PC or SP are - likely to have been sign extended to all 1s by instruction - sequences that load 32-bit addresses. For example, a typical - piece of code that loads an address is this: - - lui $r2, <upper 16 bits> - ori $r2, <lower 16 bits> - - But the lui sign-extends the value such that the upper 32 bits - may be all 1s. The workaround is simply to mask off these - bits. In the future, gcc may be changed to support true 64-bit - addressing, and this masking will have to be disabled. */ - return addr &= 0xffffffffUL; + if (mips_mdebug_frame_sniffer (next_frame) != NULL) + return &mips_mdebug_frame_base; else - return addr; -} - -/* mips_software_single_step() is called just before we want to resume - the inferior, if we want to single-step it but there is no hardware - or kernel single-step support (MIPS on GNU/Linux for example). We find - the target of the coming instruction and breakpoint it. - - single_step is also called just after the inferior stops. If we had - set up a simulated single-step, we undo our damage. */ - -void -mips_software_single_step (enum target_signal sig, int insert_breakpoints_p) -{ - static CORE_ADDR next_pc; - typedef char binsn_quantum[BREAKPOINT_MAX]; - static binsn_quantum break_mem; - CORE_ADDR pc; - - if (insert_breakpoints_p) - { - pc = read_register (mips_regnum (current_gdbarch)->pc); - next_pc = mips_next_pc (pc); - - target_insert_breakpoint (next_pc, break_mem); - } - else - target_remove_breakpoint (next_pc, break_mem); + return NULL; } -static struct mips_extra_func_info temp_proc_desc; - -/* This hack will go away once the get_prev_frame() code has been - modified to set the frame's type first. That is BEFORE init extra - frame info et.al. is called. This is because it will become - possible to skip the init extra info call for sigtramp and dummy - frames. */ -static CORE_ADDR *temp_saved_regs; - /* Set a register's saved stack address in temp_saved_regs. If an address has already been set for this register, do nothing; this way we will only recognize the first save of a given register in a @@ -1822,134 +1722,22 @@ static CORE_ADDR *temp_saved_regs; frame. */ static void -set_reg_offset (CORE_ADDR *saved_regs, int regno, CORE_ADDR offset) +set_reg_offset (struct mips_frame_cache *this_cache, int regnum, + CORE_ADDR offset) { - if (saved_regs[regno] == 0) + if (this_cache != NULL + && this_cache->saved_regs[regnum].addr == -1) { - saved_regs[regno + 0 * NUM_REGS] = offset; - saved_regs[regno + 1 * NUM_REGS] = offset; + this_cache->saved_regs[regnum + 0 * NUM_REGS].addr = offset; + this_cache->saved_regs[regnum + 1 * NUM_REGS].addr = offset; } } -/* Test whether the PC points to the return instruction at the - end of a function. */ - -static int -mips_about_to_return (CORE_ADDR pc) -{ - if (pc_is_mips16 (pc)) - /* This mips16 case isn't necessarily reliable. Sometimes the compiler - generates a "jr $ra"; other times it generates code to load - the return address from the stack to an accessible register (such - as $a3), then a "jr" using that register. This second case - is almost impossible to distinguish from an indirect jump - used for switch statements, so we don't even try. */ - return mips_fetch_instruction (pc) == 0xe820; /* jr $ra */ - else - return mips_fetch_instruction (pc) == 0x3e00008; /* jr $ra */ -} - - -/* This fencepost looks highly suspicious to me. Removing it also - seems suspicious as it could affect remote debugging across serial - lines. */ - -static CORE_ADDR -heuristic_proc_start (CORE_ADDR pc) -{ - CORE_ADDR start_pc; - CORE_ADDR fence; - int instlen; - int seen_adjsp = 0; - - pc = ADDR_BITS_REMOVE (pc); - start_pc = pc; - fence = start_pc - heuristic_fence_post; - if (start_pc == 0) - return 0; - - if (heuristic_fence_post == UINT_MAX || fence < VM_MIN_ADDRESS) - fence = VM_MIN_ADDRESS; - - instlen = pc_is_mips16 (pc) ? MIPS16_INSTLEN : MIPS_INSTLEN; - - /* search back for previous return */ - for (start_pc -= instlen;; start_pc -= instlen) - if (start_pc < fence) - { - /* It's not clear to me why we reach this point when - stop_soon, but with this test, at least we - don't print out warnings for every child forked (eg, on - decstation). 22apr93 rich@cygnus.com. */ - if (stop_soon == NO_STOP_QUIETLY) - { - static int blurb_printed = 0; - - warning - ("Warning: GDB can't find the start of the function at 0x%s.", - paddr_nz (pc)); - - if (!blurb_printed) - { - /* This actually happens frequently in embedded - development, when you first connect to a board - and your stack pointer and pc are nowhere in - particular. This message needs to give people - in that situation enough information to - determine that it's no big deal. */ - printf_filtered ("\n\ - GDB is unable to find the start of the function at 0x%s\n\ -and thus can't determine the size of that function's stack frame.\n\ -This means that GDB may be unable to access that stack frame, or\n\ -the frames below it.\n\ - This problem is most likely caused by an invalid program counter or\n\ -stack pointer.\n\ - However, if you think GDB should simply search farther back\n\ -from 0x%s for code which looks like the beginning of a\n\ -function, you can increase the range of the search using the `set\n\ -heuristic-fence-post' command.\n", paddr_nz (pc), paddr_nz (pc)); - blurb_printed = 1; - } - } - - return 0; - } - else if (pc_is_mips16 (start_pc)) - { - unsigned short inst; - - /* On MIPS16, any one of the following is likely to be the - start of a function: - entry - addiu sp,-n - daddiu sp,-n - extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n' */ - inst = mips_fetch_instruction (start_pc); - if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */ - || (inst & 0xff80) == 0x6380 /* addiu sp,-n */ - || (inst & 0xff80) == 0xfb80 /* daddiu sp,-n */ - || ((inst & 0xf810) == 0xf010 && seen_adjsp)) /* extend -n */ - break; - else if ((inst & 0xff00) == 0x6300 /* addiu sp */ - || (inst & 0xff00) == 0xfb00) /* daddiu sp */ - seen_adjsp = 1; - else - seen_adjsp = 0; - } - else if (mips_about_to_return (start_pc)) - { - start_pc += 2 * MIPS_INSTLEN; /* skip return, and its delay slot */ - break; - } - - return start_pc; -} - /* Fetch the immediate value from a MIPS16 instruction. If the previous instruction was an EXTEND, use it to extend the upper bits of the immediate value. This is a helper function - for mips16_heuristic_proc_desc. */ + for mips16_scan_prologue. */ static int mips16_get_imm (unsigned short prev_inst, /* previous instruction */ @@ -1981,23 +1769,39 @@ mips16_get_imm (unsigned short prev_inst, /* previous instruction */ } -/* Fill in values in temp_proc_desc based on the MIPS16 instruction - stream from start_pc to limit_pc. */ +/* Analyze the function prologue from START_PC to LIMIT_PC. Builds + the associated FRAME_CACHE if not null. + Return the address of the first instruction past the prologue. */ -static void -mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, - struct frame_info *next_frame, CORE_ADDR sp) +static CORE_ADDR +mips16_scan_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc, + struct frame_info *next_frame, + struct mips_frame_cache *this_cache) { CORE_ADDR cur_pc; CORE_ADDR frame_addr = 0; /* Value of $r17, used as frame pointer */ + CORE_ADDR sp; + long frame_offset = 0; /* Size of stack frame. */ + long frame_adjust = 0; /* Offset of FP from SP. */ + int frame_reg = MIPS_SP_REGNUM; unsigned short prev_inst = 0; /* saved copy of previous instruction */ unsigned inst = 0; /* current instruction */ unsigned entry_inst = 0; /* the entry instruction */ int reg, offset; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - PROC_FRAME_OFFSET (&temp_proc_desc) = 0; /* size of stack frame */ - PROC_FRAME_ADJUST (&temp_proc_desc) = 0; /* offset of FP from SP */ + int extend_bytes = 0; + int prev_extend_bytes; + CORE_ADDR end_prologue_addr = 0; + + /* Can be called when there's no process, and hence when there's no + NEXT_FRAME. */ + if (next_frame != NULL) + sp = read_next_frame_reg (next_frame, NUM_REGS + MIPS_SP_REGNUM); + else + sp = 0; + + if (limit_pc > start_pc + 200) + limit_pc = start_pc + 200; for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS16_INSTLEN) { @@ -2007,12 +1811,27 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, /* Fetch and decode the instruction. */ inst = (unsigned short) mips_fetch_instruction (cur_pc); + + /* Normally we ignore extend instructions. However, if it is + not followed by a valid prologue instruction, then this + instruction is not part of the prologue either. We must + remember in this case to adjust the end_prologue_addr back + over the extend. */ + if ((inst & 0xf800) == 0xf000) /* extend */ + { + extend_bytes = MIPS16_INSTLEN; + continue; + } + + prev_extend_bytes = extend_bytes; + extend_bytes = 0; + if ((inst & 0xff00) == 0x6300 /* addiu sp */ || (inst & 0xff00) == 0xfb00) /* daddiu sp */ { offset = mips16_get_imm (prev_inst, inst, 8, 8, 1); if (offset < 0) /* negative stack adjustment? */ - PROC_FRAME_OFFSET (&temp_proc_desc) -= offset; + frame_offset -= offset; else /* Exit loop if a positive stack adjustment is found, which usually means that the stack cleanup code in the function @@ -2023,58 +1842,66 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, { offset = mips16_get_imm (prev_inst, inst, 8, 4, 0); reg = mips16_to_32_reg[(inst & 0x700) >> 8]; - PROC_REG_MASK (&temp_proc_desc) |= (1 << reg); - set_reg_offset (temp_saved_regs, reg, sp + offset); + set_reg_offset (this_cache, reg, sp + offset); } else if ((inst & 0xff00) == 0xf900) /* sd reg,n($sp) */ { offset = mips16_get_imm (prev_inst, inst, 5, 8, 0); reg = mips16_to_32_reg[(inst & 0xe0) >> 5]; - PROC_REG_MASK (&temp_proc_desc) |= (1 << reg); - set_reg_offset (temp_saved_regs, reg, sp + offset); + set_reg_offset (this_cache, reg, sp + offset); } else if ((inst & 0xff00) == 0x6200) /* sw $ra,n($sp) */ { offset = mips16_get_imm (prev_inst, inst, 8, 4, 0); - PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM); - set_reg_offset (temp_saved_regs, RA_REGNUM, sp + offset); + set_reg_offset (this_cache, RA_REGNUM, sp + offset); } else if ((inst & 0xff00) == 0xfa00) /* sd $ra,n($sp) */ { offset = mips16_get_imm (prev_inst, inst, 8, 8, 0); - PROC_REG_MASK (&temp_proc_desc) |= (1 << RA_REGNUM); - set_reg_offset (temp_saved_regs, RA_REGNUM, sp + offset); + set_reg_offset (this_cache, RA_REGNUM, sp + offset); } else if (inst == 0x673d) /* move $s1, $sp */ { frame_addr = sp; - PROC_FRAME_REG (&temp_proc_desc) = 17; + frame_reg = 17; } else if ((inst & 0xff00) == 0x0100) /* addiu $s1,sp,n */ { offset = mips16_get_imm (prev_inst, inst, 8, 4, 0); frame_addr = sp + offset; - PROC_FRAME_REG (&temp_proc_desc) = 17; - PROC_FRAME_ADJUST (&temp_proc_desc) = offset; + frame_reg = 17; + frame_adjust = offset; } else if ((inst & 0xFF00) == 0xd900) /* sw reg,offset($s1) */ { offset = mips16_get_imm (prev_inst, inst, 5, 4, 0); reg = mips16_to_32_reg[(inst & 0xe0) >> 5]; - PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (temp_saved_regs, reg, frame_addr + offset); + set_reg_offset (this_cache, reg, frame_addr + offset); } else if ((inst & 0xFF00) == 0x7900) /* sd reg,offset($s1) */ { offset = mips16_get_imm (prev_inst, inst, 5, 8, 0); reg = mips16_to_32_reg[(inst & 0xe0) >> 5]; - PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (temp_saved_regs, reg, frame_addr + offset); + set_reg_offset (this_cache, reg, frame_addr + offset); } - else if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */ + else if ((inst & 0xf81f) == 0xe809 + && (inst & 0x700) != 0x700) /* entry */ entry_inst = inst; /* save for later processing */ else if ((inst & 0xf800) == 0x1800) /* jal(x) */ cur_pc += MIPS16_INSTLEN; /* 32-bit instruction */ + else if ((inst & 0xff1c) == 0x6704) /* move reg,$a0-$a3 */ + { + /* This instruction is part of the prologue, but we don't + need to do anything special to handle it. */ + } + else + { + /* This instruction is not an instruction typically found + in a prologue, so we must have reached the end of the + prologue. */ + if (end_prologue_addr == 0) + end_prologue_addr = cur_pc - prev_extend_bytes; + } } /* The entry instruction is typically the first instruction in a function, @@ -2089,50 +1916,209 @@ mips16_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, int sreg_count = (entry_inst >> 6) & 3; /* The entry instruction always subtracts 32 from the SP. */ - PROC_FRAME_OFFSET (&temp_proc_desc) += 32; + frame_offset += 32; /* Now we can calculate what the SP must have been at the start of the function prologue. */ - sp += PROC_FRAME_OFFSET (&temp_proc_desc); + sp += frame_offset; /* Check if a0-a3 were saved in the caller's argument save area. */ for (reg = 4, offset = 0; reg < areg_count + 4; reg++) { - PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (temp_saved_regs, reg, sp + offset); - offset += mips_saved_regsize (tdep); + set_reg_offset (this_cache, reg, sp + offset); + offset += mips_abi_regsize (current_gdbarch); } /* Check if the ra register was pushed on the stack. */ offset = -4; if (entry_inst & 0x20) { - PROC_REG_MASK (&temp_proc_desc) |= 1 << RA_REGNUM; - set_reg_offset (temp_saved_regs, RA_REGNUM, sp + offset); - offset -= mips_saved_regsize (tdep); + set_reg_offset (this_cache, RA_REGNUM, sp + offset); + offset -= mips_abi_regsize (current_gdbarch); } /* Check if the s0 and s1 registers were pushed on the stack. */ for (reg = 16; reg < sreg_count + 16; reg++) { - PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (temp_saved_regs, reg, sp + offset); - offset -= mips_saved_regsize (tdep); + set_reg_offset (this_cache, reg, sp + offset); + offset -= mips_abi_regsize (current_gdbarch); } } + + if (this_cache != NULL) + { + this_cache->base = + (frame_unwind_register_signed (next_frame, NUM_REGS + frame_reg) + + frame_offset - frame_adjust); + /* FIXME: brobecker/2004-10-10: Just as in the mips32 case, we should + be able to get rid of the assignment below, evetually. But it's + still needed for now. */ + this_cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc] + = this_cache->saved_regs[NUM_REGS + RA_REGNUM]; + } + + /* If we didn't reach the end of the prologue when scanning the function + instructions, then set end_prologue_addr to the address of the + instruction immediately after the last one we scanned. */ + if (end_prologue_addr == 0) + end_prologue_addr = cur_pc; + + return end_prologue_addr; +} + +/* Heuristic unwinder for 16-bit MIPS instruction set (aka MIPS16). + Procedures that use the 32-bit instruction set are handled by the + mips_insn32 unwinder. */ + +static struct mips_frame_cache * +mips_insn16_frame_cache (struct frame_info *next_frame, void **this_cache) +{ + struct mips_frame_cache *cache; + + if ((*this_cache) != NULL) + return (*this_cache); + cache = FRAME_OBSTACK_ZALLOC (struct mips_frame_cache); + (*this_cache) = cache; + cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); + + /* Analyze the function prologue. */ + { + const CORE_ADDR pc = frame_pc_unwind (next_frame); + CORE_ADDR start_addr; + + find_pc_partial_function (pc, NULL, &start_addr, NULL); + if (start_addr == 0) + start_addr = heuristic_proc_start (pc); + /* We can't analyze the prologue if we couldn't find the begining + of the function. */ + if (start_addr == 0) + return cache; + + mips16_scan_prologue (start_addr, pc, next_frame, *this_cache); + } + + /* SP_REGNUM, contains the value and not the address. */ + trad_frame_set_value (cache->saved_regs, NUM_REGS + MIPS_SP_REGNUM, cache->base); + + return (*this_cache); } static void -mips32_heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, - struct frame_info *next_frame, CORE_ADDR sp) +mips_insn16_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) +{ + struct mips_frame_cache *info = mips_insn16_frame_cache (next_frame, + this_cache); + (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame)); +} + +static void +mips_insn16_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct mips_frame_cache *info = mips_insn16_frame_cache (next_frame, + this_cache); + trad_frame_get_prev_register (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind mips_insn16_frame_unwind = +{ + NORMAL_FRAME, + mips_insn16_frame_this_id, + mips_insn16_frame_prev_register +}; + +static const struct frame_unwind * +mips_insn16_frame_sniffer (struct frame_info *next_frame) +{ + CORE_ADDR pc = frame_pc_unwind (next_frame); + if (pc_is_mips16 (pc)) + return &mips_insn16_frame_unwind; + return NULL; +} + +static CORE_ADDR +mips_insn16_frame_base_address (struct frame_info *next_frame, + void **this_cache) +{ + struct mips_frame_cache *info = mips_insn16_frame_cache (next_frame, + this_cache); + return info->base; +} + +static const struct frame_base mips_insn16_frame_base = +{ + &mips_insn16_frame_unwind, + mips_insn16_frame_base_address, + mips_insn16_frame_base_address, + mips_insn16_frame_base_address +}; + +static const struct frame_base * +mips_insn16_frame_base_sniffer (struct frame_info *next_frame) +{ + if (mips_insn16_frame_sniffer (next_frame) != NULL) + return &mips_insn16_frame_base; + else + return NULL; +} + +/* Mark all the registers as unset in the saved_regs array + of THIS_CACHE. Do nothing if THIS_CACHE is null. */ + +void +reset_saved_regs (struct mips_frame_cache *this_cache) +{ + if (this_cache == NULL || this_cache->saved_regs == NULL) + return; + + { + const int num_regs = NUM_REGS; + int i; + + for (i = 0; i < num_regs; i++) + { + this_cache->saved_regs[i].addr = -1; + } + } +} + +/* Analyze the function prologue from START_PC to LIMIT_PC. Builds + the associated FRAME_CACHE if not null. + Return the address of the first instruction past the prologue. */ + +static CORE_ADDR +mips32_scan_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc, + struct frame_info *next_frame, + struct mips_frame_cache *this_cache) { CORE_ADDR cur_pc; - CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */ + CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */ + CORE_ADDR sp; + long frame_offset; + int frame_reg = MIPS_SP_REGNUM; + + CORE_ADDR end_prologue_addr = 0; + int seen_sp_adjust = 0; + int load_immediate_bytes = 0; + + /* Can be called when there's no process, and hence when there's no + NEXT_FRAME. */ + if (next_frame != NULL) + sp = read_next_frame_reg (next_frame, NUM_REGS + MIPS_SP_REGNUM); + else + sp = 0; + + if (limit_pc > start_pc + 200) + limit_pc = start_pc + 200; + restart: - temp_saved_regs = xrealloc (temp_saved_regs, SIZEOF_FRAME_SAVED_REGS); - memset (temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS); - PROC_FRAME_OFFSET (&temp_proc_desc) = 0; - PROC_FRAME_ADJUST (&temp_proc_desc) = 0; /* offset of FP from SP */ + + frame_offset = 0; for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS_INSTLEN) { unsigned long inst, high_word, low_word; @@ -2151,45 +2137,46 @@ restart: || high_word == 0x67bd) /* daddiu $sp,$sp,-i */ { if (low_word & 0x8000) /* negative stack adjustment? */ - PROC_FRAME_OFFSET (&temp_proc_desc) += 0x10000 - low_word; + frame_offset += 0x10000 - low_word; else /* Exit loop if a positive stack adjustment is found, which usually means that the stack cleanup code in the function epilogue is reached. */ break; + seen_sp_adjust = 1; } else if ((high_word & 0xFFE0) == 0xafa0) /* sw reg,offset($sp) */ { - PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (temp_saved_regs, reg, sp + low_word); + set_reg_offset (this_cache, reg, sp + low_word); } else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */ { - /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra, - but the register size used is only 32 bits. Make the address - for the saved register point to the lower 32 bits. */ - PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (temp_saved_regs, reg, - sp + low_word + 8 - mips_regsize (current_gdbarch)); + /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra. */ + set_reg_offset (this_cache, reg, sp + low_word); } else if (high_word == 0x27be) /* addiu $30,$sp,size */ { /* Old gcc frame, r30 is virtual frame pointer. */ - if ((long) low_word != PROC_FRAME_OFFSET (&temp_proc_desc)) + if ((long) low_word != frame_offset) frame_addr = sp + low_word; - else if (PROC_FRAME_REG (&temp_proc_desc) == SP_REGNUM) + else if (frame_reg == MIPS_SP_REGNUM) { unsigned alloca_adjust; - PROC_FRAME_REG (&temp_proc_desc) = 30; + + frame_reg = 30; frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30); alloca_adjust = (unsigned) (frame_addr - (sp + low_word)); if (alloca_adjust > 0) { - /* FP > SP + frame_size. This may be because - * of an alloca or somethings similar. - * Fix sp to "pre-alloca" value, and try again. - */ + /* FP > SP + frame_size. This may be because of + an alloca or somethings similar. Fix sp to + "pre-alloca" value, and try again. */ sp += alloca_adjust; + /* Need to reset the status of all registers. Otherwise, + we will hit a guard that prevents the new address + for each register to be recomputed during the second + pass. */ + reset_saved_regs (this_cache); goto restart; } } @@ -2200,57 +2187,504 @@ restart: else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d) { /* New gcc frame, virtual frame pointer is at r30 + frame_size. */ - if (PROC_FRAME_REG (&temp_proc_desc) == SP_REGNUM) + if (frame_reg == MIPS_SP_REGNUM) { unsigned alloca_adjust; - PROC_FRAME_REG (&temp_proc_desc) = 30; + + frame_reg = 30; frame_addr = read_next_frame_reg (next_frame, NUM_REGS + 30); alloca_adjust = (unsigned) (frame_addr - sp); if (alloca_adjust > 0) - { - /* FP > SP + frame_size. This may be because - * of an alloca or somethings similar. - * Fix sp to "pre-alloca" value, and try again. - */ - sp += alloca_adjust; - goto restart; - } + { + /* FP > SP + frame_size. This may be because of + an alloca or somethings similar. Fix sp to + "pre-alloca" value, and try again. */ + sp = frame_addr; + /* Need to reset the status of all registers. Otherwise, + we will hit a guard that prevents the new address + for each register to be recomputed during the second + pass. */ + reset_saved_regs (this_cache); + goto restart; + } } } else if ((high_word & 0xFFE0) == 0xafc0) /* sw reg,offset($30) */ { - PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; - set_reg_offset (temp_saved_regs, reg, frame_addr + low_word); + set_reg_offset (this_cache, reg, frame_addr + low_word); } + else if ((high_word & 0xFFE0) == 0xE7A0 /* swc1 freg,n($sp) */ + || (high_word & 0xF3E0) == 0xA3C0 /* sx reg,n($s8) */ + || (inst & 0xFF9F07FF) == 0x00800021 /* move reg,$a0-$a3 */ + || high_word == 0x3c1c /* lui $gp,n */ + || high_word == 0x279c /* addiu $gp,$gp,n */ + || inst == 0x0399e021 /* addu $gp,$gp,$t9 */ + || inst == 0x033ce021 /* addu $gp,$t9,$gp */ + ) + { + /* These instructions are part of the prologue, but we don't + need to do anything special to handle them. */ + } + /* The instructions below load $at or $t0 with an immediate + value in preparation for a stack adjustment via + subu $sp,$sp,[$at,$t0]. These instructions could also + initialize a local variable, so we accept them only before + a stack adjustment instruction was seen. */ + else if (!seen_sp_adjust + && (high_word == 0x3c01 /* lui $at,n */ + || high_word == 0x3c08 /* lui $t0,n */ + || high_word == 0x3421 /* ori $at,$at,n */ + || high_word == 0x3508 /* ori $t0,$t0,n */ + || high_word == 0x3401 /* ori $at,$zero,n */ + || high_word == 0x3408 /* ori $t0,$zero,n */ + )) + { + load_immediate_bytes += MIPS_INSTLEN; /* FIXME!! */ + } + else + { + /* This instruction is not an instruction typically found + in a prologue, so we must have reached the end of the + prologue. */ + /* FIXME: brobecker/2004-10-10: Can't we just break out of this + loop now? Why would we need to continue scanning the function + instructions? */ + if (end_prologue_addr == 0) + end_prologue_addr = cur_pc; + } } + + if (this_cache != NULL) + { + this_cache->base = + (frame_unwind_register_signed (next_frame, NUM_REGS + frame_reg) + + frame_offset); + /* FIXME: brobecker/2004-09-15: We should be able to get rid of + this assignment below, eventually. But it's still needed + for now. */ + this_cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc] + = this_cache->saved_regs[NUM_REGS + RA_REGNUM]; + } + + /* If we didn't reach the end of the prologue when scanning the function + instructions, then set end_prologue_addr to the address of the + instruction immediately after the last one we scanned. */ + /* brobecker/2004-10-10: I don't think this would ever happen, but + we may as well be careful and do our best if we have a null + end_prologue_addr. */ + if (end_prologue_addr == 0) + end_prologue_addr = cur_pc; + + /* In a frameless function, we might have incorrectly + skipped some load immediate instructions. Undo the skipping + if the load immediate was not followed by a stack adjustment. */ + if (load_immediate_bytes && !seen_sp_adjust) + end_prologue_addr -= load_immediate_bytes; + + return end_prologue_addr; } -static mips_extra_func_info_t -heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, - struct frame_info *next_frame, int cur_frame) +/* Heuristic unwinder for procedures using 32-bit instructions (covers + both 32-bit and 64-bit MIPS ISAs). Procedures using 16-bit + instructions (a.k.a. MIPS16) are handled by the mips_insn16 + unwinder. */ + +static struct mips_frame_cache * +mips_insn32_frame_cache (struct frame_info *next_frame, void **this_cache) { - CORE_ADDR sp; + struct mips_frame_cache *cache; + + if ((*this_cache) != NULL) + return (*this_cache); - if (cur_frame) - sp = read_next_frame_reg (next_frame, NUM_REGS + SP_REGNUM); + cache = FRAME_OBSTACK_ZALLOC (struct mips_frame_cache); + (*this_cache) = cache; + cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); + + /* Analyze the function prologue. */ + { + const CORE_ADDR pc = frame_pc_unwind (next_frame); + CORE_ADDR start_addr; + + find_pc_partial_function (pc, NULL, &start_addr, NULL); + if (start_addr == 0) + start_addr = heuristic_proc_start (pc); + /* We can't analyze the prologue if we couldn't find the begining + of the function. */ + if (start_addr == 0) + return cache; + + mips32_scan_prologue (start_addr, pc, next_frame, *this_cache); + } + + /* SP_REGNUM, contains the value and not the address. */ + trad_frame_set_value (cache->saved_regs, NUM_REGS + MIPS_SP_REGNUM, cache->base); + + return (*this_cache); +} + +static void +mips_insn32_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) +{ + struct mips_frame_cache *info = mips_insn32_frame_cache (next_frame, + this_cache); + (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame)); +} + +static void +mips_insn32_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct mips_frame_cache *info = mips_insn32_frame_cache (next_frame, + this_cache); + trad_frame_get_prev_register (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind mips_insn32_frame_unwind = +{ + NORMAL_FRAME, + mips_insn32_frame_this_id, + mips_insn32_frame_prev_register +}; + +static const struct frame_unwind * +mips_insn32_frame_sniffer (struct frame_info *next_frame) +{ + CORE_ADDR pc = frame_pc_unwind (next_frame); + if (! pc_is_mips16 (pc)) + return &mips_insn32_frame_unwind; + return NULL; +} + +static CORE_ADDR +mips_insn32_frame_base_address (struct frame_info *next_frame, + void **this_cache) +{ + struct mips_frame_cache *info = mips_insn32_frame_cache (next_frame, + this_cache); + return info->base; +} + +static const struct frame_base mips_insn32_frame_base = +{ + &mips_insn32_frame_unwind, + mips_insn32_frame_base_address, + mips_insn32_frame_base_address, + mips_insn32_frame_base_address +}; + +static const struct frame_base * +mips_insn32_frame_base_sniffer (struct frame_info *next_frame) +{ + if (mips_insn32_frame_sniffer (next_frame) != NULL) + return &mips_insn32_frame_base; else - sp = 0; + return NULL; +} + +static struct trad_frame_cache * +mips_stub_frame_cache (struct frame_info *next_frame, void **this_cache) +{ + CORE_ADDR pc; + CORE_ADDR start_addr; + CORE_ADDR stack_addr; + struct trad_frame_cache *this_trad_cache; + + if ((*this_cache) != NULL) + return (*this_cache); + this_trad_cache = trad_frame_cache_zalloc (next_frame); + (*this_cache) = this_trad_cache; + + /* The return address is in the link register. */ + trad_frame_set_reg_realreg (this_trad_cache, PC_REGNUM, RA_REGNUM); + + /* Frame ID, since it's a frameless / stackless function, no stack + space is allocated and SP on entry is the current SP. */ + pc = frame_pc_unwind (next_frame); + find_pc_partial_function (pc, NULL, &start_addr, NULL); + stack_addr = frame_unwind_register_signed (next_frame, SP_REGNUM); + trad_frame_set_id (this_trad_cache, frame_id_build (start_addr, stack_addr)); + + /* Assume that the frame's base is the same as the + stack-pointer. */ + trad_frame_set_this_base (this_trad_cache, stack_addr); + + return this_trad_cache; +} + +static void +mips_stub_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) +{ + struct trad_frame_cache *this_trad_cache + = mips_stub_frame_cache (next_frame, this_cache); + trad_frame_get_id (this_trad_cache, this_id); +} + +static void +mips_stub_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct trad_frame_cache *this_trad_cache + = mips_stub_frame_cache (next_frame, this_cache); + trad_frame_get_register (this_trad_cache, next_frame, regnum, optimizedp, + lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind mips_stub_frame_unwind = +{ + NORMAL_FRAME, + mips_stub_frame_this_id, + mips_stub_frame_prev_register +}; + +static const struct frame_unwind * +mips_stub_frame_sniffer (struct frame_info *next_frame) +{ + CORE_ADDR pc = frame_pc_unwind (next_frame); + if (in_plt_section (pc, NULL)) + return &mips_stub_frame_unwind; + else + return NULL; +} + +static CORE_ADDR +mips_stub_frame_base_address (struct frame_info *next_frame, + void **this_cache) +{ + struct trad_frame_cache *this_trad_cache + = mips_stub_frame_cache (next_frame, this_cache); + return trad_frame_get_this_base (this_trad_cache); +} + +static const struct frame_base mips_stub_frame_base = +{ + &mips_stub_frame_unwind, + mips_stub_frame_base_address, + mips_stub_frame_base_address, + mips_stub_frame_base_address +}; + +static const struct frame_base * +mips_stub_frame_base_sniffer (struct frame_info *next_frame) +{ + if (mips_stub_frame_sniffer (next_frame) != NULL) + return &mips_stub_frame_base; + else + return NULL; +} + +static CORE_ADDR +read_next_frame_reg (struct frame_info *fi, int regno) +{ + /* Always a pseudo. */ + gdb_assert (regno >= NUM_REGS); + if (fi == NULL) + { + LONGEST val; + regcache_cooked_read_signed (current_regcache, regno, &val); + return val; + } + else + return frame_unwind_register_signed (fi, regno); + +} + +/* mips_addr_bits_remove - remove useless address bits */ + +static CORE_ADDR +mips_addr_bits_remove (CORE_ADDR addr) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + if (mips_mask_address_p (tdep) && (((ULONGEST) addr) >> 32 == 0xffffffffUL)) + /* This hack is a work-around for existing boards using PMON, the + simulator, and any other 64-bit targets that doesn't have true + 64-bit addressing. On these targets, the upper 32 bits of + addresses are ignored by the hardware. Thus, the PC or SP are + likely to have been sign extended to all 1s by instruction + sequences that load 32-bit addresses. For example, a typical + piece of code that loads an address is this: + + lui $r2, <upper 16 bits> + ori $r2, <lower 16 bits> + + But the lui sign-extends the value such that the upper 32 bits + may be all 1s. The workaround is simply to mask off these + bits. In the future, gcc may be changed to support true 64-bit + addressing, and this masking will have to be disabled. */ + return addr &= 0xffffffffUL; + else + return addr; +} + +/* mips_software_single_step() is called just before we want to resume + the inferior, if we want to single-step it but there is no hardware + or kernel single-step support (MIPS on GNU/Linux for example). We find + the target of the coming instruction and breakpoint it. + + single_step is also called just after the inferior stops. If we had + set up a simulated single-step, we undo our damage. */ +void +mips_software_single_step (enum target_signal sig, int insert_breakpoints_p) +{ + static CORE_ADDR next_pc; + typedef char binsn_quantum[BREAKPOINT_MAX]; + static binsn_quantum break_mem; + CORE_ADDR pc; + + if (insert_breakpoints_p) + { + pc = read_register (mips_regnum (current_gdbarch)->pc); + next_pc = mips_next_pc (pc); + + target_insert_breakpoint (next_pc, break_mem); + } + else + target_remove_breakpoint (next_pc, break_mem); +} + +static struct mips_extra_func_info temp_proc_desc; + +/* Test whether the PC points to the return instruction at the + end of a function. */ + +static int +mips_about_to_return (CORE_ADDR pc) +{ + if (pc_is_mips16 (pc)) + /* This mips16 case isn't necessarily reliable. Sometimes the compiler + generates a "jr $ra"; other times it generates code to load + the return address from the stack to an accessible register (such + as $a3), then a "jr" using that register. This second case + is almost impossible to distinguish from an indirect jump + used for switch statements, so we don't even try. */ + return mips_fetch_instruction (pc) == 0xe820; /* jr $ra */ + else + return mips_fetch_instruction (pc) == 0x3e00008; /* jr $ra */ +} + + +/* This fencepost looks highly suspicious to me. Removing it also + seems suspicious as it could affect remote debugging across serial + lines. */ + +static CORE_ADDR +heuristic_proc_start (CORE_ADDR pc) +{ + CORE_ADDR start_pc; + CORE_ADDR fence; + int instlen; + int seen_adjsp = 0; + + pc = ADDR_BITS_REMOVE (pc); + start_pc = pc; + fence = start_pc - heuristic_fence_post; + if (start_pc == 0) + return 0; + + if (heuristic_fence_post == UINT_MAX || fence < VM_MIN_ADDRESS) + fence = VM_MIN_ADDRESS; + + instlen = pc_is_mips16 (pc) ? MIPS16_INSTLEN : MIPS_INSTLEN; + + /* search back for previous return */ + for (start_pc -= instlen;; start_pc -= instlen) + if (start_pc < fence) + { + /* It's not clear to me why we reach this point when + stop_soon, but with this test, at least we + don't print out warnings for every child forked (eg, on + decstation). 22apr93 rich@cygnus.com. */ + if (stop_soon == NO_STOP_QUIETLY) + { + static int blurb_printed = 0; + + warning ("GDB can't find the start of the function at 0x%s.", + paddr_nz (pc)); + + if (!blurb_printed) + { + /* This actually happens frequently in embedded + development, when you first connect to a board + and your stack pointer and pc are nowhere in + particular. This message needs to give people + in that situation enough information to + determine that it's no big deal. */ + printf_filtered ("\n\ + GDB is unable to find the start of the function at 0x%s\n\ +and thus can't determine the size of that function's stack frame.\n\ +This means that GDB may be unable to access that stack frame, or\n\ +the frames below it.\n\ + This problem is most likely caused by an invalid program counter or\n\ +stack pointer.\n\ + However, if you think GDB should simply search farther back\n\ +from 0x%s for code which looks like the beginning of a\n\ +function, you can increase the range of the search using the `set\n\ +heuristic-fence-post' command.\n", paddr_nz (pc), paddr_nz (pc)); + blurb_printed = 1; + } + } + + return 0; + } + else if (pc_is_mips16 (start_pc)) + { + unsigned short inst; + + /* On MIPS16, any one of the following is likely to be the + start of a function: + entry + addiu sp,-n + daddiu sp,-n + extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n' */ + inst = mips_fetch_instruction (start_pc); + if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */ + || (inst & 0xff80) == 0x6380 /* addiu sp,-n */ + || (inst & 0xff80) == 0xfb80 /* daddiu sp,-n */ + || ((inst & 0xf810) == 0xf010 && seen_adjsp)) /* extend -n */ + break; + else if ((inst & 0xff00) == 0x6300 /* addiu sp */ + || (inst & 0xff00) == 0xfb00) /* daddiu sp */ + seen_adjsp = 1; + else + seen_adjsp = 0; + } + else if (mips_about_to_return (start_pc)) + { + start_pc += 2 * MIPS_INSTLEN; /* skip return, and its delay slot */ + break; + } + + return start_pc; +} + +static mips_extra_func_info_t +heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, + struct frame_info *next_frame, + struct mips_frame_cache *this_cache) +{ if (start_pc == 0) return NULL; + memset (&temp_proc_desc, '\0', sizeof (temp_proc_desc)); - temp_saved_regs = xrealloc (temp_saved_regs, SIZEOF_FRAME_SAVED_REGS); - memset (temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS); PROC_LOW_ADDR (&temp_proc_desc) = start_pc; - PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM; + PROC_FRAME_REG (&temp_proc_desc) = MIPS_SP_REGNUM; PROC_PC_REG (&temp_proc_desc) = RA_REGNUM; - if (start_pc + 200 < limit_pc) - limit_pc = start_pc + 200; if (pc_is_mips16 (start_pc)) - mips16_heuristic_proc_desc (start_pc, limit_pc, next_frame, sp); + mips16_scan_prologue (start_pc, limit_pc, next_frame, this_cache); else - mips32_heuristic_proc_desc (start_pc, limit_pc, next_frame, sp); + mips32_scan_prologue (start_pc, limit_pc, next_frame, this_cache); + return &temp_proc_desc; } @@ -2288,9 +2722,6 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) struct obj_section *sec; struct mips_objfile_private *priv; - if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) - return NULL; - find_pc_partial_function (pc, NULL, &startaddr, NULL); if (addrptr) *addrptr = startaddr; @@ -2354,38 +2785,70 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) { int low, mid, high; char *ptr; + CORE_ADDR pdr_pc; low = 0; high = priv->size / 32; + /* We've found a .pdr section describing this objfile. We want to + find the entry which describes this code address. The .pdr + information is not very descriptive; we have only a function + start address. We have to look for the closest entry, because + the local symbol at the beginning of this function may have + been stripped - so if we ask the symbol table for the start + address we may get a preceding global function. */ + + /* First, find the last .pdr entry starting at or before PC. */ do { - CORE_ADDR pdr_pc; - mid = (low + high) / 2; ptr = priv->contents + mid * 32; pdr_pc = bfd_get_signed_32 (sec->objfile->obfd, ptr); pdr_pc += ANOFFSET (sec->objfile->section_offsets, SECT_OFF_TEXT (sec->objfile)); - if (pdr_pc == startaddr) - break; - if (pdr_pc > startaddr) + + if (pdr_pc > pc) high = mid; else low = mid + 1; } while (low != high); - if (low != high) + /* Both low and high point one past the PDR of interest. If + both are zero, that means this PC is before any region + covered by a PDR, i.e. pdr_pc for the first PDR entry is + greater than PC. */ + if (low > 0) + { + ptr = priv->contents + (low - 1) * 32; + pdr_pc = bfd_get_signed_32 (sec->objfile->obfd, ptr); + pdr_pc += ANOFFSET (sec->objfile->section_offsets, + SECT_OFF_TEXT (sec->objfile)); + } + + /* We don't have a range, so we have no way to know for sure + whether we're in the correct PDR or a PDR for a preceding + function and the current function was a stripped local + symbol. But if the PDR's PC is at least as great as the + best guess from the symbol table, assume that it does cover + the right area; if a .pdr section is present at all then + nearly every function will have an entry. The biggest exception + will be the dynamic linker stubs; conveniently these are + placed before .text instead of after. */ + + if (pc >= pdr_pc && pdr_pc >= startaddr) { struct symbol *sym = find_pc_function (pc); + if (addrptr) + *addrptr = pdr_pc; + /* Fill in what we need of the proc_desc. */ proc_desc = (mips_extra_func_info_t) obstack_alloc (&sec->objfile->objfile_obstack, sizeof (struct mips_extra_func_info)); - PROC_LOW_ADDR (proc_desc) = startaddr; + PROC_LOW_ADDR (proc_desc) = pdr_pc; /* Only used for dummy frames. */ PROC_HIGH_ADDR (proc_desc) = 0; @@ -2439,67 +2902,6 @@ non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) return NULL; } - -static mips_extra_func_info_t -find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame) -{ - mips_extra_func_info_t proc_desc; - CORE_ADDR startaddr = 0; - - proc_desc = non_heuristic_proc_desc (pc, &startaddr); - - if (proc_desc) - { - /* IF this is the topmost frame AND - * (this proc does not have debugging information OR - * the PC is in the procedure prologue) - * THEN create a "heuristic" proc_desc (by analyzing - * the actual code) to replace the "official" proc_desc. - */ - if (next_frame == NULL) - { - struct symtab_and_line val; - struct symbol *proc_symbol = - PROC_DESC_IS_DUMMY (proc_desc) ? 0 : PROC_SYMBOL (proc_desc); - - if (proc_symbol) - { - val = find_pc_line (BLOCK_START - (SYMBOL_BLOCK_VALUE (proc_symbol)), 0); - val.pc = val.end ? val.end : pc; - } - if (!proc_symbol || pc < val.pc) - { - mips_extra_func_info_t found_heuristic = - heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), - pc, next_frame, cur_frame); - if (found_heuristic) - proc_desc = found_heuristic; - } - } - } - else - { - /* Is linked_proc_desc_table really necessary? It only seems to be used - by procedure call dummys. However, the procedures being called ought - to have their own proc_descs, and even if they don't, - heuristic_proc_desc knows how to create them! */ - - struct linked_proc_info *link; - - for (link = linked_proc_desc_table; link; link = link->next) - if (PROC_LOW_ADDR (&link->info) <= pc - && PROC_HIGH_ADDR (&link->info) > pc) - return &link->info; - - if (startaddr == 0) - startaddr = heuristic_proc_start (pc); - - proc_desc = heuristic_proc_desc (startaddr, pc, next_frame, cur_frame); - } - return proc_desc; -} - /* MIPS stack frames are almost impenetrable. When execution stops, we basically have to look at symbol information for the function that we stopped in, which tells us *which* register (if any) is @@ -2602,10 +3004,10 @@ return_value_location (struct type *valtype, && ((MIPS_FPU_TYPE == MIPS_FPU_DOUBLE && (len == 4 || len == 8)) || (MIPS_FPU_TYPE == MIPS_FPU_SINGLE && len == 4))) { - if (!FP_REGISTER_DOUBLE && len == 8) + if (mips_abi_regsize (current_gdbarch) < 8 && len == 8) { /* We need to break a 64bit float in two 32 bit halves and - spread them across a floating-point register pair. */ + spread them across a floating-point register pair. */ lo->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0; hi->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 0 : 4; lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG @@ -2643,22 +3045,22 @@ return_value_location (struct type *valtype, lo->reg = regnum + 0; hi->reg = regnum + 1; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && len < mips_saved_regsize (tdep)) + && len < mips_abi_regsize (current_gdbarch)) { /* "un-left-justify" the value in the low register */ - lo->reg_offset = mips_saved_regsize (tdep) - len; + lo->reg_offset = mips_abi_regsize (current_gdbarch) - len; lo->len = len; hi->reg_offset = 0; hi->len = 0; } - else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len > mips_saved_regsize (tdep) /* odd-size structs */ - && len < mips_saved_regsize (tdep) * 2 + else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len > mips_abi_regsize (current_gdbarch) /* odd-size structs */ + && len < mips_abi_regsize (current_gdbarch) * 2 && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT || TYPE_CODE (valtype) == TYPE_CODE_UNION)) { /* "un-left-justify" the value spread across two registers. */ - lo->reg_offset = 2 * mips_saved_regsize (tdep) - len; - lo->len = mips_saved_regsize (tdep) - lo->reg_offset; + lo->reg_offset = 2 * mips_abi_regsize (current_gdbarch) - len; + lo->len = mips_abi_regsize (current_gdbarch) - lo->reg_offset; hi->reg_offset = 0; hi->len = len - lo->len; } @@ -2667,10 +3069,10 @@ return_value_location (struct type *valtype, /* Only perform a partial copy of the second register. */ lo->reg_offset = 0; hi->reg_offset = 0; - if (len > mips_saved_regsize (tdep)) + if (len > mips_abi_regsize (current_gdbarch)) { - lo->len = mips_saved_regsize (tdep); - hi->len = len - mips_saved_regsize (tdep); + lo->len = mips_abi_regsize (current_gdbarch); + hi->len = len - mips_abi_regsize (current_gdbarch); } else { @@ -2680,7 +3082,7 @@ return_value_location (struct type *valtype, } if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && register_size (current_gdbarch, regnum) == 8 - && mips_saved_regsize (tdep) == 4) + && mips_abi_regsize (current_gdbarch) == 4) { /* Account for the fact that only the least-signficant part of the register is being used */ @@ -2698,7 +3100,7 @@ static int mips_eabi_use_struct_convention (int gcc_p, struct type *type) { struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - return (TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep)); + return (TYPE_LENGTH (type) > 2 * mips_abi_regsize (current_gdbarch)); } /* Should call_function pass struct by reference? @@ -2713,13 +3115,13 @@ mips_eabi_reg_struct_has_addr (int gcc_p, struct type *type) struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION) - return (len > mips_saved_regsize (tdep)); + return (len > mips_abi_regsize (current_gdbarch)); return 0; } static CORE_ADDR -mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -2730,6 +3132,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, int len = 0; int stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + CORE_ADDR func_addr = find_function_addr (function, NULL); /* For shared libraries, "t9" needs to point at the function address. */ @@ -2753,7 +3156,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, passed in registers, but that's OK. */ for (argnum = 0; argnum < nargs; argnum++) len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); sp -= align_up (len, 16); if (mips_debug) @@ -2794,13 +3197,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, /* The EABI passes structures that do not fit in a register by reference. */ - if (len > mips_saved_regsize (tdep) + if (len > mips_abi_regsize (gdbarch) && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) { - store_unsigned_integer (valbuf, mips_saved_regsize (tdep), + store_unsigned_integer (valbuf, mips_abi_regsize (gdbarch), VALUE_ADDRESS (arg)); typecode = TYPE_CODE_PTR; - len = mips_saved_regsize (tdep); + len = mips_abi_regsize (gdbarch); val = valbuf; if (mips_debug) fprintf_unfiltered (gdb_stdlog, " push"); @@ -2813,7 +3216,8 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, up before the check to see if there are any FP registers left. Non MIPS_EABI targets also pass the FP in the integer registers so also round up normal registers. */ - if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type)) + if (mips_abi_regsize (gdbarch) < 8 + && fp_register_arg_p (typecode, arg_type)) { if ((float_argreg & 1)) float_argreg++; @@ -2834,7 +3238,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, if (fp_register_arg_p (typecode, arg_type) && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) { - if (!FP_REGISTER_DOUBLE && len == 8) + if (mips_abi_regsize (gdbarch) < 8 && len == 8) { int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0; unsigned long regval; @@ -2872,12 +3276,12 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, register-sized pieces. Large arguments are split between registers and stack. */ /* Note: structs whose size is not a multiple of - mips_regsize() are treated specially: Irix cc passes them - in registers where gcc sometimes puts them on the stack. - For maximum compatibility, we will put them in both - places. */ - int odd_sized_struct = ((len > mips_saved_regsize (tdep)) - && (len % mips_saved_regsize (tdep) != 0)); + mips_abi_regsize() are treated specially: Irix cc passes + them in registers where gcc sometimes puts them on the + stack. For maximum compatibility, we will put them in + both places. */ + int odd_sized_struct = ((len > mips_abi_regsize (gdbarch)) + && (len % mips_abi_regsize (gdbarch) != 0)); /* Note: Floating-point values that didn't fit into an FP register are only written to memory. */ @@ -2885,8 +3289,8 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, { /* Remember if the argument was written to the stack. */ int stack_used_p = 0; - int partial_len = (len < mips_saved_regsize (tdep) - ? len : mips_saved_regsize (tdep)); + int partial_len = (len < mips_abi_regsize (gdbarch) + ? len : mips_abi_regsize (gdbarch)); if (mips_debug) fprintf_unfiltered (gdb_stdlog, " -- partial=%d", @@ -2904,16 +3308,16 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, stack_used_p = 1; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { - if (mips_stack_argsize (tdep) == 8 + if (mips_stack_argsize (gdbarch) == 8 && (typecode == TYPE_CODE_INT || typecode == TYPE_CODE_PTR || typecode == TYPE_CODE_FLT) && len <= 4) - longword_offset = mips_stack_argsize (tdep) - len; + longword_offset = mips_stack_argsize (gdbarch) - len; else if ((typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION) && (TYPE_LENGTH (arg_type) - < mips_stack_argsize (tdep))) - longword_offset = mips_stack_argsize (tdep) - len; + < mips_stack_argsize (gdbarch))) + longword_offset = mips_stack_argsize (gdbarch) - len; } if (mips_debug) @@ -2955,7 +3359,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, fprintf_filtered (gdb_stdlog, " - reg=%d val=%s", argreg, phex (regval, - mips_saved_regsize (tdep))); + mips_abi_regsize (gdbarch))); write_register (argreg, regval); argreg++; } @@ -2971,14 +3375,14 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, if (stack_used_p) stack_offset += align_up (partial_len, - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); } } if (mips_debug) fprintf_unfiltered (gdb_stdlog, "\n"); } - regcache_cooked_write_signed (regcache, SP_REGNUM, sp); + regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp); /* Return adjusted stack pointer. */ return sp; @@ -3036,7 +3440,7 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf) /* N32/N64 ABI stuff. */ static CORE_ADDR -mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -3047,6 +3451,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, int len = 0; int stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + CORE_ADDR func_addr = find_function_addr (function, NULL); /* For shared libraries, "t9" needs to point at the function address. */ @@ -3068,7 +3473,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); sp -= align_up (len, 16); if (mips_debug) @@ -3133,20 +3538,20 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, register-sized pieces. Large arguments are split between registers and stack. */ /* Note: structs whose size is not a multiple of - mips_regsize() are treated specially: Irix cc passes them - in registers where gcc sometimes puts them on the stack. - For maximum compatibility, we will put them in both - places. */ - int odd_sized_struct = ((len > mips_saved_regsize (tdep)) - && (len % mips_saved_regsize (tdep) != 0)); + mips_abi_regsize() are treated specially: Irix cc passes + them in registers where gcc sometimes puts them on the + stack. For maximum compatibility, we will put them in + both places. */ + int odd_sized_struct = ((len > mips_abi_regsize (gdbarch)) + && (len % mips_abi_regsize (gdbarch) != 0)); /* Note: Floating-point values that didn't fit into an FP register are only written to memory. */ while (len > 0) { /* Rememer if the argument was written to the stack. */ int stack_used_p = 0; - int partial_len = (len < mips_saved_regsize (tdep) - ? len : mips_saved_regsize (tdep)); + int partial_len = (len < mips_abi_regsize (gdbarch) + ? len : mips_abi_regsize (gdbarch)); if (mips_debug) fprintf_unfiltered (gdb_stdlog, " -- partial=%d", @@ -3164,11 +3569,11 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, stack_used_p = 1; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { - if (mips_stack_argsize (tdep) == 8 + if (mips_stack_argsize (gdbarch) == 8 && (typecode == TYPE_CODE_INT || typecode == TYPE_CODE_PTR || typecode == TYPE_CODE_FLT) && len <= 4) - longword_offset = mips_stack_argsize (tdep) - len; + longword_offset = mips_stack_argsize (gdbarch) - len; } if (mips_debug) @@ -3217,10 +3622,10 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, cagney/2001-07-23: gdb/179: Also, GCC, when outputting LE O32 with sizeof (struct) < - mips_saved_regsize(), generates a left shift as + mips_abi_regsize(), generates a left shift as part of storing the argument in a register a register (the left shift isn't generated when - sizeof (struct) >= mips_saved_regsize()). Since + sizeof (struct) >= mips_abi_regsize()). Since it is quite possible that this is GCC contradicting the LE/O32 ABI, GDB has not been adjusted to accommodate this. Either someone @@ -3230,17 +3635,17 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, accordingly. */ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && partial_len < mips_saved_regsize (tdep) + && partial_len < mips_abi_regsize (gdbarch) && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) - regval <<= ((mips_saved_regsize (tdep) - partial_len) * + regval <<= ((mips_abi_regsize (gdbarch) - partial_len) * TARGET_CHAR_BIT); if (mips_debug) fprintf_filtered (gdb_stdlog, " - reg=%d val=%s", argreg, phex (regval, - mips_saved_regsize (tdep))); + mips_abi_regsize (gdbarch))); write_register (argreg, regval); argreg++; } @@ -3256,14 +3661,14 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, if (stack_used_p) stack_offset += align_up (partial_len, - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); } } if (mips_debug) fprintf_unfiltered (gdb_stdlog, "\n"); } - regcache_cooked_write_signed (regcache, SP_REGNUM, sp); + regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp); /* Return adjusted stack pointer. */ return sp; @@ -3278,7 +3683,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, if (TYPE_CODE (type) == TYPE_CODE_STRUCT || TYPE_CODE (type) == TYPE_CODE_UNION || TYPE_CODE (type) == TYPE_CODE_ARRAY - || TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep)) + || TYPE_LENGTH (type) > 2 * mips_abi_regsize (gdbarch)) return RETURN_VALUE_STRUCT_CONVENTION; else if (TYPE_CODE (type) == TYPE_CODE_FLT && tdep->mips_fpu_type != MIPS_FPU_NONE) @@ -3374,7 +3779,7 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, /* O32 ABI stuff. */ static CORE_ADDR -mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -3385,6 +3790,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, int len = 0; int stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + CORE_ADDR func_addr = find_function_addr (function, NULL); /* For shared libraries, "t9" needs to point at the function address. */ @@ -3406,7 +3812,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); sp -= align_up (len, 16); if (mips_debug) @@ -3426,7 +3832,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, "mips_o32_push_dummy_call: struct_return reg=%d 0x%s\n", argreg, paddr_nz (struct_addr)); write_register (argreg++, struct_addr); - stack_offset += mips_stack_argsize (tdep); + stack_offset += mips_stack_argsize (gdbarch); } /* Now load as many as possible of the first arguments into @@ -3452,7 +3858,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, up before the check to see if there are any FP registers left. O32/O64 targets also pass the FP in the integer registers so also round up normal registers. */ - if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type)) + if (mips_abi_regsize (gdbarch) < 8 + && fp_register_arg_p (typecode, arg_type)) { if ((float_argreg & 1)) float_argreg++; @@ -3471,7 +3878,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, if (fp_register_arg_p (typecode, arg_type) && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) { - if (!FP_REGISTER_DOUBLE && len == 8) + if (mips_abi_regsize (gdbarch) < 8 && len == 8) { int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0; unsigned long regval; @@ -3518,10 +3925,10 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", argreg, phex (regval, len)); write_register (argreg, regval); - argreg += FP_REGISTER_DOUBLE ? 1 : 2; + argreg += (mips_abi_regsize (gdbarch) == 8) ? 1 : 2; } /* Reserve space for the FP register. */ - stack_offset += align_up (len, mips_stack_argsize (tdep)); + stack_offset += align_up (len, mips_stack_argsize (gdbarch)); } else { @@ -3529,15 +3936,15 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, register-sized pieces. Large arguments are split between registers and stack. */ /* Note: structs whose size is not a multiple of - mips_regsize() are treated specially: Irix cc passes them - in registers where gcc sometimes puts them on the stack. - For maximum compatibility, we will put them in both - places. */ - int odd_sized_struct = ((len > mips_saved_regsize (tdep)) - && (len % mips_saved_regsize (tdep) != 0)); + mips_abi_regsize() are treated specially: Irix cc passes + them in registers where gcc sometimes puts them on the + stack. For maximum compatibility, we will put them in + both places. */ + int odd_sized_struct = ((len > mips_abi_regsize (gdbarch)) + && (len % mips_abi_regsize (gdbarch) != 0)); /* Structures should be aligned to eight bytes (even arg registers) on MIPS_ABI_O32, if their first member has double precision. */ - if (mips_saved_regsize (tdep) < 8 + if (mips_abi_regsize (gdbarch) < 8 && mips_type_needs_double_align (arg_type)) { if ((argreg & 1)) @@ -3549,8 +3956,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, { /* Remember if the argument was written to the stack. */ int stack_used_p = 0; - int partial_len = (len < mips_saved_regsize (tdep) - ? len : mips_saved_regsize (tdep)); + int partial_len = (len < mips_abi_regsize (gdbarch) + ? len : mips_abi_regsize (gdbarch)); if (mips_debug) fprintf_unfiltered (gdb_stdlog, " -- partial=%d", @@ -3568,11 +3975,11 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, stack_used_p = 1; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { - if (mips_stack_argsize (tdep) == 8 + if (mips_stack_argsize (gdbarch) == 8 && (typecode == TYPE_CODE_INT || typecode == TYPE_CODE_PTR || typecode == TYPE_CODE_FLT) && len <= 4) - longword_offset = mips_stack_argsize (tdep) - len; + longword_offset = mips_stack_argsize (gdbarch) - len; } if (mips_debug) @@ -3609,7 +4016,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, { LONGEST regval = extract_signed_integer (val, partial_len); /* Value may need to be sign extended, because - mips_regsize() != mips_saved_regsize(). */ + mips_isa_regsize() != mips_abi_regsize(). */ /* A non-floating-point argument being passed in a general register. If a struct or union, and if @@ -3624,10 +4031,10 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, cagney/2001-07-23: gdb/179: Also, GCC, when outputting LE O32 with sizeof (struct) < - mips_saved_regsize(), generates a left shift as + mips_abi_regsize(), generates a left shift as part of storing the argument in a register a register (the left shift isn't generated when - sizeof (struct) >= mips_saved_regsize()). Since + sizeof (struct) >= mips_abi_regsize()). Since it is quite possible that this is GCC contradicting the LE/O32 ABI, GDB has not been adjusted to accommodate this. Either someone @@ -3636,19 +4043,19 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, identified as such and GDB gets tweaked accordingly. */ - if (mips_saved_regsize (tdep) < 8 + if (mips_abi_regsize (gdbarch) < 8 && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && partial_len < mips_saved_regsize (tdep) + && partial_len < mips_abi_regsize (gdbarch) && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) - regval <<= ((mips_saved_regsize (tdep) - partial_len) * + regval <<= ((mips_abi_regsize (gdbarch) - partial_len) * TARGET_CHAR_BIT); if (mips_debug) fprintf_filtered (gdb_stdlog, " - reg=%d val=%s", argreg, phex (regval, - mips_saved_regsize (tdep))); + mips_abi_regsize (gdbarch))); write_register (argreg, regval); argreg++; @@ -3669,14 +4076,14 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, always allocated. */ stack_offset += align_up (partial_len, - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); } } if (mips_debug) fprintf_unfiltered (gdb_stdlog, "\n"); } - regcache_cooked_write_signed (regcache, SP_REGNUM, sp); + regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp); /* Return adjusted stack pointer. */ return sp; @@ -3806,9 +4213,9 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct type *type, int regnum; for (offset = 0, regnum = V0_REGNUM; offset < TYPE_LENGTH (type); - offset += mips_stack_argsize (tdep), regnum++) + offset += mips_stack_argsize (gdbarch), regnum++) { - int xfer = mips_stack_argsize (tdep); + int xfer = mips_stack_argsize (gdbarch); if (offset + xfer > TYPE_LENGTH (type)) xfer = TYPE_LENGTH (type) - offset; if (mips_debug) @@ -3825,7 +4232,7 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct type *type, ABI. */ static CORE_ADDR -mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, @@ -3837,6 +4244,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, int len = 0; int stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + CORE_ADDR func_addr = find_function_addr (function, NULL); /* For shared libraries, "t9" needs to point at the function address. */ @@ -3858,7 +4266,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); sp -= align_up (len, 16); if (mips_debug) @@ -3878,7 +4286,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, "mips_o64_push_dummy_call: struct_return reg=%d 0x%s\n", argreg, paddr_nz (struct_addr)); write_register (argreg++, struct_addr); - stack_offset += mips_stack_argsize (tdep); + stack_offset += mips_stack_argsize (gdbarch); } /* Now load as many as possible of the first arguments into @@ -3904,7 +4312,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, up before the check to see if there are any FP registers left. O32/O64 targets also pass the FP in the integer registers so also round up normal registers. */ - if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type)) + if (mips_abi_regsize (gdbarch) < 8 + && fp_register_arg_p (typecode, arg_type)) { if ((float_argreg & 1)) float_argreg++; @@ -3923,7 +4332,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, if (fp_register_arg_p (typecode, arg_type) && float_argreg <= MIPS_LAST_FP_ARG_REGNUM) { - if (!FP_REGISTER_DOUBLE && len == 8) + if (mips_abi_regsize (gdbarch) < 8 && len == 8) { int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0; unsigned long regval; @@ -3970,10 +4379,10 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", argreg, phex (regval, len)); write_register (argreg, regval); - argreg += FP_REGISTER_DOUBLE ? 1 : 2; + argreg += (mips_abi_regsize (gdbarch) == 8) ? 1 : 2; } /* Reserve space for the FP register. */ - stack_offset += align_up (len, mips_stack_argsize (tdep)); + stack_offset += align_up (len, mips_stack_argsize (gdbarch)); } else { @@ -3981,15 +4390,15 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, register-sized pieces. Large arguments are split between registers and stack. */ /* Note: structs whose size is not a multiple of - mips_regsize() are treated specially: Irix cc passes them - in registers where gcc sometimes puts them on the stack. - For maximum compatibility, we will put them in both - places. */ - int odd_sized_struct = ((len > mips_saved_regsize (tdep)) - && (len % mips_saved_regsize (tdep) != 0)); + mips_abi_regsize() are treated specially: Irix cc passes + them in registers where gcc sometimes puts them on the + stack. For maximum compatibility, we will put them in + both places. */ + int odd_sized_struct = ((len > mips_abi_regsize (gdbarch)) + && (len % mips_abi_regsize (gdbarch) != 0)); /* Structures should be aligned to eight bytes (even arg registers) on MIPS_ABI_O32, if their first member has double precision. */ - if (mips_saved_regsize (tdep) < 8 + if (mips_abi_regsize (gdbarch) < 8 && mips_type_needs_double_align (arg_type)) { if ((argreg & 1)) @@ -4001,8 +4410,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, { /* Remember if the argument was written to the stack. */ int stack_used_p = 0; - int partial_len = (len < mips_saved_regsize (tdep) - ? len : mips_saved_regsize (tdep)); + int partial_len = (len < mips_abi_regsize (gdbarch) + ? len : mips_abi_regsize (gdbarch)); if (mips_debug) fprintf_unfiltered (gdb_stdlog, " -- partial=%d", @@ -4020,11 +4429,11 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, stack_used_p = 1; if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { - if (mips_stack_argsize (tdep) == 8 + if (mips_stack_argsize (gdbarch) == 8 && (typecode == TYPE_CODE_INT || typecode == TYPE_CODE_PTR || typecode == TYPE_CODE_FLT) && len <= 4) - longword_offset = mips_stack_argsize (tdep) - len; + longword_offset = mips_stack_argsize (gdbarch) - len; } if (mips_debug) @@ -4061,7 +4470,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, { LONGEST regval = extract_signed_integer (val, partial_len); /* Value may need to be sign extended, because - mips_regsize() != mips_saved_regsize(). */ + mips_isa_regsize() != mips_abi_regsize(). */ /* A non-floating-point argument being passed in a general register. If a struct or union, and if @@ -4076,10 +4485,10 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, cagney/2001-07-23: gdb/179: Also, GCC, when outputting LE O32 with sizeof (struct) < - mips_saved_regsize(), generates a left shift as + mips_abi_regsize(), generates a left shift as part of storing the argument in a register a register (the left shift isn't generated when - sizeof (struct) >= mips_saved_regsize()). Since + sizeof (struct) >= mips_abi_regsize()). Since it is quite possible that this is GCC contradicting the LE/O32 ABI, GDB has not been adjusted to accommodate this. Either someone @@ -4088,19 +4497,19 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, identified as such and GDB gets tweaked accordingly. */ - if (mips_saved_regsize (tdep) < 8 + if (mips_abi_regsize (gdbarch) < 8 && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && partial_len < mips_saved_regsize (tdep) + && partial_len < mips_abi_regsize (gdbarch) && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) - regval <<= ((mips_saved_regsize (tdep) - partial_len) * + regval <<= ((mips_abi_regsize (gdbarch) - partial_len) * TARGET_CHAR_BIT); if (mips_debug) fprintf_filtered (gdb_stdlog, " - reg=%d val=%s", argreg, phex (regval, - mips_saved_regsize (tdep))); + mips_abi_regsize (gdbarch))); write_register (argreg, regval); argreg++; @@ -4121,14 +4530,14 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, always allocated. */ stack_offset += align_up (partial_len, - mips_stack_argsize (tdep)); + mips_stack_argsize (gdbarch)); } } if (mips_debug) fprintf_unfiltered (gdb_stdlog, "\n"); } - regcache_cooked_write_signed (regcache, SP_REGNUM, sp); + regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp); /* Return adjusted stack pointer. */ return sp; @@ -4435,7 +4844,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, struct gdbarch *gdbarch = get_frame_arch (frame); /* do values for GP (int) regs */ char raw_buffer[MAX_REGISTER_SIZE]; - int ncols = (mips_regsize (gdbarch) == 8 ? 4 : 8); /* display cols per row */ + int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8); /* display cols per row */ int col, byte; int regnum; @@ -4450,7 +4859,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, TYPE_CODE_FLT) break; /* end the row: reached FP register */ fprintf_filtered (file, - mips_regsize (current_gdbarch) == 8 ? "%17s" : "%9s", + mips_abi_regsize (current_gdbarch) == 8 ? "%17s" : "%9s", REGISTER_NAME (regnum)); col++; } @@ -4474,7 +4883,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum)); /* pad small registers */ for (byte = 0; - byte < (mips_regsize (current_gdbarch) + byte < (mips_abi_regsize (current_gdbarch) - register_size (current_gdbarch, regnum)); byte++) printf_filtered (" "); /* Now print the register value in hex, endian order. */ @@ -4566,199 +4975,6 @@ mips_step_skips_delay (CORE_ADDR pc) extract_unsigned_integer (buf, MIPS_INSTLEN)); } -/* Skip the PC past function prologue instructions (32-bit version). - This is a helper function for mips_skip_prologue. */ - -static CORE_ADDR -mips32_skip_prologue (CORE_ADDR pc) -{ - t_inst inst; - CORE_ADDR end_pc; - int seen_sp_adjust = 0; - int load_immediate_bytes = 0; - - /* Find an upper bound on the prologue. */ - end_pc = skip_prologue_using_sal (pc); - if (end_pc == 0) - end_pc = pc + 100; /* Magic. */ - - /* Skip the typical prologue instructions. These are the stack adjustment - instruction and the instructions that save registers on the stack - or in the gcc frame. */ - for (; pc < end_pc; pc += MIPS_INSTLEN) - { - unsigned long high_word; - - inst = mips_fetch_instruction (pc); - high_word = (inst >> 16) & 0xffff; - - if (high_word == 0x27bd /* addiu $sp,$sp,offset */ - || high_word == 0x67bd) /* daddiu $sp,$sp,offset */ - seen_sp_adjust = 1; - else if (inst == 0x03a1e823 || /* subu $sp,$sp,$at */ - inst == 0x03a8e823) /* subu $sp,$sp,$t0 */ - seen_sp_adjust = 1; - else if (((inst & 0xFFE00000) == 0xAFA00000 /* sw reg,n($sp) */ - || (inst & 0xFFE00000) == 0xFFA00000) /* sd reg,n($sp) */ - && (inst & 0x001F0000)) /* reg != $zero */ - continue; - - else if ((inst & 0xFFE00000) == 0xE7A00000) /* swc1 freg,n($sp) */ - continue; - else if ((inst & 0xF3E00000) == 0xA3C00000 && (inst & 0x001F0000)) - /* sx reg,n($s8) */ - continue; /* reg != $zero */ - - /* move $s8,$sp. With different versions of gas this will be either - `addu $s8,$sp,$zero' or `or $s8,$sp,$zero' or `daddu s8,sp,$0'. - Accept any one of these. */ - else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d) - continue; - - else if ((inst & 0xFF9F07FF) == 0x00800021) /* move reg,$a0-$a3 */ - continue; - else if (high_word == 0x3c1c) /* lui $gp,n */ - continue; - else if (high_word == 0x279c) /* addiu $gp,$gp,n */ - continue; - else if (inst == 0x0399e021 /* addu $gp,$gp,$t9 */ - || inst == 0x033ce021) /* addu $gp,$t9,$gp */ - continue; - /* The following instructions load $at or $t0 with an immediate - value in preparation for a stack adjustment via - subu $sp,$sp,[$at,$t0]. These instructions could also initialize - a local variable, so we accept them only before a stack adjustment - instruction was seen. */ - else if (!seen_sp_adjust) - { - if (high_word == 0x3c01 || /* lui $at,n */ - high_word == 0x3c08) /* lui $t0,n */ - { - load_immediate_bytes += MIPS_INSTLEN; /* FIXME!! */ - continue; - } - else if (high_word == 0x3421 || /* ori $at,$at,n */ - high_word == 0x3508 || /* ori $t0,$t0,n */ - high_word == 0x3401 || /* ori $at,$zero,n */ - high_word == 0x3408) /* ori $t0,$zero,n */ - { - load_immediate_bytes += MIPS_INSTLEN; /* FIXME!! */ - continue; - } - else - break; - } - else - break; - } - - /* In a frameless function, we might have incorrectly - skipped some load immediate instructions. Undo the skipping - if the load immediate was not followed by a stack adjustment. */ - if (load_immediate_bytes && !seen_sp_adjust) - pc -= load_immediate_bytes; - return pc; -} - -/* Skip the PC past function prologue instructions (16-bit version). - This is a helper function for mips_skip_prologue. */ - -static CORE_ADDR -mips16_skip_prologue (CORE_ADDR pc) -{ - CORE_ADDR end_pc; - int extend_bytes = 0; - int prev_extend_bytes; - - /* Table of instructions likely to be found in a function prologue. */ - static struct - { - unsigned short inst; - unsigned short mask; - } - table[] = - { - { - 0x6300, 0xff00} - , /* addiu $sp,offset */ - { - 0xfb00, 0xff00} - , /* daddiu $sp,offset */ - { - 0xd000, 0xf800} - , /* sw reg,n($sp) */ - { - 0xf900, 0xff00} - , /* sd reg,n($sp) */ - { - 0x6200, 0xff00} - , /* sw $ra,n($sp) */ - { - 0xfa00, 0xff00} - , /* sd $ra,n($sp) */ - { - 0x673d, 0xffff} - , /* move $s1,sp */ - { - 0xd980, 0xff80} - , /* sw $a0-$a3,n($s1) */ - { - 0x6704, 0xff1c} - , /* move reg,$a0-$a3 */ - { - 0xe809, 0xf81f} - , /* entry pseudo-op */ - { - 0x0100, 0xff00} - , /* addiu $s1,$sp,n */ - { - 0, 0} /* end of table marker */ - }; - - /* Find an upper bound on the prologue. */ - end_pc = skip_prologue_using_sal (pc); - if (end_pc == 0) - end_pc = pc + 100; /* Magic. */ - - /* Skip the typical prologue instructions. These are the stack adjustment - instruction and the instructions that save registers on the stack - or in the gcc frame. */ - for (; pc < end_pc; pc += MIPS16_INSTLEN) - { - unsigned short inst; - int i; - - inst = mips_fetch_instruction (pc); - - /* Normally we ignore an extend instruction. However, if it is - not followed by a valid prologue instruction, we must adjust - the pc back over the extend so that it won't be considered - part of the prologue. */ - if ((inst & 0xf800) == 0xf000) /* extend */ - { - extend_bytes = MIPS16_INSTLEN; - continue; - } - prev_extend_bytes = extend_bytes; - extend_bytes = 0; - - /* Check for other valid prologue instructions besides extend. */ - for (i = 0; table[i].mask != 0; i++) - if ((inst & table[i].mask) == table[i].inst) /* found, get out */ - break; - if (table[i].mask != 0) /* it was in table? */ - continue; /* ignore it */ - else - /* non-prologue */ - { - /* Return the current pc, adjusted backwards by 2 if - the previous instruction was an extend. */ - return pc - prev_extend_bytes; - } - } - return pc; -} - /* To skip prologues, I use this predicate. Returns either PC itself if the code at PC does not look like a function prologue; otherwise returns an address that (if we're lucky) follows the prologue. If @@ -4775,7 +4991,8 @@ mips_skip_prologue (CORE_ADDR pc) If so, then return either PC, or the PC after the prologue, whichever is greater. */ - CORE_ADDR post_prologue_pc = after_prologue (pc, NULL); + CORE_ADDR post_prologue_pc = after_prologue (pc); + CORE_ADDR limit_pc; if (post_prologue_pc != 0) return max (pc, post_prologue_pc); @@ -4783,20 +5000,17 @@ mips_skip_prologue (CORE_ADDR pc) /* Can't determine prologue from the symbol table, need to examine instructions. */ + /* Find an upper limit on the function prologue using the debug + information. If the debug information could not be used to provide + that bound, then use an arbitrary large number as the upper bound. */ + limit_pc = skip_prologue_using_sal (pc); + if (limit_pc == 0) + limit_pc = pc + 100; /* Magic. */ + if (pc_is_mips16 (pc)) - return mips16_skip_prologue (pc); + return mips16_scan_prologue (pc, limit_pc, NULL, NULL); else - return mips32_skip_prologue (pc); -} - -/* Exported procedure: Is PC in the signal trampoline code */ - -static int -mips_pc_in_sigtramp (CORE_ADDR pc, char *ignore) -{ - if (sigtramp_address == 0) - fixup_sigtramp (); - return (pc >= sigtramp_address && pc < sigtramp_end); + return mips32_scan_prologue (pc, limit_pc, NULL, NULL); } /* Root of all "set mips "/"show mips " commands. This will eventually be @@ -5217,8 +5431,9 @@ mips_in_return_stub (CORE_ADDR pc, char *name) } -/* Return non-zero if the PC is in a library helper function that should - be ignored. This implements the IGNORE_HELPER_CALL macro. */ +/* Return non-zero if the PC is in a library helper function that + should be ignored. This implements the + DEPRECATED_IGNORE_HELPER_CALL macro. */ int mips_ignore_helper (CORE_ADDR pc) @@ -5399,7 +5614,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (found_abi == MIPS_ABI_UNKNOWN && info.abfd != NULL) bfd_map_over_sections (info.abfd, mips_find_abi_section, &found_abi); - /* If we have no usefu BFD information, use the ABI from the last + /* If we have no useful BFD information, use the ABI from the last MIPS architecture (if there is one). */ if (found_abi == MIPS_ABI_UNKNOWN && info.abfd == NULL && arches != NULL) found_abi = gdbarch_tdep (arches->gdbarch)->found_abi; @@ -5470,6 +5685,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_mach_mips3900: case bfd_mach_mips4100: case bfd_mach_mips4111: + case bfd_mach_mips4120: fpu_type = MIPS_FPU_NONE; break; case bfd_mach_mips4650: @@ -5568,7 +5784,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } /* FIXME: cagney/2003-11-15: For MIPS, hasn't PC_REGNUM been replaced by read_pc? */ - set_gdbarch_pc_regnum (gdbarch, regnum->pc); + set_gdbarch_pc_regnum (gdbarch, regnum->pc + num_regs); + set_gdbarch_sp_regnum (gdbarch, MIPS_SP_REGNUM + num_regs); set_gdbarch_fp0_regnum (gdbarch, regnum->fp0); set_gdbarch_num_regs (gdbarch, num_regs); set_gdbarch_num_pseudo_regs (gdbarch, num_regs); @@ -5582,9 +5799,6 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case MIPS_ABI_O32: set_gdbarch_push_dummy_call (gdbarch, mips_o32_push_dummy_call); set_gdbarch_return_value (gdbarch, mips_o32_return_value); - tdep->mips_default_saved_regsize = 4; - tdep->mips_default_stack_argsize = 4; - tdep->mips_fp_register_double = 0; tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1; tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 4 - 1; tdep->default_mask_address_p = 0; @@ -5598,17 +5812,13 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) mips_o64_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_o64_extract_return_value); - tdep->mips_default_saved_regsize = 8; - tdep->mips_default_stack_argsize = 8; - tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1; tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 4 - 1; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 32); set_gdbarch_ptr_bit (gdbarch, 32); set_gdbarch_long_long_bit (gdbarch, 64); - set_gdbarch_use_struct_convention (gdbarch, - always_use_struct_convention); + set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention); break; case MIPS_ABI_EABI32: set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call); @@ -5616,9 +5826,6 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) mips_eabi_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); - tdep->mips_default_saved_regsize = 4; - tdep->mips_default_stack_argsize = 4; - tdep->mips_fp_register_double = 0; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1; tdep->default_mask_address_p = 0; @@ -5627,8 +5834,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_long_bit (gdbarch, 64); set_gdbarch_deprecated_reg_struct_has_addr (gdbarch, mips_eabi_reg_struct_has_addr); - set_gdbarch_use_struct_convention (gdbarch, - mips_eabi_use_struct_convention); + set_gdbarch_deprecated_use_struct_convention (gdbarch, mips_eabi_use_struct_convention); break; case MIPS_ABI_EABI64: set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call); @@ -5636,9 +5842,6 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) mips_eabi_store_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, mips_eabi_extract_return_value); - tdep->mips_default_saved_regsize = 8; - tdep->mips_default_stack_argsize = 8; - tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1; tdep->default_mask_address_p = 0; @@ -5647,34 +5850,33 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_long_bit (gdbarch, 64); set_gdbarch_deprecated_reg_struct_has_addr (gdbarch, mips_eabi_reg_struct_has_addr); - set_gdbarch_use_struct_convention (gdbarch, - mips_eabi_use_struct_convention); + set_gdbarch_deprecated_use_struct_convention (gdbarch, mips_eabi_use_struct_convention); break; case MIPS_ABI_N32: set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call); set_gdbarch_return_value (gdbarch, mips_n32n64_return_value); - tdep->mips_default_saved_regsize = 8; - tdep->mips_default_stack_argsize = 8; - tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 32); set_gdbarch_ptr_bit (gdbarch, 32); set_gdbarch_long_long_bit (gdbarch, 64); + set_gdbarch_long_double_bit (gdbarch, 128); + set_gdbarch_long_double_format (gdbarch, + &floatformat_n32n64_long_double_big); break; case MIPS_ABI_N64: set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call); set_gdbarch_return_value (gdbarch, mips_n32n64_return_value); - tdep->mips_default_saved_regsize = 8; - tdep->mips_default_stack_argsize = 8; - tdep->mips_fp_register_double = 1; tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1; tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1; tdep->default_mask_address_p = 0; set_gdbarch_long_bit (gdbarch, 64); set_gdbarch_ptr_bit (gdbarch, 64); set_gdbarch_long_long_bit (gdbarch, 64); + set_gdbarch_long_double_bit (gdbarch, 128); + set_gdbarch_long_double_format (gdbarch, + &floatformat_n32n64_long_double_big); break; default: internal_error (__FILE__, __LINE__, "unknown ABI in switch"); @@ -5711,9 +5913,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Unwind the frame. */ set_gdbarch_unwind_pc (gdbarch, mips_unwind_pc); - frame_unwind_append_sniffer (gdbarch, mips_mdebug_frame_sniffer); set_gdbarch_unwind_dummy_id (gdbarch, mips_unwind_dummy_id); - frame_base_append_sniffer (gdbarch, mips_mdebug_frame_base_sniffer); /* Map debug register numbers onto internal register numbers. */ set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum); @@ -5749,7 +5949,6 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, mips_register_type); set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info); - set_gdbarch_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp); set_gdbarch_print_insn (gdbarch, gdb_print_insn_mips); @@ -5778,6 +5977,16 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Hook in OS ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); + /* Unwind the frame. */ + frame_unwind_append_sniffer (gdbarch, mips_stub_frame_sniffer); + frame_unwind_append_sniffer (gdbarch, mips_mdebug_frame_sniffer); + frame_unwind_append_sniffer (gdbarch, mips_insn16_frame_sniffer); + frame_unwind_append_sniffer (gdbarch, mips_insn32_frame_sniffer); + frame_base_append_sniffer (gdbarch, mips_stub_frame_base_sniffer); + frame_base_append_sniffer (gdbarch, mips_mdebug_frame_base_sniffer); + frame_base_append_sniffer (gdbarch, mips_insn16_frame_base_sniffer); + frame_base_append_sniffer (gdbarch, mips_insn32_frame_base_sniffer); + return gdbarch; } @@ -5871,9 +6080,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) tdep->default_mask_address_p); } fprintf_unfiltered (file, - "mips_dump_tdep: FP_REGISTER_DOUBLE = %d\n", - FP_REGISTER_DOUBLE); - fprintf_unfiltered (file, "mips_dump_tdep: MIPS_DEFAULT_FPU_TYPE = %d (%s)\n", MIPS_DEFAULT_FPU_TYPE, (MIPS_DEFAULT_FPU_TYPE == MIPS_FPU_NONE ? "none" @@ -5889,11 +6095,8 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) : MIPS_FPU_TYPE == MIPS_FPU_DOUBLE ? "double" : "???")); fprintf_unfiltered (file, - "mips_dump_tdep: FP_REGISTER_DOUBLE = %d\n", - FP_REGISTER_DOUBLE); - fprintf_unfiltered (file, "mips_dump_tdep: mips_stack_argsize() = %d\n", - mips_stack_argsize (tdep)); + mips_stack_argsize (current_gdbarch)); fprintf_unfiltered (file, "mips_dump_tdep: A0_REGNUM = %d\n", A0_REGNUM); fprintf_unfiltered (file, "mips_dump_tdep: ADDR_BITS_REMOVE # %s\n", @@ -5911,8 +6114,8 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: FIRST_EMBED_REGNUM = %d\n", FIRST_EMBED_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: IGNORE_HELPER_CALL # %s\n", - XSTRING (IGNORE_HELPER_CALL (PC))); + "mips_dump_tdep: DEPRECATED_IGNORE_HELPER_CALL # %s\n", + XSTRING (DEPRECATED_IGNORE_HELPER_CALL (PC))); fprintf_unfiltered (file, "mips_dump_tdep: IN_SOLIB_CALL_TRAMPOLINE # %s\n", XSTRING (IN_SOLIB_CALL_TRAMPOLINE (PC, NAME))); @@ -5952,13 +6155,11 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "mips_dump_tdep: MIPS_NUMREGS = %d\n", MIPS_NUMREGS); fprintf_unfiltered (file, - "mips_dump_tdep: mips_saved_regsize() = %d\n", - mips_saved_regsize (tdep)); + "mips_dump_tdep: mips_abi_regsize() = %d\n", + mips_abi_regsize (current_gdbarch)); fprintf_unfiltered (file, "mips_dump_tdep: PRID_REGNUM = %d\n", PRID_REGNUM); fprintf_unfiltered (file, - "mips_dump_tdep: PROC_DESC_IS_DUMMY = function?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: PROC_FRAME_ADJUST = function?\n"); fprintf_unfiltered (file, "mips_dump_tdep: PROC_FRAME_OFFSET = function?\n"); @@ -5987,8 +6188,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: SETUP_ARBITRARY_FRAME # %s\n", XSTRING (SETUP_ARBITRARY_FRAME (NUMARGS, ARGS))); fprintf_unfiltered (file, - "mips_dump_tdep: SET_PROC_DESC_IS_DUMMY = function?\n"); - fprintf_unfiltered (file, "mips_dump_tdep: SKIP_TRAMPOLINE_CODE # %s\n", XSTRING (SKIP_TRAMPOLINE_CODE (PC))); fprintf_unfiltered (file, @@ -6021,9 +6220,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) "mips_dump_tdep: TARGET_CAN_USE_HARDWARE_WATCHPOINT # %s\n", XSTRING (TARGET_CAN_USE_HARDWARE_WATCHPOINT (TYPE, CNT, OTHERTYPE))); - fprintf_unfiltered (file, - "mips_dump_tdep: TARGET_HAS_HARDWARE_WATCHPOINTS # %s\n", - XSTRING (TARGET_HAS_HARDWARE_WATCHPOINTS)); #ifdef TRACE_CLEAR fprintf_unfiltered (file, "mips_dump_tdep: TRACE_CLEAR # %s\n", @@ -6053,8 +6249,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file) (long) VM_MIN_ADDRESS); fprintf_unfiltered (file, "mips_dump_tdep: ZERO_REGNUM = %d\n", ZERO_REGNUM); - fprintf_unfiltered (file, - "mips_dump_tdep: _PROC_MAGIC_ = %d\n", _PROC_MAGIC_); } extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */ @@ -6084,10 +6278,10 @@ _initialize_mips_tdep (void) &showmipscmdlist, "show mips ", 0, &showlist); /* Allow the user to override the saved register size. */ - add_show_from_set (add_set_enum_cmd ("saved-gpreg-size", - class_obscure, - size_enums, - &mips_saved_regsize_string, "\ + deprecated_add_show_from_set (add_set_enum_cmd ("saved-gpreg-size", + class_obscure, + size_enums, + &mips_abi_regsize_string, "\ Set size of general purpose registers saved on the stack.\n\ This option can be set to one of:\n\ 32 - Force GDB to treat saved GP registers as 32-bit\n\ @@ -6097,16 +6291,18 @@ This option can be set to one of:\n\ (default: auto)", &setmipscmdlist), &showmipscmdlist); /* Allow the user to override the argument stack size. */ - add_show_from_set (add_set_enum_cmd ("stack-arg-size", - class_obscure, - size_enums, - &mips_stack_argsize_string, "\ + deprecated_add_show_from_set + (add_set_enum_cmd ("stack-arg-size", + class_obscure, + size_enums, + &mips_stack_argsize_string, "\ Set the amount of stack space reserved for each argument.\n\ This option can be set to one of:\n\ 32 - Force GDB to allocate 32-bit chunks per argument\n\ 64 - Force GDB to allocate 64-bit chunks per argument\n\ auto - Allow GDB to determine the correct setting from the current\n\ - target and executable (default)", &setmipscmdlist), &showmipscmdlist); + target and executable (default)", &setmipscmdlist), + &showmipscmdlist); /* Allow the user to override the ABI. */ c = add_set_enum_cmd @@ -6159,32 +6355,34 @@ search. The only need to set it is when debugging a stripped executable.", &set /* We need to throw away the frame cache when we set this, since it might change our ability to get backtraces. */ set_cmd_sfunc (c, reinit_frame_cache_sfunc); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); /* Allow the user to control whether the upper bits of 64-bit addresses should be zeroed. */ add_setshow_auto_boolean_cmd ("mask-address", no_class, &mask_address_var, "\ -Set zeroing of upper 32 bits of 64-bit addresses.\n\ +Set zeroing of upper 32 bits of 64-bit addresses.", "\ +Show zeroing of upper 32 bits of 64-bit addresses.", "\ Use \"on\" to enable the masking, \"off\" to disable it and \"auto\" to \n\ allow GDB to determine the correct value.\n", "\ -Show zeroing of upper 32 bits of 64-bit addresses.", +Zerroing of upper 32 bits of 64-bit address is %s.", NULL, show_mask_address, &setmipscmdlist, &showmipscmdlist); /* Allow the user to control the size of 32 bit registers within the raw remote packet. */ - add_setshow_cmd ("remote-mips64-transfers-32bit-regs", class_obscure, - var_boolean, &mips64_transfers_32bit_regs_p, "\ -Set compatibility with 64-bit MIPS targets that transfer 32-bit quantities.\n\ + add_setshow_boolean_cmd ("remote-mips64-transfers-32bit-regs", class_obscure, + &mips64_transfers_32bit_regs_p, "\ +Set compatibility with 64-bit MIPS target that transfers 32-bit quantities.", "\ +Show compatibility with 64-bit MIPS target that transfers 32-bit quantities.", "\ Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\ that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\ 64 bits for others. Use \"off\" to disable compatibility mode", "\ -Show compatibility with 64-bit MIPS targets that transfer 32-bit quantities.\n\ -Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\ -that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\ -64 bits for others. Use \"off\" to disable compatibility mode", set_mips64_transfers_32bit_regs, NULL, &setlist, &showlist); +Compatibility with 64-bit MIPS target that transfers 32-bit quantities is %s.", + set_mips64_transfers_32bit_regs, NULL, &setlist, &showlist); /* Debug this files internals. */ - add_show_from_set (add_set_cmd ("mips", class_maintenance, var_zinteger, - &mips_debug, "Set mips debugging.\n\ -When non-zero, mips specific debugging is enabled.", &setdebuglist), &showdebuglist); + deprecated_add_show_from_set + (add_set_cmd ("mips", class_maintenance, var_zinteger, + &mips_debug, "Set mips debugging.\n\ +When non-zero, mips specific debugging is enabled.", &setdebuglist), + &showdebuglist); } diff --git a/gnu/usr.bin/binutils/gdb/mipsnbsd-nat.c b/gnu/usr.bin/binutils/gdb/mipsnbsd-nat.c index 16521f67617..45fe2bcda65 100644 --- a/gnu/usr.bin/binutils/gdb/mipsnbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/mipsnbsd-nat.c @@ -1,5 +1,6 @@ /* Native-dependent code for MIPS systems running NetBSD. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + + Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -43,7 +44,7 @@ fetch_inferior_registers (int regno) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); mipsnbsd_supply_reg ((char *) ®s, regno); @@ -56,7 +57,7 @@ fetch_inferior_registers (int regno) struct fpreg fpregs; if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't get floating point status"); mipsnbsd_supply_fpreg ((char *) &fpregs, regno); @@ -71,13 +72,13 @@ store_inferior_registers (int regno) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); mipsnbsd_fill_reg ((char *) ®s, regno); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't write registers"); if (regno != -1) @@ -89,13 +90,13 @@ store_inferior_registers (int regno) struct fpreg fpregs; if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't get floating point status"); mipsnbsd_fill_fpreg ((char *) &fpregs, regno); if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't write floating point status"); } } diff --git a/gnu/usr.bin/binutils/gdb/mipsread.c b/gnu/usr.bin/binutils/gdb/mipsread.c index f67eeea9819..d34755e9d68 100644 --- a/gnu/usr.bin/binutils/gdb/mipsread.c +++ b/gnu/usr.bin/binutils/gdb/mipsread.c @@ -59,12 +59,9 @@ read_alphacoff_dynamic_symtab (struct section_offsets *, symbol file is specified (not just adding some symbols from another file, e.g. a shared library). */ -extern CORE_ADDR sigtramp_address; - static void mipscoff_new_init (struct objfile *ignore) { - sigtramp_address = 0; stabsread_new_init (); buildsym_new_init (); } @@ -105,25 +102,6 @@ mipscoff_symfile_read (struct objfile *objfile, int mainline) minimal symbols for this objfile. */ install_minimal_symbols (objfile); - - /* If the entry_file bounds are still unknown after processing the - partial symbols, then try to set them from the minimal symbols - surrounding the entry_point. */ - - if (mainline - && objfile->ei.entry_point != INVALID_ENTRY_POINT - && objfile->ei.deprecated_entry_file_lowpc == INVALID_ENTRY_LOWPC) - { - struct minimal_symbol *m; - - m = lookup_minimal_symbol_by_pc (objfile->ei.entry_point); - if (m && DEPRECATED_SYMBOL_NAME (m + 1)) - { - objfile->ei.deprecated_entry_file_lowpc = SYMBOL_VALUE_ADDRESS (m); - objfile->ei.deprecated_entry_file_highpc = SYMBOL_VALUE_ADDRESS (m + 1); - } - } - do_cleanups (back_to); } @@ -256,10 +234,10 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets, || si.got_sect == NULL) return; - sym_secsize = bfd_get_section_size_before_reloc (si.sym_sect); - str_secsize = bfd_get_section_size_before_reloc (si.str_sect); - dyninfo_secsize = bfd_get_section_size_before_reloc (si.dyninfo_sect); - got_secsize = bfd_get_section_size_before_reloc (si.got_sect); + sym_secsize = bfd_get_section_size (si.sym_sect); + str_secsize = bfd_get_section_size (si.str_sect); + dyninfo_secsize = bfd_get_section_size (si.dyninfo_sect); + got_secsize = bfd_get_section_size (si.got_sect); sym_secptr = xmalloc (sym_secsize); cleanups = make_cleanup (free, sym_secptr); str_secptr = xmalloc (str_secsize); diff --git a/gnu/usr.bin/binutils/gdb/mipsv4-nat.c b/gnu/usr.bin/binutils/gdb/mipsv4-nat.c index 3a3e7327ef5..53e286a9d78 100644 --- a/gnu/usr.bin/binutils/gdb/mipsv4-nat.c +++ b/gnu/usr.bin/binutils/gdb/mipsv4-nat.c @@ -51,24 +51,26 @@ supply_gregset (gregset_t *gregsetp) memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = 0; regi <= CXT_RA; regi++) - supply_register (regi, (char *) (regp + regi)); + regcache_raw_supply (current_regcache, regi, (char *) (regp + regi)); - supply_register (mips_regnum (current_gdbarch)->pc, - (char *) (regp + CXT_EPC)); - supply_register (mips_regnum (current_gdbarch)->hi, - (char *) (regp + CXT_MDHI)); - supply_register (mips_regnum (current_gdbarch)->lo, - (char *) (regp + CXT_MDLO)); - supply_register (mips_regnum (current_gdbarch)->cause, - (char *) (regp + CXT_CAUSE)); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->pc, + (char *) (regp + CXT_EPC)); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->hi, + (char *) (regp + CXT_MDHI)); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->lo, + (char *) (regp + CXT_MDLO)); + regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->cause, + (char *) (regp + CXT_CAUSE)); /* Fill inaccessible registers with zero. */ - supply_register (PS_REGNUM, zerobuf); - supply_register (mips_regnum (current_gdbarch)->badvaddr, zerobuf); - supply_register (DEPRECATED_FP_REGNUM, zerobuf); - supply_register (UNUSED_REGNUM, zerobuf); + regcache_raw_supply (current_regcache, PS_REGNUM, zerobuf); + regcache_raw_supply (current_regcache, + mips_regnum (current_gdbarch)->badvaddr, + zerobuf); + regcache_raw_supply (current_regcache, DEPRECATED_FP_REGNUM, zerobuf); + regcache_raw_supply (current_regcache, UNUSED_REGNUM, zerobuf); for (regi = FIRST_EMBED_REGNUM; regi <= LAST_EMBED_REGNUM; regi++) - supply_register (regi, zerobuf); + regcache_raw_supply (current_regcache, regi, zerobuf); } void @@ -110,15 +112,18 @@ supply_fpregset (fpregset_t *fpregsetp) memset (zerobuf, 0, MAX_REGISTER_SIZE); for (regi = 0; regi < 32; regi++) - supply_register (mips_regnum (current_gdbarch)->fp0 + regi, - (char *) &fpregsetp->fp_r.fp_regs[regi]); + regcache_raw_supply (current_regcache, + mips_regnum (current_gdbarch)->fp0 + regi, + (char *) &fpregsetp->fp_r.fp_regs[regi]); - supply_register (mips_regnum (current_gdbarch)->fp_control_status, - (char *) &fpregsetp->fp_csr); + regcache_raw_supply (current_regcache, + mips_regnum (current_gdbarch)->fp_control_status, + (char *) &fpregsetp->fp_csr); /* FIXME: how can we supply FCRIR? The ABI doesn't tell us. */ - supply_register (mips_regnum (current_gdbarch)->fp_implementation_revision, - zerobuf); + regcache_raw_supply (current_regcache, + mips_regnum (current_gdbarch)->fp_implementation_revision, + zerobuf); } void @@ -134,7 +139,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) { from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)]; to = (char *) &(fpregsetp->fp_r.fp_regs[regi - mips_regnum (current_gdbarch)->fp0]); - memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi)); + memcpy (to, from, register_size (current_gdbarch, regi)); } } diff --git a/gnu/usr.bin/binutils/gdb/monitor.c b/gnu/usr.bin/binutils/gdb/monitor.c index cd4f045375e..5e50713ed83 100644 --- a/gnu/usr.bin/binutils/gdb/monitor.c +++ b/gnu/usr.bin/binutils/gdb/monitor.c @@ -153,7 +153,7 @@ static void monitor_debug (const char *fmt, ...) ATTR_FORMAT(printf, 1, 2); static int monitor_debug_p = 0; /* NOTE: This file alternates between monitor_debug_p and remote_debug - when determining if debug information is printed. Perhaphs this + when determining if debug information is printed. Perhaps this could be simplified. */ static void @@ -921,9 +921,9 @@ monitor_supply_register (int regno, char *valstr) /* supply register stores in target byte order, so swap here */ - store_unsigned_integer (regbuf, DEPRECATED_REGISTER_RAW_SIZE (regno), val); + store_unsigned_integer (regbuf, register_size (current_gdbarch, regno), val); - supply_register (regno, regbuf); + regcache_raw_supply (current_regcache, regno, regbuf); return p; } @@ -1184,7 +1184,7 @@ monitor_fetch_register (int regno) if (!name || (*name == '\0')) { monitor_debug ("No register known for %d\n", regno); - supply_register (regno, zerobuf); + regcache_raw_supply (current_regcache, regno, zerobuf); return; } @@ -1227,7 +1227,7 @@ monitor_fetch_register (int regno) spaces, but stop reading if something else is seen. Some monitors like to drop leading zeros. */ - for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno) * 2; i++) + for (i = 0; i < register_size (current_gdbarch, regno) * 2; i++) { int c; c = readchar (timeout); @@ -1344,7 +1344,7 @@ monitor_store_register (int regno) val = read_register (regno); monitor_debug ("MON storeg %d %s\n", regno, - phex (val, DEPRECATED_REGISTER_RAW_SIZE (regno))); + phex (val, register_size (current_gdbarch, regno))); /* send the register deposit command */ @@ -2011,7 +2011,8 @@ monitor_kill (void) the program at that point. */ static void -monitor_create_inferior (char *exec_file, char *args, char **env) +monitor_create_inferior (char *exec_file, char *args, char **env, + int from_tty) { if (args && (*args != '\000')) error ("Args are not supported by the monitor."); @@ -2255,7 +2256,7 @@ init_base_monitor_ops (void) monitor_ops.to_fetch_registers = monitor_fetch_registers; monitor_ops.to_store_registers = monitor_store_registers; monitor_ops.to_prepare_to_store = monitor_prepare_to_store; - monitor_ops.to_xfer_memory = monitor_xfer_memory; + monitor_ops.deprecated_xfer_memory = monitor_xfer_memory; monitor_ops.to_files_info = monitor_files_info; monitor_ops.to_insert_breakpoint = monitor_insert_breakpoint; monitor_ops.to_remove_breakpoint = monitor_remove_breakpoint; @@ -2293,14 +2294,15 @@ void _initialize_remote_monitors (void) { init_base_monitor_ops (); - add_show_from_set (add_set_cmd ("hash", no_class, var_boolean, - (char *) &hashmark, - "Set display of activity while downloading a file.\n\ + deprecated_add_show_from_set + (add_set_cmd ("hash", no_class, var_boolean, + (char *) &hashmark, + "Set display of activity while downloading a file.\n\ When enabled, a hashmark \'#\' is displayed.", - &setlist), - &showlist); + &setlist), + &showlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("monitor", no_class, var_zinteger, (char *) &monitor_debug_p, "Set debugging of remote monitor communication.\n\ diff --git a/gnu/usr.bin/binutils/gdb/nlm/Makefile.in b/gnu/usr.bin/binutils/gdb/nlm/Makefile.in index 6b3cf8c9ddf..a3fd1513d0d 100644 --- a/gnu/usr.bin/binutils/gdb/nlm/Makefile.in +++ b/gnu/usr.bin/binutils/gdb/nlm/Makefile.in @@ -130,7 +130,7 @@ gdbserve.O: prelude.o gdbserve.o $(TDEPFILES) # specific routine gets the one for the correct machine. # The xyzzy stuff below deals with empty DEPFILES TAGS: ${TAGFILES} - etags `find ${srcdir}/../config -name $(TM_FILE) -print` \ + etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \ `find ${srcdir}/../config -name ${XM_FILE} -print` \ `find ${srcdir}/../config -name ${NAT_FILE} -print` \ `for i in yzzy ${DEPFILES}; do \ diff --git a/gnu/usr.bin/binutils/gdb/nlmread.c b/gnu/usr.bin/binutils/gdb/nlmread.c index 4e9c87d3ff0..b2a6a35a2f6 100644 --- a/gnu/usr.bin/binutils/gdb/nlmread.c +++ b/gnu/usr.bin/binutils/gdb/nlmread.c @@ -177,7 +177,6 @@ nlm_symfile_read (struct objfile *objfile, int mainline) bfd *abfd = objfile->obfd; struct cleanup *back_to; CORE_ADDR offset; - struct symbol *mainsym; init_minimal_symbol_collection (); back_to = make_cleanup_discard_minimal_symbols (); @@ -199,16 +198,6 @@ nlm_symfile_read (struct objfile *objfile, int mainline) stabsect_build_psymtabs (objfile, mainline, ".stab", ".stabstr", ".text"); - - mainsym = lookup_symbol (main_name (), NULL, VAR_DOMAIN, NULL, NULL); - - if (mainsym - && SYMBOL_CLASS (mainsym) == LOC_BLOCK) - { - objfile->ei.main_func_lowpc = BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym)); - objfile->ei.main_func_highpc = BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym)); - } - /* FIXME: We could locate and read the optional native debugging format here and add the symbols to the minimal symbol table. */ } @@ -224,7 +213,7 @@ nlm_symfile_finish (struct objfile *objfile) { if (objfile->sym_private != NULL) { - xmfree (objfile->md, objfile->sym_private); + xfree (objfile->sym_private); } } diff --git a/gnu/usr.bin/binutils/gdb/ns32k-tdep.c b/gnu/usr.bin/binutils/gdb/ns32k-tdep.c index 95475a894ca..8813cb2f58c 100644 --- a/gnu/usr.bin/binutils/gdb/ns32k-tdep.c +++ b/gnu/usr.bin/binutils/gdb/ns32k-tdep.c @@ -399,22 +399,6 @@ ns32k_frame_init_saved_regs (struct frame_info *frame) } static void -ns32k_push_dummy_frame (void) -{ - CORE_ADDR sp = read_register (SP_REGNUM); - int regnum; - - sp = push_word (sp, read_register (PC_REGNUM)); - sp = push_word (sp, read_register (DEPRECATED_FP_REGNUM)); - write_register (DEPRECATED_FP_REGNUM, sp); - - for (regnum = 0; regnum < 8; regnum++) - sp = push_word (sp, read_register (regnum)); - - write_register (SP_REGNUM, sp); -} - -static void ns32k_pop_frame (void) { struct frame_info *frame = get_current_frame (); @@ -434,42 +418,34 @@ ns32k_pop_frame (void) write_register (SP_REGNUM, fp + 8); flush_cached_frames (); } - -/* The NS32000 call dummy sequence: - - enter 0xff,0 82 ff 00 - jsr @0x00010203 7f ae c0 01 02 03 - adjspd 0x69696969 7f a5 01 02 03 04 - bpt f2 - It is 16 bytes long. */ - -static LONGEST ns32k_call_dummy_words[] = -{ - 0x7f00ff82, - 0x0201c0ae, - 0x01a57f03, - 0xf2040302 -}; -static int sizeof_ns32k_call_dummy_words = sizeof (ns32k_call_dummy_words); - -#define NS32K_CALL_DUMMY_ADDR 5 -#define NS32K_CALL_DUMMY_NARGS 11 - -static void -ns32k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, - struct value **args, struct type *type, int gcc_p) +static CORE_ADDR +ns32k_push_arguments (int nargs, struct value **args, CORE_ADDR sp, + int struct_return, CORE_ADDR struct_addr) { - int flipped; - - flipped = fun | 0xc0000000; - flip_bytes (&flipped, 4); - store_unsigned_integer (dummy + NS32K_CALL_DUMMY_ADDR, 4, flipped); + /* ASSERT ( !struct_return); */ + int i; + for (i = nargs - 1; i >= 0; i--) + { + struct value *arg = args[i]; + int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg)); + int container_len = len; + int offset; + + /* Are we going to put it at the high or low end of the + container? */ + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + offset = container_len - len; + else + offset = 0; - flipped = - nargs * 4; - flip_bytes (&flipped, 4); - store_unsigned_integer (dummy + NS32K_CALL_DUMMY_NARGS, 4, flipped); + /* Stack grows downward. */ + sp -= container_len; + write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len); + } + return sp; } + static void ns32k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp) @@ -499,7 +475,6 @@ ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32082); set_gdbarch_register_name (gdbarch, ns32k_register_name_32082); - set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082); set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32082); } @@ -509,7 +484,6 @@ ns32k_gdbarch_init_32382 (struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32382); set_gdbarch_register_name (gdbarch, ns32k_register_name_32382); - set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382); set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32382); } @@ -545,10 +519,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_register_size (gdbarch, NS32K_REGISTER_SIZE); set_gdbarch_deprecated_register_raw_size (gdbarch, ns32k_register_raw_size); - set_gdbarch_deprecated_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE); set_gdbarch_deprecated_register_virtual_size (gdbarch, ns32k_register_virtual_size); - set_gdbarch_deprecated_max_register_virtual_size (gdbarch, - NS32K_MAX_REGISTER_VIRTUAL_SIZE); set_gdbarch_deprecated_register_virtual_type (gdbarch, ns32k_register_virtual_type); /* Frame and stack info */ @@ -574,16 +545,9 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value); /* Call dummy info */ - set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame); set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame); set_gdbarch_call_dummy_location (gdbarch, ON_STACK); - set_gdbarch_deprecated_call_dummy_words (gdbarch, ns32k_call_dummy_words); - set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words); - set_gdbarch_deprecated_fix_call_dummy (gdbarch, ns32k_fix_call_dummy); - set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 3); - set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 15); - set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); - set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); + set_gdbarch_deprecated_push_arguments (gdbarch, ns32k_push_arguments); /* Breakpoint info */ set_gdbarch_breakpoint_from_pc (gdbarch, ns32k_breakpoint_from_pc); diff --git a/gnu/usr.bin/binutils/gdb/ns32knbsd-nat.c b/gnu/usr.bin/binutils/gdb/ns32knbsd-nat.c index 2dc7771f345..520dfe4fb79 100644 --- a/gnu/usr.bin/binutils/gdb/ns32knbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/ns32knbsd-nat.c @@ -1,6 +1,7 @@ /* Functions specific to running gdb native on an ns32k running NetBSD - Copyright 1989, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + + Copyright 1989, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, + 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -44,9 +45,9 @@ fetch_inferior_registers (int regno) struct fpreg inferior_fpregisters; ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); + (PTRACE_TYPE_ARG3) & inferior_registers, 0); ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0); + (PTRACE_TYPE_ARG3) & inferior_fpregisters, 0); RF (R0_REGNUM + 0, inferior_registers.r_r0); RF (R0_REGNUM + 1, inferior_registers.r_r1); @@ -105,9 +106,9 @@ store_inferior_registers (int regno) RS (LP0_REGNUM + 7, inferior_fpregisters.r_freg[7]); ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); + (PTRACE_TYPE_ARG3) & inferior_registers, 0); ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fpregisters, 0); + (PTRACE_TYPE_ARG3) & inferior_fpregisters, 0); } @@ -182,7 +183,7 @@ static struct core_fns nat_core_fns = void _initialize_ns32knbsd_nat (void) { - add_core_fns (&nat_core_fns); + deprecated_add_core_fns (&nat_core_fns); } diff --git a/gnu/usr.bin/binutils/gdb/objfiles.c b/gnu/usr.bin/binutils/gdb/objfiles.c index 61790778d18..3c4e0b402b0 100644 --- a/gnu/usr.bin/binutils/gdb/objfiles.c +++ b/gnu/usr.bin/binutils/gdb/objfiles.c @@ -180,11 +180,11 @@ allocate_objfile (bfd *abfd, int flags) objfile->obfd = abfd; if (objfile->name != NULL) { - xmfree (objfile->md, objfile->name); + xfree (objfile->name); } if (abfd != NULL) { - objfile->name = mstrsave (objfile->md, bfd_get_filename (abfd)); + objfile->name = xstrdup (bfd_get_filename (abfd)); objfile->mtime = bfd_get_mtime (abfd); /* Build section table. */ @@ -197,7 +197,7 @@ allocate_objfile (bfd *abfd, int flags) } else { - objfile->name = mstrsave (objfile->md, "<<anonymous objfile>>"); + objfile->name = xstrdup ("<<anonymous objfile>>"); } /* Initialize the section indexes for this objfile, so that we can @@ -250,12 +250,6 @@ init_entry_point_info (struct objfile *objfile) /* Examination of non-executable.o files. Short-circuit this stuff. */ objfile->ei.entry_point = INVALID_ENTRY_POINT; } - objfile->ei.deprecated_entry_file_lowpc = INVALID_ENTRY_LOWPC; - objfile->ei.deprecated_entry_file_highpc = INVALID_ENTRY_HIGHPC; - objfile->ei.entry_func_lowpc = INVALID_ENTRY_LOWPC; - objfile->ei.entry_func_highpc = INVALID_ENTRY_HIGHPC; - objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC; - objfile->ei.main_func_highpc = INVALID_ENTRY_HIGHPC; } /* Get current entry point address. */ @@ -447,19 +441,19 @@ free_objfile (struct objfile *objfile) objfile_free_data (objfile); if (objfile->name != NULL) { - xmfree (objfile->md, objfile->name); + xfree (objfile->name); } if (objfile->global_psymbols.list) - xmfree (objfile->md, objfile->global_psymbols.list); + xfree (objfile->global_psymbols.list); if (objfile->static_psymbols.list) - xmfree (objfile->md, objfile->static_psymbols.list); + xfree (objfile->static_psymbols.list); /* Free the obstacks for non-reusable objfiles */ bcache_xfree (objfile->psymbol_cache); bcache_xfree (objfile->macro_cache); if (objfile->demangled_names_hash) htab_delete (objfile->demangled_names_hash); obstack_free (&objfile->objfile_obstack, 0); - xmfree (objfile->md, objfile); + xfree (objfile); objfile = NULL; } @@ -651,24 +645,6 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) } } - if (objfile->ei.entry_func_lowpc != INVALID_ENTRY_LOWPC) - { - objfile->ei.entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); - objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); - } - - if (objfile->ei.deprecated_entry_file_lowpc != INVALID_ENTRY_LOWPC) - { - objfile->ei.deprecated_entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); - objfile->ei.deprecated_entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); - } - - if (objfile->ei.main_func_lowpc != INVALID_ENTRY_LOWPC) - { - objfile->ei.main_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); - objfile->ei.main_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); - } - /* Relocate breakpoints as necessary, after things are relocated. */ breakpoint_re_set (); } diff --git a/gnu/usr.bin/binutils/gdb/objfiles.h b/gnu/usr.bin/binutils/gdb/objfiles.h index 2b8ca7d350f..afbe8d26d38 100644 --- a/gnu/usr.bin/binutils/gdb/objfiles.h +++ b/gnu/usr.bin/binutils/gdb/objfiles.h @@ -44,9 +44,8 @@ struct objfile_data; to the user executable's recorded entry point, as if the call had been made directly by the kernel. - The traditional gdb method of using this info is to use the - recorded entry point to set the variables - deprecated_entry_file_lowpc and deprecated_entry_file_highpc from + The traditional gdb method of using this info was to use the + recorded entry point to set the entry-file's lowpc and highpc from the debugging information, where these values are the starting address (inclusive) and ending address (exclusive) of the instruction space in the executable which correspond to the @@ -57,7 +56,7 @@ struct objfile_data; NOTE: cagney/2003-09-09: It turns out that this "traditional" method doesn't work. Corinna writes: ``It turns out that the call - to deprecated_inside_entry_file destroys a meaningful backtrace + to test for "inside entry file" destroys a meaningful backtrace under some conditions. E. g. the backtrace tests in the asm-source testcase are broken for some targets. In this test the functions are all implemented as part of one file and the testcase is not @@ -111,32 +110,6 @@ struct entry_info #define INVALID_ENTRY_POINT (~0) /* ~0 will not be in any file, we hope. */ - /* Start (inclusive) and end (exclusive) of function containing the - entry point. */ - - CORE_ADDR entry_func_lowpc; - CORE_ADDR entry_func_highpc; - - /* Start (inclusive) and end (exclusive) of object file containing the - entry point. */ - - CORE_ADDR deprecated_entry_file_lowpc; - CORE_ADDR deprecated_entry_file_highpc; - - /* Start (inclusive) and end (exclusive) of the user code main() function. */ - - CORE_ADDR main_func_lowpc; - CORE_ADDR main_func_highpc; - -/* Use these values when any of the above ranges is invalid. */ - -/* We use these values because it guarantees that there is no number that is - both >= LOWPC && < HIGHPC. It is also highly unlikely that 3 is a valid - module or function start address (as opposed to 0). */ - -#define INVALID_ENTRY_LOWPC (3) -#define INVALID_ENTRY_HIGHPC (1) - }; /* Sections in an objfile. diff --git a/gnu/usr.bin/binutils/gdb/observer.h b/gnu/usr.bin/binutils/gdb/observer.h deleted file mode 100644 index 8b9a6db5607..00000000000 --- a/gnu/usr.bin/binutils/gdb/observer.h +++ /dev/null @@ -1,35 +0,0 @@ -/* GDB Notifications to Observers. - Copyright 2003 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. */ - -#ifndef OBSERVER_H -#define OBSERVER_H - -struct observer; - -/* normal_stop notifications. */ - -typedef void (observer_normal_stop_ftype) (void); - -extern struct observer * - observer_attach_normal_stop (observer_normal_stop_ftype *f); -extern void observer_detach_normal_stop (struct observer *observer); -extern void observer_notify_normal_stop (void); - -#endif /* OBSERVER_H */ diff --git a/gnu/usr.bin/binutils/gdb/parse.c b/gnu/usr.bin/binutils/gdb/parse.c index 374e88ed85d..61d28f70663 100644 --- a/gnu/usr.bin/binutils/gdb/parse.c +++ b/gnu/usr.bin/binutils/gdb/parse.c @@ -1,6 +1,8 @@ /* Parse expressions for GDB. - Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + + Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, + 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. + Modified from expread.y by the Department of Computer Science at the State University of New York at Buffalo, 1991. @@ -95,8 +97,6 @@ int comma_terminates; static int expressiondebug = 0; -extern int hp_som_som_object_present; - static void free_funcalls (void *ignore); static void prefixify_expression (struct expression *); @@ -104,6 +104,9 @@ static void prefixify_expression (struct expression *); static void prefixify_subexp (struct expression *, struct expression *, int, int); +static struct expression *parse_exp_in_context (char **, struct block *, int, + int); + void _initialize_parse (void); /* Data structure for saving values of arglist_len for function calls whose @@ -590,7 +593,7 @@ parse_nested_classes_for_hpacc (char *name, int len, char **token, return NULL, and caller must default to standard GDB behaviour. */ - if (!hp_som_som_object_present) + if (!deprecated_hp_som_som_object_present) return (struct symbol *) NULL; p = name; @@ -1023,6 +1026,16 @@ prefixify_subexp (struct expression *inexpr, struct expression * parse_exp_1 (char **stringptr, struct block *block, int comma) { + return parse_exp_in_context (stringptr, block, comma, 0); +} + +/* As for parse_exp_1, except that if VOID_CONTEXT_P, then + no value is expected from the expression. */ + +static struct expression * +parse_exp_in_context (char **stringptr, struct block *block, int comma, + int void_context_p) +{ struct cleanup *old_chain; lexptr = *stringptr; @@ -1078,6 +1091,8 @@ parse_exp_1 (char **stringptr, struct block *block, int comma) prefixify_expression (expout); + current_language->la_post_parser (&expout, void_context_p); + if (expressiondebug) dump_prefix_expression (expout, gdb_stdlog); @@ -1097,6 +1112,27 @@ parse_expression (char *string) error ("Junk after end of expression."); return exp; } + + +/* As for parse_expression, except that if VOID_CONTEXT_P, then + no value is expected from the expression. */ + +struct expression * +parse_expression_in_context (char *string, int void_context_p) +{ + struct expression *exp; + exp = parse_exp_in_context (&string, 0, 0, void_context_p); + if (*string != '\000') + error ("Junk after end of expression."); + return exp; +} + +/* A post-parser that does nothing */ + +void +null_post_parser (struct expression **exp, int void_context_p) +{ +} /* Stuff for maintaining a stack of types. Currently just used by C, but probably useful for any language which declares its types "backwards". */ @@ -1298,11 +1334,11 @@ _initialize_parse (void) DEPRECATED_REGISTER_GDBARCH_SWAP (msym_unknown_symbol_type); deprecated_register_gdbarch_swap (NULL, 0, build_parse); - add_show_from_set ( - add_set_cmd ("expression", class_maintenance, var_zinteger, - (char *) &expressiondebug, - "Set expression debugging.\n\ + deprecated_add_show_from_set + (add_set_cmd ("expression", class_maintenance, var_zinteger, + (char *) &expressiondebug, + "Set expression debugging.\n\ When non-zero, the internal representation of expressions will be printed.", - &setdebuglist), - &showdebuglist); + &setdebuglist), + &showdebuglist); } diff --git a/gnu/usr.bin/binutils/gdb/parser-defs.h b/gnu/usr.bin/binutils/gdb/parser-defs.h index c84fcad2c1f..43a07c37466 100644 --- a/gnu/usr.bin/binutils/gdb/parser-defs.h +++ b/gnu/usr.bin/binutils/gdb/parser-defs.h @@ -172,6 +172,8 @@ extern char *op_name_standard (enum exp_opcode); extern struct type *follow_types (struct type *); +extern void null_post_parser (struct expression **, int); + /* During parsing of a C expression, the pointer to the next character is in this variable. */ diff --git a/gnu/usr.bin/binutils/gdb/ppcbug-rom.c b/gnu/usr.bin/binutils/gdb/ppcbug-rom.c index 0619964eef3..ee0465660f7 100644 --- a/gnu/usr.bin/binutils/gdb/ppcbug-rom.c +++ b/gnu/usr.bin/binutils/gdb/ppcbug-rom.c @@ -166,7 +166,7 @@ init_ppc_cmds (char *LOAD_CMD, OPS->getreg.term = NULL; /* getreg.term */ OPS->getreg.term_cmd = NULL; /* getreg.term_cmd */ OPS->register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ - OPS->supply_register = ppcbug_supply_register; /* supply_register */ + OPS->supply_register = ppcbug_supply_register; OPS->dump_registers = "rd\r"; /* dump all registers */ OPS->load_routine = NULL; /* load_routine (defaults to SRECs) */ OPS->load = LOAD_CMD; /* download command */ diff --git a/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c b/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c index 1293b406c65..c36c63f11d8 100644 --- a/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c @@ -19,8 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "nm-bsd.h" - #include "defs.h" #include "inferior.h" #include "regcache.h" @@ -30,8 +28,11 @@ #include <sys/ptrace.h> #include <machine/reg.h> +#include "ppc-tdep.h" #include "ppcobsd-tdep.h" - + +/* OpenBSD/powerpc doesn't have PT_GETFPREGS/PT_SETFPREGS like + NetBSD/powerpc and FreeBSD/powerpc. */ /* Fetch register REGNUM from the inferior. If REGNUM is -1, do this for all registers. */ @@ -42,7 +43,7 @@ fetch_inferior_registers (int regnum) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); ppcobsd_supply_gregset (&ppcobsd_gregset, current_regcache, -1, @@ -58,14 +59,14 @@ store_inferior_registers (int regnum) struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); ppcobsd_collect_gregset (&ppcobsd_gregset, current_regcache, regnum, ®s, sizeof regs); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't write registers"); } diff --git a/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.c b/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.c index dd6afddd7ad..8a0a9c41717 100644 --- a/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.c +++ b/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.c @@ -24,6 +24,7 @@ #include "osabi.h" #include "regcache.h" #include "regset.h" +#include "gdb_assert.h" #include "gdb_string.h" @@ -31,171 +32,14 @@ #include "ppcobsd-tdep.h" #include "solib-svr4.h" - -/* Register set support functions. */ - -/* FIXME: kettenis/20040418: There is nothing OpenBSD-specific about - the functions on this page; they were written to be as general as - possible. This stuff should probably be moved to rs6000-tdep.c or - perhaps a new ppc-tdep.c. */ - -static void -ppc_supply_reg (struct regcache *regcache, int regnum, - const char *regs, size_t offset) -{ - if (regnum != -1 && offset != -1) - regcache_raw_supply (regcache, regnum, regs + offset); -} - -static void -ppc_collect_reg (const struct regcache *regcache, int regnum, - char *regs, size_t offset) -{ - if (regnum != -1 && offset != -1) - regcache_raw_collect (regcache, regnum, regs + offset); -} - -/* Supply the general-purpose registers stored in GREGS to REGCACHE. */ - -void -ppc_supply_gregset (const struct regset *regset, struct regcache *regcache, - int regnum, const void *gregs, size_t len) -{ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - const struct ppc_reg_offsets *offsets = regset->descr; - size_t offset; - int i; - - for (i = 0, offset = offsets->r0_offset; i < 32; i++, offset += 4) - { - if (regnum == -1 || regnum == i) - ppc_supply_reg (regcache, i, gregs, offset); - } - - if (regnum == -1 || regnum == PC_REGNUM) - ppc_supply_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset); - if (regnum == -1 || regnum == tdep->ppc_ps_regnum) - ppc_supply_reg (regcache, tdep->ppc_ps_regnum, - gregs, offsets->ps_offset); - if (regnum == -1 || regnum == tdep->ppc_cr_regnum) - ppc_supply_reg (regcache, tdep->ppc_cr_regnum, - gregs, offsets->cr_offset); - if (regnum == -1 || regnum == tdep->ppc_lr_regnum) - ppc_supply_reg (regcache, tdep->ppc_lr_regnum, - gregs, offsets->lr_offset); - if (regnum == -1 || regnum == tdep->ppc_ctr_regnum) - ppc_supply_reg (regcache, tdep->ppc_ctr_regnum, - gregs, offsets->ctr_offset); - if (regnum == -1 || regnum == tdep->ppc_xer_regnum) - ppc_supply_reg (regcache, tdep->ppc_xer_regnum, - gregs, offsets->cr_offset); - if (regnum == -1 || regnum == tdep->ppc_mq_regnum) - ppc_supply_reg (regcache, tdep->ppc_mq_regnum, gregs, offsets->mq_offset); -} - -/* Supply the floating-point registers stored in FPREGS to REGCACHE. */ - -void -ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache, - int regnum, const void *fpregs, size_t len) -{ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - const struct ppc_reg_offsets *offsets = regset->descr; - size_t offset; - int i; - - offset = offsets->f0_offset; - for (i = FP0_REGNUM; i < FP0_REGNUM + 32; i++, offset += 4) - { - if (regnum == -1 || regnum == i) - ppc_supply_reg (regcache, i, fpregs, offset); - } - - if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum) - ppc_supply_reg (regcache, tdep->ppc_fpscr_regnum, - fpregs, offsets->fpscr_offset); -} - -/* Collect the general-purpose registers from REGCACHE and store them - in GREGS. */ - -void -ppc_collect_gregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *gregs, size_t len) -{ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - const struct ppc_reg_offsets *offsets = &ppcobsd_reg_offsets; - size_t offset; - int i; - - offset = offsets->r0_offset; - for (i = 0; i <= 32; i++, offset += 4) - { - if (regnum == -1 || regnum == i) - ppc_collect_reg (regcache, regnum, gregs, offset); - } - - if (regnum == -1 || regnum == PC_REGNUM) - ppc_collect_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset); - if (regnum == -1 || regnum == tdep->ppc_ps_regnum) - ppc_collect_reg (regcache, tdep->ppc_ps_regnum, - gregs, offsets->ps_offset); - if (regnum == -1 || regnum == tdep->ppc_cr_regnum) - ppc_collect_reg (regcache, tdep->ppc_cr_regnum, - gregs, offsets->cr_offset); - if (regnum == -1 || regnum == tdep->ppc_lr_regnum) - ppc_collect_reg (regcache, tdep->ppc_lr_regnum, - gregs, offsets->lr_offset); - if (regnum == -1 || regnum == tdep->ppc_ctr_regnum) - ppc_collect_reg (regcache, tdep->ppc_ctr_regnum, - gregs, offsets->ctr_offset); - if (regnum == -1 || regnum == tdep->ppc_xer_regnum) - ppc_collect_reg (regcache, tdep->ppc_xer_regnum, - gregs, offsets->xer_offset); - if (regnum == -1 || regnum == tdep->ppc_mq_regnum) - ppc_collect_reg (regcache, tdep->ppc_mq_regnum, - gregs, offsets->mq_offset); -} - -/* Collect the floating-point registers from REGCACHE and store them - in FPREGS. */ - -void -ppc_collect_fpregset (const struct regset *regset, - const struct regcache *regcache, - int regnum, void *fpregs, size_t len) -{ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - const struct ppc_reg_offsets *offsets = &ppcobsd_reg_offsets; - size_t offset; - int i; - - offset = offsets->f0_offset; - for (i = FP0_REGNUM; i <= FP0_REGNUM + 32; i++, offset += 4) - { - if (regnum == -1 || regnum == i) - ppc_collect_reg (regcache, regnum, fpregs, offset); - } - - if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum) - ppc_collect_reg (regcache, tdep->ppc_fpscr_regnum, - fpregs, offsets->fpscr_offset); -} - - /* Register offsets from <machine/reg.h>. */ struct ppc_reg_offsets ppcobsd_reg_offsets; /* Core file support. */ -/* Supply register REGNUM from the buffer specified by GREGS and LEN - in the general-purpose register set REGSET to register cache +/* Supply register REGNUM in the general-purpose register set REGSET + from the buffer specified by GREGS and LEN to register cache REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ void @@ -203,20 +47,49 @@ ppcobsd_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { + /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating + point registers. Traditionally, GDB's register set has still + listed the floating point registers for such machines, so this + code is harmless. However, the new E500 port actually omits the + floating point registers entirely from the register set --- they + don't even have register numbers assigned to them. + + It's not clear to me how best to update this code, so this assert + will alert the first person to encounter the OpenBSD/E500 + combination to the problem. */ + gdb_assert (ppc_floating_point_unit_p (current_gdbarch)); + ppc_supply_gregset (regset, regcache, regnum, gregs, len); ppc_supply_fpregset (regset, regcache, regnum, gregs, len); } +/* Collect register REGNUM in the general-purpose register set + REGSET. from register cache REGCACHE into the buffer specified by + GREGS and LEN. If REGNUM is -1, do this for all registers in + REGSET. */ + void ppcobsd_collect_gregset (const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len) { + /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating + point registers. Traditionally, GDB's register set has still + listed the floating point registers for such machines, so this + code is harmless. However, the new E500 port actually omits the + floating point registers entirely from the register set --- they + don't even have register numbers assigned to them. + + It's not clear to me how best to update this code, so this assert + will alert the first person to encounter the OpenBSD/E500 + combination to the problem. */ + gdb_assert (ppc_floating_point_unit_p (current_gdbarch)); + ppc_collect_gregset (regset, regcache, regnum, gregs, len); ppc_collect_fpregset (regset, regcache, regnum, gregs, len); } -/* OpenBS/macppc register set. */ +/* OpenBS/powerpc register set. */ struct regset ppcobsd_gregset = { @@ -276,6 +149,8 @@ _initialize_ppcobsd_tdep (void) gdbarch_register_osabi_sniffer (bfd_arch_powerpc, bfd_target_unknown_flavour, ppcobsd_core_osabi_sniffer); + gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_OPENBSD_ELF, + ppcobsd_init_abi); gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_OPENBSD_ELF, ppcobsd_init_abi); diff --git a/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.h b/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.h index 4fd7fdbf6f5..8f29aaa32ea 100644 --- a/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.h +++ b/gnu/usr.bin/binutils/gdb/ppcobsd-tdep.h @@ -27,46 +27,26 @@ struct regset; struct regcache; -/* Register set description. */ - -/* FIXME: kettenis/20040418: There is nothing OpenBSD-specific about - this structure; it was written to be as general as possible. This - stuff should probably be moved to ppc-tdep.h. */ - -struct ppc_reg_offsets -{ - /* General-purpose registers. */ - int r0_offset; - int pc_offset; - int ps_offset; - int cr_offset; - int lr_offset; - int ctr_offset; - int xer_offset; - int mq_offset; - - /* Floating-point registers. */ - int f0_offset; - int fpscr_offset; - - /* AltiVec registers. */ - int vr0_offset; - int vscr_offset; - int vrsave_offset; -}; - - -/* Register offsets for OpenBSD/macppc. */ +/* Register offsets for OpenBSD/powerpc. */ extern struct ppc_reg_offsets ppcobsd_reg_offsets; -/* Register sets for OpenBSD/macppc. */ +/* Register sets for OpenBSD/powerpc. */ extern struct regset ppcobsd_gregset; +/* Supply register REGNUM in the general-purpose register set REGSET + from the buffer specified by GREGS and LEN to register cache + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ + extern void ppcobsd_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len); +/* Collect register REGNUM in the general-purpose register set + REGSET. from register cache REGCACHE into the buffer specified by + GREGS and LEN. If REGNUM is -1, do this for all registers in + REGSET. */ + extern void ppcobsd_collect_gregset (const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len); diff --git a/gnu/usr.bin/binutils/gdb/printcmd.c b/gnu/usr.bin/binutils/gdb/printcmd.c index 9734ec12ed6..8b7d31d5101 100644 --- a/gnu/usr.bin/binutils/gdb/printcmd.c +++ b/gnu/usr.bin/binutils/gdb/printcmd.c @@ -499,9 +499,7 @@ print_scalar_formatted (void *valaddr, struct type *type, int format, int size, if (*cp == '\0') cp--; } - strcpy (buf, local_binary_format_prefix ()); - strcat (buf, cp); - strcat (buf, local_binary_format_suffix ()); + strcpy (buf, cp); fputs_filtered (buf, stream); } break; @@ -2146,18 +2144,18 @@ but no count or size letter (see \"x\" command).", NULL)); environment, the value is printed in its own window."); set_cmd_completer (c, location_completer); - add_show_from_set ( - add_set_cmd ("max-symbolic-offset", no_class, var_uinteger, - (char *) &max_symbolic_offset, + deprecated_add_show_from_set + (add_set_cmd ("max-symbolic-offset", no_class, var_uinteger, + (char *) &max_symbolic_offset, "Set the largest offset that will be printed in <symbol+1234> form.", - &setprintlist), - &showprintlist); - add_show_from_set ( - add_set_cmd ("symbol-filename", no_class, var_boolean, - (char *) &print_symbol_filename, - "Set printing of source filename and line number with <symbol>.", - &setprintlist), - &showprintlist); + &setprintlist), + &showprintlist); + deprecated_add_show_from_set + (add_set_cmd ("symbol-filename", no_class, var_boolean, + (char *) &print_symbol_filename, "\ +Set printing of source filename and line number with <symbol>.", + &setprintlist), + &showprintlist); /* For examine/instruction a single byte quantity is specified as the data. This avoids problems with value_at_lazy() requiring a diff --git a/gnu/usr.bin/binutils/gdb/procfs.c b/gnu/usr.bin/binutils/gdb/procfs.c index 352b735c868..7e31a7ffcb6 100644 --- a/gnu/usr.bin/binutils/gdb/procfs.c +++ b/gnu/usr.bin/binutils/gdb/procfs.c @@ -124,7 +124,7 @@ static void procfs_notice_signals (ptid_t); static void procfs_prepare_to_store (void); static void procfs_kill_inferior (void); static void procfs_mourn_inferior (void); -static void procfs_create_inferior (char *, char *, char **); +static void procfs_create_inferior (char *, char *, char **, int); static ptid_t procfs_wait (ptid_t, struct target_waitstatus *); static int procfs_xfer_memory (CORE_ADDR, char *, int, int, struct mem_attrib *attrib, @@ -172,7 +172,7 @@ init_procfs_ops (void) procfs_ops.to_fetch_registers = procfs_fetch_registers; procfs_ops.to_store_registers = procfs_store_registers; procfs_ops.to_xfer_partial = procfs_xfer_partial; - procfs_ops.to_xfer_memory = procfs_xfer_memory; + procfs_ops.deprecated_xfer_memory = procfs_xfer_memory; procfs_ops.to_insert_breakpoint = memory_insert_breakpoint; procfs_ops.to_remove_breakpoint = memory_remove_breakpoint; procfs_ops.to_notice_signals = procfs_notice_signals; @@ -3382,6 +3382,17 @@ proc_iterate_over_threads (procinfo *pi, static ptid_t do_attach (ptid_t ptid); static void do_detach (int signo); static int register_gdb_signals (procinfo *, gdb_sigset_t *); +static void proc_trace_syscalls_1 (procinfo *pi, int syscallnum, + int entry_or_exit, int mode, int from_tty); +static int insert_dbx_link_breakpoint (procinfo *pi); +static void remove_dbx_link_breakpoint (void); + +/* On mips-irix, we need to insert a breakpoint at __dbx_link during + the startup phase. The following two variables are used to record + the address of the breakpoint, and the code that was replaced by + a breakpoint. */ +static int dbx_link_bpt_addr = 0; +static char dbx_link_shadow_contents[BREAKPOINT_MAX]; /* * Function: procfs_debug_inferior @@ -3545,24 +3556,29 @@ procfs_attach (char *args, int from_tty) static void procfs_detach (char *args, int from_tty) { - char *exec_file; - int signo = 0; + int sig = 0; + + if (args) + sig = atoi (args); if (from_tty) { + int pid = PIDGET (inferior_ptid); + char *exec_file; + exec_file = get_exec_file (0); - if (exec_file == 0) + if (exec_file == NULL) exec_file = ""; - printf_filtered ("Detaching from program: %s %s\n", - exec_file, target_pid_to_str (inferior_ptid)); - fflush (stdout); + + printf_filtered ("Detaching from program: %s, %s\n", exec_file, + target_pid_to_str (pid_to_ptid (pid))); + gdb_flush (gdb_stdout); } - if (args) - signo = atoi (args); - do_detach (signo); + do_detach (sig); + inferior_ptid = null_ptid; - unpush_target (&procfs_ops); /* Pop out of handling an inferior */ + unpush_target (&procfs_ops); } static ptid_t @@ -4065,6 +4081,22 @@ wait_again: address. */ wstat = (SIGTRAP << 8) | 0177; } +#ifdef SYS_syssgi + else if (what == SYS_syssgi) + { + /* see if we can break on dbx_link(). If yes, then + we no longer need the SYS_syssgi notifications. */ + if (insert_dbx_link_breakpoint (pi)) + proc_trace_syscalls_1 (pi, SYS_syssgi, PR_SYSEXIT, + FLAG_RESET, 0); + + /* This is an internal event and should be transparent + to wfi, so resume the execution and wait again. See + comment in procfs_init_inferior() for more details. */ + target_resume (ptid, 0, TARGET_SIGNAL_0); + goto wait_again; + } +#endif else if (syscall_is_lwp_create (pi, what)) { /* @@ -4191,6 +4223,13 @@ wait_again: #if (FLTTRACE != FLTBPT) /* avoid "duplicate case" error */ case FLTTRACE: #endif + /* If we hit our __dbx_link() internal breakpoint, + then remove it. See comments in procfs_init_inferior() + for more details. */ + if (dbx_link_bpt_addr != 0 + && dbx_link_bpt_addr == read_pc ()) + remove_dbx_link_breakpoint (); + wstat = (SIGTRAP << 8) | 0177; break; case FLTSTACK: @@ -4287,11 +4326,11 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object, { case TARGET_OBJECT_MEMORY: if (readbuf) - return (*ops->to_xfer_memory) (offset, readbuf, len, 0/*write*/, - NULL, ops); + return (*ops->deprecated_xfer_memory) (offset, readbuf, len, + 0/*write*/, NULL, ops); if (writebuf) - return (*ops->to_xfer_memory) (offset, readbuf, len, 1/*write*/, - NULL, ops); + return (*ops->deprecated_xfer_memory) (offset, writebuf, len, + 1/*write*/, NULL, ops); return -1; #ifdef NEW_PROC_API @@ -4842,6 +4881,32 @@ procfs_init_inferior (int pid) /* Typically two, one trap to exec the shell, one to exec the program being debugged. Defined by "inferior.h". */ startup_inferior (START_INFERIOR_TRAPS_EXPECTED); + +#ifdef SYS_syssgi + /* On mips-irix, we need to stop the inferior early enough during + the startup phase in order to be able to load the shared library + symbols and insert the breakpoints that are located in these shared + libraries. Stopping at the program entry point is not good enough + because the -init code is executed before the execution reaches + that point. + + So what we need to do is to insert a breakpoint in the runtime + loader (rld), more precisely in __dbx_link(). This procedure is + called by rld once all shared libraries have been mapped, but before + the -init code is executed. Unfortuantely, this is not straightforward, + as rld is not part of the executable we are running, and thus we need + the inferior to run until rld itself has been mapped in memory. + + For this, we trace all syssgi() syscall exit events. Each time + we detect such an event, we iterate over each text memory maps, + get its associated fd, and scan the symbol table for __dbx_link(). + When found, we know that rld has been mapped, and that we can insert + the breakpoint at the symbol address. Once the dbx_link() breakpoint + has been inserted, the syssgi() notifications are no longer necessary, + so they should be canceled. */ + proc_trace_syscalls_1 (pi, SYS_syssgi, PR_SYSEXIT, FLAG_SET, 0); + dbx_link_bpt_addr = 0; +#endif } /* @@ -4972,7 +5037,8 @@ procfs_set_exec_trap (void) */ static void -procfs_create_inferior (char *exec_file, char *allargs, char **env) +procfs_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { char *shell_file = getenv ("SHELL"); char *tryname; @@ -5047,6 +5113,16 @@ procfs_create_inferior (char *exec_file, char *allargs, char **env) fork_inferior (exec_file, allargs, env, procfs_set_exec_trap, procfs_init_inferior, NULL, shell_file); +#ifdef SYS_syssgi + /* Make sure to cancel the syssgi() syscall-exit notifications. + They should normally have been removed by now, but they may still + be activated if the inferior doesn't use shared libraries, or if + we didn't locate __dbx_link, or if we never stopped in __dbx_link. + See procfs_init_inferior() for more details. */ + proc_trace_syscalls_1 (find_procinfo_or_die (PIDGET (inferior_ptid), 0), + SYS_syssgi, PR_SYSEXIT, FLAG_RESET, 0); +#endif + /* We are at the first instruction we care about. */ /* Pedal to the metal... */ @@ -5121,29 +5197,19 @@ procfs_thread_alive (ptid_t ptid) return 1; } -/* - * Function: target_pid_to_str - * - * Return a string to be used to identify the thread in - * the "info threads" display. - */ +/* Convert PTID to a string. Returns the string in a static buffer. */ char * procfs_pid_to_str (ptid_t ptid) { static char buf[80]; - int proc, thread; - procinfo *pi; - proc = PIDGET (ptid); - thread = TIDGET (ptid); - pi = find_procinfo (proc, thread); - - if (thread == 0) - sprintf (buf, "Process %d", proc); + if (TIDGET (ptid) == 0) + sprintf (buf, "process %d", PIDGET (ptid)); else - sprintf (buf, "LWP %d", thread); - return &buf[0]; + sprintf (buf, "LWP %ld", TIDGET (ptid)); + + return buf; } /* @@ -5519,6 +5585,131 @@ proc_find_memory_regions (int (*func) (CORE_ADDR, find_memory_regions_callback); } +/* Remove the breakpoint that we inserted in __dbx_link(). + Does nothing if the breakpoint hasn't been inserted or has already + been removed. */ + +static void +remove_dbx_link_breakpoint (void) +{ + if (dbx_link_bpt_addr == 0) + return; + + if (memory_remove_breakpoint (dbx_link_bpt_addr, + dbx_link_shadow_contents) != 0) + warning ("Unable to remove __dbx_link breakpoint."); + + dbx_link_bpt_addr = 0; +} + +/* Return the address of the __dbx_link() function in the file + refernced by ABFD by scanning its symbol table. Return 0 if + the symbol was not found. */ + +static CORE_ADDR +dbx_link_addr (bfd *abfd) +{ + long storage_needed; + asymbol **symbol_table; + long number_of_symbols; + long i; + + storage_needed = bfd_get_symtab_upper_bound (abfd); + if (storage_needed <= 0) + return 0; + + symbol_table = (asymbol **) xmalloc (storage_needed); + make_cleanup (xfree, symbol_table); + + number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); + + for (i = 0; i < number_of_symbols; i++) + { + asymbol *sym = symbol_table[i]; + + if ((sym->flags & BSF_GLOBAL) + && sym->name != NULL && strcmp (sym->name, "__dbx_link") == 0) + return (sym->value + sym->section->vma); + } + + /* Symbol not found, return NULL. */ + return 0; +} + +/* Search the symbol table of the file referenced by FD for a symbol + named __dbx_link(). If found, then insert a breakpoint at this location, + and return nonzero. Return zero otherwise. */ + +static int +insert_dbx_link_bpt_in_file (int fd, CORE_ADDR ignored) +{ + bfd *abfd; + long storage_needed; + CORE_ADDR sym_addr; + + abfd = bfd_fdopenr ("unamed", 0, fd); + if (abfd == NULL) + { + warning ("Failed to create a bfd: %s.\n", bfd_errmsg (bfd_get_error ())); + return 0; + } + + if (!bfd_check_format (abfd, bfd_object)) + { + /* Not the correct format, so we can not possibly find the dbx_link + symbol in it. */ + bfd_close (abfd); + return 0; + } + + sym_addr = dbx_link_addr (abfd); + if (sym_addr != 0) + { + /* Insert the breakpoint. */ + dbx_link_bpt_addr = sym_addr; + if (target_insert_breakpoint (sym_addr, dbx_link_shadow_contents) != 0) + { + warning ("Failed to insert dbx_link breakpoint."); + bfd_close (abfd); + return 0; + } + bfd_close (abfd); + return 1; + } + + bfd_close (abfd); + return 0; +} + +/* If the given memory region MAP contains a symbol named __dbx_link, + insert a breakpoint at this location and return nonzero. Return + zero otherwise. */ + +static int +insert_dbx_link_bpt_in_region (struct prmap *map, + int (*child_func) (), + void *data) +{ + procinfo *pi = (procinfo *) data; + + /* We know the symbol we're looking for is in a text region, so + only look for it if the region is a text one. */ + if (map->pr_mflags & MA_EXEC) + return solib_mappings_callback (map, insert_dbx_link_bpt_in_file, pi); + + return 0; +} + +/* Search all memory regions for a symbol named __dbx_link. If found, + insert a breakpoint at its location, and return nonzero. Return zero + otherwise. */ + +static int +insert_dbx_link_breakpoint (procinfo *pi) +{ + return iterate_over_mappings (pi, NULL, pi, insert_dbx_link_bpt_in_region); +} + /* * Function: mappingflags * @@ -5707,12 +5898,50 @@ info_proc_cmd (char *args, int from_tty) do_cleanups (old_chain); } +/* Modify the status of the system call identified by SYSCALLNUM in + the set of syscalls that are currently traced/debugged. + + If ENTRY_OR_EXIT is set to PR_SYSENTRY, then the entry syscalls set + will be updated. Otherwise, the exit syscalls set will be updated. + + If MODE is FLAG_SET, then traces will be enabled. Otherwise, they + will be disabled. */ + +static void +proc_trace_syscalls_1 (procinfo *pi, int syscallnum, int entry_or_exit, + int mode, int from_tty) +{ + sysset_t *sysset; + + if (entry_or_exit == PR_SYSENTRY) + sysset = proc_get_traced_sysentry (pi, NULL); + else + sysset = proc_get_traced_sysexit (pi, NULL); + + if (sysset == NULL) + proc_error (pi, "proc-trace, get_traced_sysset", __LINE__); + + if (mode == FLAG_SET) + gdb_praddsysset (sysset, syscallnum); + else + gdb_prdelsysset (sysset, syscallnum); + + if (entry_or_exit == PR_SYSENTRY) + { + if (!proc_set_traced_sysentry (pi, sysset)) + proc_error (pi, "proc-trace, set_traced_sysentry", __LINE__); + } + else + { + if (!proc_set_traced_sysexit (pi, sysset)) + proc_error (pi, "proc-trace, set_traced_sysexit", __LINE__); + } +} + static void proc_trace_syscalls (char *args, int from_tty, int entry_or_exit, int mode) { procinfo *pi; - sysset_t *sysset; - int syscallnum = 0; if (PIDGET (inferior_ptid) <= 0) error ("you must be debugging a process to use this command."); @@ -5723,30 +5952,9 @@ proc_trace_syscalls (char *args, int from_tty, int entry_or_exit, int mode) pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0); if (isdigit (args[0])) { - syscallnum = atoi (args); - if (entry_or_exit == PR_SYSENTRY) - sysset = proc_get_traced_sysentry (pi, NULL); - else - sysset = proc_get_traced_sysexit (pi, NULL); - - if (sysset == NULL) - proc_error (pi, "proc-trace, get_traced_sysset", __LINE__); - - if (mode == FLAG_SET) - gdb_praddsysset (sysset, syscallnum); - else - gdb_prdelsysset (sysset, syscallnum); + const int syscallnum = atoi (args); - if (entry_or_exit == PR_SYSENTRY) - { - if (!proc_set_traced_sysentry (pi, sysset)) - proc_error (pi, "proc-trace, set_traced_sysentry", __LINE__); - } - else - { - if (!proc_set_traced_sysexit (pi, sysset)) - proc_error (pi, "proc-trace, set_traced_sysexit", __LINE__); - } + proc_trace_syscalls_1 (pi, syscallnum, entry_or_exit, mode, from_tty); } } diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/adp.h b/gnu/usr.bin/binutils/gdb/rdi-share/adp.h index 98c60563d90..5014d7c90a8 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/adp.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/adp.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:53 $ * * * diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/adperr.h b/gnu/usr.bin/binutils/gdb/rdi-share/adperr.h index 69ddbf7dd74..7a8c090d64b 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/adperr.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/adperr.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:53 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/angel.h b/gnu/usr.bin/binutils/gdb/rdi-share/angel.h index 8acef4ff158..51e9caf542d 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/angel.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/angel.h @@ -13,8 +13,8 @@ * described at the start of this file to ensure that a complete view * of the Angel world can be derived purely from the source. * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:53 $ * * * NOTE: Currently the Angel source is designed to be simple, diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.c b/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.c index 56f55998ee3..f00ce0b74d3 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.c @@ -12,8 +12,8 @@ */ /* - * RCS $Revision: 1.2 $ - * Checkin $Date: 2004/05/21 20:23:36 $ + * RCS $Revision: 1.3 $ + * Checkin $Date: 2004/12/27 14:00:53 $ */ #include "angel_bytesex.h" diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.h b/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.h index cef4da62a0f..2dd3b6358cb 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/angel_bytesex.h @@ -11,8 +11,8 @@ Copyright: (C) 1991, Advanced RISC Machines Ltd., Cambridge, England. */ /* - * RCS $Revision: 1.2 $ - * Checkin $Date: 2004/05/21 20:23:36 $ + * RCS $Revision: 1.3 $ + * Checkin $Date: 2004/12/27 14:00:53 $ */ #ifndef angel_bytesex_h diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/angel_endian.h b/gnu/usr.bin/binutils/gdb/rdi-share/angel_endian.h index 2b0689838d3..4c4787c4ae5 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/angel_endian.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/angel_endian.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:53 $ * * * angel_endian.h - target endianness independent read/write primitives. diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/ardi.c b/gnu/usr.bin/binutils/gdb/rdi-share/ardi.c index be8db472f27..a32b953e3fe 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/ardi.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/ardi.c @@ -11,8 +11,8 @@ * Angel Remote Debug Interface * * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:53 $ * * This file is based on /plg/pisd/rdi.c, but instead of using RDP it uses * ADP messages. @@ -1353,7 +1353,7 @@ void angel_RDI_stop_request(void) static int angel_RDI_ExecuteOrStep(PointHandle *handle, word type, unsigned ninstr) { - extern int (*ui_loop_hook) (int); + extern int (*deprecated_ui_loop_hook) (int); int err; adp_stopped_struct stopped_info; void* stateptr = (void *)&stopped_info; @@ -1414,8 +1414,8 @@ static int angel_RDI_ExecuteOrStep(PointHandle *handle, word type, signal(SIGINT, ardi_sigint_handler); while( executing ) { - if (ui_loop_hook) - ui_loop_hook(0); + if (deprecated_ui_loop_hook) + deprecated_ui_loop_hook(0); if (interrupt_request || stop_request) { diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/ardi.h b/gnu/usr.bin/binutils/gdb/rdi-share/ardi.h index e7ffcdab303..c8eec3f4145 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/ardi.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/ardi.h @@ -10,8 +10,8 @@ * ardi.h * ADP RDI interfaces * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ */ #include "host.h" diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/armdbg.h b/gnu/usr.bin/binutils/gdb/rdi-share/armdbg.h index c004a713db7..c10149e31b4 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/armdbg.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/armdbg.h @@ -11,8 +11,8 @@ */ /* - * RCS $Revision: 1.2 $ - * Checkin $Date: 2004/05/21 20:23:36 $ + * RCS $Revision: 1.3 $ + * Checkin $Date: 2004/12/27 14:00:54 $ */ /* Minor points of uncertainty are indicated by a question mark in the diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/buffers.h b/gnu/usr.bin/binutils/gdb/rdi-share/buffers.h index 39cbc61fa8e..ce8e66f4c85 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/buffers.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/buffers.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/chandefs.h b/gnu/usr.bin/binutils/gdb/rdi-share/chandefs.h index b1423bd7b44..fad828ab67f 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/chandefs.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/chandefs.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/channels.h b/gnu/usr.bin/binutils/gdb/rdi-share/channels.h index ed99e674bdc..8bc0b984c72 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/channels.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/channels.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/chanpriv.h b/gnu/usr.bin/binutils/gdb/rdi-share/chanpriv.h index 8b28ea7ed0c..d0ffb2a283b 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/chanpriv.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/chanpriv.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/crc.c b/gnu/usr.bin/binutils/gdb/rdi-share/crc.c index f4998c5a770..d6834a9a880 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/crc.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/crc.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * crc.c - provides some "standard" CRC calculation routines. diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/crc.h b/gnu/usr.bin/binutils/gdb/rdi-share/crc.h index efb472aab10..dfa10d70dbb 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/crc.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/crc.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:36 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * crc.h - describes some "standard" CRC calculation routines. diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_conf.h b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_conf.h index a0a7e6c07fb..90a7ab3a3cb 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_conf.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_conf.h @@ -11,8 +11,8 @@ */ /* - * RCS $Revision: 1.2 $ - * Checkin $Date: 2004/05/21 20:23:36 $ + * RCS $Revision: 1.3 $ + * Checkin $Date: 2004/12/27 14:00:54 $ */ #ifndef Dbg_Conf__h diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_cp.h b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_cp.h index cdf040cbd2b..1218d05abc0 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_cp.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_cp.h @@ -11,8 +11,8 @@ */ /* - * RCS $Revision: 1.2 $ - * Checkin $Date: 2004/05/21 20:23:36 $ + * RCS $Revision: 1.3 $ + * Checkin $Date: 2004/12/27 14:00:54 $ */ #ifndef Dbg_CP__h diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_hif.h b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_hif.h index 1fb0a1ca12b..3f37be07b84 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_hif.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_hif.h @@ -15,8 +15,8 @@ */ /* - * RCS $Revision: 1.2 $ - * Checkin $Date: 2004/05/21 20:23:37 $ + * RCS $Revision: 1.3 $ + * Checkin $Date: 2004/12/27 14:00:54 $ */ #ifndef dbg_hif__h diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_rdi.h b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_rdi.h index e375f0d0b79..d6e9dabf253 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/dbg_rdi.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/dbg_rdi.h @@ -11,8 +11,8 @@ */ /* - * RCS $Revision: 1.2 $ - * Checkin $Date: 2004/05/21 20:23:37 $ + * RCS $Revision: 1.3 $ + * Checkin $Date: 2004/12/27 14:00:54 $ */ #ifndef dbg_rdi__h diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/devclnt.h b/gnu/usr.bin/binutils/gdb/rdi-share/devclnt.h index a90ca8f0e6f..b770956bfee 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/devclnt.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/devclnt.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/devices.h b/gnu/usr.bin/binutils/gdb/rdi-share/devices.h index aaff00b4fa5..be494dd3635 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/devices.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/devices.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/devsw.c b/gnu/usr.bin/binutils/gdb/rdi-share/devsw.c index d1964b56324..5fbfd6163e7 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/devsw.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/devsw.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * */ #include <stdio.h> diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/devsw.h b/gnu/usr.bin/binutils/gdb/rdi-share/devsw.h index 278ba3a7a49..f1549f9cb9c 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/devsw.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/devsw.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * */ #ifndef angsd_devsw_h diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/drivers.c b/gnu/usr.bin/binutils/gdb/rdi-share/drivers.c index 7f8964fee19..d74e82dc120 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/drivers.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/drivers.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * drivers.c - declares a NULL terminated list of device driver diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/drivers.h b/gnu/usr.bin/binutils/gdb/rdi-share/drivers.h index 9ee2338513e..3adeb109b98 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/drivers.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/drivers.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/etherdrv.c b/gnu/usr.bin/binutils/gdb/rdi-share/etherdrv.c index 8bc7f9aae95..e76c4e8d6d0 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/etherdrv.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/etherdrv.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * etherdrv.c - Ethernet Driver for Angel. diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/ethernet.h b/gnu/usr.bin/binutils/gdb/rdi-share/ethernet.h index 2e414c7e5b7..3bc0eb004ea 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/ethernet.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/ethernet.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * ethernet.h: Angel drivers for Ethernet using Fusion UDP/IP stack diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.c b/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.c index 9cdcc8955ac..8bb563d0f31 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * hostchan.c - Semi Synchronous Host side channel interface for Angel. diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.h b/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.h index 245ae2030bc..79226ec730b 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/hostchan.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * */ #ifndef angsd_hostchan_h diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/hsys.c b/gnu/usr.bin/binutils/gdb/rdi-share/hsys.c index 17cca4bd203..4d6cb83f5ea 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/hsys.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/hsys.c @@ -9,8 +9,8 @@ /* * Host C Library support functions. * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ */ #ifdef DEBUG diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/hsys.h b/gnu/usr.bin/binutils/gdb/rdi-share/hsys.h index b4f32340e95..9425c9385be 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/hsys.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/hsys.h @@ -9,8 +9,8 @@ /* * Host C library support header file. * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * */ diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/logging.c b/gnu/usr.bin/binutils/gdb/rdi-share/logging.c index 2b311224cbe..75060745f94 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/logging.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/logging.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * logging.c - methods for logging warnings, errors and trace info diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/logging.h b/gnu/usr.bin/binutils/gdb/rdi-share/logging.h index 8f6fc330a93..d485578fc19 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/logging.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/logging.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * logging.h - methods for logging warnings, errors and trace info diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.c b/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.c index 7bf3d4b606c..f060c3618c0 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * msgbuild.c - utilities for assembling and interpreting ADP messages diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.h b/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.h index b2549080ec5..a5c2a270439 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/msgbuild.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * msgbuild.h - utilities for assembling and interpreting ADP messages diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/params.c b/gnu/usr.bin/binutils/gdb/rdi-share/params.c index 294e2cba79e..b8bc410617e 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/params.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/params.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/params.h b/gnu/usr.bin/binutils/gdb/rdi-share/params.h index 946141c00ea..0ebc0fe8169 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/params.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/params.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/rx.c b/gnu/usr.bin/binutils/gdb/rdi-share/rx.c index ee42465a536..b8139a2b40f 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/rx.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/rx.c @@ -8,8 +8,8 @@ /*-*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/rxtx.h b/gnu/usr.bin/binutils/gdb/rdi-share/rxtx.h index 6710a1e8697..81ba245f45a 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/rxtx.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/rxtx.h @@ -8,8 +8,8 @@ /*-*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * Project: ANGEL diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/serdrv.c b/gnu/usr.bin/binutils/gdb/rdi-share/serdrv.c index cf8eb0f7ba6..04275c764a6 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/serdrv.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/serdrv.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * serdrv.c - Synchronous Serial Driver for Angel. diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/serpardr.c b/gnu/usr.bin/binutils/gdb/rdi-share/serpardr.c index 74e27203a9e..052d1386f58 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/serpardr.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/serpardr.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * serpardv.c - Serial/Parallel Driver for Angel. diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/sys.h b/gnu/usr.bin/binutils/gdb/rdi-share/sys.h index 9de76c26bff..e87d3e64dfc 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/sys.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/sys.h @@ -10,8 +10,8 @@ *********************************************************************** * Angel C Libary support channel protocol definitions * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * * diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/tx.c b/gnu/usr.bin/binutils/gdb/rdi-share/tx.c index 3ee88a09135..35dede8f008 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/tx.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/tx.c @@ -8,8 +8,8 @@ /*-*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * * Project: ANGEL * diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.c b/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.c index d8ddc106bc8..62c14a8ecab 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.c +++ b/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.c @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * */ diff --git a/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.h b/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.h index 75fe14c3a1c..9a5f4453d1d 100644 --- a/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.h +++ b/gnu/usr.bin/binutils/gdb/rdi-share/unixcomm.h @@ -8,8 +8,8 @@ /* -*-C-*- * - * $Revision: 1.2 $ - * $Date: 2004/05/21 20:23:37 $ + * $Revision: 1.3 $ + * $Date: 2004/12/27 14:00:54 $ * */ #ifndef angsd_unixcomm_h diff --git a/gnu/usr.bin/binutils/gdb/remote-e7000.c b/gnu/usr.bin/binutils/gdb/remote-e7000.c index c422c947612..405a6b53411 100644 --- a/gnu/usr.bin/binutils/gdb/remote-e7000.c +++ b/gnu/usr.bin/binutils/gdb/remote-e7000.c @@ -1,7 +1,7 @@ /* Remote debugging interface for Renesas E7000 ICE, for GDB Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003 Free Software Foundation, Inc. + 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -362,7 +362,7 @@ get_hex_regs (int n, int regno) val = 0; for (j = 0; j < 8; j++) val = (val << 4) + get_hex_digit (j == 0); - supply_register (regno++, (char *) &val); + regcache_raw_supply (current_regcache, regno++, (char *) &val); } } #endif @@ -371,7 +371,8 @@ get_hex_regs (int n, int regno) user types "run" after having attached. */ static void -e7000_create_inferior (char *execfile, char *args, char **env) +e7000_create_inferior (char *execfile, char *args, char **env, + int from_tty) { int entry_pt; @@ -629,7 +630,7 @@ e7000_start_remote (void *dummy) flush_cached_frames (); registers_changed (); stop_pc = read_pc (); - print_stack_frame (get_selected_frame (), -1, 1); + print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC); return 1; } @@ -878,9 +879,9 @@ fetch_regs_from_dump (int (*nextchar) (), char *want) internal_error (__FILE__, __LINE__, "failed internal consistency check"); } store_signed_integer (buf, - DEPRECATED_REGISTER_RAW_SIZE (regno), + register_size (current_gdbarch, regno), (LONGEST) get_hex (&thischar)); - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regno, buf); break; } } @@ -925,7 +926,7 @@ e7000_fetch_registers (void) { int buf = 0; - supply_register (regno, (char *) (&buf)); + regcache_raw_supply (current_regcache, regno, (char *) (&buf)); } } @@ -1568,7 +1569,7 @@ e7000_load (char *args, int from_tty) file_ptr fptr; section_address = bfd_get_section_vma (pbfd, section); - section_size = bfd_get_section_size_before_reloc (section); + section_size = bfd_get_section_size (section); if (!quiet) printf_filtered ("[Loading section %s at 0x%s (%s bytes)]\n", @@ -1963,9 +1964,9 @@ sub2_from_pc (void) char buf2[200]; store_signed_integer (buf, - DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM), + register_size (current_gdbarch, PC_REGNUM), read_register (PC_REGNUM) - 2); - supply_register (PC_REGNUM, buf); + regcache_raw_supply (current_regcache, PC_REGNUM, buf); sprintf (buf2, ".PC %s\r", phex_nz (read_register (PC_REGNUM), 0)); puts_e7000debug (buf2); } @@ -2063,7 +2064,7 @@ e7000_wait (ptid_t ptid, struct target_waitstatus *status) for (regno = NUM_REALREGS; regno < NUM_REGS; regno++) { int buf = 0; - supply_register (regno, (char *) &buf); + regcache_raw_supply (current_regcache, regno, (char *) &buf); } stop_reason = why_stop (); @@ -2149,7 +2150,7 @@ target e7000 foobar"; e7000_ops.to_fetch_registers = e7000_fetch_register; e7000_ops.to_store_registers = e7000_store_register; e7000_ops.to_prepare_to_store = e7000_prepare_to_store; - e7000_ops.to_xfer_memory = e7000_xfer_inferior_memory; + e7000_ops.deprecated_xfer_memory = e7000_xfer_inferior_memory; e7000_ops.to_files_info = e7000_files_info; e7000_ops.to_insert_breakpoint = e7000_insert_breakpoint; e7000_ops.to_remove_breakpoint = e7000_remove_breakpoint; @@ -2187,8 +2188,9 @@ _initialize_remote_e7000 (void) add_com ("drain", class_obscure, e7000_drain_command, "Drain pending e7000 text buffers."); - add_show_from_set (add_set_cmd ("usehardbreakpoints", no_class, - var_integer, (char *) &use_hard_breakpoints, - "Set use of hardware breakpoints for all breakpoints.\n", &setlist), - &showlist); + deprecated_add_show_from_set + (add_set_cmd ("usehardbreakpoints", no_class, + var_integer, (char *) &use_hard_breakpoints, "\ +Set use of hardware breakpoints for all breakpoints.\n", &setlist), + &showlist); } diff --git a/gnu/usr.bin/binutils/gdb/remote-est.c b/gnu/usr.bin/binutils/gdb/remote-est.c index a2c0f7ce2af..884429ac28c 100644 --- a/gnu/usr.bin/binutils/gdb/remote-est.c +++ b/gnu/usr.bin/binutils/gdb/remote-est.c @@ -148,7 +148,7 @@ init_est_cmds (void) est_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ est_cmds.dump_registers = "dr\r"; /* dump_registers */ est_cmds.register_pattern = "\\(\\w+\\) = \\([0-9a-fA-F]+\\)"; /* register_pattern */ - est_cmds.supply_register = est_supply_register; /* supply_register */ + est_cmds.supply_register = est_supply_register; est_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ est_cmds.load = "dl\r"; /* download command */ est_cmds.loadresp = "+"; /* load response */ diff --git a/gnu/usr.bin/binutils/gdb/remote-hms.c b/gnu/usr.bin/binutils/gdb/remote-hms.c index ee40051fb3c..75674861023 100644 --- a/gnu/usr.bin/binutils/gdb/remote-hms.c +++ b/gnu/usr.bin/binutils/gdb/remote-hms.c @@ -119,7 +119,7 @@ init_hms_cmds (void) hms_cmds.getreg.term_cmd = "\003"; /* getreg.term_cmd */ hms_cmds.dump_registers = "r\r"; /* dump_registers */ hms_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\)"; /* register_pattern */ - hms_cmds.supply_register = hms_supply_register; /* supply_register */ + hms_cmds.supply_register = hms_supply_register; hms_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ hms_cmds.load = "tl\r"; /* download command */ hms_cmds.loadresp = NULL; /* load response */ diff --git a/gnu/usr.bin/binutils/gdb/remote-mips.c b/gnu/usr.bin/binutils/gdb/remote-mips.c index c75768406b9..175a4f96f03 100644 --- a/gnu/usr.bin/binutils/gdb/remote-mips.c +++ b/gnu/usr.bin/binutils/gdb/remote-mips.c @@ -1,7 +1,7 @@ /* Remote debugging interface for MIPS remote debugging protocol. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Ian Lance Taylor <ian@cygnus.com>. @@ -114,8 +114,6 @@ static int mips_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, static void mips_files_info (struct target_ops *ignore); -static void mips_create_inferior (char *execfile, char *args, char **env); - static void mips_mourn_inferior (void); static int pmon_makeb64 (unsigned long v, char *p, int n, int *chksum); @@ -1588,7 +1586,7 @@ device is attached to the target board (e.g., /dev/ttya).\n" flush_cached_frames (); registers_changed (); stop_pc = read_pc (); - print_stack_frame (get_selected_frame (), -1, 1); + print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC); xfree (serial_port_name); } @@ -1759,17 +1757,17 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status) { char buf[MAX_REGISTER_SIZE]; - store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM), rpc); - supply_register (PC_REGNUM, buf); + store_unsigned_integer (buf, register_size (current_gdbarch, PC_REGNUM), rpc); + regcache_raw_supply (current_regcache, PC_REGNUM, buf); - store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM), rfp); - supply_register (30, buf); /* This register they are avoiding and so it is unnamed */ + store_unsigned_integer (buf, register_size (current_gdbarch, PC_REGNUM), rfp); + regcache_raw_supply (current_regcache, 30, buf); /* This register they are avoiding and so it is unnamed */ - store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (SP_REGNUM), rsp); - supply_register (SP_REGNUM, buf); + store_unsigned_integer (buf, register_size (current_gdbarch, SP_REGNUM), rsp); + regcache_raw_supply (current_regcache, SP_REGNUM, buf); - store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (DEPRECATED_FP_REGNUM), 0); - supply_register (DEPRECATED_FP_REGNUM, buf); + store_unsigned_integer (buf, register_size (current_gdbarch, DEPRECATED_FP_REGNUM), 0); + regcache_raw_supply (current_regcache, DEPRECATED_FP_REGNUM, buf); if (nfields == 9) { @@ -1940,8 +1938,8 @@ mips_fetch_registers (int regno) /* We got the number the register holds, but gdb expects to see a value in the target byte ordering. */ - store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (regno), val); - supply_register (regno, buf); + store_unsigned_integer (buf, register_size (current_gdbarch, regno), val); + regcache_raw_supply (current_regcache, regno, buf); } } @@ -2178,7 +2176,7 @@ Give up (and stop debugging it)? ")) /* Start running on the target board. */ static void -mips_create_inferior (char *execfile, char *args, char **env) +mips_create_inferior (char *execfile, char *args, char **env, int from_tty) { CORE_ADDR entry_pt; @@ -2650,20 +2648,20 @@ mips_load_srec (char *args) /* FIXME! vma too small????? */ printf_filtered ("%s\t: 0x%4lx .. 0x%4lx ", s->name, (long) s->vma, - (long) (s->vma + s->_raw_size)); + (long) (s->vma + bfd_get_section_size (s))); gdb_flush (gdb_stdout); - for (i = 0; i < s->_raw_size; i += numbytes) + for (i = 0; i < bfd_get_section_size (s); i += numbytes) { - numbytes = min (srec_frame, s->_raw_size - i); + numbytes = min (srec_frame, bfd_get_section_size (s) - i); bfd_get_section_contents (abfd, s, buffer, i, numbytes); reclen = mips_make_srec (srec, '3', s->vma + i, buffer, numbytes); send_srec (srec, reclen, s->vma + i); - if (ui_load_progress_hook) - ui_load_progress_hook (s->name, i); + if (deprecated_ui_load_progress_hook) + deprecated_ui_load_progress_hook (s->name, i); if (hashmark) { @@ -3137,11 +3135,11 @@ pmon_load_fast (char *file) for (s = abfd->sections; s && !finished; s = s->next) if (s->flags & SEC_LOAD) /* only deal with loadable sections */ { - bintotal += s->_raw_size; - final = (s->vma + s->_raw_size); + bintotal += bfd_get_section_size (s); + final = (s->vma + bfd_get_section_size (s)); printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name, (unsigned int) s->vma, - (unsigned int) (s->vma + s->_raw_size)); + (unsigned int) (s->vma + bfd_get_section_size (s))); gdb_flush (gdb_stdout); /* Output the starting address */ @@ -3162,11 +3160,13 @@ pmon_load_fast (char *file) reclen = 0; - for (i = 0; ((i < s->_raw_size) && !finished); i += binamount) + for (i = 0; + i < bfd_get_section_size (s) && !finished; + i += binamount) { int binptr = 0; - binamount = min (BINCHUNK, s->_raw_size - i); + binamount = min (BINCHUNK, bfd_get_section_size (s) - i); bfd_get_section_contents (abfd, s, binbuf, i, binamount); @@ -3186,8 +3186,8 @@ pmon_load_fast (char *file) break; } - if (ui_load_progress_hook) - ui_load_progress_hook (s->name, i); + if (deprecated_ui_load_progress_hook) + deprecated_ui_load_progress_hook (s->name, i); if (hashmark) { @@ -3306,7 +3306,7 @@ _initialize_remote_mips (void) mips_ops.to_fetch_registers = mips_fetch_registers; mips_ops.to_store_registers = mips_store_registers; mips_ops.to_prepare_to_store = mips_prepare_to_store; - mips_ops.to_xfer_memory = mips_xfer_memory; + mips_ops.deprecated_xfer_memory = mips_xfer_memory; mips_ops.to_files_info = mips_files_info; mips_ops.to_insert_breakpoint = mips_insert_breakpoint; mips_ops.to_remove_breakpoint = mips_remove_breakpoint; @@ -3368,54 +3368,56 @@ of the TFTP temporary file, if it differs from the filename seen by the board."; add_target (&ddb_ops); add_target (&lsi_ops); - add_show_from_set ( - add_set_cmd ("timeout", no_class, var_zinteger, - (char *) &mips_receive_wait, - "Set timeout in seconds for remote MIPS serial I/O.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("retransmit-timeout", no_class, var_zinteger, - (char *) &mips_retransmit_wait, - "Set retransmit timeout in seconds for remote MIPS serial I/O.\n\ + deprecated_add_show_from_set + (add_set_cmd ("timeout", no_class, var_zinteger, + (char *) &mips_receive_wait, + "Set timeout in seconds for remote MIPS serial I/O.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("retransmit-timeout", no_class, var_zinteger, + (char *) &mips_retransmit_wait, "\ +Set retransmit timeout in seconds for remote MIPS serial I/O.\n\ This is the number of seconds to wait for an acknowledgement to a packet\n\ before resending the packet.", &setlist), - &showlist); + &showlist); - add_show_from_set ( - add_set_cmd ("syn-garbage-limit", no_class, var_zinteger, - (char *) &mips_syn_garbage, - "Set the maximum number of characters to ignore when scanning for a SYN.\n\ + deprecated_add_show_from_set + (add_set_cmd ("syn-garbage-limit", no_class, var_zinteger, + (char *) &mips_syn_garbage, "\ +Set the maximum number of characters to ignore when scanning for a SYN.\n\ This is the maximum number of characters GDB will ignore when trying to\n\ -synchronize with the remote system. A value of -1 means that there is no limit\n\ -(Note that these characters are printed out even though they are ignored.)", - &setlist), - &showlist); +synchronize with the remote system. A value of -1 means that there is no\n\ +limit. (Note that these characters are printed out even though they are\n\ +ignored.)", + &setlist), + &showlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("monitor-prompt", class_obscure, var_string, (char *) &mips_monitor_prompt, "Set the prompt that GDB expects from the monitor.", &setlist), &showlist); - add_show_from_set ( - add_set_cmd ("monitor-warnings", class_obscure, var_zinteger, - (char *) &monitor_warnings, - "Set printing of monitor warnings.\n" - "When enabled, monitor warnings about hardware breakpoints " - "will be displayed.", - &setlist), - &showlist); + deprecated_add_show_from_set + (add_set_cmd ("monitor-warnings", class_obscure, var_zinteger, + (char *) &monitor_warnings, + "Set printing of monitor warnings.\n" + "When enabled, monitor warnings about hardware breakpoints " + "will be displayed.", + &setlist), + &showlist); add_com ("pmon <command>", class_obscure, pmon_command, "Send a packet to PMON (must be in debug mode)."); - add_show_from_set (add_set_cmd ("mask-address", no_class, - var_boolean, &mask_address_p, - "Set zeroing of upper 32 bits of 64-bit addresses when talking to PMON targets.\n\ + deprecated_add_show_from_set + (add_set_cmd ("mask-address", no_class, + var_boolean, &mask_address_p, "\ +Set zeroing of upper 32 bits of 64-bit addresses when talking to PMON targets.\n\ Use \"on\" to enable the masking and \"off\" to disable it.\n", - &setlist), - &showlist); + &setlist), + &showlist); } diff --git a/gnu/usr.bin/binutils/gdb/remote-rdp.c b/gnu/usr.bin/binutils/gdb/remote-rdp.c index eab68eaf9e4..d480d5331ee 100644 --- a/gnu/usr.bin/binutils/gdb/remote-rdp.c +++ b/gnu/usr.bin/binutils/gdb/remote-rdp.c @@ -645,7 +645,7 @@ remote_rdp_fetch_register (int regno) { printf ("Help me with fetch reg %d\n", regno); } - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regno, buf); } } @@ -721,7 +721,7 @@ rdp_set_command_line (char *command, char *args) if (commandline != NULL) xfree (commandline); - xasprintf (&commandline, "%s %s", command, args); + commandline = xstrprintf ("%s %s", command, args); } static void @@ -1181,7 +1181,7 @@ remote_rdp_open (char *args, int from_tty) flush_cached_frames (); registers_changed (); stop_pc = read_pc (); - print_stack_frame (get_selected_frame (), -1, 1); + print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC); } @@ -1351,7 +1351,8 @@ remote_rdp_files_info (struct target_ops *target) static void -remote_rdp_create_inferior (char *exec_file, char *allargs, char **env) +remote_rdp_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { CORE_ADDR entry_point; @@ -1404,7 +1405,7 @@ init_remote_rdp_ops (void) remote_rdp_ops.to_fetch_registers = remote_rdp_fetch_register; remote_rdp_ops.to_store_registers = remote_rdp_store_register; remote_rdp_ops.to_prepare_to_store = remote_rdp_prepare_to_store; - remote_rdp_ops.to_xfer_memory = remote_rdp_xfer_inferior_memory; + remote_rdp_ops.deprecated_xfer_memory = remote_rdp_xfer_inferior_memory; remote_rdp_ops.to_files_info = remote_rdp_files_info; remote_rdp_ops.to_insert_breakpoint = remote_rdp_insert_breakpoint; remote_rdp_ops.to_remove_breakpoint = remote_rdp_remove_breakpoint; diff --git a/gnu/usr.bin/binutils/gdb/remote-sim.c b/gnu/usr.bin/binutils/gdb/remote-sim.c index 9b0b3fd99fe..9e377ae083e 100644 --- a/gnu/usr.bin/binutils/gdb/remote-sim.c +++ b/gnu/usr.bin/binutils/gdb/remote-sim.c @@ -48,8 +48,6 @@ extern void _initialize_remote_sim (void); -extern int (*ui_loop_hook) (int signo); - static void dump_mem (char *buf, int len); static void init_callbacks (void); @@ -83,8 +81,6 @@ static void gdbsim_kill (void); static void gdbsim_load (char *prog, int fromtty); -static void gdbsim_create_inferior (char *exec_file, char *args, char **env); - static void gdbsim_open (char *args, int from_tty); static void gdbsim_close (int quitting); @@ -268,8 +264,8 @@ gdb_os_evprintf_filtered (host_callback * p, const char *format, va_list ap) static void gdb_os_error (host_callback * p, const char *format,...) { - if (error_hook) - (*error_hook) (); + if (deprecated_error_hook) + (*deprecated_error_hook) (); else { va_list args; @@ -308,7 +304,7 @@ gdbsim_fetch_register (int regno) char buf[MAX_REGISTER_SIZE]; int nr_bytes; memset (buf, 0, MAX_REGISTER_SIZE); - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regno, buf); set_register_cached (regno, -1); break; } @@ -321,14 +317,14 @@ gdbsim_fetch_register (int regno) memset (buf, 0, MAX_REGISTER_SIZE); nr_bytes = sim_fetch_register (gdbsim_desc, REGISTER_SIM_REGNO (regno), - buf, DEPRECATED_REGISTER_RAW_SIZE (regno)); - if (nr_bytes > 0 && nr_bytes != DEPRECATED_REGISTER_RAW_SIZE (regno) && warn_user) + buf, register_size (current_gdbarch, regno)); + if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno) && warn_user) { fprintf_unfiltered (gdb_stderr, "Size of register %s (%d/%d) incorrect (%d instead of %d))", REGISTER_NAME (regno), regno, REGISTER_SIM_REGNO (regno), - nr_bytes, DEPRECATED_REGISTER_RAW_SIZE (regno)); + nr_bytes, register_size (current_gdbarch, regno)); warn_user = 0; } /* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0' @@ -336,12 +332,12 @@ gdbsim_fetch_register (int regno) which registers are fetchable. */ /* Else if (nr_bytes < 0): an old simulator, that doesn't think to return the register size. Just assume all is ok. */ - supply_register (regno, buf); + regcache_raw_supply (current_regcache, regno, buf); if (sr_get_debug ()) { printf_filtered ("gdbsim_fetch_register: %d", regno); /* FIXME: We could print something more intelligible. */ - dump_mem (buf, DEPRECATED_REGISTER_RAW_SIZE (regno)); + dump_mem (buf, register_size (current_gdbarch, regno)); } break; } @@ -365,8 +361,8 @@ gdbsim_store_register (int regno) deprecated_read_register_gen (regno, tmp); nr_bytes = sim_store_register (gdbsim_desc, REGISTER_SIM_REGNO (regno), - tmp, DEPRECATED_REGISTER_RAW_SIZE (regno)); - if (nr_bytes > 0 && nr_bytes != DEPRECATED_REGISTER_RAW_SIZE (regno)) + tmp, register_size (current_gdbarch, regno)); + if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno)) internal_error (__FILE__, __LINE__, "Register size different to expected"); /* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0' @@ -376,7 +372,7 @@ gdbsim_store_register (int regno) { printf_filtered ("gdbsim_store_register: %d", regno); /* FIXME: We could print something more intelligible. */ - dump_mem (tmp, DEPRECATED_REGISTER_RAW_SIZE (regno)); + dump_mem (tmp, register_size (current_gdbarch, regno)); } } } @@ -429,7 +425,7 @@ gdbsim_load (char *prog, int fromtty) user types "run" after having attached. */ static void -gdbsim_create_inferior (char *exec_file, char *args, char **env) +gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty) { int len; char *arg_buf, **argv; @@ -636,8 +632,8 @@ gdbsim_stop (void) static int gdb_os_poll_quit (host_callback *p) { - if (ui_loop_hook != NULL) - ui_loop_hook (0); + if (deprecated_ui_loop_hook != NULL) + deprecated_ui_loop_hook (0); if (quit_flag) /* gdb's idea of quit */ { @@ -867,7 +863,7 @@ init_gdbsim_ops (void) gdbsim_ops.to_fetch_registers = gdbsim_fetch_register; gdbsim_ops.to_store_registers = gdbsim_store_register; gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store; - gdbsim_ops.to_xfer_memory = gdbsim_xfer_inferior_memory; + gdbsim_ops.deprecated_xfer_memory = gdbsim_xfer_inferior_memory; gdbsim_ops.to_files_info = gdbsim_files_info; gdbsim_ops.to_insert_breakpoint = gdbsim_insert_breakpoint; gdbsim_ops.to_remove_breakpoint = gdbsim_remove_breakpoint; diff --git a/gnu/usr.bin/binutils/gdb/remote-st.c b/gnu/usr.bin/binutils/gdb/remote-st.c index ce4c7ab13e5..a71998c2f5f 100644 --- a/gnu/usr.bin/binutils/gdb/remote-st.c +++ b/gnu/usr.bin/binutils/gdb/remote-st.c @@ -222,14 +222,15 @@ get_hex_regs (int n, int regno) val = 0; for (j = 0; j < 8; j++) val = (val << 4) + get_hex_digit (j == 0); - supply_register (regno++, (char *) &val); + regcache_raw_supply (current_regcache, regno++, (char *) &val); } } /* This is called not only when we first attach, but also when the user types "run" after having attached. */ static void -st2000_create_inferior (char *execfile, char *args, char **env) +st2000_create_inferior (char *execfile, char *args, char **env, + int from_tty) { int entry_pt; @@ -774,7 +775,7 @@ the speed to connect at in bits per second."; st2000_ops.to_fetch_registers = st2000_fetch_register; st2000_ops.to_store_registers = st2000_store_register; st2000_ops.to_prepare_to_store = st2000_prepare_to_store; - st2000_ops.to_xfer_memory = st2000_xfer_inferior_memory; + st2000_ops.deprecated_xfer_memory = st2000_xfer_inferior_memory; st2000_ops.to_files_info = st2000_files_info; st2000_ops.to_insert_breakpoint = st2000_insert_breakpoint; st2000_ops.to_remove_breakpoint = st2000_remove_breakpoint; /* Breakpoints */ diff --git a/gnu/usr.bin/binutils/gdb/remote-utils.c b/gnu/usr.bin/binutils/gdb/remote-utils.c index ba150e34d5d..2f3032c7e0d 100644 --- a/gnu/usr.bin/binutils/gdb/remote-utils.c +++ b/gnu/usr.bin/binutils/gdb/remote-utils.c @@ -596,12 +596,13 @@ void _initialize_sr_support (void) { /* FIXME-now: if target is open... */ - add_show_from_set (add_set_cmd ("remotedevice", no_class, - var_filename, (char *) &sr_settings.device, - "Set device for remote serial I/O.\n\ + deprecated_add_show_from_set + (add_set_cmd ("remotedevice", no_class, + var_filename, (char *) &sr_settings.device, + "Set device for remote serial I/O.\n\ This device is used as the serial port when debugging using remote\n\ targets.", &setlist), - &showlist); + &showlist); add_com ("remote <command>", class_obscure, sr_com, "Send a command to the remote monitor."); diff --git a/gnu/usr.bin/binutils/gdb/remote-vx.c b/gnu/usr.bin/binutils/gdb/remote-vx.c index fd51781b196..76baff564e8 100644 --- a/gnu/usr.bin/binutils/gdb/remote-vx.c +++ b/gnu/usr.bin/binutils/gdb/remote-vx.c @@ -202,7 +202,7 @@ vx_remove_breakpoint (int addr) On VxWorks, we ignore exec_file. */ static void -vx_create_inferior (char *exec_file, char *args, char **env) +vx_create_inferior (char *exec_file, char *args, char **env, int from_tty) { enum clnt_stat status; arg_array passArgs; @@ -466,7 +466,7 @@ static void vx_prepare_to_store (void) { /* Fetch all registers, if any of them are not yet fetched. */ - deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES); + deprecated_read_register_bytes (0, NULL, deprecated_register_bytes ()); } /* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR @@ -566,7 +566,7 @@ vx_run_files_info (void) { printf_unfiltered ("\tRunning %s VxWorks process %s", vx_running ? "child" : "attached", - local_hex_string (PIDGET (inferior_ptid))); + hex_string (PIDGET (inferior_ptid))); if (vx_running) printf_unfiltered (", function `%s'", vx_running); printf_unfiltered (".\n"); @@ -747,17 +747,8 @@ net_step (void) SOURCE_STEP source_step; source_step.taskId = PIDGET (inferior_ptid); - - if (step_range_end) - { - source_step.startAddr = step_range_start; - source_step.endAddr = step_range_end; - } - else - { - source_step.startAddr = 0; - source_step.endAddr = 0; - } + source_step.startAddr = 0; + source_step.endAddr = 0; status = net_clnt_call (VX_SOURCE_STEP, xdr_SOURCE_STEP, &source_step, xdr_int, &step_status); @@ -981,7 +972,7 @@ vx_wait (ptid_t ptid_to_wait_for, struct target_waitstatus *status) else if (pid != PIDGET (inferior_ptid)) internal_error (__FILE__, __LINE__, "Bad pid for debugged task: %s\n", - local_hex_string ((unsigned long) pid)); + hex_string ((unsigned long) pid)); } while (pid == 0); @@ -1192,7 +1183,7 @@ vx_attach (char *args, int from_tty) if (from_tty) printf_unfiltered ("Attaching pid %s.\n", - local_hex_string ((unsigned long) pid)); + hex_string ((unsigned long) pid)); memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in)); memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out)); @@ -1239,7 +1230,7 @@ vx_detach (char *args, int from_tty) if (from_tty) printf_unfiltered ("Detaching pid %s.\n", - local_hex_string ( + hex_string ( (unsigned long) PIDGET (inferior_ptid))); if (args) /* FIXME, should be possible to leave suspended */ @@ -1271,7 +1262,8 @@ vx_kill (void) Ptrace_return ptrace_out; int status; - printf_unfiltered ("Killing pid %s.\n", local_hex_string ((unsigned long) PIDGET (inferior_ptid))); + printf_unfiltered ("Killing pid %s.\n", + hex_string ((unsigned long) PIDGET (inferior_ptid))); memset ((char *) &ptrace_in, '\0', sizeof (ptrace_in)); memset ((char *) &ptrace_out, '\0', sizeof (ptrace_out)); @@ -1351,7 +1343,7 @@ Specify the name of the machine to connect to."; vx_ops.to_open = vx_open; vx_ops.to_close = vx_close; vx_ops.to_attach = vx_attach; - vx_ops.to_xfer_memory = vx_xfer_memory; + vx_ops.deprecated_xfer_memory = vx_xfer_memory; vx_ops.to_files_info = vx_files_info; vx_ops.to_load = vx_load_command; vx_ops.to_lookup_symbol = vx_lookup_symbol; @@ -1376,7 +1368,7 @@ init_vx_run_ops (void) vx_run_ops.to_fetch_registers = vx_read_register; vx_run_ops.to_store_registers = vx_write_register; vx_run_ops.to_prepare_to_store = vx_prepare_to_store; - vx_run_ops.to_xfer_memory = vx_xfer_memory; + vx_run_ops.deprecated_xfer_memory = vx_xfer_memory; vx_run_ops.to_files_info = vx_run_files_info; vx_run_ops.to_insert_breakpoint = vx_insert_breakpoint; vx_run_ops.to_remove_breakpoint = vx_remove_breakpoint; @@ -1400,7 +1392,7 @@ _initialize_vx (void) init_vx_run_ops (); add_target (&vx_run_ops); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("vxworks-timeout", class_support, var_uinteger, (char *) &rpcTimeout.tv_sec, "Set seconds to wait for rpc calls to return.\n\ diff --git a/gnu/usr.bin/binutils/gdb/remote-vx68.c b/gnu/usr.bin/binutils/gdb/remote-vx68.c index 8cdac6f0278..8b008247e72 100644 --- a/gnu/usr.bin/binutils/gdb/remote-vx68.c +++ b/gnu/usr.bin/binutils/gdb/remote-vx68.c @@ -85,14 +85,15 @@ vx_read_register (int regno) net_read_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_GETREGS); - bcopy (&mc68k_greg_packet[MC68K_R_D0], deprecated_registers, - 16 * MC68K_GREG_SIZE); - bcopy (&mc68k_greg_packet[MC68K_R_SR], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], - MC68K_GREG_SIZE); - bcopy (&mc68k_greg_packet[MC68K_R_PC], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)], - MC68K_GREG_SIZE); + memcpy (deprecated_registers, + &mc68k_greg_packet[MC68K_R_D0] + 16 * MC68K_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], + &mc68k_greg_packet[MC68K_R_SR], + MC68K_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)], + &mc68k_greg_packet[MC68K_R_PC], + MC68K_GREG_SIZE); /* Get floating-point registers, if the target system has them. Otherwise, zero them. */ @@ -102,12 +103,12 @@ vx_read_register (int regno) net_read_registers (mc68k_fpreg_packet, MC68K_FPREG_PLEN, PTRACE_GETFPREGS); - bcopy (&mc68k_fpreg_packet[MC68K_R_FP0], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - MC68K_FPREG_SIZE * 8); - bcopy (&mc68k_fpreg_packet[MC68K_R_FPCR], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)], - MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8)); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], + &mc68k_fpreg_packet[MC68K_R_FP0], + MC68K_FPREG_SIZE * 8); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)], + &mc68k_fpreg_packet[MC68K_R_FPCR], + MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8)); } else { @@ -134,12 +135,14 @@ vx_write_register (int regno) /* Store general-purpose registers. */ - bcopy (deprecated_registers, &mc68k_greg_packet[MC68K_R_D0], - 16 * MC68K_GREG_SIZE); - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], - &mc68k_greg_packet[MC68K_R_SR], MC68K_GREG_SIZE); - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)], - &mc68k_greg_packet[MC68K_R_PC], MC68K_GREG_SIZE); + memcpy (&mc68k_greg_packet[MC68K_R_D0], deprecated_registers, + 16 * MC68K_GREG_SIZE); + memcpy (&mc68k_greg_packet[MC68K_R_SR], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], + MC68K_GREG_SIZE); + memcpy (&mc68k_greg_packet[MC68K_R_PC], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)], + MC68K_GREG_SIZE); net_write_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_SETREGS); @@ -147,12 +150,12 @@ vx_write_register (int regno) if (target_has_fp) { - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - &mc68k_fpreg_packet[MC68K_R_FP0], - MC68K_FPREG_SIZE * 8); - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)], - &mc68k_fpreg_packet[MC68K_R_FPCR], - MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8)); + memcpy (&mc68k_fpreg_packet[MC68K_R_FP0], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], + MC68K_FPREG_SIZE * 8); + memcpy (&mc68k_fpreg_packet[MC68K_R_FPCR], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)], + MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8)); net_write_registers (mc68k_fpreg_packet, MC68K_FPREG_PLEN, PTRACE_SETFPREGS); diff --git a/gnu/usr.bin/binutils/gdb/remote-vxmips.c b/gnu/usr.bin/binutils/gdb/remote-vxmips.c index 55ba49b98ca..84e6c7dbb75 100644 --- a/gnu/usr.bin/binutils/gdb/remote-vxmips.c +++ b/gnu/usr.bin/binutils/gdb/remote-vxmips.c @@ -103,19 +103,23 @@ vx_read_register (int regno) /* Copy the general registers. */ - bcopy (&mips_greg_packet[MIPS_R_GP0], &deprecated_registers[0], - 32 * MIPS_GREG_SIZE); + memcpy (&deprecated_registers[0], &mips_greg_packet[MIPS_R_GP0], + 32 * MIPS_GREG_SIZE); /* Copy SR, LO, HI, and PC. */ - bcopy (&mips_greg_packet[MIPS_R_SR], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE); - bcopy (&mips_greg_packet[MIPS_R_LO], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], MIPS_GREG_SIZE); - bcopy (&mips_greg_packet[MIPS_R_HI], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], MIPS_GREG_SIZE); - bcopy (&mips_greg_packet[MIPS_R_PC], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], + &mips_greg_packet[MIPS_R_SR], + MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], + &mips_greg_packet[MIPS_R_LO], + MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], + &mips_greg_packet[MIPS_R_HI], + MIPS_GREG_SIZE); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], + &mips_greg_packet[MIPS_R_PC], + MIPS_GREG_SIZE); /* If the target has floating point registers, fetch them. Otherwise, zero the floating point register values in @@ -129,22 +133,22 @@ vx_read_register (int regno) /* Copy the floating point registers. */ - bcopy (&mips_fpreg_packet[MIPS_R_FP0], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], + &mips_fpreg_packet[MIPS_R_FP0], + register_size (current_gdbarch, FP0_REGNUM) * 32); /* Copy the floating point control/status register (fpcsr). */ - bcopy (&mips_fpreg_packet[MIPS_R_FPCSR], - &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], - DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status)); + memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], + &mips_fpreg_packet[MIPS_R_FPCSR], + register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status)); } else { memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - 0, DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32); + 0, register_size (current_gdbarch, FP0_REGNUM) * 32); memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], - 0, DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status)); + 0, register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status)); } /* Mark the register cache valid. */ @@ -163,19 +167,23 @@ vx_write_register (int regno) /* Store general registers. */ - bcopy (&deprecated_registers[0], &mips_greg_packet[MIPS_R_GP0], - 32 * MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_GP0], &deprecated_registers[0], + 32 * MIPS_GREG_SIZE); /* Copy SR, LO, HI, and PC. */ - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], - &mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE); - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], - &mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE); - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], - &mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE); - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], - &mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_SR], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], + MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_LO], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], + MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_HI], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], + MIPS_GREG_SIZE); + memcpy (&mips_greg_packet[MIPS_R_PC], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], + MIPS_GREG_SIZE); net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS); @@ -185,15 +193,15 @@ vx_write_register (int regno) { /* Copy the floating point data registers. */ - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - &mips_fpreg_packet[MIPS_R_FP0], - DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32); + memcpy (&mips_fpreg_packet[MIPS_R_FP0], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], + register_size (current_gdbarch, FP0_REGNUM) * 32); /* Copy the floating point control/status register (fpcsr). */ - bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], - &mips_fpreg_packet[MIPS_R_FPCSR], - DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status)); + memcpy (&mips_fpreg_packet[MIPS_R_FPCSR], + &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)], + register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status)); net_write_registers (mips_fpreg_packet, MIPS_FPREG_PLEN, PTRACE_SETFPREGS); diff --git a/gnu/usr.bin/binutils/gdb/remote.c b/gnu/usr.bin/binutils/gdb/remote.c index 29bbbc86d80..5d1ac7f2eb0 100644 --- a/gnu/usr.bin/binutils/gdb/remote.c +++ b/gnu/usr.bin/binutils/gdb/remote.c @@ -43,9 +43,6 @@ #include <ctype.h> #include <sys/time.h> -#ifdef USG -#include <sys/types.h> -#endif #include "event-loop.h" #include "event-top.h" @@ -107,9 +104,6 @@ static void extended_remote_restart (void); static void extended_remote_mourn (void); -static void extended_remote_create_inferior (char *, char *, char **); -static void extended_remote_async_create_inferior (char *, char *, char **); - static void remote_mourn_1 (struct target_ops *); static void remote_send (char *buf, long sizeof_buf); @@ -211,7 +205,7 @@ struct packet_reg long regnum; /* GDB's internal register number. */ LONGEST pnum; /* Remote protocol register number. */ int in_g_packet; /* Always part of G packet. */ - /* long size in bytes; == DEPRECATED_REGISTER_RAW_SIZE (regnum); at present. */ + /* long size in bytes; == register_size (current_gdbarch, regnum); at present. */ /* char *name; == REGISTER_NAME (regnum); at present. */ }; @@ -253,8 +247,8 @@ init_remote_state (struct gdbarch *gdbarch) int regnum; struct remote_state *rs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct remote_state); - if (DEPRECATED_REGISTER_BYTES != 0) - rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; + if (deprecated_register_bytes () != 0) + rs->sizeof_g_packet = deprecated_register_bytes (); else rs->sizeof_g_packet = 0; @@ -271,7 +265,7 @@ init_remote_state (struct gdbarch *gdbarch) /* ...name = REGISTER_NAME (regnum); */ /* Compute packet size by accumulating the size of all registers. */ - if (DEPRECATED_REGISTER_BYTES == 0) + if (deprecated_register_bytes () == 0) rs->sizeof_g_packet += register_size (current_gdbarch, regnum); } @@ -649,26 +643,31 @@ add_packet_config_cmd (struct packet_config *config, struct cmd_list_element *show_cmd; char *set_doc; char *show_doc; + char *help_doc; + char *print; char *cmd_name; config->name = name; config->title = title; config->detect = AUTO_BOOLEAN_AUTO; config->support = PACKET_SUPPORT_UNKNOWN; - xasprintf (&set_doc, "Set use of remote protocol `%s' (%s) packet", - name, title); - xasprintf (&show_doc, "Show current use of remote protocol `%s' (%s) packet", - name, title); + set_doc = xstrprintf ("Set use of remote protocol `%s' (%s) packet", + name, title); + show_doc = xstrprintf ("Show current use of remote protocol `%s' (%s) packet", + name, title); + print = xstrprintf ("Current use of remote protocol `%s' (%s) is %%s", + name, title); /* set/show TITLE-packet {auto,on,off} */ - xasprintf (&cmd_name, "%s-packet", title); + cmd_name = xstrprintf ("%s-packet", title); add_setshow_auto_boolean_cmd (cmd_name, class_obscure, &config->detect, set_doc, show_doc, + "", print, set_func, show_func, set_remote_list, show_remote_list); /* set/show remote NAME-packet {auto,on,off} -- legacy */ if (legacy) { char *legacy_name; - xasprintf (&legacy_name, "%s-packet", name); + legacy_name = xstrprintf ("%s-packet", name); add_alias_cmd (legacy_name, cmd_name, class_obscure, 0, set_remote_list); add_alias_cmd (legacy_name, cmd_name, class_obscure, 0, @@ -774,42 +773,6 @@ show_remote_protocol_qSymbol_packet_cmd (char *args, int from_tty, show_packet_config_cmd (&remote_protocol_qSymbol); } -/* Should we try the 'e' (step over range) request? */ -static struct packet_config remote_protocol_e; - -static void -set_remote_protocol_e_packet_cmd (char *args, int from_tty, - struct cmd_list_element *c) -{ - update_packet_config (&remote_protocol_e); -} - -static void -show_remote_protocol_e_packet_cmd (char *args, int from_tty, - struct cmd_list_element *c) -{ - show_packet_config_cmd (&remote_protocol_e); -} - - -/* Should we try the 'E' (step over range / w signal #) request? */ -static struct packet_config remote_protocol_E; - -static void -set_remote_protocol_E_packet_cmd (char *args, int from_tty, - struct cmd_list_element *c) -{ - update_packet_config (&remote_protocol_E); -} - -static void -show_remote_protocol_E_packet_cmd (char *args, int from_tty, - struct cmd_list_element *c) -{ - show_packet_config_cmd (&remote_protocol_E); -} - - /* Should we try the 'P' (set register) request? */ static struct packet_config remote_protocol_P; @@ -998,6 +961,23 @@ show_remote_protocol_qPart_auxv_packet_cmd (char *args, int from_tty, show_packet_config_cmd (&remote_protocol_qPart_auxv); } +static struct packet_config remote_protocol_p; + +static void +set_remote_protocol_p_packet_cmd (char *args, int from_tty, + struct cmd_list_element *c) +{ + update_packet_config (&remote_protocol_p); +} + +static void +show_remote_protocol_p_packet_cmd (char *args, int from_tty, + struct cmd_list_element *c) +{ + show_packet_config_cmd (&remote_protocol_p); +} + + /* Tokens for use by the asynchronous signal handlers for SIGINT */ static void *sigint_remote_twice_token; @@ -1006,8 +986,8 @@ static void *sigint_remote_token; /* These are pointers to hook functions that may be set in order to modify resume/wait behavior for a particular architecture. */ -void (*target_resume_hook) (void); -void (*target_wait_loop_hook) (void); +void (*deprecated_target_resume_hook) (void); +void (*deprecated_target_wait_loop_hook) (void); @@ -2077,9 +2057,8 @@ static void init_all_packet_configs (void) { int i; - update_packet_config (&remote_protocol_e); - update_packet_config (&remote_protocol_E); update_packet_config (&remote_protocol_P); + update_packet_config (&remote_protocol_p); update_packet_config (&remote_protocol_qSymbol); update_packet_config (&remote_protocol_vcont); for (i = 0; i < NR_Z_PACKET_TYPES; i++) @@ -2164,6 +2143,9 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, if (!async_p) wait_forever_enabled_p = 1; + reopen_exec_file (); + reread_symbols (); + target_preopen (from_tty); unpush_target (target); @@ -2549,8 +2531,8 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal) /* A hook for when we need to do something at the last moment before resumption. */ - if (target_resume_hook) - (*target_resume_hook) (); + if (deprecated_target_resume_hook) + (*deprecated_target_resume_hook) (); /* The vCont packet doesn't need to specify threads via Hc. */ if (remote_vcont_resume (ptid, step, siggnal)) @@ -2562,60 +2544,6 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal) else set_thread (pid, 0); /* run this thread */ - /* The s/S/c/C packets do not return status. So if the target does - not support the S or C packets, the debug agent returns an empty - string which is detected in remote_wait(). This protocol defect - is fixed in the e/E packets. */ - - if (step && step_range_end) - { - /* If the target does not support the 'E' packet, we try the 'S' - packet. Ideally we would fall back to the 'e' packet if that - too is not supported. But that would require another copy of - the code to issue the 'e' packet (and fall back to 's' if not - supported) in remote_wait(). */ - - if (siggnal != TARGET_SIGNAL_0) - { - if (remote_protocol_E.support != PACKET_DISABLE) - { - p = buf; - *p++ = 'E'; - *p++ = tohex (((int) siggnal >> 4) & 0xf); - *p++ = tohex (((int) siggnal) & 0xf); - *p++ = ','; - p += hexnumstr (p, (ULONGEST) step_range_start); - *p++ = ','; - p += hexnumstr (p, (ULONGEST) step_range_end); - *p++ = 0; - - putpkt (buf); - getpkt (buf, (rs->remote_packet_size), 0); - - if (packet_ok (buf, &remote_protocol_E) == PACKET_OK) - return; - } - } - else - { - if (remote_protocol_e.support != PACKET_DISABLE) - { - p = buf; - *p++ = 'e'; - p += hexnumstr (p, (ULONGEST) step_range_start); - *p++ = ','; - p += hexnumstr (p, (ULONGEST) step_range_end); - *p++ = 0; - - putpkt (buf); - getpkt (buf, (rs->remote_packet_size), 0); - - if (packet_ok (buf, &remote_protocol_e) == PACKET_OK) - return; - } - } - } - if (siggnal != TARGET_SIGNAL_0) { buf[0] = step ? 'S' : 'C'; @@ -2642,7 +2570,7 @@ remote_async_resume (ptid_t ptid, int step, enum target_signal siggnal) /* FIXME: ezannoni 1999-09-28: We may need to move this out of here into infcmd.c in order to allow inferior function calls to work NOT asynchronously. */ - if (event_loop_p && target_can_async_p ()) + if (target_can_async_p ()) target_async (inferior_event_handler, 0); /* Tell the world that the target is now executing. */ /* FIXME: cagney/1999-09-23: Is it the targets responsibility to set @@ -2880,8 +2808,8 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status) /* This is a hook for when we need to do something (perhaps the collection of trace data) every time the target stops. */ - if (target_wait_loop_hook) - (*target_wait_loop_hook) (); + if (deprecated_target_wait_loop_hook) + (*deprecated_target_wait_loop_hook) (); remote_stopped_by_watchpoint_p = 0; @@ -2971,11 +2899,11 @@ Packet: '%s'\n", error ("Remote sent bad register number %s: %s\nPacket: '%s'\n", phex_nz (pnum, 0), p, buf); - fieldsize = hex2bin (p, regs, DEPRECATED_REGISTER_RAW_SIZE (reg->regnum)); + fieldsize = hex2bin (p, regs, register_size (current_gdbarch, reg->regnum)); p += 2 * fieldsize; - if (fieldsize < DEPRECATED_REGISTER_RAW_SIZE (reg->regnum)) + if (fieldsize < register_size (current_gdbarch, reg->regnum)) warning ("Remote reply is too short: %s", buf); - supply_register (reg->regnum, regs); + regcache_raw_supply (current_regcache, reg->regnum, regs); } if (*p++ != ';') @@ -3071,8 +2999,8 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status) /* This is a hook for when we need to do something (perhaps the collection of trace data) every time the target stops. */ - if (target_wait_loop_hook) - (*target_wait_loop_hook) (); + if (deprecated_target_wait_loop_hook) + (*deprecated_target_wait_loop_hook) (); switch (buf[0]) { @@ -3159,11 +3087,11 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status) error ("Remote sent bad register number %ld: %s\nPacket: '%s'\n", pnum, p, buf); - fieldsize = hex2bin (p, regs, DEPRECATED_REGISTER_RAW_SIZE (reg->regnum)); + fieldsize = hex2bin (p, regs, register_size (current_gdbarch, reg->regnum)); p += 2 * fieldsize; - if (fieldsize < DEPRECATED_REGISTER_RAW_SIZE (reg->regnum)) + if (fieldsize < register_size (current_gdbarch, reg->regnum)) warning ("Remote reply is too short: %s", buf); - supply_register (reg->regnum, regs); + regcache_raw_supply (current_regcache, reg->regnum, regs); } if (*p++ != ';') @@ -3240,6 +3168,37 @@ static int register_bytes_found; /* Read the remote registers into the block REGS. */ /* Currently we just read all the registers, so we don't use regnum. */ +static int +fetch_register_using_p (int regnum) +{ + struct remote_state *rs = get_remote_state (); + char *buf = alloca (rs->remote_packet_size), *p; + char regp[MAX_REGISTER_SIZE]; + int i; + + p = buf; + *p++ = 'p'; + p += hexnumstr (p, regnum); + *p++ = '\0'; + remote_send (buf, rs->remote_packet_size); + if (buf[0] != 0 && buf[0] != 'E') { + p = buf; + i = 0; + while (p[0] != 0) { + if (p[1] == 0) { + error("fetch_register_using_p: early buf termination"); + return 0; + } + regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]); + p += 2; + } + regcache_raw_supply (current_regcache, regnum, regp); + return 1; + } + + return 0; +} + static void remote_fetch_registers (int regnum) { @@ -3260,6 +3219,31 @@ remote_fetch_registers (int regnum) "Attempt to fetch a non G-packet register when this " "remote.c does not support the p-packet."); } + switch (remote_protocol_p.support) + { + case PACKET_DISABLE: + break; + case PACKET_ENABLE: + if (fetch_register_using_p (regnum)) + return; + else + error ("Protocol error: p packet not recognized by stub"); + case PACKET_SUPPORT_UNKNOWN: + if (fetch_register_using_p (regnum)) + { + /* The stub recognized the 'p' packet. Remember this. */ + remote_protocol_p.support = PACKET_ENABLE; + return; + } + else + { + /* The stub does not support the 'P' packet. Use 'G' + instead, and don't try using 'P' in the future (it + will just waste our time). */ + remote_protocol_p.support = PACKET_DISABLE; + break; + } + } sprintf (buf, "g"); remote_send (buf, (rs->remote_packet_size)); @@ -3389,8 +3373,8 @@ store_register_using_P (int regnum) sprintf (buf, "P%s=", phex_nz (reg->pnum, 0)); p = buf + strlen (buf); - regcache_collect (reg->regnum, regp); - bin2hex (regp, p, DEPRECATED_REGISTER_RAW_SIZE (reg->regnum)); + regcache_raw_collect (current_regcache, reg->regnum, regp); + bin2hex (regp, p, register_size (current_gdbarch, reg->regnum)); remote_send (buf, rs->remote_packet_size); return buf[0] != '\0'; @@ -3450,7 +3434,7 @@ remote_store_registers (int regnum) { struct packet_reg *r = &rs->regs[i]; if (r->in_g_packet) - regcache_collect (r->regnum, regs + r->offset); + regcache_raw_collect (current_regcache, r->regnum, regs + r->offset); } } @@ -4335,7 +4319,8 @@ remote_mourn_1 (struct target_ops *target) we're debugging, arguments and an environment. */ static void -extended_remote_create_inferior (char *exec_file, char *args, char **env) +extended_remote_create_inferior (char *exec_file, char *args, char **env, + int from_tty) { /* Rip out the breakpoints; we'll reinsert them after restarting the remote server. */ @@ -4357,7 +4342,8 @@ extended_remote_create_inferior (char *exec_file, char *args, char **env) /* Async version of extended_remote_create_inferior. */ static void -extended_remote_async_create_inferior (char *exec_file, char *args, char **env) +extended_remote_async_create_inferior (char *exec_file, char *args, char **env, + int from_tty) { /* Rip out the breakpoints; we'll reinsert them after restarting the remote server. */ @@ -4365,7 +4351,7 @@ extended_remote_async_create_inferior (char *exec_file, char *args, char **env) /* If running asynchronously, register the target file descriptor with the event loop. */ - if (event_loop_p && target_can_async_p ()) + if (target_can_async_p ()) target_async (inferior_event_handler, 0); /* Now restart the remote server. */ @@ -4637,12 +4623,20 @@ remote_stopped_by_watchpoint (void) return remote_stopped_by_watchpoint_p; } -static CORE_ADDR -remote_stopped_data_address (void) +extern int stepped_after_stopped_by_watchpoint; + +static int +remote_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p) { - if (remote_stopped_by_watchpoint ()) - return remote_watch_data_address; - return (CORE_ADDR)0; + int rc = 0; + if (remote_stopped_by_watchpoint () + || stepped_after_stopped_by_watchpoint) + { + *addr_p = remote_watch_data_address; + rc = 1; + } + + return rc; } @@ -4816,7 +4810,7 @@ compare_sections_command (char *args, int from_tty) if (!(s->flags & SEC_LOAD)) continue; /* skip non-loadable section */ - size = bfd_get_section_size_before_reloc (s); + size = bfd_get_section_size (s); if (size == 0) continue; /* skip zero-length section */ @@ -4876,6 +4870,31 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object, char *p2 = &buf2[0]; char query_type; + /* Handle memory using remote_xfer_memory. */ + if (object == TARGET_OBJECT_MEMORY) + { + int xfered; + errno = 0; + + if (writebuf != NULL) + { + void *buffer = xmalloc (len); + struct cleanup *cleanup = make_cleanup (xfree, buffer); + memcpy (buffer, writebuf, len); + xfered = remote_xfer_memory (offset, buffer, len, 1, NULL, ops); + do_cleanups (cleanup); + } + else + xfered = remote_xfer_memory (offset, readbuf, len, 0, NULL, ops); + + if (xfered > 0) + return xfered; + else if (xfered == 0 && errno == 0) + return 0; + else + return -1; + } + /* Only handle reads. */ if (writebuf != NULL || readbuf == NULL) return -1; @@ -5229,7 +5248,7 @@ Specify the serial device it is connected to\n\ remote_ops.to_fetch_registers = remote_fetch_registers; remote_ops.to_store_registers = remote_store_registers; remote_ops.to_prepare_to_store = remote_prepare_to_store; - remote_ops.to_xfer_memory = remote_xfer_memory; + remote_ops.deprecated_xfer_memory = remote_xfer_memory; remote_ops.to_files_info = remote_files_info; remote_ops.to_insert_breakpoint = remote_insert_breakpoint; remote_ops.to_remove_breakpoint = remote_remove_breakpoint; @@ -5349,7 +5368,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; remote_async_ops.to_fetch_registers = remote_fetch_registers; remote_async_ops.to_store_registers = remote_store_registers; remote_async_ops.to_prepare_to_store = remote_prepare_to_store; - remote_async_ops.to_xfer_memory = remote_xfer_memory; + remote_async_ops.deprecated_xfer_memory = remote_xfer_memory; remote_async_ops.to_files_info = remote_files_info; remote_async_ops.to_insert_breakpoint = remote_insert_breakpoint; remote_async_ops.to_remove_breakpoint = remote_remove_breakpoint; @@ -5416,9 +5435,8 @@ show_remote_cmd (char *args, int from_tty) /* FIXME: cagney/2002-06-15: This function should iterate over remote_show_cmdlist for a list of sub commands to show. */ show_remote_protocol_Z_packet_cmd (args, from_tty, NULL); - show_remote_protocol_e_packet_cmd (args, from_tty, NULL); - show_remote_protocol_E_packet_cmd (args, from_tty, NULL); show_remote_protocol_P_packet_cmd (args, from_tty, NULL); + show_remote_protocol_p_packet_cmd (args, from_tty, NULL); show_remote_protocol_qSymbol_packet_cmd (args, from_tty, NULL); show_remote_protocol_vcont_packet_cmd (args, from_tty, NULL); show_remote_protocol_binary_download_cmd (args, from_tty, NULL); @@ -5456,7 +5474,7 @@ _initialize_remote (void) struct cmd_list_element *tmpcmd; /* architecture specific data */ - remote_gdbarch_data_handle = register_gdbarch_data (init_remote_state); + remote_gdbarch_data_handle = gdbarch_data_register_post_init (init_remote_state); /* Old tacky stuff. NOTE: This comes after the remote protocol so that the remote protocol has been initialized. */ @@ -5476,8 +5494,8 @@ _initialize_remote (void) add_target (&extended_async_remote_ops); /* Hook into new objfile notification. */ - remote_new_objfile_chain = target_new_objfile_hook; - target_new_objfile_hook = remote_new_objfile; + remote_new_objfile_chain = deprecated_target_new_objfile_hook; + deprecated_target_new_objfile_hook = remote_new_objfile; #if 0 init_remote_threadtests (); @@ -5512,9 +5530,11 @@ response packet. GDB supplies the initial `$' character, and the\n\ terminating `#' character and checksum.", &maintenancelist); - add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, - "Set whether to send break if interrupted.\n", - "Show whether to send break if interrupted.\n", + add_setshow_boolean_cmd ("remotebreak", no_class, &remote_break, "\ +Set whether to send break if interrupted.", "\ +Show whether to send break if interrupted.", "\ +If set, a break, instead of a cntrl-c, is sent to the remote target.", "\ +Whether to send break if interrupted is %s.", NULL, NULL, &setlist, &showlist); @@ -5551,20 +5571,24 @@ terminating `#' character and checksum.", "Show the maximum number of bytes per memory-read packet.\n", &remote_show_cmdlist); - add_setshow_cmd ("hardware-watchpoint-limit", no_class, - var_zinteger, &remote_hw_watchpoint_limit, "\ -Set the maximum number of target hardware watchpoints.\n\ + add_setshow_zinteger_cmd ("hardware-watchpoint-limit", no_class, + &remote_hw_watchpoint_limit, "\ +Set the maximum number of target hardware watchpoints.", "\ +Show the maximum number of target hardware watchpoints.", "\ Specify a negative limit for unlimited.", "\ -Show the maximum number of target hardware watchpoints.\n", - NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist); - add_setshow_cmd ("hardware-breakpoint-limit", no_class, - var_zinteger, &remote_hw_breakpoint_limit, "\ -Set the maximum number of target hardware breakpoints.\n\ +The maximum number of target hardware watchpoints is %s.", + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); + add_setshow_zinteger_cmd ("hardware-breakpoint-limit", no_class, + &remote_hw_breakpoint_limit, "\ +Set the maximum number of target hardware breakpoints.", "\ +Show the maximum number of target hardware breakpoints.", "\ Specify a negative limit for unlimited.", "\ -Show the maximum number of target hardware breakpoints.\n", - NULL, NULL, &remote_set_cmdlist, &remote_show_cmdlist); +The maximum number of target hardware breakpoints is %s.", + NULL, NULL, + &remote_set_cmdlist, &remote_show_cmdlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("remoteaddresssize", class_obscure, var_integer, (char *) &remote_address_size, "Set the maximum size of the address (in bits) \ @@ -5581,7 +5605,7 @@ in a memory packet.\n", #if 0 /* XXXX - should ``set remotebinarydownload'' be retained for compatibility. */ - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("remotebinarydownload", no_class, var_boolean, (char *) &remote_binary_download, "Set binary downloads.\n", &setlist), @@ -5602,28 +5626,6 @@ in a memory packet.\n", &remote_set_cmdlist, &remote_show_cmdlist, 0); - add_packet_config_cmd (&remote_protocol_e, - "e", "step-over-range", - set_remote_protocol_e_packet_cmd, - show_remote_protocol_e_packet_cmd, - &remote_set_cmdlist, &remote_show_cmdlist, - 0); - /* Disable by default. The ``e'' packet has nasty interactions with - the threading code - it relies on global state. */ - remote_protocol_e.detect = AUTO_BOOLEAN_FALSE; - update_packet_config (&remote_protocol_e); - - add_packet_config_cmd (&remote_protocol_E, - "E", "step-over-range-w-signal", - set_remote_protocol_E_packet_cmd, - show_remote_protocol_E_packet_cmd, - &remote_set_cmdlist, &remote_show_cmdlist, - 0); - /* Disable by default. The ``e'' packet has nasty interactions with - the threading code - it relies on global state. */ - remote_protocol_E.detect = AUTO_BOOLEAN_FALSE; - update_packet_config (&remote_protocol_E); - add_packet_config_cmd (&remote_protocol_P, "P", "set-register", set_remote_protocol_P_packet_cmd, @@ -5631,6 +5633,13 @@ in a memory packet.\n", &remote_set_cmdlist, &remote_show_cmdlist, 1); + add_packet_config_cmd (&remote_protocol_p, + "p", "fetch-register", + set_remote_protocol_p_packet_cmd, + show_remote_protocol_p_packet_cmd, + &remote_set_cmdlist, &remote_show_cmdlist, + 1); + add_packet_config_cmd (&remote_protocol_Z[Z_PACKET_SOFTWARE_BP], "Z0", "software-breakpoint", set_remote_protocol_Z_software_bp_packet_cmd, @@ -5676,8 +5685,11 @@ in a memory packet.\n", /* Keep the old ``set remote Z-packet ...'' working. */ add_setshow_auto_boolean_cmd ("Z-packet", class_obscure, &remote_Z_packet_detect, "\ -Set use of remote protocol `Z' packets", - "Show use of remote protocol `Z' packets ", +Set use of remote protocol `Z' packets", "\ +Show use of remote protocol `Z' packets ", "\ +When set, GDB will attempt to use the remote breakpoint and watchpoint\n\ +packets.", "\ +Use of remote protocol `Z' packets is %s", set_remote_protocol_Z_packet_cmd, show_remote_protocol_Z_packet_cmd, &remote_set_cmdlist, &remote_show_cmdlist); diff --git a/gnu/usr.bin/binutils/gdb/rom68k-rom.c b/gnu/usr.bin/binutils/gdb/rom68k-rom.c index 2ddba0acf5b..01422a6d3fa 100644 --- a/gnu/usr.bin/binutils/gdb/rom68k-rom.c +++ b/gnu/usr.bin/binutils/gdb/rom68k-rom.c @@ -101,8 +101,8 @@ rom68k_supply_one_register (int regno, unsigned char *hex) while (is_whitespace (*hex)) hex++; - store_unsigned_integer (regbuf, DEPRECATED_REGISTER_RAW_SIZE (regno), value); - supply_register (regno, regbuf); + store_unsigned_integer (regbuf, register_size (current_gdbarch, regno), value); + regcache_raw_supply (current_regcache, regno, regbuf); return hex; } diff --git a/gnu/usr.bin/binutils/gdb/rs6000-nat.c b/gnu/usr.bin/binutils/gdb/rs6000-nat.c index 3d6c07c3dda..df360763f42 100644 --- a/gnu/usr.bin/binutils/gdb/rs6000-nat.c +++ b/gnu/usr.bin/binutils/gdb/rs6000-nat.c @@ -28,12 +28,11 @@ #include "xcoffsolib.h" #include "symfile.h" #include "objfiles.h" -#include "libbfd.h" /* For bfd_cache_lookup (FIXME) */ +#include "libbfd.h" /* For bfd_default_set_arch_mach (FIXME) */ #include "bfd.h" #include "gdb-stabs.h" #include "regcache.h" #include "arch-utils.h" -#include "language.h" /* for local_hex_string(). */ #include "ppc-tdep.h" #include "exec.h" @@ -73,7 +72,7 @@ #ifndef ARCH3264 # define ARCH64() 0 #else -# define ARCH64() (DEPRECATED_REGISTER_RAW_SIZE (0) == 8) +# define ARCH64() (register_size (current_gdbarch, 0) == 8) #endif /* Union of 32-bit and 64-bit ".reg" core file sections. */ @@ -156,12 +155,15 @@ regmap (int regno, int *isfloat) struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); *isfloat = 0; - if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum) + if (tdep->ppc_gp0_regnum <= regno + && regno < tdep->ppc_gp0_regnum + ppc_num_gprs) return regno; - else if (FP0_REGNUM <= regno && regno <= FPLAST_REGNUM) + else if (tdep->ppc_fp0_regnum >= 0 + && tdep->ppc_fp0_regnum <= regno + && regno < tdep->ppc_fp0_regnum + ppc_num_fprs) { *isfloat = 1; - return regno - FP0_REGNUM + FPR0; + return regno - tdep->ppc_fp0_regnum + FPR0; } else if (regno == PC_REGNUM) return IAR; @@ -175,7 +177,8 @@ regmap (int regno, int *isfloat) return CTR; else if (regno == tdep->ppc_xer_regnum) return XER; - else if (regno == tdep->ppc_fpscr_regnum) + else if (tdep->ppc_fpscr_regnum >= 0 + && regno == tdep->ppc_fpscr_regnum) return FPSCR; else if (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum) return MQ; @@ -251,7 +254,7 @@ fetch_register (int regno) even if the register is really only 32 bits. */ long long buf; rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf); - if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8) + if (register_size (current_gdbarch, regno) == 8) memcpy (addr, &buf, 8); else *addr = buf; @@ -259,7 +262,7 @@ fetch_register (int regno) } if (!errno) - supply_register (regno, (char *) addr); + regcache_raw_supply (current_regcache, regno, (char *) addr); else { #if 0 @@ -279,7 +282,7 @@ store_register (int regno) int nr, isfloat; /* Fetch the register's value from the register cache. */ - regcache_collect (regno, addr); + regcache_raw_collect (current_regcache, regno, addr); /* -1 can be a successful return value, so infer errors from errno. */ errno = 0; @@ -320,7 +323,7 @@ store_register (int regno) /* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte area, even if the register is really only 32 bits. */ long long buf; - if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8) + if (register_size (current_gdbarch, regno) == 8) memcpy (&buf, addr, 8); else buf = *addr; @@ -350,15 +353,16 @@ fetch_inferior_registers (int regno) /* Read 32 general purpose registers. */ for (regno = tdep->ppc_gp0_regnum; - regno <= tdep->ppc_gplast_regnum; + regno < tdep->ppc_gp0_regnum + ppc_num_gprs; regno++) { fetch_register (regno); } /* Read general purpose floating point registers. */ - for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++) - fetch_register (regno); + if (tdep->ppc_fp0_regnum >= 0) + for (regno = 0; regno < ppc_num_fprs; regno++) + fetch_register (tdep->ppc_fp0_regnum + regno); /* Read special registers. */ fetch_register (PC_REGNUM); @@ -367,7 +371,8 @@ fetch_inferior_registers (int regno) fetch_register (tdep->ppc_lr_regnum); fetch_register (tdep->ppc_ctr_regnum); fetch_register (tdep->ppc_xer_regnum); - fetch_register (tdep->ppc_fpscr_regnum); + if (tdep->ppc_fpscr_regnum >= 0) + fetch_register (tdep->ppc_fpscr_regnum); if (tdep->ppc_mq_regnum >= 0) fetch_register (tdep->ppc_mq_regnum); } @@ -389,15 +394,16 @@ store_inferior_registers (int regno) /* Write general purpose registers first. */ for (regno = tdep->ppc_gp0_regnum; - regno <= tdep->ppc_gplast_regnum; + regno < tdep->ppc_gp0_regnum + ppc_num_gprs; regno++) { store_register (regno); } /* Write floating point registers. */ - for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++) - store_register (regno); + if (tdep->ppc_fp0_regnum >= 0) + for (regno = 0; regno < ppc_num_fprs; regno++) + store_register (tdep->ppc_fp0_regnum + regno); /* Write special registers. */ store_register (PC_REGNUM); @@ -406,7 +412,8 @@ store_inferior_registers (int regno) store_register (tdep->ppc_lr_regnum); store_register (tdep->ppc_ctr_regnum); store_register (tdep->ppc_xer_regnum); - store_register (tdep->ppc_fpscr_regnum); + if (tdep->ppc_fpscr_regnum >= 0) + store_register (tdep->ppc_fpscr_regnum); if (tdep->ppc_mq_regnum >= 0) store_register (tdep->ppc_mq_regnum); } @@ -435,10 +442,10 @@ read_word (CORE_ADDR from, int *to, int arch64) to debugger memory starting at MYADDR. Copy to inferior if WRITE is nonzero. - Returns the length copied, which is either the LEN argument or zero. - This xfer function does not do partial moves, since child_ops - doesn't allow memory operations to cross below us in the target stack - anyway. */ + Returns the length copied, which is either the LEN argument or + zero. This xfer function does not do partial moves, since + deprecated_child_ops doesn't allow memory operations to cross below + us in the target stack anyway. */ int child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, @@ -578,37 +585,60 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, if (ARCH64 ()) { - for (regi = 0; regi < 32; regi++) - supply_register (regi, (char *) ®s->r64.gpr[regi]); - - for (regi = 0; regi < 32; regi++) - supply_register (FP0_REGNUM + regi, (char *) ®s->r64.fpr[regi]); - - supply_register (PC_REGNUM, (char *) ®s->r64.iar); - supply_register (tdep->ppc_ps_regnum, (char *) ®s->r64.msr); - supply_register (tdep->ppc_cr_regnum, (char *) ®s->r64.cr); - supply_register (tdep->ppc_lr_regnum, (char *) ®s->r64.lr); - supply_register (tdep->ppc_ctr_regnum, (char *) ®s->r64.ctr); - supply_register (tdep->ppc_xer_regnum, (char *) ®s->r64.xer); - supply_register (tdep->ppc_fpscr_regnum, (char *) ®s->r64.fpscr); + for (regi = 0; regi < ppc_num_gprs; regi++) + regcache_raw_supply (current_regcache, tdep->ppc_gp0_regnum + regi, + (char *) ®s->r64.gpr[regi]); + + if (tdep->ppc_fp0_regnum >= 0) + for (regi = 0; regi < ppc_num_fprs; regi++) + regcache_raw_supply (current_regcache, tdep->ppc_fp0_regnum + regi, + (char *) ®s->r64.fpr[regi]); + + regcache_raw_supply (current_regcache, PC_REGNUM, + (char *) ®s->r64.iar); + regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum, + (char *) ®s->r64.msr); + regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum, + (char *) ®s->r64.cr); + regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum, + (char *) ®s->r64.lr); + regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum, + (char *) ®s->r64.ctr); + regcache_raw_supply (current_regcache, tdep->ppc_xer_regnum, + (char *) ®s->r64.xer); + if (tdep->ppc_fpscr_regnum >= 0) + regcache_raw_supply (current_regcache, tdep->ppc_fpscr_regnum, + (char *) ®s->r64.fpscr); } else { - for (regi = 0; regi < 32; regi++) - supply_register (regi, (char *) ®s->r32.gpr[regi]); - - for (regi = 0; regi < 32; regi++) - supply_register (FP0_REGNUM + regi, (char *) ®s->r32.fpr[regi]); - - supply_register (PC_REGNUM, (char *) ®s->r32.iar); - supply_register (tdep->ppc_ps_regnum, (char *) ®s->r32.msr); - supply_register (tdep->ppc_cr_regnum, (char *) ®s->r32.cr); - supply_register (tdep->ppc_lr_regnum, (char *) ®s->r32.lr); - supply_register (tdep->ppc_ctr_regnum, (char *) ®s->r32.ctr); - supply_register (tdep->ppc_xer_regnum, (char *) ®s->r32.xer); - supply_register (tdep->ppc_fpscr_regnum, (char *) ®s->r32.fpscr); + for (regi = 0; regi < ppc_num_gprs; regi++) + regcache_raw_supply (current_regcache, tdep->ppc_gp0_regnum + regi, + (char *) ®s->r32.gpr[regi]); + + if (tdep->ppc_fp0_regnum >= 0) + for (regi = 0; regi < ppc_num_fprs; regi++) + regcache_raw_supply (current_regcache, tdep->ppc_fp0_regnum + regi, + (char *) ®s->r32.fpr[regi]); + + regcache_raw_supply (current_regcache, PC_REGNUM, + (char *) ®s->r32.iar); + regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum, + (char *) ®s->r32.msr); + regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum, + (char *) ®s->r32.cr); + regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum, + (char *) ®s->r32.lr); + regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum, + (char *) ®s->r32.ctr); + regcache_raw_supply (current_regcache, tdep->ppc_xer_regnum, + (char *) ®s->r32.xer); + if (tdep->ppc_fpscr_regnum >= 0) + regcache_raw_supply (current_regcache, tdep->ppc_fpscr_regnum, + (char *) ®s->r32.fpscr); if (tdep->ppc_mq_regnum >= 0) - supply_register (tdep->ppc_mq_regnum, (char *) ®s->r32.mq); + regcache_raw_supply (current_regcache, tdep->ppc_mq_regnum, + (char *) ®s->r32.mq); } } @@ -880,8 +910,8 @@ vmap_ldinfo (LdInfo *ldi) /* Announce new object files. Doing this after symbol relocation makes aix-thread.c's job easier. */ - if (target_new_objfile_hook && vp->objfile) - target_new_objfile_hook (vp->objfile); + if (deprecated_target_new_objfile_hook && vp->objfile) + deprecated_target_new_objfile_hook (vp->objfile); /* There may be more, so we don't break out of the loop. */ } @@ -1162,8 +1192,8 @@ xcoff_relocate_core (struct target_ops *target) vmap_symtab (vp); - if (target_new_objfile_hook && vp != vmap && vp->objfile) - target_new_objfile_hook (vp->objfile); + if (deprecated_target_new_objfile_hook && vp != vmap && vp->objfile) + deprecated_target_new_objfile_hook (vp->objfile); } while (LDI_NEXT (ldi, arch64) != 0); vmap_exec (); @@ -1198,7 +1228,7 @@ find_toc_address (CORE_ADDR pc) : vp->objfile); } } - error ("Unable to find TOC entry for pc %s\n", local_hex_string (pc)); + error ("Unable to find TOC entry for pc %s\n", hex_string (pc)); } /* Register that we are able to handle rs6000 core file formats. */ @@ -1223,5 +1253,5 @@ _initialize_core_rs6000 (void) starting a child process. */ rs6000_set_host_arch_hook = set_host_arch; - add_core_fns (&rs6000_core_fns); + deprecated_add_core_fns (&rs6000_core_fns); } diff --git a/gnu/usr.bin/binutils/gdb/rs6000-tdep.c b/gnu/usr.bin/binutils/gdb/rs6000-tdep.c index 5eef8959115..37988a37f64 100644 --- a/gnu/usr.bin/binutils/gdb/rs6000-tdep.c +++ b/gnu/usr.bin/binutils/gdb/rs6000-tdep.c @@ -31,10 +31,15 @@ #include "objfiles.h" #include "arch-utils.h" #include "regcache.h" +#include "regset.h" #include "doublest.h" #include "value.h" #include "parser-defs.h" #include "osabi.h" +#include "infcall.h" +#include "sim-regno.h" +#include "gdb/sim-ppc.h" +#include "reggroups.h" #include "libbfd.h" /* for bfd_default_set_arch_mach */ #include "coff/internal.h" /* for libcoff.h */ @@ -50,6 +55,10 @@ #include "gdb_assert.h" #include "dis-asm.h" +#include "trad-frame.h" +#include "frame-unwind.h" +#include "frame-base.h" + /* If the kernel has to deliver a signal, it pushes a sigcontext structure on the stack and then calls the signal handler, passing the address of the sigcontext in an argument register. Usually @@ -93,6 +102,9 @@ struct reg unsigned char sz64; /* size on 64-bit arch, 0 if nonextant */ unsigned char fpr; /* whether register is floating-point */ unsigned char pseudo; /* whether register is pseudo */ + int spr_num; /* PowerPC SPR number, or -1 if not an SPR. + This is an ISA SPR number, not a GDB + register number. */ }; /* Breakpoint shadows for the single step instructions will be kept here. */ @@ -123,9 +135,6 @@ static CORE_ADDR branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety); static CORE_ADDR skip_prologue (CORE_ADDR, CORE_ADDR, struct rs6000_framedata *); -static void frame_get_saved_regs (struct frame_info * fi, - struct rs6000_framedata * fdatap); -static CORE_ADDR frame_initial_stack_address (struct frame_info *); /* Is REGNO an AltiVec register? Return 1 if so, 0 otherwise. */ int @@ -138,18 +147,343 @@ altivec_register_p (int regno) return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum); } -/* Use the architectures FP registers? */ + +/* Return true if REGNO is an SPE register, false otherwise. */ int -ppc_floating_point_unit_p (struct gdbarch *gdbarch) +spe_register_p (int regno) { - const struct bfd_arch_info *info = gdbarch_bfd_arch_info (gdbarch); - if (info->arch == bfd_arch_powerpc) - return (info->mach != bfd_mach_ppc_e500); - if (info->arch == bfd_arch_rs6000) + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + /* Is it a reference to EV0 -- EV31, and do we have those? */ + if (tdep->ppc_ev0_regnum >= 0 + && tdep->ppc_ev31_regnum >= 0 + && tdep->ppc_ev0_regnum <= regno && regno <= tdep->ppc_ev31_regnum) + return 1; + + /* Is it a reference to one of the raw upper GPR halves? */ + if (tdep->ppc_ev0_upper_regnum >= 0 + && tdep->ppc_ev0_upper_regnum <= regno + && regno < tdep->ppc_ev0_upper_regnum + ppc_num_gprs) + return 1; + + /* Is it a reference to the 64-bit accumulator, and do we have that? */ + if (tdep->ppc_acc_regnum >= 0 + && tdep->ppc_acc_regnum == regno) return 1; + + /* Is it a reference to the SPE floating-point status and control register, + and do we have that? */ + if (tdep->ppc_spefscr_regnum >= 0 + && tdep->ppc_spefscr_regnum == regno) + return 1; + return 0; } + +/* Return non-zero if the architecture described by GDBARCH has + floating-point registers (f0 --- f31 and fpscr). */ +int +ppc_floating_point_unit_p (struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + return (tdep->ppc_fp0_regnum >= 0 + && tdep->ppc_fpscr_regnum >= 0); +} + + +/* Check that TABLE[GDB_REGNO] is not already initialized, and then + set it to SIM_REGNO. + + This is a helper function for init_sim_regno_table, constructing + the table mapping GDB register numbers to sim register numbers; we + initialize every element in that table to -1 before we start + filling it in. */ +static void +set_sim_regno (int *table, int gdb_regno, int sim_regno) +{ + /* Make sure we don't try to assign any given GDB register a sim + register number more than once. */ + gdb_assert (table[gdb_regno] == -1); + table[gdb_regno] = sim_regno; +} + + +/* Initialize ARCH->tdep->sim_regno, the table mapping GDB register + numbers to simulator register numbers, based on the values placed + in the ARCH->tdep->ppc_foo_regnum members. */ +static void +init_sim_regno_table (struct gdbarch *arch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (arch); + int total_regs = gdbarch_num_regs (arch) + gdbarch_num_pseudo_regs (arch); + const struct reg *regs = tdep->regs; + int *sim_regno = GDBARCH_OBSTACK_CALLOC (arch, total_regs, int); + int i; + + /* Presume that all registers not explicitly mentioned below are + unavailable from the sim. */ + for (i = 0; i < total_regs; i++) + sim_regno[i] = -1; + + /* General-purpose registers. */ + for (i = 0; i < ppc_num_gprs; i++) + set_sim_regno (sim_regno, tdep->ppc_gp0_regnum + i, sim_ppc_r0_regnum + i); + + /* Floating-point registers. */ + if (tdep->ppc_fp0_regnum >= 0) + for (i = 0; i < ppc_num_fprs; i++) + set_sim_regno (sim_regno, + tdep->ppc_fp0_regnum + i, + sim_ppc_f0_regnum + i); + if (tdep->ppc_fpscr_regnum >= 0) + set_sim_regno (sim_regno, tdep->ppc_fpscr_regnum, sim_ppc_fpscr_regnum); + + set_sim_regno (sim_regno, gdbarch_pc_regnum (arch), sim_ppc_pc_regnum); + set_sim_regno (sim_regno, tdep->ppc_ps_regnum, sim_ppc_ps_regnum); + set_sim_regno (sim_regno, tdep->ppc_cr_regnum, sim_ppc_cr_regnum); + + /* Segment registers. */ + if (tdep->ppc_sr0_regnum >= 0) + for (i = 0; i < ppc_num_srs; i++) + set_sim_regno (sim_regno, + tdep->ppc_sr0_regnum + i, + sim_ppc_sr0_regnum + i); + + /* Altivec registers. */ + if (tdep->ppc_vr0_regnum >= 0) + { + for (i = 0; i < ppc_num_vrs; i++) + set_sim_regno (sim_regno, + tdep->ppc_vr0_regnum + i, + sim_ppc_vr0_regnum + i); + + /* FIXME: jimb/2004-07-15: when we have tdep->ppc_vscr_regnum, + we can treat this more like the other cases. */ + set_sim_regno (sim_regno, + tdep->ppc_vr0_regnum + ppc_num_vrs, + sim_ppc_vscr_regnum); + } + /* vsave is a special-purpose register, so the code below handles it. */ + + /* SPE APU (E500) registers. */ + if (tdep->ppc_ev0_regnum >= 0) + for (i = 0; i < ppc_num_gprs; i++) + set_sim_regno (sim_regno, + tdep->ppc_ev0_regnum + i, + sim_ppc_ev0_regnum + i); + if (tdep->ppc_ev0_upper_regnum >= 0) + for (i = 0; i < ppc_num_gprs; i++) + set_sim_regno (sim_regno, + tdep->ppc_ev0_upper_regnum + i, + sim_ppc_rh0_regnum + i); + if (tdep->ppc_acc_regnum >= 0) + set_sim_regno (sim_regno, tdep->ppc_acc_regnum, sim_ppc_acc_regnum); + /* spefscr is a special-purpose register, so the code below handles it. */ + + /* Now handle all special-purpose registers. Verify that they + haven't mistakenly been assigned numbers by any of the above + code). */ + for (i = 0; i < total_regs; i++) + if (regs[i].spr_num >= 0) + set_sim_regno (sim_regno, i, regs[i].spr_num + sim_ppc_spr0_regnum); + + /* Drop the initialized array into place. */ + tdep->sim_regno = sim_regno; +} + + +/* Given a GDB register number REG, return the corresponding SIM + register number. */ +static int +rs6000_register_sim_regno (int reg) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + int sim_regno; + + gdb_assert (0 <= reg && reg <= NUM_REGS + NUM_PSEUDO_REGS); + sim_regno = tdep->sim_regno[reg]; + + if (sim_regno >= 0) + return sim_regno; + else + return LEGACY_SIM_REGNO_IGNORE; +} + + + +/* Register set support functions. */ + +static void +ppc_supply_reg (struct regcache *regcache, int regnum, + const char *regs, size_t offset) +{ + if (regnum != -1 && offset != -1) + regcache_raw_supply (regcache, regnum, regs + offset); +} + +static void +ppc_collect_reg (const struct regcache *regcache, int regnum, + char *regs, size_t offset) +{ + if (regnum != -1 && offset != -1) + regcache_raw_collect (regcache, regnum, regs + offset); +} + +/* Supply register REGNUM in the general-purpose register set REGSET + from the buffer specified by GREGS and LEN to register cache + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ + +void +ppc_supply_gregset (const struct regset *regset, struct regcache *regcache, + int regnum, const void *gregs, size_t len) +{ + struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + const struct ppc_reg_offsets *offsets = regset->descr; + size_t offset; + int i; + + for (i = tdep->ppc_gp0_regnum, offset = offsets->r0_offset; + i < tdep->ppc_gp0_regnum + ppc_num_gprs; + i++, offset += 4) + { + if (regnum == -1 || regnum == i) + ppc_supply_reg (regcache, i, gregs, offset); + } + + if (regnum == -1 || regnum == PC_REGNUM) + ppc_supply_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset); + if (regnum == -1 || regnum == tdep->ppc_ps_regnum) + ppc_supply_reg (regcache, tdep->ppc_ps_regnum, + gregs, offsets->ps_offset); + if (regnum == -1 || regnum == tdep->ppc_cr_regnum) + ppc_supply_reg (regcache, tdep->ppc_cr_regnum, + gregs, offsets->cr_offset); + if (regnum == -1 || regnum == tdep->ppc_lr_regnum) + ppc_supply_reg (regcache, tdep->ppc_lr_regnum, + gregs, offsets->lr_offset); + if (regnum == -1 || regnum == tdep->ppc_ctr_regnum) + ppc_supply_reg (regcache, tdep->ppc_ctr_regnum, + gregs, offsets->ctr_offset); + if (regnum == -1 || regnum == tdep->ppc_xer_regnum) + ppc_supply_reg (regcache, tdep->ppc_xer_regnum, + gregs, offsets->cr_offset); + if (regnum == -1 || regnum == tdep->ppc_mq_regnum) + ppc_supply_reg (regcache, tdep->ppc_mq_regnum, gregs, offsets->mq_offset); +} + +/* Supply register REGNUM in the floating-point register set REGSET + from the buffer specified by FPREGS and LEN to register cache + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ + +void +ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache, + int regnum, const void *fpregs, size_t len) +{ + struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + const struct ppc_reg_offsets *offsets = regset->descr; + size_t offset; + int i; + + gdb_assert (ppc_floating_point_unit_p (gdbarch)); + + offset = offsets->f0_offset; + for (i = tdep->ppc_fp0_regnum; + i < tdep->ppc_fp0_regnum + ppc_num_fprs; + i++, offset += 4) + { + if (regnum == -1 || regnum == i) + ppc_supply_reg (regcache, i, fpregs, offset); + } + + if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum) + ppc_supply_reg (regcache, tdep->ppc_fpscr_regnum, + fpregs, offsets->fpscr_offset); +} + +/* Collect register REGNUM in the general-purpose register set + REGSET. from register cache REGCACHE into the buffer specified by + GREGS and LEN. If REGNUM is -1, do this for all registers in + REGSET. */ + +void +ppc_collect_gregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *gregs, size_t len) +{ + struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + const struct ppc_reg_offsets *offsets = regset->descr; + size_t offset; + int i; + + offset = offsets->r0_offset; + for (i = tdep->ppc_gp0_regnum; + i < tdep->ppc_gp0_regnum + ppc_num_gprs; + i++, offset += 4) + { + if (regnum == -1 || regnum == i) + ppc_collect_reg (regcache, i, gregs, offset); + } + + if (regnum == -1 || regnum == PC_REGNUM) + ppc_collect_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset); + if (regnum == -1 || regnum == tdep->ppc_ps_regnum) + ppc_collect_reg (regcache, tdep->ppc_ps_regnum, + gregs, offsets->ps_offset); + if (regnum == -1 || regnum == tdep->ppc_cr_regnum) + ppc_collect_reg (regcache, tdep->ppc_cr_regnum, + gregs, offsets->cr_offset); + if (regnum == -1 || regnum == tdep->ppc_lr_regnum) + ppc_collect_reg (regcache, tdep->ppc_lr_regnum, + gregs, offsets->lr_offset); + if (regnum == -1 || regnum == tdep->ppc_ctr_regnum) + ppc_collect_reg (regcache, tdep->ppc_ctr_regnum, + gregs, offsets->ctr_offset); + if (regnum == -1 || regnum == tdep->ppc_xer_regnum) + ppc_collect_reg (regcache, tdep->ppc_xer_regnum, + gregs, offsets->xer_offset); + if (regnum == -1 || regnum == tdep->ppc_mq_regnum) + ppc_collect_reg (regcache, tdep->ppc_mq_regnum, + gregs, offsets->mq_offset); +} + +/* Collect register REGNUM in the floating-point register set + REGSET. from register cache REGCACHE into the buffer specified by + FPREGS and LEN. If REGNUM is -1, do this for all registers in + REGSET. */ + +void +ppc_collect_fpregset (const struct regset *regset, + const struct regcache *regcache, + int regnum, void *fpregs, size_t len) +{ + struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + const struct ppc_reg_offsets *offsets = regset->descr; + size_t offset; + int i; + + gdb_assert (ppc_floating_point_unit_p (gdbarch)); + + offset = offsets->f0_offset; + for (i = tdep->ppc_fp0_regnum; + i <= tdep->ppc_fp0_regnum + ppc_num_fprs; + i++, offset += 4) + { + if (regnum == -1 || regnum == i) + ppc_collect_reg (regcache, regnum, fpregs, offset); + } + + if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum) + ppc_collect_reg (regcache, tdep->ppc_fpscr_regnum, + fpregs, offsets->fpscr_offset); +} + + /* Read a LEN-byte address from debugged memory address MEMADDR. */ static CORE_ADDR @@ -179,58 +513,6 @@ struct frame_extra_info CORE_ADDR initial_sp; /* initial stack pointer. */ }; -void -rs6000_init_extra_frame_info (int fromleaf, struct frame_info *fi) -{ - struct frame_extra_info *extra_info = - frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info)); - extra_info->initial_sp = 0; - if (get_next_frame (fi) != NULL - && get_frame_pc (fi) < TEXT_SEGMENT_BASE) - /* We're in get_prev_frame */ - /* and this is a special signal frame. */ - /* (fi->pc will be some low address in the kernel, */ - /* to which the signal handler returns). */ - deprecated_set_frame_type (fi, SIGTRAMP_FRAME); -} - -/* Put here the code to store, into a struct frame_saved_regs, - the addresses of the saved registers of frame described by FRAME_INFO. - This includes special registers such as pc and fp saved in special - ways in the stack frame. sp is even more special: - the address we return for it IS the sp for the next frame. */ - -/* In this implementation for RS/6000, we do *not* save sp. I am - not sure if it will be needed. The following function takes care of gpr's - and fpr's only. */ - -void -rs6000_frame_init_saved_regs (struct frame_info *fi) -{ - frame_get_saved_regs (fi, NULL); -} - -static CORE_ADDR -rs6000_frame_args_address (struct frame_info *fi) -{ - struct frame_extra_info *extra_info = get_frame_extra_info (fi); - if (extra_info->initial_sp != 0) - return extra_info->initial_sp; - else - return frame_initial_stack_address (fi); -} - -/* Immediately after a function call, return the saved pc. - Can't go through the frames for this because on some machines - the new frame is not set up until the new function executes - some instructions. */ - -static CORE_ADDR -rs6000_saved_pc_after_call (struct frame_info *fi) -{ - return read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum); -} - /* Get the ith function argument for the current function. */ static CORE_ADDR rs6000_fetch_pointer_argument (struct frame_info *frame, int argi, @@ -470,6 +752,76 @@ refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc) return lim_pc; } +/* Return nonzero if the given instruction OP can be part of the prologue + of a function and saves a parameter on the stack. FRAMEP should be + set if one of the previous instructions in the function has set the + Frame Pointer. */ + +static int +store_param_on_stack_p (unsigned long op, int framep, int *r0_contains_arg) +{ + /* Move parameters from argument registers to temporary register. */ + if ((op & 0xfc0007fe) == 0x7c000378) /* mr(.) Rx,Ry */ + { + /* Rx must be scratch register r0. */ + const int rx_regno = (op >> 16) & 31; + /* Ry: Only r3 - r10 are used for parameter passing. */ + const int ry_regno = GET_SRC_REG (op); + + if (rx_regno == 0 && ry_regno >= 3 && ry_regno <= 10) + { + *r0_contains_arg = 1; + return 1; + } + else + return 0; + } + + /* Save a General Purpose Register on stack. */ + + if ((op & 0xfc1f0003) == 0xf8010000 || /* std Rx,NUM(r1) */ + (op & 0xfc1f0000) == 0xd8010000) /* stfd Rx,NUM(r1) */ + { + /* Rx: Only r3 - r10 are used for parameter passing. */ + const int rx_regno = GET_SRC_REG (op); + + return (rx_regno >= 3 && rx_regno <= 10); + } + + /* Save a General Purpose Register on stack via the Frame Pointer. */ + + if (framep && + ((op & 0xfc1f0000) == 0x901f0000 || /* st rx,NUM(r31) */ + (op & 0xfc1f0000) == 0x981f0000 || /* stb Rx,NUM(r31) */ + (op & 0xfc1f0000) == 0xd81f0000)) /* stfd Rx,NUM(r31) */ + { + /* Rx: Usually, only r3 - r10 are used for parameter passing. + However, the compiler sometimes uses r0 to hold an argument. */ + const int rx_regno = GET_SRC_REG (op); + + return ((rx_regno >= 3 && rx_regno <= 10) + || (rx_regno == 0 && *r0_contains_arg)); + } + + if ((op & 0xfc1f0000) == 0xfc010000) /* frsp, fp?,NUM(r1) */ + { + /* Only f2 - f8 are used for parameter passing. */ + const int src_regno = GET_SRC_REG (op); + + return (src_regno >= 2 && src_regno <= 8); + } + + if (framep && ((op & 0xfc1f0000) == 0xfc1f0000)) /* frsp, fp?,NUM(r31) */ + { + /* Only f2 - f8 are used for parameter passing. */ + const int src_regno = GET_SRC_REG (op); + + return (src_regno >= 2 && src_regno <= 8); + } + + /* Not an insn that saves a parameter on stack. */ + return 0; +} static CORE_ADDR skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) @@ -492,6 +844,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) int minimal_toc_loaded = 0; int prev_insn_was_prologue_insn = 1; int num_skip_non_prologue_insns = 0; + int r0_contains_arg = 0; const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch); struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); @@ -541,13 +894,34 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) if ((op & 0xfc1fffff) == 0x7c0802a6) { /* mflr Rx */ - lr_reg = (op & 0x03e00000); + /* Since shared library / PIC code, which needs to get its + address at runtime, can appear to save more than one link + register vis: + + *INDENT-OFF* + stwu r1,-304(r1) + mflr r3 + bl 0xff570d0 (blrl) + stw r30,296(r1) + mflr r30 + stw r31,300(r1) + stw r3,308(r1); + ... + *INDENT-ON* + + remember just the first one, but skip over additional + ones. */ + if (lr_reg < 0) + lr_reg = (op & 0x03e00000); + if (lr_reg == 0) + r0_contains_arg = 0; continue; - } else if ((op & 0xfc1fffff) == 0x7c000026) { /* mfcr Rx */ cr_reg = (op & 0x03e00000); + if (cr_reg == 0) + r0_contains_arg = 0; continue; } @@ -594,6 +968,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) for >= 32k frames */ fdata->offset = (op & 0x0000ffff) << 16; fdata->frameless = 0; + r0_contains_arg = 0; continue; } @@ -602,6 +977,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) lf of >= 32k frames */ fdata->offset |= (op & 0x0000ffff); fdata->frameless = 0; + r0_contains_arg = 0; continue; } @@ -734,19 +1110,9 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) /* store parameters in stack */ } - else if ((op & 0xfc1f0003) == 0xf8010000 || /* std rx,NUM(r1) */ - (op & 0xfc1f0000) == 0xd8010000 || /* stfd Rx,NUM(r1) */ - (op & 0xfc1f0000) == 0xfc010000) /* frsp, fp?,NUM(r1) */ - { - continue; - - /* store parameters in stack via frame pointer */ - } - else if (framep && - ((op & 0xfc1f0000) == 0x901f0000 || /* st rx,NUM(r1) */ - (op & 0xfc1f0000) == 0xd81f0000 || /* stfd Rx,NUM(r1) */ - (op & 0xfc1f0000) == 0xfc1f0000)) - { /* frsp, fp?,NUM(r1) */ + /* Move parameters from argument registers to temporary register. */ + else if (store_param_on_stack_p (op, framep, &r0_contains_arg)) + { continue; /* Set up frame pointer */ @@ -814,8 +1180,15 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) else if ((op & 0xffff0000) == 0x38000000 /* li r0, SIMM */ || (op & 0xffff0000) == 0x39c00000) /* li r14, SIMM */ { + if ((op & 0xffff0000) == 0x38000000) + r0_contains_arg = 0; li_found_pc = pc; vr_saved_offset = SIGNED_SHORT (op); + + /* This insn by itself is not part of the prologue, unless + if part of the pair of insns mentioned above. So do not + record this insn as part of the prologue yet. */ + prev_insn_was_prologue_insn = 0; } /* Store vector register S at (r31+r0) aligned to 16 bytes. */ /* 011111 sssss 11111 00000 00111001110 */ @@ -1007,79 +1380,6 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata) *************************************************************************/ -/* Pop the innermost frame, go back to the caller. */ - -static void -rs6000_pop_frame (void) -{ - CORE_ADDR pc, lr, sp, prev_sp, addr; /* %pc, %lr, %sp */ - struct rs6000_framedata fdata; - struct frame_info *frame = get_current_frame (); - int ii, wordsize; - - pc = read_pc (); - sp = get_frame_base (frame); - - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame), - get_frame_base (frame), - get_frame_base (frame))) - { - generic_pop_dummy_frame (); - flush_cached_frames (); - return; - } - - /* Make sure that all registers are valid. */ - deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES); - - /* Figure out previous %pc value. If the function is frameless, it is - still in the link register, otherwise walk the frames and retrieve the - saved %pc value in the previous frame. */ - - addr = get_frame_func (frame); - (void) skip_prologue (addr, get_frame_pc (frame), &fdata); - - wordsize = gdbarch_tdep (current_gdbarch)->wordsize; - if (fdata.frameless) - prev_sp = sp; - else - prev_sp = read_memory_addr (sp, wordsize); - if (fdata.lr_offset == 0) - lr = read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum); - else - lr = read_memory_addr (prev_sp + fdata.lr_offset, wordsize); - - /* reset %pc value. */ - write_register (PC_REGNUM, lr); - - /* reset register values if any was saved earlier. */ - - if (fdata.saved_gpr != -1) - { - addr = prev_sp + fdata.gpr_offset; - for (ii = fdata.saved_gpr; ii <= 31; ++ii) - { - read_memory (addr, &deprecated_registers[DEPRECATED_REGISTER_BYTE (ii)], - wordsize); - addr += wordsize; - } - } - - if (fdata.saved_fpr != -1) - { - addr = prev_sp + fdata.fpr_offset; - for (ii = fdata.saved_fpr; ii <= 31; ++ii) - { - read_memory (addr, &deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + FP0_REGNUM)], 8); - addr += 8; - } - } - - write_register (SP_REGNUM, prev_sp); - target_store_registers (-1); - flush_cached_frames (); -} - /* All the ABI's require 16 byte alignment. */ static CORE_ADDR rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) @@ -1104,7 +1404,7 @@ rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) starting from r4. */ static CORE_ADDR -rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -1117,12 +1417,18 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, char tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; + CORE_ADDR func_addr = find_function_addr (function, NULL); struct value *arg = 0; struct type *type; CORE_ADDR saved_sp; + /* The calling convention this function implements assumes the + processor has floating-point registers. We shouldn't be using it + on PPC variants that lack them. */ + gdb_assert (ppc_floating_point_unit_p (current_gdbarch)); + /* The first eight words of ther arguments are passed in registers. Copy them appropriately. */ ii = 0; @@ -1159,7 +1465,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii) { - int reg_size = DEPRECATED_REGISTER_RAW_SIZE (ii + 3); + int reg_size = register_size (current_gdbarch, ii + 3); arg = args[argno]; type = check_typedef (VALUE_TYPE (arg)); @@ -1172,13 +1478,11 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, There are 13 fpr's reserved for passing parameters. At this point there is no way we would run out of them. */ - if (len > 8) - printf_unfiltered ( - "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno); + gdb_assert (len <= 8); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)], - VALUE_CONTENTS (arg), - len); + regcache_cooked_write (regcache, + tdep->ppc_fp0_regnum + 1 + f_argno, + VALUE_CONTENTS (arg)); ++f_argno; } @@ -1188,12 +1492,15 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, /* Argument takes more than one register. */ while (argbytes < len) { - memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, - reg_size); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], + char word[MAX_REGISTER_SIZE]; + memset (word, 0, reg_size); + memcpy (word, ((char *) VALUE_CONTENTS (arg)) + argbytes, (len - argbytes) > reg_size ? reg_size : len - argbytes); + regcache_cooked_write (regcache, + tdep->ppc_gp0_regnum + 3 + ii, + word); ++ii, argbytes += reg_size; if (ii >= 8) @@ -1206,9 +1513,11 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, { /* Argument can fit in one register. No problem. */ int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0; - memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, reg_size); - memcpy ((char *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)] + adj, - VALUE_CONTENTS (arg), len); + char word[MAX_REGISTER_SIZE]; + + memset (word, 0, reg_size); + memcpy (word, VALUE_CONTENTS (arg), len); + regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word); } ++argno; } @@ -1285,17 +1594,17 @@ ran_out_of_registers_for_arguments: if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13) { - if (len > 8) - printf_unfiltered ( - "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno); + gdb_assert (len <= 8); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)], - VALUE_CONTENTS (arg), - len); + regcache_cooked_write (regcache, + tdep->ppc_fp0_regnum + 1 + f_argno, + VALUE_CONTENTS (arg)); ++f_argno; } - write_memory (sp + 24 + (ii * 4), (char *) VALUE_CONTENTS (arg), len); + write_memory (sp + 24 + (ii * 4), + (char *) VALUE_CONTENTS (arg), + len); ii += ((len + 3) & -4) / 4; } } @@ -1346,25 +1655,23 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf) int offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + /* The calling convention this function implements assumes the + processor has floating-point registers. We shouldn't be using it + on PPC variants that lack them. */ + gdb_assert (ppc_floating_point_unit_p (current_gdbarch)); + if (TYPE_CODE (valtype) == TYPE_CODE_FLT) { - double dd; - float ff; /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes. We need to truncate the return value into float size (4 byte) if necessary. */ - if (TYPE_LENGTH (valtype) > 4) /* this is a double */ - memcpy (valbuf, - ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], - TYPE_LENGTH (valtype)); - else - { /* float */ - memcpy (&dd, ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8); - ff = (float) dd; - memcpy (valbuf, &ff, sizeof (float)); - } + convert_typed_floating (®buf[DEPRECATED_REGISTER_BYTE + (tdep->ppc_fp0_regnum + 1)], + builtin_type_double, + valbuf, + valtype); } else if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_LENGTH (valtype) == 16 @@ -1377,8 +1684,8 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf) { /* return value is copied starting from r3. */ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG - && TYPE_LENGTH (valtype) < DEPRECATED_REGISTER_RAW_SIZE (3)) - offset = DEPRECATED_REGISTER_RAW_SIZE (3) - TYPE_LENGTH (valtype); + && TYPE_LENGTH (valtype) < register_size (current_gdbarch, 3)) + offset = register_size (current_gdbarch, 3) - TYPE_LENGTH (valtype); memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (3) + offset, @@ -1479,317 +1786,6 @@ rs6000_skip_trampoline_code (CORE_ADDR pc) return pc; } -/* Determines whether the function FI has a frame on the stack or not. */ - -int -rs6000_frameless_function_invocation (struct frame_info *fi) -{ - CORE_ADDR func_start; - struct rs6000_framedata fdata; - - /* Don't even think about framelessness except on the innermost frame - or if the function was interrupted by a signal. */ - if (get_next_frame (fi) != NULL - && !(get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME)) - return 0; - - func_start = get_frame_func (fi); - - /* If we failed to find the start of the function, it is a mistake - to inspect the instructions. */ - - if (!func_start) - { - /* A frame with a zero PC is usually created by dereferencing a NULL - function pointer, normally causing an immediate core dump of the - inferior. Mark function as frameless, as the inferior has no chance - of setting up a stack frame. */ - if (get_frame_pc (fi) == 0) - return 1; - else - return 0; - } - - (void) skip_prologue (func_start, get_frame_pc (fi), &fdata); - return fdata.frameless; -} - -/* Return the PC saved in a frame. */ - -CORE_ADDR -rs6000_frame_saved_pc (struct frame_info *fi) -{ - CORE_ADDR func_start; - struct rs6000_framedata fdata; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - int wordsize = tdep->wordsize; - - if ((get_frame_type (fi) == SIGTRAMP_FRAME)) - return read_memory_addr (get_frame_base (fi) + SIG_FRAME_PC_OFFSET, - wordsize); - - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), - get_frame_base (fi), - get_frame_base (fi))) - return deprecated_read_register_dummy (get_frame_pc (fi), - get_frame_base (fi), PC_REGNUM); - - func_start = get_frame_func (fi); - - /* If we failed to find the start of the function, it is a mistake - to inspect the instructions. */ - if (!func_start) - return 0; - - (void) skip_prologue (func_start, get_frame_pc (fi), &fdata); - - if (fdata.lr_offset == 0 && get_next_frame (fi) != NULL) - { - if ((get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME)) - return read_memory_addr ((get_frame_base (get_next_frame (fi)) - + SIG_FRAME_LR_OFFSET), - wordsize); - else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0)) - /* The link register wasn't saved by this frame and the next - (inner, newer) frame is a dummy. Get the link register - value by unwinding it from that [dummy] frame. */ - { - ULONGEST lr; - frame_unwind_unsigned_register (get_next_frame (fi), - tdep->ppc_lr_regnum, &lr); - return lr; - } - else - return read_memory_addr (DEPRECATED_FRAME_CHAIN (fi) - + tdep->lr_frame_offset, - wordsize); - } - - if (fdata.lr_offset == 0) - return read_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum); - - return read_memory_addr (DEPRECATED_FRAME_CHAIN (fi) + fdata.lr_offset, - wordsize); -} - -/* If saved registers of frame FI are not known yet, read and cache them. - &FDATAP contains rs6000_framedata; TDATAP can be NULL, - in which case the framedata are read. */ - -static void -frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap) -{ - CORE_ADDR frame_addr; - struct rs6000_framedata work_fdata; - struct gdbarch_tdep * tdep = gdbarch_tdep (current_gdbarch); - int wordsize = tdep->wordsize; - - if (deprecated_get_frame_saved_regs (fi)) - return; - - if (fdatap == NULL) - { - fdatap = &work_fdata; - (void) skip_prologue (get_frame_func (fi), get_frame_pc (fi), fdatap); - } - - frame_saved_regs_zalloc (fi); - - /* If there were any saved registers, figure out parent's stack - pointer. */ - /* The following is true only if the frame doesn't have a call to - alloca(), FIXME. */ - - if (fdatap->saved_fpr == 0 - && fdatap->saved_gpr == 0 - && fdatap->saved_vr == 0 - && fdatap->saved_ev == 0 - && fdatap->lr_offset == 0 - && fdatap->cr_offset == 0 - && fdatap->vr_offset == 0 - && fdatap->ev_offset == 0) - frame_addr = 0; - else - /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most - address of the current frame. Things might be easier if the - ->frame pointed to the outer-most address of the frame. In the - mean time, the address of the prev frame is used as the base - address of this frame. */ - frame_addr = DEPRECATED_FRAME_CHAIN (fi); - - /* if != -1, fdatap->saved_fpr is the smallest number of saved_fpr. - All fpr's from saved_fpr to fp31 are saved. */ - - if (fdatap->saved_fpr >= 0) - { - int i; - CORE_ADDR fpr_addr = frame_addr + fdatap->fpr_offset; - for (i = fdatap->saved_fpr; i < 32; i++) - { - deprecated_get_frame_saved_regs (fi)[FP0_REGNUM + i] = fpr_addr; - fpr_addr += 8; - } - } - - /* if != -1, fdatap->saved_gpr is the smallest number of saved_gpr. - All gpr's from saved_gpr to gpr31 are saved. */ - - if (fdatap->saved_gpr >= 0) - { - int i; - CORE_ADDR gpr_addr = frame_addr + fdatap->gpr_offset; - for (i = fdatap->saved_gpr; i < 32; i++) - { - deprecated_get_frame_saved_regs (fi)[tdep->ppc_gp0_regnum + i] = gpr_addr; - gpr_addr += wordsize; - } - } - - /* if != -1, fdatap->saved_vr is the smallest number of saved_vr. - All vr's from saved_vr to vr31 are saved. */ - if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1) - { - if (fdatap->saved_vr >= 0) - { - int i; - CORE_ADDR vr_addr = frame_addr + fdatap->vr_offset; - for (i = fdatap->saved_vr; i < 32; i++) - { - deprecated_get_frame_saved_regs (fi)[tdep->ppc_vr0_regnum + i] = vr_addr; - vr_addr += DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum); - } - } - } - - /* if != -1, fdatap->saved_ev is the smallest number of saved_ev. - All vr's from saved_ev to ev31 are saved. ????? */ - if (tdep->ppc_ev0_regnum != -1 && tdep->ppc_ev31_regnum != -1) - { - if (fdatap->saved_ev >= 0) - { - int i; - CORE_ADDR ev_addr = frame_addr + fdatap->ev_offset; - for (i = fdatap->saved_ev; i < 32; i++) - { - deprecated_get_frame_saved_regs (fi)[tdep->ppc_ev0_regnum + i] = ev_addr; - deprecated_get_frame_saved_regs (fi)[tdep->ppc_gp0_regnum + i] = ev_addr + 4; - ev_addr += DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_ev0_regnum); - } - } - } - - /* If != 0, fdatap->cr_offset is the offset from the frame that holds - the CR. */ - if (fdatap->cr_offset != 0) - deprecated_get_frame_saved_regs (fi)[tdep->ppc_cr_regnum] = frame_addr + fdatap->cr_offset; - - /* If != 0, fdatap->lr_offset is the offset from the frame that holds - the LR. */ - if (fdatap->lr_offset != 0) - deprecated_get_frame_saved_regs (fi)[tdep->ppc_lr_regnum] = frame_addr + fdatap->lr_offset; - - /* If != 0, fdatap->vrsave_offset is the offset from the frame that holds - the VRSAVE. */ - if (fdatap->vrsave_offset != 0) - deprecated_get_frame_saved_regs (fi)[tdep->ppc_vrsave_regnum] = frame_addr + fdatap->vrsave_offset; -} - -/* Return the address of a frame. This is the inital %sp value when the frame - was first allocated. For functions calling alloca(), it might be saved in - an alloca register. */ - -static CORE_ADDR -frame_initial_stack_address (struct frame_info *fi) -{ - CORE_ADDR tmpaddr; - struct rs6000_framedata fdata; - struct frame_info *callee_fi; - - /* If the initial stack pointer (frame address) of this frame is known, - just return it. */ - - if (get_frame_extra_info (fi)->initial_sp) - return get_frame_extra_info (fi)->initial_sp; - - /* Find out if this function is using an alloca register. */ - - (void) skip_prologue (get_frame_func (fi), get_frame_pc (fi), &fdata); - - /* If saved registers of this frame are not known yet, read and - cache them. */ - - if (!deprecated_get_frame_saved_regs (fi)) - frame_get_saved_regs (fi, &fdata); - - /* If no alloca register used, then fi->frame is the value of the %sp for - this frame, and it is good enough. */ - - if (fdata.alloca_reg < 0) - { - get_frame_extra_info (fi)->initial_sp = get_frame_base (fi); - return get_frame_extra_info (fi)->initial_sp; - } - - /* There is an alloca register, use its value, in the current frame, - as the initial stack pointer. */ - { - char tmpbuf[MAX_REGISTER_SIZE]; - if (frame_register_read (fi, fdata.alloca_reg, tmpbuf)) - { - get_frame_extra_info (fi)->initial_sp - = extract_unsigned_integer (tmpbuf, - DEPRECATED_REGISTER_RAW_SIZE (fdata.alloca_reg)); - } - else - /* NOTE: cagney/2002-04-17: At present the only time - frame_register_read will fail is when the register isn't - available. If that does happen, use the frame. */ - get_frame_extra_info (fi)->initial_sp = get_frame_base (fi); - } - return get_frame_extra_info (fi)->initial_sp; -} - -/* Describe the pointer in each stack frame to the previous stack frame - (its caller). */ - -/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces - the frame's chain-pointer. */ - -/* In the case of the RS/6000, the frame's nominal address - is the address of a 4-byte word containing the calling frame's address. */ - -CORE_ADDR -rs6000_frame_chain (struct frame_info *thisframe) -{ - CORE_ADDR fp, fpp, lr; - int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; - - if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe), - get_frame_base (thisframe), - get_frame_base (thisframe))) - /* A dummy frame always correctly chains back to the previous - frame. */ - return read_memory_addr (get_frame_base (thisframe), wordsize); - - if (deprecated_inside_entry_file (get_frame_pc (thisframe)) - || get_frame_pc (thisframe) == entry_point_address ()) - return 0; - - if ((get_frame_type (thisframe) == SIGTRAMP_FRAME)) - fp = read_memory_addr (get_frame_base (thisframe) + SIG_FRAME_FP_OFFSET, - wordsize); - else if (get_next_frame (thisframe) != NULL - && (get_frame_type (get_next_frame (thisframe)) == SIGTRAMP_FRAME) - && (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P () - && DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (thisframe))) - /* A frameless function interrupted by a signal did not change the - frame pointer. */ - fp = get_frame_base (thisframe); - else - fp = read_memory_addr (get_frame_base (thisframe), wordsize); - return fp; -} - /* Return the size of register REG when words are WORDSIZE bytes long. If REG isn't available with that word size, return 0. */ @@ -1813,33 +1809,13 @@ rs6000_register_name (int n) return reg->name; } -/* Index within `registers' of the first byte of the space for - register N. */ - -static int -rs6000_register_byte (int n) -{ - return gdbarch_tdep (current_gdbarch)->regoff[n]; -} - -/* Return the number of bytes of storage in the actual machine representation - for register N if that register is available, else return 0. */ - -static int -rs6000_register_raw_size (int n) -{ - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - const struct reg *reg = tdep->regs + n; - return regsize (reg, tdep->wordsize); -} - /* Return the GDB type object for the "standard" data type of data in register N. */ static struct type * -rs6000_register_virtual_type (int n) +rs6000_register_type (struct gdbarch *gdbarch, int n) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); const struct reg *reg = tdep->regs + n; if (reg->fpr) @@ -1852,12 +1828,12 @@ rs6000_register_virtual_type (int n) case 0: return builtin_type_int0; case 4: - return builtin_type_int32; + return builtin_type_uint32; case 8: if (tdep->ppc_ev0_regnum <= n && n <= tdep->ppc_ev31_regnum) return builtin_type_vec64; else - return builtin_type_int64; + return builtin_type_uint64; break; case 16: return builtin_type_vec128; @@ -1869,166 +1845,299 @@ rs6000_register_virtual_type (int n) } } -/* Return whether register N requires conversion when moving from raw format - to virtual format. - - The register format for RS/6000 floating point registers is always +/* The register format for RS/6000 floating point registers is always double, we need a conversion if the memory format is float. */ static int -rs6000_register_convertible (int n) +rs6000_convert_register_p (int regnum, struct type *type) { - const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + n; - return reg->fpr; + const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum; + + return (reg->fpr + && TYPE_CODE (type) == TYPE_CODE_FLT + && TYPE_LENGTH (type) != TYPE_LENGTH (builtin_type_double)); } -/* Convert data from raw format for register N in buffer FROM - to virtual format with type TYPE in buffer TO. */ - static void -rs6000_register_convert_to_virtual (int n, struct type *type, - char *from, char *to) +rs6000_register_to_value (struct frame_info *frame, + int regnum, + struct type *type, + void *to) { - if (TYPE_LENGTH (type) != DEPRECATED_REGISTER_RAW_SIZE (n)) - { - double val = deprecated_extract_floating (from, DEPRECATED_REGISTER_RAW_SIZE (n)); - deprecated_store_floating (to, TYPE_LENGTH (type), val); - } - else - memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (n)); + const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum; + char from[MAX_REGISTER_SIZE]; + + gdb_assert (reg->fpr); + gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT); + + get_frame_register (frame, regnum, from); + convert_typed_floating (from, builtin_type_double, to, type); } -/* Convert data from virtual format with type TYPE in buffer FROM - to raw format for register N in buffer TO. */ +static void +rs6000_value_to_register (struct frame_info *frame, + int regnum, + struct type *type, + const void *from) +{ + const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum; + char to[MAX_REGISTER_SIZE]; + gdb_assert (reg->fpr); + gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT); + + convert_typed_floating (from, type, to, builtin_type_double); + put_frame_register (frame, regnum, to); +} + +/* Move SPE vector register values between a 64-bit buffer and the two + 32-bit raw register halves in a regcache. This function handles + both splitting a 64-bit value into two 32-bit halves, and joining + two halves into a whole 64-bit value, depending on the function + passed as the MOVE argument. + + EV_REG must be the number of an SPE evN vector register --- a + pseudoregister. REGCACHE must be a regcache, and BUFFER must be a + 64-bit buffer. + + Call MOVE once for each 32-bit half of that register, passing + REGCACHE, the number of the raw register corresponding to that + half, and the address of the appropriate half of BUFFER. + + For example, passing 'regcache_raw_read' as the MOVE function will + fill BUFFER with the full 64-bit contents of EV_REG. Or, passing + 'regcache_raw_supply' will supply the contents of BUFFER to the + appropriate pair of raw registers in REGCACHE. + + You may need to cast away some 'const' qualifiers when passing + MOVE, since this function can't tell at compile-time which of + REGCACHE or BUFFER is acting as the source of the data. If C had + co-variant type qualifiers, ... */ static void -rs6000_register_convert_to_raw (struct type *type, int n, - const char *from, char *to) +e500_move_ev_register (void (*move) (struct regcache *regcache, + int regnum, void *buf), + struct regcache *regcache, int ev_reg, + void *buffer) { - if (TYPE_LENGTH (type) != DEPRECATED_REGISTER_RAW_SIZE (n)) + struct gdbarch *arch = get_regcache_arch (regcache); + struct gdbarch_tdep *tdep = gdbarch_tdep (arch); + int reg_index; + char *byte_buffer = buffer; + + gdb_assert (tdep->ppc_ev0_regnum <= ev_reg + && ev_reg < tdep->ppc_ev0_regnum + ppc_num_gprs); + + reg_index = ev_reg - tdep->ppc_ev0_regnum; + + if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { - double val = deprecated_extract_floating (from, TYPE_LENGTH (type)); - deprecated_store_floating (to, DEPRECATED_REGISTER_RAW_SIZE (n), val); + move (regcache, tdep->ppc_ev0_upper_regnum + reg_index, byte_buffer); + move (regcache, tdep->ppc_gp0_regnum + reg_index, byte_buffer + 4); } else - memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (n)); + { + move (regcache, tdep->ppc_gp0_regnum + reg_index, byte_buffer); + move (regcache, tdep->ppc_ev0_upper_regnum + reg_index, byte_buffer + 4); + } } static void e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, void *buffer) { - int base_regnum; - int offset = 0; - char temp_buffer[MAX_REGISTER_SIZE]; + struct gdbarch *regcache_arch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - if (reg_nr >= tdep->ppc_gp0_regnum - && reg_nr <= tdep->ppc_gplast_regnum) - { - base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; - - /* Build the value in the provided buffer. */ - /* Read the raw register of which this one is the lower portion. */ - regcache_raw_read (regcache, base_regnum, temp_buffer); - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - offset = 4; - memcpy ((char *) buffer, temp_buffer + offset, 4); - } + gdb_assert (regcache_arch == gdbarch); + + if (tdep->ppc_ev0_regnum <= reg_nr + && reg_nr < tdep->ppc_ev0_regnum + ppc_num_gprs) + e500_move_ev_register (regcache_raw_read, regcache, reg_nr, buffer); + else + internal_error (__FILE__, __LINE__, + "e500_pseudo_register_read: " + "called on unexpected register '%s' (%d)", + gdbarch_register_name (gdbarch, reg_nr), reg_nr); } static void e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int reg_nr, const void *buffer) { - int base_regnum; - int offset = 0; - char temp_buffer[MAX_REGISTER_SIZE]; + struct gdbarch *regcache_arch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - if (reg_nr >= tdep->ppc_gp0_regnum - && reg_nr <= tdep->ppc_gplast_regnum) - { - base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; - /* reg_nr is 32 bit here, and base_regnum is 64 bits. */ - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - offset = 4; - - /* Let's read the value of the base register into a temporary - buffer, so that overwriting the last four bytes with the new - value of the pseudo will leave the upper 4 bytes unchanged. */ - regcache_raw_read (regcache, base_regnum, temp_buffer); - - /* Write as an 8 byte quantity. */ - memcpy (temp_buffer + offset, (char *) buffer, 4); - regcache_raw_write (regcache, base_regnum, temp_buffer); - } + gdb_assert (regcache_arch == gdbarch); + + if (tdep->ppc_ev0_regnum <= reg_nr + && reg_nr < tdep->ppc_ev0_regnum + ppc_num_gprs) + e500_move_ev_register ((void (*) (struct regcache *, int, void *)) + regcache_raw_write, + regcache, reg_nr, (void *) buffer); + else + internal_error (__FILE__, __LINE__, + "e500_pseudo_register_read: " + "called on unexpected register '%s' (%d)", + gdbarch_register_name (gdbarch, reg_nr), reg_nr); } -/* Convert a dwarf2 register number to a gdb REGNUM. */ +/* The E500 needs a custom reggroup function: it has anonymous raw + registers, and default_register_reggroup_p assumes that anonymous + registers are not members of any reggroup. */ static int -e500_dwarf2_reg_to_regnum (int num) +e500_register_reggroup_p (struct gdbarch *gdbarch, + int regnum, + struct reggroup *group) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + /* The save and restore register groups need to include the + upper-half registers, even though they're anonymous. */ + if ((group == save_reggroup + || group == restore_reggroup) + && (tdep->ppc_ev0_upper_regnum <= regnum + && regnum < tdep->ppc_ev0_upper_regnum + ppc_num_gprs)) + return 1; + + /* In all other regards, the default reggroup definition is fine. */ + return default_register_reggroup_p (gdbarch, regnum, group); +} + +/* Convert a DBX STABS register number to a GDB register number. */ +static int +rs6000_stab_reg_to_regnum (int num) { - int regnum; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + if (0 <= num && num <= 31) - return num + gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum; - else - return num; + return tdep->ppc_gp0_regnum + num; + else if (32 <= num && num <= 63) + /* FIXME: jimb/2004-05-05: What should we do when the debug info + specifies registers the architecture doesn't have? Our + callers don't check the value we return. */ + return tdep->ppc_fp0_regnum + (num - 32); + else if (77 <= num && num <= 108) + return tdep->ppc_vr0_regnum + (num - 77); + else if (1200 <= num && num < 1200 + 32) + return tdep->ppc_ev0_regnum + (num - 1200); + else + switch (num) + { + case 64: + return tdep->ppc_mq_regnum; + case 65: + return tdep->ppc_lr_regnum; + case 66: + return tdep->ppc_ctr_regnum; + case 76: + return tdep->ppc_xer_regnum; + case 109: + return tdep->ppc_vrsave_regnum; + case 110: + return tdep->ppc_vrsave_regnum - 1; /* vscr */ + case 111: + return tdep->ppc_acc_regnum; + case 112: + return tdep->ppc_spefscr_regnum; + default: + return num; + } } -/* Convert a dbx stab register number (from `r' declaration) to a gdb - REGNUM. */ + +/* Convert a Dwarf 2 register number to a GDB register number. */ static int -rs6000_stab_reg_to_regnum (int num) +rs6000_dwarf2_reg_to_regnum (int num) { - int regnum; - switch (num) - { - case 64: - regnum = gdbarch_tdep (current_gdbarch)->ppc_mq_regnum; - break; - case 65: - regnum = gdbarch_tdep (current_gdbarch)->ppc_lr_regnum; - break; - case 66: - regnum = gdbarch_tdep (current_gdbarch)->ppc_ctr_regnum; - break; - case 76: - regnum = gdbarch_tdep (current_gdbarch)->ppc_xer_regnum; - break; - default: - regnum = num; - break; - } - return regnum; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + if (0 <= num && num <= 31) + return tdep->ppc_gp0_regnum + num; + else if (32 <= num && num <= 63) + /* FIXME: jimb/2004-05-05: What should we do when the debug info + specifies registers the architecture doesn't have? Our + callers don't check the value we return. */ + return tdep->ppc_fp0_regnum + (num - 32); + else if (1124 <= num && num < 1124 + 32) + return tdep->ppc_vr0_regnum + (num - 1124); + else if (1200 <= num && num < 1200 + 32) + return tdep->ppc_ev0_regnum + (num - 1200); + else + switch (num) + { + case 67: + return tdep->ppc_vrsave_regnum - 1; /* vscr */ + case 99: + return tdep->ppc_acc_regnum; + case 100: + return tdep->ppc_mq_regnum; + case 101: + return tdep->ppc_xer_regnum; + case 108: + return tdep->ppc_lr_regnum; + case 109: + return tdep->ppc_ctr_regnum; + case 356: + return tdep->ppc_vrsave_regnum; + case 612: + return tdep->ppc_spefscr_regnum; + default: + return num; + } } + static void -rs6000_store_return_value (struct type *type, char *valbuf) +rs6000_store_return_value (struct type *type, + struct regcache *regcache, + const void *valbuf) { - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + int regnum = -1; - if (TYPE_CODE (type) == TYPE_CODE_FLT) + /* The calling convention this function implements assumes the + processor has floating-point registers. We shouldn't be using it + on PPC variants that lack them. */ + gdb_assert (ppc_floating_point_unit_p (gdbarch)); + if (TYPE_CODE (type) == TYPE_CODE_FLT) /* Floating point values are returned starting from FPR1 and up. Say a double_double_double type could be returned in FPR1/FPR2/FPR3 triple. */ - - deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1), valbuf, - TYPE_LENGTH (type)); + regnum = tdep->ppc_fp0_regnum + 1; else if (TYPE_CODE (type) == TYPE_CODE_ARRAY) { if (TYPE_LENGTH (type) == 16 && TYPE_VECTOR (type)) - deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (tdep->ppc_vr0_regnum + 2), - valbuf, TYPE_LENGTH (type)); + regnum = tdep->ppc_vr0_regnum + 2; + else + internal_error (__FILE__, __LINE__, + "rs6000_store_return_value: " + "unexpected array return type"); } else /* Everything else is returned in GPR3 and up. */ - deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3), - valbuf, TYPE_LENGTH (type)); + regnum = tdep->ppc_gp0_regnum + 3; + + { + size_t bytes_written = 0; + + while (bytes_written < TYPE_LENGTH (type)) + { + /* How much of this value can we write to this register? */ + size_t bytes_to_write = min (TYPE_LENGTH (type) - bytes_written, + register_size (gdbarch, regnum)); + regcache_cooked_write_part (regcache, regnum, + 0, bytes_to_write, + (char *) valbuf + bytes_written); + regnum++; + bytes_written += bytes_to_write; + } + } } + /* Extract from an array REGBUF containing the (raw) register state the address in which a function should return its structure value, as a CORE_ADDR (or an expression that can be used as one). */ @@ -2139,37 +2248,58 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch, /* Return a struct reg defining register NAME that's 32 bits on 32-bit systems and 64 bits on 64-bit systems. */ -#define R(name) { STR(name), 4, 8, 0, 0 } +#define R(name) { STR(name), 4, 8, 0, 0, -1 } /* Return a struct reg defining register NAME that's 32 bits on all systems. */ -#define R4(name) { STR(name), 4, 4, 0, 0 } +#define R4(name) { STR(name), 4, 4, 0, 0, -1 } /* Return a struct reg defining register NAME that's 64 bits on all systems. */ -#define R8(name) { STR(name), 8, 8, 0, 0 } +#define R8(name) { STR(name), 8, 8, 0, 0, -1 } /* Return a struct reg defining register NAME that's 128 bits on all systems. */ -#define R16(name) { STR(name), 16, 16, 0, 0 } +#define R16(name) { STR(name), 16, 16, 0, 0, -1 } /* Return a struct reg defining floating-point register NAME. */ -#define F(name) { STR(name), 8, 8, 1, 0 } +#define F(name) { STR(name), 8, 8, 1, 0, -1 } -/* Return a struct reg defining a pseudo register NAME. */ -#define P(name) { STR(name), 4, 8, 0, 1} +/* Return a struct reg defining a pseudo register NAME that is 64 bits + long on all systems. */ +#define P8(name) { STR(name), 8, 8, 0, 1, -1 } /* Return a struct reg defining register NAME that's 32 bits on 32-bit systems and that doesn't exist on 64-bit systems. */ -#define R32(name) { STR(name), 4, 0, 0, 0 } +#define R32(name) { STR(name), 4, 0, 0, 0, -1 } /* Return a struct reg defining register NAME that's 64 bits on 64-bit systems and that doesn't exist on 32-bit systems. */ -#define R64(name) { STR(name), 0, 8, 0, 0 } +#define R64(name) { STR(name), 0, 8, 0, 0, -1 } /* Return a struct reg placeholder for a register that doesn't exist. */ -#define R0 { 0, 0, 0, 0, 0 } +#define R0 { 0, 0, 0, 0, 0, -1 } + +/* Return a struct reg defining an anonymous raw register that's 32 + bits on all systems. */ +#define A4 { 0, 4, 4, 0, 0, -1 } +/* Return a struct reg defining an SPR named NAME that is 32 bits on + 32-bit systems and 64 bits on 64-bit systems. */ +#define S(name) { STR(name), 4, 8, 0, 0, ppc_spr_ ## name } + +/* Return a struct reg defining an SPR named NAME that is 32 bits on + all systems. */ +#define S4(name) { STR(name), 4, 4, 0, 0, ppc_spr_ ## name } + +/* Return a struct reg defining an SPR named NAME that is 32 bits on + all systems, and whose SPR number is NUMBER. */ +#define SN4(name, number) { STR(name), 4, 4, 0, 0, (number) } + +/* Return a struct reg defining an SPR named NAME that's 64 bits on + 64-bit systems and that doesn't exist on 32-bit systems. */ +#define S64(name) { STR(name), 0, 8, 0, 0, ppc_spr_ ## name } + /* UISA registers common across all architectures, including POWER. */ #define COMMON_UISA_REGS \ @@ -2183,24 +2313,13 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch, /* 56 */ F(f24),F(f25),F(f26),F(f27),F(f28),F(f29),F(f30),F(f31), \ /* 64 */ R(pc), R(ps) -#define COMMON_UISA_NOFP_REGS \ - /* 0 */ R(r0), R(r1), R(r2), R(r3), R(r4), R(r5), R(r6), R(r7), \ - /* 8 */ R(r8), R(r9), R(r10),R(r11),R(r12),R(r13),R(r14),R(r15), \ - /* 16 */ R(r16),R(r17),R(r18),R(r19),R(r20),R(r21),R(r22),R(r23), \ - /* 24 */ R(r24),R(r25),R(r26),R(r27),R(r28),R(r29),R(r30),R(r31), \ - /* 32 */ R0, R0, R0, R0, R0, R0, R0, R0, \ - /* 40 */ R0, R0, R0, R0, R0, R0, R0, R0, \ - /* 48 */ R0, R0, R0, R0, R0, R0, R0, R0, \ - /* 56 */ R0, R0, R0, R0, R0, R0, R0, R0, \ - /* 64 */ R(pc), R(ps) - /* UISA-level SPRs for PowerPC. */ #define PPC_UISA_SPRS \ - /* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R4(fpscr) + /* 66 */ R4(cr), S(lr), S(ctr), S4(xer), R4(fpscr) /* UISA-level SPRs for PowerPC without floating point support. */ #define PPC_UISA_NOFP_SPRS \ - /* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R0 + /* 66 */ R4(cr), S(lr), S(ctr), S4(xer), R0 /* Segment registers, for PowerPC. */ #define PPC_SEGMENT_REGS \ @@ -2211,15 +2330,15 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch, /* OEA SPRs for PowerPC. */ #define PPC_OEA_SPRS \ - /* 87 */ R4(pvr), \ - /* 88 */ R(ibat0u), R(ibat0l), R(ibat1u), R(ibat1l), \ - /* 92 */ R(ibat2u), R(ibat2l), R(ibat3u), R(ibat3l), \ - /* 96 */ R(dbat0u), R(dbat0l), R(dbat1u), R(dbat1l), \ - /* 100 */ R(dbat2u), R(dbat2l), R(dbat3u), R(dbat3l), \ - /* 104 */ R(sdr1), R64(asr), R(dar), R4(dsisr), \ - /* 108 */ R(sprg0), R(sprg1), R(sprg2), R(sprg3), \ - /* 112 */ R(srr0), R(srr1), R(tbl), R(tbu), \ - /* 116 */ R4(dec), R(dabr), R4(ear) + /* 87 */ S4(pvr), \ + /* 88 */ S(ibat0u), S(ibat0l), S(ibat1u), S(ibat1l), \ + /* 92 */ S(ibat2u), S(ibat2l), S(ibat3u), S(ibat3l), \ + /* 96 */ S(dbat0u), S(dbat0l), S(dbat1u), S(dbat1l), \ + /* 100 */ S(dbat2u), S(dbat2l), S(dbat3u), S(dbat3l), \ + /* 104 */ S(sdr1), S64(asr), S(dar), S4(dsisr), \ + /* 108 */ S(sprg0), S(sprg1), S(sprg2), S(sprg3), \ + /* 112 */ S(srr0), S(srr1), S(tbl), S(tbu), \ + /* 116 */ S4(dec), S(dabr), S4(ear) /* AltiVec registers. */ #define PPC_ALTIVEC_REGS \ @@ -2229,26 +2348,45 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch, /*143*/R16(vr24),R16(vr25),R16(vr26),R16(vr27),R16(vr28),R16(vr29),R16(vr30),R16(vr31), \ /*151*/R4(vscr), R4(vrsave) -/* Vectors of hi-lo general purpose registers. */ -#define PPC_EV_REGS \ - /* 0*/R8(ev0), R8(ev1), R8(ev2), R8(ev3), R8(ev4), R8(ev5), R8(ev6), R8(ev7), \ - /* 8*/R8(ev8), R8(ev9), R8(ev10),R8(ev11),R8(ev12),R8(ev13),R8(ev14),R8(ev15), \ - /*16*/R8(ev16),R8(ev17),R8(ev18),R8(ev19),R8(ev20),R8(ev21),R8(ev22),R8(ev23), \ - /*24*/R8(ev24),R8(ev25),R8(ev26),R8(ev27),R8(ev28),R8(ev29),R8(ev30),R8(ev31) -/* Lower half of the EV registers. */ -#define PPC_GPRS_PSEUDO_REGS \ - /* 0 */ P(r0), P(r1), P(r2), P(r3), P(r4), P(r5), P(r6), P(r7), \ - /* 8 */ P(r8), P(r9), P(r10),P(r11),P(r12),P(r13),P(r14),P(r15), \ - /* 16 */ P(r16),P(r17),P(r18),P(r19),P(r20),P(r21),P(r22),P(r23), \ - /* 24 */ P(r24),P(r25),P(r26),P(r27),P(r28),P(r29),P(r30),P(r31) +/* On machines supporting the SPE APU, the general-purpose registers + are 64 bits long. There are SIMD vector instructions to treat them + as pairs of floats, but the rest of the instruction set treats them + as 32-bit registers, and only operates on their lower halves. + + In the GDB regcache, we treat their high and low halves as separate + registers. The low halves we present as the general-purpose + registers, and then we have pseudo-registers that stitch together + the upper and lower halves and present them as pseudo-registers. */ + +/* SPE GPR lower halves --- raw registers. */ +#define PPC_SPE_GP_REGS \ + /* 0 */ R4(r0), R4(r1), R4(r2), R4(r3), R4(r4), R4(r5), R4(r6), R4(r7), \ + /* 8 */ R4(r8), R4(r9), R4(r10),R4(r11),R4(r12),R4(r13),R4(r14),R4(r15), \ + /* 16 */ R4(r16),R4(r17),R4(r18),R4(r19),R4(r20),R4(r21),R4(r22),R4(r23), \ + /* 24 */ R4(r24),R4(r25),R4(r26),R4(r27),R4(r28),R4(r29),R4(r30),R4(r31) + +/* SPE GPR upper halves --- anonymous raw registers. */ +#define PPC_SPE_UPPER_GP_REGS \ + /* 0 */ A4, A4, A4, A4, A4, A4, A4, A4, \ + /* 8 */ A4, A4, A4, A4, A4, A4, A4, A4, \ + /* 16 */ A4, A4, A4, A4, A4, A4, A4, A4, \ + /* 24 */ A4, A4, A4, A4, A4, A4, A4, A4 + +/* SPE GPR vector registers --- pseudo registers based on underlying + gprs and the anonymous upper half raw registers. */ +#define PPC_EV_PSEUDO_REGS \ +/* 0*/P8(ev0), P8(ev1), P8(ev2), P8(ev3), P8(ev4), P8(ev5), P8(ev6), P8(ev7), \ +/* 8*/P8(ev8), P8(ev9), P8(ev10),P8(ev11),P8(ev12),P8(ev13),P8(ev14),P8(ev15),\ +/*16*/P8(ev16),P8(ev17),P8(ev18),P8(ev19),P8(ev20),P8(ev21),P8(ev22),P8(ev23),\ +/*24*/P8(ev24),P8(ev25),P8(ev26),P8(ev27),P8(ev28),P8(ev29),P8(ev30),P8(ev31) /* IBM POWER (pre-PowerPC) architecture, user-level view. We only cover user-level SPR's. */ static const struct reg registers_power[] = { COMMON_UISA_REGS, - /* 66 */ R4(cnd), R(lr), R(cnt), R4(xer), R4(mq), + /* 66 */ R4(cnd), S(lr), S(cnt), S4(xer), S4(mq), /* 71 */ R4(fpscr) }; @@ -2261,44 +2399,49 @@ static const struct reg registers_powerpc[] = PPC_ALTIVEC_REGS }; -/* PowerPC UISA - a PPC processor as viewed by user-level - code, but without floating point registers. */ -static const struct reg registers_powerpc_nofp[] = -{ - COMMON_UISA_NOFP_REGS, - PPC_UISA_SPRS -}; +/* IBM PowerPC 403. + + Some notes about the "tcr" special-purpose register: + - On the 403 and 403GC, SPR 986 is named "tcr", and it controls the + 403's programmable interval timer, fixed interval timer, and + watchdog timer. + - On the 602, SPR 984 is named "tcr", and it controls the 602's + watchdog timer, and nothing else. -/* IBM PowerPC 403. */ + Some of the fields are similar between the two, but they're not + compatible with each other. Since the two variants have different + registers, with different numbers, but the same name, we can't + splice the register name to get the SPR number. */ static const struct reg registers_403[] = { COMMON_UISA_REGS, PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(icdbdr), R(esr), R(dear), R(evpr), - /* 123 */ R(cdbcr), R(tsr), R(tcr), R(pit), - /* 127 */ R(tbhi), R(tblo), R(srr2), R(srr3), - /* 131 */ R(dbsr), R(dbcr), R(iac1), R(iac2), - /* 135 */ R(dac1), R(dac2), R(dccr), R(iccr), - /* 139 */ R(pbl1), R(pbu1), R(pbl2), R(pbu2) + /* 119 */ S(icdbdr), S(esr), S(dear), S(evpr), + /* 123 */ S(cdbcr), S(tsr), SN4(tcr, ppc_spr_403_tcr), S(pit), + /* 127 */ S(tbhi), S(tblo), S(srr2), S(srr3), + /* 131 */ S(dbsr), S(dbcr), S(iac1), S(iac2), + /* 135 */ S(dac1), S(dac2), S(dccr), S(iccr), + /* 139 */ S(pbl1), S(pbu1), S(pbl2), S(pbu2) }; -/* IBM PowerPC 403GC. */ +/* IBM PowerPC 403GC. + See the comments about 'tcr' for the 403, above. */ static const struct reg registers_403GC[] = { COMMON_UISA_REGS, PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(icdbdr), R(esr), R(dear), R(evpr), - /* 123 */ R(cdbcr), R(tsr), R(tcr), R(pit), - /* 127 */ R(tbhi), R(tblo), R(srr2), R(srr3), - /* 131 */ R(dbsr), R(dbcr), R(iac1), R(iac2), - /* 135 */ R(dac1), R(dac2), R(dccr), R(iccr), - /* 139 */ R(pbl1), R(pbu1), R(pbl2), R(pbu2), - /* 143 */ R(zpr), R(pid), R(sgr), R(dcwr), - /* 147 */ R(tbhu), R(tblu) + /* 119 */ S(icdbdr), S(esr), S(dear), S(evpr), + /* 123 */ S(cdbcr), S(tsr), SN4(tcr, ppc_spr_403_tcr), S(pit), + /* 127 */ S(tbhi), S(tblo), S(srr2), S(srr3), + /* 131 */ S(dbsr), S(dbcr), S(iac1), S(iac2), + /* 135 */ S(dac1), S(dac2), S(dccr), S(iccr), + /* 139 */ S(pbl1), S(pbu1), S(pbl2), S(pbu2), + /* 143 */ S(zpr), S(pid), S(sgr), S(dcwr), + /* 147 */ S(tbhu), S(tblu) }; /* Motorola PowerPC 505. */ @@ -2308,7 +2451,7 @@ static const struct reg registers_505[] = PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(eie), R(eid), R(nri) + /* 119 */ S(eie), S(eid), S(nri) }; /* Motorola PowerPC 860 or 850. */ @@ -2318,18 +2461,18 @@ static const struct reg registers_860[] = PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(eie), R(eid), R(nri), R(cmpa), - /* 123 */ R(cmpb), R(cmpc), R(cmpd), R(icr), - /* 127 */ R(der), R(counta), R(countb), R(cmpe), - /* 131 */ R(cmpf), R(cmpg), R(cmph), R(lctrl1), - /* 135 */ R(lctrl2), R(ictrl), R(bar), R(ic_cst), - /* 139 */ R(ic_adr), R(ic_dat), R(dc_cst), R(dc_adr), - /* 143 */ R(dc_dat), R(dpdr), R(dpir), R(immr), - /* 147 */ R(mi_ctr), R(mi_ap), R(mi_epn), R(mi_twc), - /* 151 */ R(mi_rpn), R(md_ctr), R(m_casid), R(md_ap), - /* 155 */ R(md_epn), R(md_twb), R(md_twc), R(md_rpn), - /* 159 */ R(m_tw), R(mi_dbcam), R(mi_dbram0), R(mi_dbram1), - /* 163 */ R(md_dbcam), R(md_dbram0), R(md_dbram1) + /* 119 */ S(eie), S(eid), S(nri), S(cmpa), + /* 123 */ S(cmpb), S(cmpc), S(cmpd), S(icr), + /* 127 */ S(der), S(counta), S(countb), S(cmpe), + /* 131 */ S(cmpf), S(cmpg), S(cmph), S(lctrl1), + /* 135 */ S(lctrl2), S(ictrl), S(bar), S(ic_cst), + /* 139 */ S(ic_adr), S(ic_dat), S(dc_cst), S(dc_adr), + /* 143 */ S(dc_dat), S(dpdr), S(dpir), S(immr), + /* 147 */ S(mi_ctr), S(mi_ap), S(mi_epn), S(mi_twc), + /* 151 */ S(mi_rpn), S(md_ctr), S(m_casid), S(md_ap), + /* 155 */ S(md_epn), S(m_twb), S(md_twc), S(md_rpn), + /* 159 */ S(m_tw), S(mi_dbcam), S(mi_dbram0), S(mi_dbram1), + /* 163 */ S(md_dbcam), S(md_dbram0), S(md_dbram1) }; /* Motorola PowerPC 601. Note that the 601 has different register numbers @@ -2341,20 +2484,21 @@ static const struct reg registers_601[] = PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(hid0), R(hid1), R(iabr), R(dabr), - /* 123 */ R(pir), R(mq), R(rtcu), R(rtcl) + /* 119 */ S(hid0), S(hid1), S(iabr), S(dabr), + /* 123 */ S(pir), S(mq), S(rtcu), S(rtcl) }; -/* Motorola PowerPC 602. */ +/* Motorola PowerPC 602. + See the notes under the 403 about 'tcr'. */ static const struct reg registers_602[] = { COMMON_UISA_REGS, PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(hid0), R(hid1), R(iabr), R0, - /* 123 */ R0, R(tcr), R(ibr), R(esassr), - /* 127 */ R(sebr), R(ser), R(sp), R(lt) + /* 119 */ S(hid0), S(hid1), S(iabr), R0, + /* 123 */ R0, SN4(tcr, ppc_spr_602_tcr), S(ibr), S(esasrr), + /* 127 */ S(sebr), S(ser), S(sp), S(lt) }; /* Motorola/IBM PowerPC 603 or 603e. */ @@ -2364,9 +2508,9 @@ static const struct reg registers_603[] = PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(hid0), R(hid1), R(iabr), R0, - /* 123 */ R0, R(dmiss), R(dcmp), R(hash1), - /* 127 */ R(hash2), R(imiss), R(icmp), R(rpa) + /* 119 */ S(hid0), S(hid1), S(iabr), R0, + /* 123 */ R0, S(dmiss), S(dcmp), S(hash1), + /* 127 */ S(hash2), S(imiss), S(icmp), S(rpa) }; /* Motorola PowerPC 604 or 604e. */ @@ -2376,9 +2520,9 @@ static const struct reg registers_604[] = PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(hid0), R(hid1), R(iabr), R(dabr), - /* 123 */ R(pir), R(mmcr0), R(pmc1), R(pmc2), - /* 127 */ R(sia), R(sda) + /* 119 */ S(hid0), S(hid1), S(iabr), S(dabr), + /* 123 */ S(pir), S(mmcr0), S(pmc1), S(pmc2), + /* 127 */ S(sia), S(sda) }; /* Motorola/IBM PowerPC 750 or 740. */ @@ -2388,12 +2532,12 @@ static const struct reg registers_750[] = PPC_UISA_SPRS, PPC_SEGMENT_REGS, PPC_OEA_SPRS, - /* 119 */ R(hid0), R(hid1), R(iabr), R(dabr), - /* 123 */ R0, R(ummcr0), R(upmc1), R(upmc2), - /* 127 */ R(usia), R(ummcr1), R(upmc3), R(upmc4), - /* 131 */ R(mmcr0), R(pmc1), R(pmc2), R(sia), - /* 135 */ R(mmcr1), R(pmc3), R(pmc4), R(l2cr), - /* 139 */ R(ictc), R(thrm1), R(thrm2), R(thrm3) + /* 119 */ S(hid0), S(hid1), S(iabr), S(dabr), + /* 123 */ R0, S(ummcr0), S(upmc1), S(upmc2), + /* 127 */ S(usia), S(ummcr1), S(upmc3), S(upmc4), + /* 131 */ S(mmcr0), S(pmc1), S(pmc2), S(sia), + /* 135 */ S(mmcr1), S(pmc3), S(pmc4), S(l2cr), + /* 139 */ S(ictc), S(thrm1), S(thrm2), S(thrm3) }; @@ -2402,7 +2546,7 @@ static const struct reg registers_7400[] = { /* gpr0-gpr31, fpr0-fpr31 */ COMMON_UISA_REGS, - /* ctr, xre, lr, cr */ + /* cr, lr, ctr, xer, fpscr */ PPC_UISA_SPRS, /* sr0-sr15 */ PPC_SEGMENT_REGS, @@ -2415,16 +2559,14 @@ static const struct reg registers_7400[] = /* Motorola e500. */ static const struct reg registers_e500[] = { - R(pc), R(ps), - /* cr, lr, ctr, xer, "" */ - PPC_UISA_NOFP_SPRS, - /* 7...38 */ - PPC_EV_REGS, - R8(acc), R(spefscr), + /* 0 .. 31 */ PPC_SPE_GP_REGS, + /* 32 .. 63 */ PPC_SPE_UPPER_GP_REGS, + /* 64 .. 65 */ R(pc), R(ps), + /* 66 .. 70 */ PPC_UISA_NOFP_SPRS, + /* 71 .. 72 */ R8(acc), S4(spefscr), /* NOTE: Add new registers here the end of the raw register list and just before the first pseudo register. */ - /* 39...70 */ - PPC_GPRS_PSEUDO_REGS + /* 73 .. 104 */ PPC_EV_PSEUDO_REGS }; /* Information about a particular processor variant. */ @@ -2612,6 +2754,227 @@ gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info) return print_insn_little_powerpc (memaddr, info); } +static CORE_ADDR +rs6000_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + return frame_unwind_register_unsigned (next_frame, PC_REGNUM); +} + +static struct frame_id +rs6000_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) +{ + return frame_id_build (frame_unwind_register_unsigned (next_frame, + SP_REGNUM), + frame_pc_unwind (next_frame)); +} + +struct rs6000_frame_cache +{ + CORE_ADDR base; + CORE_ADDR initial_sp; + struct trad_frame_saved_reg *saved_regs; +}; + +static struct rs6000_frame_cache * +rs6000_frame_cache (struct frame_info *next_frame, void **this_cache) +{ + struct rs6000_frame_cache *cache; + struct gdbarch *gdbarch = get_frame_arch (next_frame); + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + struct rs6000_framedata fdata; + int wordsize = tdep->wordsize; + + if ((*this_cache) != NULL) + return (*this_cache); + cache = FRAME_OBSTACK_ZALLOC (struct rs6000_frame_cache); + (*this_cache) = cache; + cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); + + skip_prologue (frame_func_unwind (next_frame), frame_pc_unwind (next_frame), + &fdata); + + /* If there were any saved registers, figure out parent's stack + pointer. */ + /* The following is true only if the frame doesn't have a call to + alloca(), FIXME. */ + + if (fdata.saved_fpr == 0 + && fdata.saved_gpr == 0 + && fdata.saved_vr == 0 + && fdata.saved_ev == 0 + && fdata.lr_offset == 0 + && fdata.cr_offset == 0 + && fdata.vr_offset == 0 + && fdata.ev_offset == 0) + cache->base = frame_unwind_register_unsigned (next_frame, SP_REGNUM); + else + { + /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most + address of the current frame. Things might be easier if the + ->frame pointed to the outer-most address of the frame. In + the mean time, the address of the prev frame is used as the + base address of this frame. */ + cache->base = frame_unwind_register_unsigned (next_frame, SP_REGNUM); + if (!fdata.frameless) + /* Frameless really means stackless. */ + cache->base = read_memory_addr (cache->base, wordsize); + } + trad_frame_set_value (cache->saved_regs, SP_REGNUM, cache->base); + + /* if != -1, fdata.saved_fpr is the smallest number of saved_fpr. + All fpr's from saved_fpr to fp31 are saved. */ + + if (fdata.saved_fpr >= 0) + { + int i; + CORE_ADDR fpr_addr = cache->base + fdata.fpr_offset; + + /* If skip_prologue says floating-point registers were saved, + but the current architecture has no floating-point registers, + then that's strange. But we have no indices to even record + the addresses under, so we just ignore it. */ + if (ppc_floating_point_unit_p (gdbarch)) + for (i = fdata.saved_fpr; i < ppc_num_fprs; i++) + { + cache->saved_regs[tdep->ppc_fp0_regnum + i].addr = fpr_addr; + fpr_addr += 8; + } + } + + /* if != -1, fdata.saved_gpr is the smallest number of saved_gpr. + All gpr's from saved_gpr to gpr31 are saved. */ + + if (fdata.saved_gpr >= 0) + { + int i; + CORE_ADDR gpr_addr = cache->base + fdata.gpr_offset; + for (i = fdata.saved_gpr; i < ppc_num_gprs; i++) + { + cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = gpr_addr; + gpr_addr += wordsize; + } + } + + /* if != -1, fdata.saved_vr is the smallest number of saved_vr. + All vr's from saved_vr to vr31 are saved. */ + if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1) + { + if (fdata.saved_vr >= 0) + { + int i; + CORE_ADDR vr_addr = cache->base + fdata.vr_offset; + for (i = fdata.saved_vr; i < 32; i++) + { + cache->saved_regs[tdep->ppc_vr0_regnum + i].addr = vr_addr; + vr_addr += register_size (gdbarch, tdep->ppc_vr0_regnum); + } + } + } + + /* if != -1, fdata.saved_ev is the smallest number of saved_ev. + All vr's from saved_ev to ev31 are saved. ????? */ + if (tdep->ppc_ev0_regnum != -1 && tdep->ppc_ev31_regnum != -1) + { + if (fdata.saved_ev >= 0) + { + int i; + CORE_ADDR ev_addr = cache->base + fdata.ev_offset; + for (i = fdata.saved_ev; i < ppc_num_gprs; i++) + { + cache->saved_regs[tdep->ppc_ev0_regnum + i].addr = ev_addr; + cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = ev_addr + 4; + ev_addr += register_size (gdbarch, tdep->ppc_ev0_regnum); + } + } + } + + /* If != 0, fdata.cr_offset is the offset from the frame that + holds the CR. */ + if (fdata.cr_offset != 0) + cache->saved_regs[tdep->ppc_cr_regnum].addr = cache->base + fdata.cr_offset; + + /* If != 0, fdata.lr_offset is the offset from the frame that + holds the LR. */ + if (fdata.lr_offset != 0) + cache->saved_regs[tdep->ppc_lr_regnum].addr = cache->base + fdata.lr_offset; + /* The PC is found in the link register. */ + cache->saved_regs[PC_REGNUM] = cache->saved_regs[tdep->ppc_lr_regnum]; + + /* If != 0, fdata.vrsave_offset is the offset from the frame that + holds the VRSAVE. */ + if (fdata.vrsave_offset != 0) + cache->saved_regs[tdep->ppc_vrsave_regnum].addr = cache->base + fdata.vrsave_offset; + + if (fdata.alloca_reg < 0) + /* If no alloca register used, then fi->frame is the value of the + %sp for this frame, and it is good enough. */ + cache->initial_sp = frame_unwind_register_unsigned (next_frame, SP_REGNUM); + else + cache->initial_sp = frame_unwind_register_unsigned (next_frame, + fdata.alloca_reg); + + return cache; +} + +static void +rs6000_frame_this_id (struct frame_info *next_frame, void **this_cache, + struct frame_id *this_id) +{ + struct rs6000_frame_cache *info = rs6000_frame_cache (next_frame, + this_cache); + (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame)); +} + +static void +rs6000_frame_prev_register (struct frame_info *next_frame, + void **this_cache, + int regnum, int *optimizedp, + enum lval_type *lvalp, CORE_ADDR *addrp, + int *realnump, void *valuep) +{ + struct rs6000_frame_cache *info = rs6000_frame_cache (next_frame, + this_cache); + trad_frame_get_prev_register (next_frame, info->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); +} + +static const struct frame_unwind rs6000_frame_unwind = +{ + NORMAL_FRAME, + rs6000_frame_this_id, + rs6000_frame_prev_register +}; + +static const struct frame_unwind * +rs6000_frame_sniffer (struct frame_info *next_frame) +{ + return &rs6000_frame_unwind; +} + + + +static CORE_ADDR +rs6000_frame_base_address (struct frame_info *next_frame, + void **this_cache) +{ + struct rs6000_frame_cache *info = rs6000_frame_cache (next_frame, + this_cache); + return info->initial_sp; +} + +static const struct frame_base rs6000_frame_base = { + &rs6000_frame_unwind, + rs6000_frame_base_address, + rs6000_frame_base_address, + rs6000_frame_base_address +}; + +static const struct frame_base * +rs6000_frame_base_sniffer (struct frame_info *next_frame) +{ + return &rs6000_frame_base; +} + /* Initialize the current architecture based on INFO. If possible, re-use an architecture from ARCHES, which is a list of architectures already created during this debugging session. @@ -2624,7 +2987,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; struct gdbarch_tdep *tdep; - int wordsize, from_xcoff_exec, from_elf_exec, power, i, off; + int wordsize, from_xcoff_exec, from_elf_exec, i, off; struct reg *regs; const struct variant *v; enum bfd_architecture arch; @@ -2723,7 +3086,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } gdbarch = gdbarch_alloc (&info, tdep); - power = arch == bfd_arch_rs6000; /* Initialize the number of real and pseudo registers in each variant. */ init_variants (); @@ -2736,7 +3098,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->regs = v->regs; tdep->ppc_gp0_regnum = 0; - tdep->ppc_gplast_regnum = 31; tdep->ppc_toc_regnum = 2; tdep->ppc_ps_regnum = 65; tdep->ppc_cr_regnum = 66; @@ -2745,15 +3106,25 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->ppc_xer_regnum = 69; if (v->mach == bfd_mach_ppc_601) tdep->ppc_mq_regnum = 124; - else if (power) + else if (arch == bfd_arch_rs6000) tdep->ppc_mq_regnum = 70; else tdep->ppc_mq_regnum = -1; - tdep->ppc_fpscr_regnum = power ? 71 : 70; + tdep->ppc_fp0_regnum = 32; + tdep->ppc_fpscr_regnum = (arch == bfd_arch_rs6000) ? 71 : 70; + tdep->ppc_sr0_regnum = 71; + tdep->ppc_vr0_regnum = -1; + tdep->ppc_vrsave_regnum = -1; + tdep->ppc_ev0_upper_regnum = -1; + tdep->ppc_ev0_regnum = -1; + tdep->ppc_ev31_regnum = -1; + tdep->ppc_acc_regnum = -1; + tdep->ppc_spefscr_regnum = -1; set_gdbarch_pc_regnum (gdbarch, 64); set_gdbarch_sp_regnum (gdbarch, 1); set_gdbarch_deprecated_fp_regnum (gdbarch, 1); + set_gdbarch_register_sim_regno (gdbarch, rs6000_register_sim_regno); if (sysv_abi && wordsize == 8) set_gdbarch_return_value (gdbarch, ppc64_sysv_abi_return_value); else if (sysv_abi && wordsize == 4) @@ -2761,71 +3132,66 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) else { set_gdbarch_deprecated_extract_return_value (gdbarch, rs6000_extract_return_value); - set_gdbarch_deprecated_store_return_value (gdbarch, rs6000_store_return_value); + set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value); } - if (v->arch == bfd_arch_powerpc) + /* Set lr_frame_offset. */ + if (wordsize == 8) + tdep->lr_frame_offset = 16; + else if (sysv_abi) + tdep->lr_frame_offset = 4; + else + tdep->lr_frame_offset = 8; + + if (v->arch == bfd_arch_rs6000) + tdep->ppc_sr0_regnum = -1; + else if (v->arch == bfd_arch_powerpc) switch (v->mach) { case bfd_mach_ppc: + tdep->ppc_sr0_regnum = -1; tdep->ppc_vr0_regnum = 71; tdep->ppc_vrsave_regnum = 104; - tdep->ppc_ev0_regnum = -1; - tdep->ppc_ev31_regnum = -1; break; case bfd_mach_ppc_7400: tdep->ppc_vr0_regnum = 119; tdep->ppc_vrsave_regnum = 152; - tdep->ppc_ev0_regnum = -1; - tdep->ppc_ev31_regnum = -1; break; case bfd_mach_ppc_e500: - tdep->ppc_gp0_regnum = 41; - tdep->ppc_gplast_regnum = tdep->ppc_gp0_regnum + 32 - 1; tdep->ppc_toc_regnum = -1; - tdep->ppc_ps_regnum = 1; - tdep->ppc_cr_regnum = 2; - tdep->ppc_lr_regnum = 3; - tdep->ppc_ctr_regnum = 4; - tdep->ppc_xer_regnum = 5; - tdep->ppc_ev0_regnum = 7; - tdep->ppc_ev31_regnum = 38; - set_gdbarch_pc_regnum (gdbarch, 0); - set_gdbarch_sp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1); - set_gdbarch_deprecated_fp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1); - set_gdbarch_dwarf2_reg_to_regnum (gdbarch, e500_dwarf2_reg_to_regnum); + tdep->ppc_ev0_upper_regnum = 32; + tdep->ppc_ev0_regnum = 73; + tdep->ppc_ev31_regnum = 104; + tdep->ppc_acc_regnum = 71; + tdep->ppc_spefscr_regnum = 72; + tdep->ppc_fp0_regnum = -1; + tdep->ppc_fpscr_regnum = -1; + tdep->ppc_sr0_regnum = -1; set_gdbarch_pseudo_register_read (gdbarch, e500_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, e500_pseudo_register_write); + set_gdbarch_register_reggroup_p (gdbarch, e500_register_reggroup_p); break; - default: - tdep->ppc_vr0_regnum = -1; - tdep->ppc_vrsave_regnum = -1; - tdep->ppc_ev0_regnum = -1; - tdep->ppc_ev31_regnum = -1; - break; + + case bfd_mach_ppc64: + case bfd_mach_ppc_620: + case bfd_mach_ppc_630: + case bfd_mach_ppc_a35: + case bfd_mach_ppc_rs64ii: + case bfd_mach_ppc_rs64iii: + /* These processor's register sets don't have segment registers. */ + tdep->ppc_sr0_regnum = -1; + break; } + else + internal_error (__FILE__, __LINE__, + "rs6000_gdbarch_init: " + "received unexpected BFD 'arch' value"); /* Sanity check on registers. */ gdb_assert (strcmp (tdep->regs[tdep->ppc_gp0_regnum].name, "r0") == 0); - /* Set lr_frame_offset. */ - if (wordsize == 8) - tdep->lr_frame_offset = 16; - else if (sysv_abi) - tdep->lr_frame_offset = 4; - else - tdep->lr_frame_offset = 8; - - /* Calculate byte offsets in raw register array. */ - tdep->regoff = xmalloc (v->num_tot_regs * sizeof (int)); - for (i = off = 0; i < v->num_tot_regs; i++) - { - tdep->regoff[i] = off; - off += regsize (v->regs + i, wordsize); - } - /* Select instruction printer. */ - if (arch == power) + if (arch == bfd_arch_rs6000) set_gdbarch_print_insn (gdbarch, print_insn_rs6000); else set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc); @@ -2835,11 +3201,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, v->nregs); set_gdbarch_num_pseudo_regs (gdbarch, v->npregs); set_gdbarch_register_name (gdbarch, rs6000_register_name); - set_gdbarch_deprecated_register_size (gdbarch, wordsize); - set_gdbarch_deprecated_register_bytes (gdbarch, off); - set_gdbarch_deprecated_register_byte (gdbarch, rs6000_register_byte); - set_gdbarch_deprecated_register_raw_size (gdbarch, rs6000_register_raw_size); - set_gdbarch_deprecated_register_virtual_type (gdbarch, rs6000_register_virtual_type); + set_gdbarch_register_type (gdbarch, rs6000_register_type); set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT); set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); @@ -2864,13 +3226,13 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) Problem is, 220 isn't frame (16 byte) aligned. Round it up to 224. */ set_gdbarch_frame_red_zone_size (gdbarch, 224); - set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos); - set_gdbarch_believe_pcc_promotion (gdbarch, 1); - set_gdbarch_deprecated_register_convertible (gdbarch, rs6000_register_convertible); - set_gdbarch_deprecated_register_convert_to_virtual (gdbarch, rs6000_register_convert_to_virtual); - set_gdbarch_deprecated_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw); + set_gdbarch_convert_register_p (gdbarch, rs6000_convert_register_p); + set_gdbarch_register_to_value (gdbarch, rs6000_register_to_value); + set_gdbarch_value_to_register (gdbarch, rs6000_value_to_register); + set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, rs6000_dwarf2_reg_to_regnum); /* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments() is correct for the SysV ABI when the wordsize is 8, but I'm also fairly certain that ppc_sysv_abi_push_arguments() will give even @@ -2886,7 +3248,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, rs6000_push_dummy_call); set_gdbarch_deprecated_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address); - set_gdbarch_deprecated_pop_frame (gdbarch, rs6000_pop_frame); set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); @@ -2905,15 +3266,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_frame_args_skip (gdbarch, 8); if (!sysv_abi) - set_gdbarch_use_struct_convention (gdbarch, - rs6000_use_struct_convention); - - set_gdbarch_deprecated_frameless_function_invocation (gdbarch, rs6000_frameless_function_invocation); - set_gdbarch_deprecated_frame_chain (gdbarch, rs6000_frame_chain); - set_gdbarch_deprecated_frame_saved_pc (gdbarch, rs6000_frame_saved_pc); - - set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs); - set_gdbarch_deprecated_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info); + set_gdbarch_deprecated_use_struct_convention (gdbarch, rs6000_use_struct_convention); if (!sysv_abi) { @@ -2922,9 +3275,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_convert_from_func_ptr_addr (gdbarch, rs6000_convert_from_func_ptr_addr); } - set_gdbarch_deprecated_frame_args_address (gdbarch, rs6000_frame_args_address); - set_gdbarch_deprecated_frame_locals_address (gdbarch, rs6000_frame_args_address); - set_gdbarch_deprecated_saved_pc_after_call (gdbarch, rs6000_saved_pc_after_call); /* Helpers for function argument information. */ set_gdbarch_fetch_pointer_argument (gdbarch, rs6000_fetch_pointer_argument); @@ -2932,6 +3282,26 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); + switch (info.osabi) + { + case GDB_OSABI_NETBSD_AOUT: + case GDB_OSABI_NETBSD_ELF: + case GDB_OSABI_UNKNOWN: + case GDB_OSABI_LINUX: + set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc); + frame_unwind_append_sniffer (gdbarch, rs6000_frame_sniffer); + set_gdbarch_unwind_dummy_id (gdbarch, rs6000_unwind_dummy_id); + frame_base_append_sniffer (gdbarch, rs6000_frame_base_sniffer); + break; + default: + set_gdbarch_believe_pcc_promotion (gdbarch, 1); + + set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc); + frame_unwind_append_sniffer (gdbarch, rs6000_frame_sniffer); + set_gdbarch_unwind_dummy_id (gdbarch, rs6000_unwind_dummy_id); + frame_base_append_sniffer (gdbarch, rs6000_frame_base_sniffer); + } + if (from_xcoff_exec) { /* NOTE: jimix/2003-06-09: This test should really check for @@ -2942,6 +3312,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_software_single_step (gdbarch, rs6000_software_single_step); } + init_sim_regno_table (gdbarch); + return gdbarch; } diff --git a/gnu/usr.bin/binutils/gdb/scm-lang.c b/gnu/usr.bin/binutils/gdb/scm-lang.c index 872dcaf89fc..21f39ec9c89 100644 --- a/gnu/usr.bin/binutils/gdb/scm-lang.c +++ b/gnu/usr.bin/binutils/gdb/scm-lang.c @@ -44,8 +44,6 @@ static void scm_printstr (struct ui_file * stream, char *string, unsigned int length, int width, int force_ellipses); -extern struct type **const (c_builtin_types[]); - struct type *builtin_type_scm; void @@ -246,13 +244,15 @@ const struct language_defn scm_language_defn = { "scheme", /* Language name */ language_scm, - c_builtin_types, + NULL, range_check_off, type_check_off, case_sensitive_off, + array_row_major, &exp_descriptor_scm, scm_parse, c_error, + null_post_parser, scm_printchar, /* Print a character constant */ scm_printstr, /* Function to print string constant */ NULL, /* Function to print a single character */ @@ -265,15 +265,13 @@ const struct language_defn scm_language_defn = basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */ basic_lookup_transparent_type,/* lookup_transparent_type */ NULL, /* Language specific symbol demangler */ - {"", "", "", ""}, /* Binary format info */ - {"#o%lo", "#o", "o", ""}, /* Octal format info */ - {"%ld", "", "d", ""}, /* Decimal format info */ - {"#x%lX", "#X", "X", ""}, /* Hex format info */ + NULL, /* Language specific class_name_from_physname */ NULL, /* expression operators for printing */ 1, /* c-style arrays */ 0, /* String lower bound */ - &builtin_type_char, /* Type of string elements */ + NULL, default_word_break_characters, + c_language_arch_info, LANG_MAGIC }; diff --git a/gnu/usr.bin/binutils/gdb/ser-go32.c b/gnu/usr.bin/binutils/gdb/ser-go32.c index cea01cdf221..f9299941976 100644 --- a/gnu/usr.bin/binutils/gdb/ser-go32.c +++ b/gnu/usr.bin/binutils/gdb/ser-go32.c @@ -903,61 +903,61 @@ _initialize_ser_dos (void) intrupts[1].inuse = /* keyboard */ intrupts[2].inuse = 1; /* slave icu */ - add_show_from_set ( - add_set_cmd ("com1base", class_obscure, var_zinteger, - (char *) &ports[0].base, - "Set COM1 base i/o port address.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("com1irq", class_obscure, var_zinteger, - (char *) &ports[0].irq, - "Set COM1 interrupt request.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("com2base", class_obscure, var_zinteger, - (char *) &ports[1].base, - "Set COM2 base i/o port address.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("com2irq", class_obscure, var_zinteger, - (char *) &ports[1].irq, - "Set COM2 interrupt request.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("com3base", class_obscure, var_zinteger, - (char *) &ports[2].base, - "Set COM3 base i/o port address.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("com3irq", class_obscure, var_zinteger, - (char *) &ports[2].irq, - "Set COM3 interrupt request.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("com4base", class_obscure, var_zinteger, - (char *) &ports[3].base, - "Set COM4 base i/o port address.", - &setlist), - &showlist); - - add_show_from_set ( - add_set_cmd ("com4irq", class_obscure, var_zinteger, - (char *) &ports[3].irq, - "Set COM4 interrupt request.", - &setlist), - &showlist); + deprecated_add_show_from_set + (add_set_cmd ("com1base", class_obscure, var_zinteger, + (char *) &ports[0].base, + "Set COM1 base i/o port address.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("com1irq", class_obscure, var_zinteger, + (char *) &ports[0].irq, + "Set COM1 interrupt request.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("com2base", class_obscure, var_zinteger, + (char *) &ports[1].base, + "Set COM2 base i/o port address.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("com2irq", class_obscure, var_zinteger, + (char *) &ports[1].irq, + "Set COM2 interrupt request.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("com3base", class_obscure, var_zinteger, + (char *) &ports[2].base, + "Set COM3 base i/o port address.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("com3irq", class_obscure, var_zinteger, + (char *) &ports[2].irq, + "Set COM3 interrupt request.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("com4base", class_obscure, var_zinteger, + (char *) &ports[3].base, + "Set COM4 base i/o port address.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("com4irq", class_obscure, var_zinteger, + (char *) &ports[3].irq, + "Set COM4 interrupt request.", + &setlist), + &showlist); add_info ("serial", dos_info, "Print DOS serial port status."); diff --git a/gnu/usr.bin/binutils/gdb/ser-tcp.c b/gnu/usr.bin/binutils/gdb/ser-tcp.c index a9a87143cb3..de8c4283744 100644 --- a/gnu/usr.bin/binutils/gdb/ser-tcp.c +++ b/gnu/usr.bin/binutils/gdb/ser-tcp.c @@ -44,12 +44,11 @@ static int net_open (struct serial *scb, const char *name); static void net_close (struct serial *scb); -extern int (*ui_loop_hook) (int); void _initialize_ser_tcp (void); /* seconds to wait for connect */ #define TIMEOUT 15 -/* how many times per second to poll ui_loop_hook */ +/* how many times per second to poll deprecated_ui_loop_hook */ #define POLL_INTERVAL 2 /* Open a tcp socket */ @@ -133,9 +132,9 @@ net_open (struct serial *scb, const char *name) /* While we wait for the connect to complete poll the UI so it can update or the user can interrupt. */ - if (ui_loop_hook) + if (deprecated_ui_loop_hook) { - if (ui_loop_hook (0)) + if (deprecated_ui_loop_hook (0)) { errno = EINTR; net_close (scb); diff --git a/gnu/usr.bin/binutils/gdb/ser-unix.c b/gnu/usr.bin/binutils/gdb/ser-unix.c index 38b6716d2ee..6f64f419b33 100644 --- a/gnu/usr.bin/binutils/gdb/ser-unix.c +++ b/gnu/usr.bin/binutils/gdb/ser-unix.c @@ -99,8 +99,6 @@ static void reschedule (struct serial *scb); void _initialize_ser_hardwire (void); -extern int (*ui_loop_hook) (int); - /* Open up a real live device for serial I/O */ static int @@ -580,11 +578,12 @@ do_hardwire_readchar (struct serial *scb, int timeout) /* N.B. The UI may destroy our world (for instance by calling remote_stop,) in which case we want to get out of here as quickly as possible. It is not safe to touch scb, since - someone else might have freed it. The ui_loop_hook signals that - we should exit by returning 1. */ + someone else might have freed it. The + deprecated_ui_loop_hook signals that we should exit by + returning 1. */ - if (ui_loop_hook) - detach = ui_loop_hook (0); + if (deprecated_ui_loop_hook) + detach = deprecated_ui_loop_hook (0); if (detach) return SERIAL_TIMEOUT; @@ -959,12 +958,13 @@ do_unix_readchar (struct serial *scb, int timeout) /* N.B. The UI may destroy our world (for instance by calling remote_stop,) in which case we want to get out of here as quickly as possible. It is not safe to touch scb, since - someone else might have freed it. The ui_loop_hook signals that - we should exit by returning 1. */ + someone else might have freed it. The + deprecated_ui_loop_hook signals that we should exit by + returning 1. */ - if (ui_loop_hook) + if (deprecated_ui_loop_hook) { - if (ui_loop_hook (0)) + if (deprecated_ui_loop_hook (0)) return SERIAL_TIMEOUT; } diff --git a/gnu/usr.bin/binutils/gdb/serial.c b/gnu/usr.bin/binutils/gdb/serial.c index ada5631dce9..7311dd8d60d 100644 --- a/gnu/usr.bin/binutils/gdb/serial.c +++ b/gnu/usr.bin/binutils/gdb/serial.c @@ -394,7 +394,7 @@ serial_printf (struct serial *desc, const char *format,...) char *buf; va_start (args, format); - xvasprintf (&buf, format, args); + buf = xstrvprintf (format, args); serial_write (desc, buf, strlen (buf)); xfree (buf); @@ -686,7 +686,7 @@ Show default serial/parallel port configuration.", 0/*allow-unknown*/, &showlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("remotelogfile", no_class, var_filename, (char *) &serial_logfile, "Set filename for remote session recording.\n\ @@ -695,18 +695,19 @@ by gdbserver.", &setlist), &showlist); - add_show_from_set + deprecated_add_show_from_set (add_set_enum_cmd ("remotelogbase", no_class, logbase_enums, &serial_logbase, "Set numerical base for remote session logging", &setlist), &showlist); - add_show_from_set (add_set_cmd ("serial", - class_maintenance, - var_zinteger, - (char *)&global_serial_debug_p, - "Set serial debugging.\n\ + deprecated_add_show_from_set + (add_set_cmd ("serial", + class_maintenance, + var_zinteger, + (char *)&global_serial_debug_p, + "Set serial debugging.\n\ When non-zero, serial port debugging is enabled.", &setdebuglist), - &showdebuglist); + &showdebuglist); } diff --git a/gnu/usr.bin/binutils/gdb/serial.h b/gnu/usr.bin/binutils/gdb/serial.h index 7495b709d57..abe76b00679 100644 --- a/gnu/usr.bin/binutils/gdb/serial.h +++ b/gnu/usr.bin/binutils/gdb/serial.h @@ -62,8 +62,9 @@ extern void serial_un_fdopen (struct serial *scb); enum serial_rc { SERIAL_ERROR = -1, /* General error. */ SERIAL_TIMEOUT = -2, /* Timeout or data-not-ready during read. - Unfortunately, through ui_loop_hook(), this - can also be a QUIT indication. */ + Unfortunately, through + deprecated_ui_loop_hook(), this can also be + a QUIT indication. */ SERIAL_EOF = -3 /* General end-of-file or remote target connection closed, indication. Includes things like the line dropping dead. */ diff --git a/gnu/usr.bin/binutils/gdb/sh-tdep.c b/gnu/usr.bin/binutils/gdb/sh-tdep.c index 9cb5278c4d4..48e994d4e2e 100644 --- a/gnu/usr.bin/binutils/gdb/sh-tdep.c +++ b/gnu/usr.bin/binutils/gdb/sh-tdep.c @@ -56,7 +56,7 @@ static void (*sh_show_regs) (void); -#define SH_NUM_REGS 59 +#define SH_NUM_REGS 67 struct sh_frame_cache { @@ -86,6 +86,7 @@ sh_sh_register_name (int reg_nr) "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", }; if (reg_nr < 0) return NULL; @@ -107,6 +108,7 @@ sh_sh3_register_name (int reg_nr) "ssr", "spc", "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1" + "", "", "", "", "", "", "", "", }; if (reg_nr < 0) return NULL; @@ -128,6 +130,7 @@ sh_sh3e_register_name (int reg_nr) "ssr", "spc", "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1", + "", "", "", "", "", "", "", "", }; if (reg_nr < 0) return NULL; @@ -149,6 +152,87 @@ sh_sh2e_register_name (int reg_nr) "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + }; + if (reg_nr < 0) + return NULL; + if (reg_nr >= (sizeof (register_names) / sizeof (*register_names))) + return NULL; + return register_names[reg_nr]; +} + +static const char * +sh_sh2a_register_name (int reg_nr) +{ + static char *register_names[] = { + /* general registers 0-15 */ + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + /* 16 - 22 */ + "pc", "pr", "gbr", "vbr", "mach", "macl", "sr", + /* 23, 24 */ + "fpul", "fpscr", + /* floating point registers 25 - 40 */ + "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", + "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", + /* 41, 42 */ + "", "", + /* 43 - 62. Banked registers. The bank number used is determined by + the bank register (63). */ + "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b", + "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", + "machb", "ivnb", "prb", "gbrb", "maclb", + /* 63: register bank number, not a real register but used to + communicate the register bank currently get/set. This register + is hidden to the user, who manipulates it using the pseudo + register called "bank" (67). See below. */ + "", + /* 64 - 66 */ + "ibcr", "ibnr", "tbr", + /* 67: register bank number, the user visible pseudo register. */ + "bank", + /* double precision (pseudo) 68 - 75 */ + "dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14", + }; + if (reg_nr < 0) + return NULL; + if (reg_nr >= (sizeof (register_names) / sizeof (*register_names))) + return NULL; + return register_names[reg_nr]; +} + +static const char * +sh_sh2a_nofpu_register_name (int reg_nr) +{ + static char *register_names[] = { + /* general registers 0-15 */ + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + /* 16 - 22 */ + "pc", "pr", "gbr", "vbr", "mach", "macl", "sr", + /* 23, 24 */ + "", "", + /* floating point registers 25 - 40 */ + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + /* 41, 42 */ + "", "", + /* 43 - 62. Banked registers. The bank number used is determined by + the bank register (63). */ + "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b", + "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", + "machb", "ivnb", "prb", "gbrb", "maclb", + /* 63: register bank number, not a real register but used to + communicate the register bank currently get/set. This register + is hidden to the user, who manipulates it using the pseudo + register called "bank" (67). See below. */ + "", + /* 64 - 66 */ + "ibcr", "ibnr", "tbr", + /* 67: register bank number, the user visible pseudo register. */ + "bank", + /* double precision (pseudo) 68 - 75 */ + "", "", "", "", "", "", "", "", }; if (reg_nr < 0) return NULL; @@ -170,6 +254,7 @@ sh_sh_dsp_register_name (int reg_nr) "", "", "rs", "re", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", }; if (reg_nr < 0) return NULL; @@ -192,6 +277,7 @@ sh_sh3_dsp_register_name (int reg_nr) "rs", "re", "", "", "", "", "", "", "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", }; if (reg_nr < 0) return NULL; @@ -220,6 +306,9 @@ sh_sh4_register_name (int reg_nr) "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", /* bank 1 51 - 58 */ "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1", + "", "", "", "", "", "", "", "", + /* pseudo bank register. */ + "", /* double precision (pseudo) 59 - 66 */ "dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14", /* vectors (pseudo) 67 - 70 */ @@ -254,6 +343,9 @@ sh_sh4_nofpu_register_name (int reg_nr) "r0b0", "r1b0", "r2b0", "r3b0", "r4b0", "r5b0", "r6b0", "r7b0", /* bank 1 51 - 58 */ "r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1", + "", "", "", "", "", "", "", "", + /* pseudo bank register. */ + "", /* double precision (pseudo) 59 - 66 -- not for nofpu target */ "", "", "", "", "", "", "", "", /* vectors (pseudo) 67 - 70 -- not for nofpu target */ @@ -280,6 +372,7 @@ sh_sh4al_dsp_register_name (int reg_nr) "rs", "re", "", "", "", "", "", "", "r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", }; if (reg_nr < 0) return NULL; @@ -318,6 +411,10 @@ sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) r15-4-->r15, PR-->(r15) */ #define IS_STS(x) ((x) == 0x4f22) +/* STS.L MACL,@-r15 0100111100010010 + r15-4-->r15, MACL-->(r15) */ +#define IS_MACL_STS(x) ((x) == 0x4f12) + /* MOV.L Rm,@-r15 00101111mmmm0110 r15-4-->r15, Rm-->(R15) */ #define IS_PUSH(x) (((x) & 0xff0f) == 0x2f06) @@ -365,6 +462,8 @@ sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) #define IS_MOVW_PCREL_TO_REG(x) (((x) & 0xf000) == 0x9000) /* MOV.L @(disp*4,PC),Rn 1101nnnndddddddd */ #define IS_MOVL_PCREL_TO_REG(x) (((x) & 0xf000) == 0xd000) +/* MOVI20 #imm20,Rn 0000nnnniiii0000 */ +#define IS_MOVI20(x) (((x) & 0xf00f) == 0x0000) /* SUB Rn,R15 00111111nnnn1000 */ #define IS_SUB_REG_FROM_SP(x) (((x) & 0xff0f) == 0x3f08) @@ -374,6 +473,7 @@ sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) #define IS_RESTORE_FP(x) ((x) == 0x6ef6) #define IS_RTS(x) ((x) == 0x000b) #define IS_LDS(x) ((x) == 0x4f26) +#define IS_MACL_LDS(x) ((x) == 0x4f16) #define IS_MOV_FP_SP(x) ((x) == 0x6fe3) #define IS_ADD_REG_TO_FP(x) (((x) & 0xff0f) == 0x3e0c) #define IS_ADD_IMM_FP(x) (((x) & 0xff00) == 0x7e00) @@ -415,6 +515,11 @@ sh_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc, cache->saved_regs[PR_REGNUM] = cache->sp_offset; cache->sp_offset += 4; } + else if (IS_MACL_STS (inst)) + { + cache->saved_regs[MACL_REGNUM] = cache->sp_offset; + cache->sp_offset += 4; + } else if (IS_MOV_R3 (inst)) { r3_val = ((inst & 0xff) ^ 0x80) - 0x80; @@ -440,9 +545,9 @@ sh_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc, if (reg < 14) { sav_reg = reg; - offset = (((inst & 0xff) ^ 0x80) - 0x80) << 1; + offset = (inst & 0xff) << 1; sav_offset = - read_memory_integer (((pc + 4) & ~3) + offset, 2); + read_memory_integer ((pc + 4) + offset, 2); } } } @@ -450,13 +555,32 @@ sh_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc, { if (sav_reg < 0) { - reg = (inst & 0x0f00) >> 8; + reg = GET_TARGET_REG (inst); if (reg < 14) { sav_reg = reg; - offset = (((inst & 0xff) ^ 0x80) - 0x80) << 1; + offset = (inst & 0xff) << 2; sav_offset = - read_memory_integer (((pc + 4) & ~3) + offset, 4); + read_memory_integer (((pc & 0xfffffffc) + 4) + offset, 4); + } + } + } + else if (IS_MOVI20 (inst)) + { + if (sav_reg < 0) + { + reg = GET_TARGET_REG (inst); + if (reg < 14) + { + sav_reg = reg; + sav_offset = GET_SOURCE_REG (inst) << 16; + /* MOVI20 is a 32 bit instruction! */ + pc += 2; + sav_offset |= read_memory_unsigned_integer (pc, 2); + /* Now sav_offset contains an unsigned 20 bit value. + It must still get sign extended. */ + if (sav_offset & 0x00080000) + sav_offset |= 0xfff00000; } } } @@ -885,7 +1009,7 @@ sh_treat_as_flt_p (struct type *type) static CORE_ADDR sh_push_dummy_call_fpu (struct gdbarch *gdbarch, - CORE_ADDR func_addr, + struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, @@ -997,7 +1121,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch, static CORE_ADDR sh_push_dummy_call_nofpu (struct gdbarch *gdbarch, - CORE_ADDR func_addr, + struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, @@ -1147,12 +1271,44 @@ sh3e_sh4_store_return_value (struct type *type, struct regcache *regcache, int len = TYPE_LENGTH (type); int i, regnum = FP0_REGNUM; for (i = 0; i < len; i += 4) - regcache_raw_write (regcache, regnum++, (char *) valbuf + i); + if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE) + regcache_raw_write (regcache, regnum++, + (char *) valbuf + len - 4 - i); + else + regcache_raw_write (regcache, regnum++, (char *) valbuf + i); } else sh_default_store_return_value (type, regcache, valbuf); } +static enum return_value_convention +sh_return_value_nofpu (struct gdbarch *gdbarch, struct type *type, + struct regcache *regcache, + void *readbuf, const void *writebuf) +{ + if (sh_use_struct_convention (0, type)) + return RETURN_VALUE_STRUCT_CONVENTION; + if (writebuf) + sh_default_store_return_value (type, regcache, writebuf); + else if (readbuf) + sh_default_extract_return_value (type, regcache, readbuf); + return RETURN_VALUE_REGISTER_CONVENTION; +} + +static enum return_value_convention +sh_return_value_fpu (struct gdbarch *gdbarch, struct type *type, + struct regcache *regcache, + void *readbuf, const void *writebuf) +{ + if (sh_use_struct_convention (0, type)) + return RETURN_VALUE_STRUCT_CONVENTION; + if (writebuf) + sh3e_sh4_store_return_value (type, regcache, writebuf); + else if (readbuf) + sh3e_sh4_extract_return_value (type, regcache, readbuf); + return RETURN_VALUE_REGISTER_CONVENTION; +} + /* Print the registers in a form similar to the E7000 */ static void @@ -1247,6 +1403,141 @@ sh2e_show_regs (void) } static void +sh2a_show_regs (void) +{ + int pr = read_register (FPSCR_REGNUM) & 0x80000; + printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n", + paddr (read_register (PC_REGNUM)), + (long) read_register (SR_REGNUM), + (long) read_register (PR_REGNUM), + (long) read_register (MACH_REGNUM), + (long) read_register (MACL_REGNUM)); + + printf_filtered ("GBR=%08lx VBR=%08lx TBR=%08lx", + (long) read_register (GBR_REGNUM), + (long) read_register (VBR_REGNUM), + (long) read_register (TBR_REGNUM)); + printf_filtered (" FPUL=%08lx FPSCR=%08lx\n", + (long) read_register (FPUL_REGNUM), + (long) read_register (FPSCR_REGNUM)); + + printf_filtered ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (0), (long) read_register (1), + (long) read_register (2), (long) read_register (3), + (long) read_register (4), (long) read_register (5), + (long) read_register (6), (long) read_register (7)); + printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (8), (long) read_register (9), + (long) read_register (10), (long) read_register (11), + (long) read_register (12), (long) read_register (13), + (long) read_register (14), (long) read_register (15)); + + printf_filtered ((pr + ? "DR0-DR6 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" + : + "FP0-FP7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"), + (long) read_register (FP0_REGNUM + 0), + (long) read_register (FP0_REGNUM + 1), + (long) read_register (FP0_REGNUM + 2), + (long) read_register (FP0_REGNUM + 3), + (long) read_register (FP0_REGNUM + 4), + (long) read_register (FP0_REGNUM + 5), + (long) read_register (FP0_REGNUM + 6), + (long) read_register (FP0_REGNUM + 7)); + printf_filtered ((pr ? + "DR8-DR14 %08lx%08lx %08lx%08lx %08lx%08lx %08lx%08lx\n" : + "FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"), + (long) read_register (FP0_REGNUM + 8), + (long) read_register (FP0_REGNUM + 9), + (long) read_register (FP0_REGNUM + 10), + (long) read_register (FP0_REGNUM + 11), + (long) read_register (FP0_REGNUM + 12), + (long) read_register (FP0_REGNUM + 13), + (long) read_register (FP0_REGNUM + 14), + (long) read_register (FP0_REGNUM + 15)); + printf_filtered ("BANK=%-3d\n", (int) read_register (BANK_REGNUM)); + printf_filtered ("R0b - R7b %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (R0_BANK0_REGNUM + 0), + (long) read_register (R0_BANK0_REGNUM + 1), + (long) read_register (R0_BANK0_REGNUM + 2), + (long) read_register (R0_BANK0_REGNUM + 3), + (long) read_register (R0_BANK0_REGNUM + 4), + (long) read_register (R0_BANK0_REGNUM + 5), + (long) read_register (R0_BANK0_REGNUM + 6), + (long) read_register (R0_BANK0_REGNUM + 7)); + printf_filtered ("R8b - R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (R0_BANK0_REGNUM + 8), + (long) read_register (R0_BANK0_REGNUM + 9), + (long) read_register (R0_BANK0_REGNUM + 10), + (long) read_register (R0_BANK0_REGNUM + 11), + (long) read_register (R0_BANK0_REGNUM + 12), + (long) read_register (R0_BANK0_REGNUM + 13), + (long) read_register (R0_BANK0_REGNUM + 14)); + printf_filtered ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n", + (long) read_register (R0_BANK0_REGNUM + 15), + (long) read_register (R0_BANK0_REGNUM + 16), + (long) read_register (R0_BANK0_REGNUM + 17), + (long) read_register (R0_BANK0_REGNUM + 18), + (long) read_register (R0_BANK0_REGNUM + 19)); +} + +static void +sh2a_nofpu_show_regs (void) +{ + int pr = read_register (FPSCR_REGNUM) & 0x80000; + printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n", + paddr (read_register (PC_REGNUM)), + (long) read_register (SR_REGNUM), + (long) read_register (PR_REGNUM), + (long) read_register (MACH_REGNUM), + (long) read_register (MACL_REGNUM)); + + printf_filtered ("GBR=%08lx VBR=%08lx TBR=%08lx", + (long) read_register (GBR_REGNUM), + (long) read_register (VBR_REGNUM), + (long) read_register (TBR_REGNUM)); + printf_filtered (" FPUL=%08lx FPSCR=%08lx\n", + (long) read_register (FPUL_REGNUM), + (long) read_register (FPSCR_REGNUM)); + + printf_filtered ("R0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (0), (long) read_register (1), + (long) read_register (2), (long) read_register (3), + (long) read_register (4), (long) read_register (5), + (long) read_register (6), (long) read_register (7)); + printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (8), (long) read_register (9), + (long) read_register (10), (long) read_register (11), + (long) read_register (12), (long) read_register (13), + (long) read_register (14), (long) read_register (15)); + + printf_filtered ("BANK=%-3d\n", (int) read_register (BANK_REGNUM)); + printf_filtered ("R0b - R7b %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (R0_BANK0_REGNUM + 0), + (long) read_register (R0_BANK0_REGNUM + 1), + (long) read_register (R0_BANK0_REGNUM + 2), + (long) read_register (R0_BANK0_REGNUM + 3), + (long) read_register (R0_BANK0_REGNUM + 4), + (long) read_register (R0_BANK0_REGNUM + 5), + (long) read_register (R0_BANK0_REGNUM + 6), + (long) read_register (R0_BANK0_REGNUM + 7)); + printf_filtered ("R8b - R14b %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + (long) read_register (R0_BANK0_REGNUM + 8), + (long) read_register (R0_BANK0_REGNUM + 9), + (long) read_register (R0_BANK0_REGNUM + 10), + (long) read_register (R0_BANK0_REGNUM + 11), + (long) read_register (R0_BANK0_REGNUM + 12), + (long) read_register (R0_BANK0_REGNUM + 13), + (long) read_register (R0_BANK0_REGNUM + 14)); + printf_filtered ("MACHb=%08lx IVNb=%08lx PRb=%08lx GBRb=%08lx MACLb=%08lx\n", + (long) read_register (R0_BANK0_REGNUM + 15), + (long) read_register (R0_BANK0_REGNUM + 16), + (long) read_register (R0_BANK0_REGNUM + 17), + (long) read_register (R0_BANK0_REGNUM + 18), + (long) read_register (R0_BANK0_REGNUM + 19)); +} + +static void sh3e_show_regs (void) { printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n", @@ -1467,6 +1758,18 @@ sh_show_regs_command (char *args, int from_tty) (*sh_show_regs) (); } +static struct type * +sh_sh2a_register_type (struct gdbarch *gdbarch, int reg_nr) +{ + if ((reg_nr >= FP0_REGNUM + && (reg_nr <= FP_LAST_REGNUM)) || (reg_nr == FPUL_REGNUM)) + return builtin_type_float; + else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM) + return builtin_type_double; + else + return builtin_type_int; +} + /* Return the GDB type object for the "standard" data type of data in register N. */ static struct type * @@ -1591,6 +1894,9 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int base_regnum, portion; char temp_buffer[MAX_REGISTER_SIZE]; + if (reg_nr == PSEUDO_BANK_REGNUM) + regcache_raw_read (regcache, BANK_REGNUM, buffer); + else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM) { base_regnum = dr_reg_base_num (reg_nr); @@ -1627,7 +1933,19 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int base_regnum, portion; char temp_buffer[MAX_REGISTER_SIZE]; - if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM) + if (reg_nr == PSEUDO_BANK_REGNUM) + { + /* When the bank register is written to, the whole register bank + is switched and all values in the bank registers must be read + from the target/sim again. We're just invalidating the regcache + so that a re-read happens next time it's necessary. */ + int bregnum; + + regcache_raw_write (regcache, BANK_REGNUM, buffer); + for (bregnum = R0_BANK0_REGNUM; bregnum < MACLB_REGNUM; ++bregnum) + set_register_cached (bregnum, 0); + } + else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM) { base_regnum = dr_reg_base_num (reg_nr); @@ -1681,6 +1999,12 @@ do_dr_register_info (struct gdbarch *gdbarch, struct ui_file *file, (int) read_register (first_fp_reg_num), (int) read_register (first_fp_reg_num + 1)); } +static void +do_bank_register_info (struct gdbarch *gdbarch, struct ui_file *file) +{ + fprintf_filtered (file, "bank %d\n", + (int) read_register (BANK_REGNUM)); +} static void sh_print_pseudo_register (struct gdbarch *gdbarch, struct ui_file *file, @@ -1689,6 +2013,8 @@ sh_print_pseudo_register (struct gdbarch *gdbarch, struct ui_file *file, if (regnum < NUM_REGS || regnum >= NUM_REGS + NUM_PSEUDO_REGS) internal_error (__FILE__, __LINE__, "Invalid pseudo register number %d\n", regnum); + else if (regnum == PSEUDO_BANK_REGNUM) + do_bank_register_info (gdbarch, file); else if (regnum >= DR0_REGNUM && regnum <= DR_LAST_REGNUM) do_dr_register_info (gdbarch, file, regnum); else if (regnum >= FV0_REGNUM && regnum <= FV_LAST_REGNUM) @@ -1792,37 +2118,30 @@ sh_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, else /* do all (or most) registers */ { - regnum = 0; - while (regnum < NUM_REGS) + for (regnum = 0; regnum < NUM_REGS; ++regnum) { /* If the register name is empty, it is undefined for this processor, so don't display anything. */ if (REGISTER_NAME (regnum) == NULL || *(REGISTER_NAME (regnum)) == '\0') - { - regnum++; - continue; - } + continue; if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT) { + /* true for "INFO ALL-REGISTERS" command */ if (fpregs) - { - /* true for "INFO ALL-REGISTERS" command */ - sh_do_fp_register (gdbarch, file, regnum); /* FP regs */ - regnum++; - } - else - regnum += (FP_LAST_REGNUM - FP0_REGNUM); /* skip FP regs */ + sh_do_fp_register (gdbarch, file, regnum); /* FP regs */ } else - { - sh_do_register (gdbarch, file, regnum); /* All other regs */ - regnum++; - } + sh_do_register (gdbarch, file, regnum); /* All other regs */ } + if (regnum == PSEUDO_BANK_REGNUM + && REGISTER_NAME (regnum) + && *REGISTER_NAME (regnum)) + sh_print_pseudo_register (gdbarch, file, regnum++); + if (fpregs) while (regnum < NUM_REGS + NUM_PSEUDO_REGS) { @@ -1832,8 +2151,6 @@ sh_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, } } -#ifdef SVR4_SHARED_LIBS - /* Fetch (and possibly build) an appropriate link_map_offsets structure for native i386 linux targets using the struct offsets defined in link.h (but without actual reference to that file). @@ -1874,7 +2191,6 @@ sh_linux_svr4_fetch_link_map_offsets (void) return lmp; } -#endif /* SVR4_SHARED_LIBS */ static int sh_dsp_register_sim_regno (int nr) @@ -1894,6 +2210,35 @@ sh_dsp_register_sim_regno (int nr) return nr; } +static int +sh_sh2a_register_sim_regno (int nr) +{ + switch (nr) + { + case TBR_REGNUM: + return SIM_SH_TBR_REGNUM; + case IBNR_REGNUM: + return SIM_SH_IBNR_REGNUM; + case IBCR_REGNUM: + return SIM_SH_IBCR_REGNUM; + case BANK_REGNUM: + return SIM_SH_BANK_REGNUM; + case MACLB_REGNUM: + return SIM_SH_BANK_MACL_REGNUM; + case GBRB_REGNUM: + return SIM_SH_BANK_GBR_REGNUM; + case PRB_REGNUM: + return SIM_SH_BANK_PR_REGNUM; + case IVNB_REGNUM: + return SIM_SH_BANK_IVN_REGNUM; + case MACHB_REGNUM: + return SIM_SH_BANK_MACH_REGNUM; + default: + break; + } + return legacy_register_sim_regno (nr); +} + static struct sh_frame_cache * sh_alloc_frame_cache (void) { @@ -2118,8 +2463,16 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) else if (!IS_RESTORE_FP (read_memory_unsigned_integer (addr + 2, 2))) return 0; - /* Step over possible lds.l @r15+,pr. */ inst = read_memory_unsigned_integer (addr - 2, 2); + + /* Step over possible lds.l @r15+,macl. */ + if (IS_MACL_LDS (inst)) + { + addr -= 2; + inst = read_memory_unsigned_integer (addr - 2, 2); + } + + /* Step over possible lds.l @r15+,pr. */ if (IS_LDS (inst)) { addr -= 2; @@ -2142,6 +2495,14 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) inst = read_memory_unsigned_integer (addr - 2, 2); } + /* On SH2a check if the previous instruction was perhaps a MOVI20. + That's allowed for the epilogue. */ + if ((gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_sh2a + || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_sh2a_nofpu) + && addr > func_addr + 6 + && IS_MOVI20 (read_memory_unsigned_integer (addr - 4, 2))) + addr -= 4; + if (pc >= addr) return 1; } @@ -2161,6 +2522,12 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) case bfd_mach_sh2e: sh_show_regs = sh2e_show_regs; break; + case bfd_mach_sh2a: + sh_show_regs = sh2a_show_regs; + break; + case bfd_mach_sh2a_nofpu: + sh_show_regs = sh2a_nofpu_show_regs; + break; case bfd_mach_sh_dsp: sh_show_regs = sh_dsp_show_regs; break; @@ -2188,10 +2555,12 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) sh_show_regs = sh4_nofpu_show_regs; break; +#if 0 case bfd_mach_sh5: sh_show_regs = sh64_show_regs; /* SH5 is handled entirely in sh64-tdep.c */ return sh64_gdbarch_init (info, arches); +#endif } /* If there is already a candidate, use it. */ @@ -2223,23 +2592,21 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info); set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc); - set_gdbarch_use_struct_convention (gdbarch, sh_use_struct_convention); set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh); set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno); set_gdbarch_write_pc (gdbarch, generic_target_write_pc); - set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value); - set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value); - set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address); + set_gdbarch_return_value (gdbarch, sh_return_value_nofpu); + set_gdbarch_deprecated_extract_struct_value_address (gdbarch, + sh_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue); set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu); - set_gdbarch_deprecated_frameless_function_invocation (gdbarch, legacy_frameless_look_for_prologue); set_gdbarch_believe_pcc_promotion (gdbarch, 1); set_gdbarch_frame_align (gdbarch, sh_frame_align); @@ -2267,12 +2634,32 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, sh_sh2e_register_name); set_gdbarch_register_type (gdbarch, sh_sh3e_register_type); set_gdbarch_fp0_regnum (gdbarch, 25); - set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value); - set_gdbarch_extract_return_value (gdbarch, - sh3e_sh4_extract_return_value); + set_gdbarch_return_value (gdbarch, sh_return_value_fpu); set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu); break; + case bfd_mach_sh2a: + set_gdbarch_register_name (gdbarch, sh_sh2a_register_name); + set_gdbarch_register_type (gdbarch, sh_sh2a_register_type); + set_gdbarch_register_sim_regno (gdbarch, sh_sh2a_register_sim_regno); + + set_gdbarch_fp0_regnum (gdbarch, 25); + set_gdbarch_num_pseudo_regs (gdbarch, 9); + set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write); + set_gdbarch_return_value (gdbarch, sh_return_value_fpu); + set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu); + break; + + case bfd_mach_sh2a_nofpu: + set_gdbarch_register_name (gdbarch, sh_sh2a_nofpu_register_name); + set_gdbarch_register_sim_regno (gdbarch, sh_sh2a_register_sim_regno); + + set_gdbarch_num_pseudo_regs (gdbarch, 1); + set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read); + set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write); + break; + case bfd_mach_sh_dsp: set_gdbarch_register_name (gdbarch, sh_sh_dsp_register_name); set_gdbarch_register_sim_regno (gdbarch, sh_dsp_register_sim_regno); @@ -2289,9 +2676,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, sh_sh3e_register_name); set_gdbarch_register_type (gdbarch, sh_sh3e_register_type); set_gdbarch_fp0_regnum (gdbarch, 25); - set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value); - set_gdbarch_extract_return_value (gdbarch, - sh3e_sh4_extract_return_value); + set_gdbarch_return_value (gdbarch, sh_return_value_fpu); set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu); break; @@ -2305,12 +2690,10 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_name (gdbarch, sh_sh4_register_name); set_gdbarch_register_type (gdbarch, sh_sh4_register_type); set_gdbarch_fp0_regnum (gdbarch, 25); - set_gdbarch_num_pseudo_regs (gdbarch, 12); + set_gdbarch_num_pseudo_regs (gdbarch, 13); set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read); set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write); - set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value); - set_gdbarch_extract_return_value (gdbarch, - sh3e_sh4_extract_return_value); + set_gdbarch_return_value (gdbarch, sh_return_value_fpu); set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu); break; diff --git a/gnu/usr.bin/binutils/gdb/sh3-rom.c b/gnu/usr.bin/binutils/gdb/sh3-rom.c index cec9fbae85b..327e76a85a5 100644 --- a/gnu/usr.bin/binutils/gdb/sh3-rom.c +++ b/gnu/usr.bin/binutils/gdb/sh3-rom.c @@ -228,7 +228,7 @@ init_sh3_cmds (void) sh3_cmds.getreg.term_cmd = ".\r"; /* getreg.term_cmd */ sh3_cmds.dump_registers = "r\r"; /* dump_registers */ sh3_cmds.register_pattern = "\\(\\w+\\)=\\([0-9a-fA-F]+\\( +[0-9a-fA-F]+\\b\\)*\\)"; - sh3_cmds.supply_register = sh3_supply_register; /* supply_register */ + sh3_cmds.supply_register = sh3_supply_register; sh3_cmds.load_routine = sh3_load; /* load_routine */ sh3_cmds.load = NULL; /* download command */ sh3_cmds.loadresp = NULL; /* Load response */ diff --git a/gnu/usr.bin/binutils/gdb/sol-thread.c b/gnu/usr.bin/binutils/gdb/sol-thread.c index 3ac2a34d62b..820317b167d 100644 --- a/gnu/usr.bin/binutils/gdb/sol-thread.c +++ b/gnu/usr.bin/binutils/gdb/sol-thread.c @@ -1,5 +1,6 @@ -/* Low level interface for debugging Solaris threads for GDB, the GNU debugger. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +/* Solaris threads debugging interface. + + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -20,32 +21,35 @@ Boston, MA 02111-1307, USA. */ /* This module implements a sort of half target that sits between the - machine-independent parts of GDB and the /proc interface (procfs.c) to - provide access to the Solaris user-mode thread implementation. - - Solaris threads are true user-mode threads, which are invoked via the thr_* - and pthread_* (native and Posix respectivly) interfaces. These are mostly - implemented in user-space, with all thread context kept in various - structures that live in the user's heap. These should not be confused with - lightweight processes (LWPs), which are implemented by the kernel, and - scheduled without explicit intervention by the process. - - Just to confuse things a little, Solaris threads (both native and Posix) are - actually implemented using LWPs. In general, there are going to be more - threads than LWPs. There is no fixed correspondence between a thread and an - LWP. When a thread wants to run, it gets scheduled onto the first available - LWP and can therefore migrate from one LWP to another as time goes on. A + machine-independent parts of GDB and the /proc interface (procfs.c) + to provide access to the Solaris user-mode thread implementation. + + Solaris threads are true user-mode threads, which are invoked via + the thr_* and pthread_* (native and POSIX respectivly) interfaces. + These are mostly implemented in user-space, with all thread context + kept in various structures that live in the user's heap. These + should not be confused with lightweight processes (LWPs), which are + implemented by the kernel, and scheduled without explicit + intervention by the process. + + Just to confuse things a little, Solaris threads (both native and + POSIX) are actually implemented using LWPs. In general, there are + going to be more threads than LWPs. There is no fixed + correspondence between a thread and an LWP. When a thread wants to + run, it gets scheduled onto the first available LWP and can + therefore migrate from one LWP to another as time goes on. A sleeping thread may not be associated with an LWP at all! - To make it possible to mess with threads, Sun provides a library called - libthread_db.so.1 (not to be confused with libthread_db.so.0, which doesn't - have a published interface). This interface has an upper part, which it - provides, and a lower part which I provide. The upper part consists of the - td_* routines, which allow me to find all the threads, query their state, - etc... The lower part consists of all of the ps_*, which are used by the - td_* routines to read/write memory, manipulate LWPs, lookup symbols, etc... - The ps_* routines actually do most of their work by calling functions in - procfs.c. */ + To make it possible to mess with threads, Sun provides a library + called libthread_db.so.1 (not to be confused with + libthread_db.so.0, which doesn't have a published interface). This + interface has an upper part, which it provides, and a lower part + which we provide. The upper part consists of the td_* routines, + which allow us to find all the threads, query their state, etc... + The lower part consists of all of the ps_*, which are used by the + td_* routines to read/write memory, manipulate LWPs, lookup + symbols, etc... The ps_* routines actually do most of their work + by calling functions in procfs.c. */ #include "defs.h" #include <thread.h> @@ -81,38 +85,34 @@ extern char *procfs_pid_to_str (ptid_t ptid); /* Prototypes for supply_gregset etc. */ #include "gregset.h" -/* This struct is defined by us, but mainly used for the proc_service interface. - We don't have much use for it, except as a handy place to get a real pid - for memory accesses. */ +/* This struct is defined by us, but mainly used for the proc_service + interface. We don't have much use for it, except as a handy place + to get a real PID for memory accesses. */ struct ps_prochandle - { - ptid_t ptid; - }; +{ + ptid_t ptid; +}; struct string_map - { - int num; - char *str; - }; +{ + int num; + char *str; +}; static struct ps_prochandle main_ph; static td_thragent_t *main_ta; static int sol_thread_active = 0; -static char *td_err_string (td_err_e errcode); -static char *td_state_string (td_thr_state_e statecode); -static ptid_t thread_to_lwp (ptid_t thread_id, int default_lwp); static void sol_thread_resume (ptid_t ptid, int step, enum target_signal signo); -static ptid_t lwp_to_thread (ptid_t lwp); static int sol_thread_alive (ptid_t ptid); static void sol_core_close (int quitting); static void init_sol_thread_ops (void); static void init_sol_core_ops (void); -/* Default definitions: These must be defined in tm.h - if they are to be shared with a process module such as procfs. */ +/* Default definitions: These must be defined in tm.h if they are to + be shared with a process module such as procfs. */ #define GET_PID(ptid) ptid_get_pid (ptid) #define GET_LWP(ptid) ptid_get_lwp (ptid) @@ -124,105 +124,87 @@ static void init_sol_core_ops (void); #define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) #define BUILD_THREAD(tid, pid) ptid_build (pid, 0, tid) -/* Pointers to routines from lithread_db resolved by dlopen() */ - -static void (*p_td_log) (const int on_off); -static td_err_e (*p_td_ta_new) (const struct ps_prochandle * ph_p, - td_thragent_t ** ta_pp); -static td_err_e (*p_td_ta_delete) (td_thragent_t * ta_p); -static td_err_e (*p_td_init) (void); -static td_err_e (*p_td_ta_get_ph) (const td_thragent_t * ta_p, - struct ps_prochandle ** ph_pp); -static td_err_e (*p_td_ta_get_nthreads) (const td_thragent_t * ta_p, - int *nthread_p); -static td_err_e (*p_td_ta_tsd_iter) (const td_thragent_t * ta_p, - td_key_iter_f * cb, - void *cbdata_p); -static td_err_e (*p_td_ta_thr_iter) (const td_thragent_t * ta_p, - td_thr_iter_f * cb, - void *cbdata_p, - td_thr_state_e state, - int ti_pri, - sigset_t * ti_sigmask_p, - unsigned ti_user_flags); -static td_err_e (*p_td_thr_validate) (const td_thrhandle_t * th_p); -static td_err_e (*p_td_thr_tsd) (const td_thrhandle_t * th_p, - const thread_key_t key, - void **data_pp); -static td_err_e (*p_td_thr_get_info) (const td_thrhandle_t * th_p, - td_thrinfo_t * ti_p); -static td_err_e (*p_td_thr_getfpregs) (const td_thrhandle_t * th_p, - prfpregset_t * fpregset); -static td_err_e (*p_td_thr_getxregsize) (const td_thrhandle_t * th_p, - int *xregsize); -static td_err_e (*p_td_thr_getxregs) (const td_thrhandle_t * th_p, - const caddr_t xregset); -static td_err_e (*p_td_thr_sigsetmask) (const td_thrhandle_t * th_p, - const sigset_t ti_sigmask); -static td_err_e (*p_td_thr_setprio) (const td_thrhandle_t * th_p, - const int ti_pri); -static td_err_e (*p_td_thr_setsigpending) (const td_thrhandle_t * th_p, - const uchar_t ti_pending_flag, - const sigset_t ti_pending); -static td_err_e (*p_td_thr_setfpregs) (const td_thrhandle_t * th_p, - const prfpregset_t * fpregset); -static td_err_e (*p_td_thr_setxregs) (const td_thrhandle_t * th_p, - const caddr_t xregset); -static td_err_e (*p_td_ta_map_id2thr) (const td_thragent_t * ta_p, - thread_t tid, - td_thrhandle_t * th_p); -static td_err_e (*p_td_ta_map_lwp2thr) (const td_thragent_t * ta_p, - lwpid_t lwpid, - td_thrhandle_t * th_p); -static td_err_e (*p_td_thr_getgregs) (const td_thrhandle_t * th_p, - prgregset_t regset); -static td_err_e (*p_td_thr_setgregs) (const td_thrhandle_t * th_p, - const prgregset_t regset); - -/* - - LOCAL FUNCTION - - td_err_string - Convert a thread_db error code to a string - - SYNOPSIS - - char * td_err_string (errcode) - - DESCRIPTION - - Return the thread_db error string associated with errcode. If errcode - is unknown, then return a message. +/* Pointers to routines from libthread_db resolved by dlopen(). */ + +static void (*p_td_log)(const int on_off); +static td_err_e (*p_td_ta_new)(const struct ps_prochandle *ph_p, + td_thragent_t **ta_pp); +static td_err_e (*p_td_ta_delete)(td_thragent_t *ta_p); +static td_err_e (*p_td_init)(void); +static td_err_e (*p_td_ta_get_ph)(const td_thragent_t *ta_p, + struct ps_prochandle **ph_pp); +static td_err_e (*p_td_ta_get_nthreads)(const td_thragent_t *ta_p, + int *nthread_p); +static td_err_e (*p_td_ta_tsd_iter)(const td_thragent_t *ta_p, + td_key_iter_f *cb, void *cbdata_p); +static td_err_e (*p_td_ta_thr_iter)(const td_thragent_t *ta_p, + td_thr_iter_f *cb, void *cbdata_p, + td_thr_state_e state, int ti_pri, + sigset_t *ti_sigmask_p, + unsigned ti_user_flags); +static td_err_e (*p_td_thr_validate)(const td_thrhandle_t *th_p); +static td_err_e (*p_td_thr_tsd)(const td_thrhandle_t * th_p, + const thread_key_t key, void **data_pp); +static td_err_e (*p_td_thr_get_info)(const td_thrhandle_t *th_p, + td_thrinfo_t *ti_p); +static td_err_e (*p_td_thr_getfpregs)(const td_thrhandle_t *th_p, + prfpregset_t *fpregset); +static td_err_e (*p_td_thr_getxregsize)(const td_thrhandle_t *th_p, + int *xregsize); +static td_err_e (*p_td_thr_getxregs)(const td_thrhandle_t *th_p, + const caddr_t xregset); +static td_err_e (*p_td_thr_sigsetmask)(const td_thrhandle_t *th_p, + const sigset_t ti_sigmask); +static td_err_e (*p_td_thr_setprio)(const td_thrhandle_t *th_p, + const int ti_pri); +static td_err_e (*p_td_thr_setsigpending)(const td_thrhandle_t *th_p, + const uchar_t ti_pending_flag, + const sigset_t ti_pending); +static td_err_e (*p_td_thr_setfpregs)(const td_thrhandle_t *th_p, + const prfpregset_t *fpregset); +static td_err_e (*p_td_thr_setxregs)(const td_thrhandle_t *th_p, + const caddr_t xregset); +static td_err_e (*p_td_ta_map_id2thr)(const td_thragent_t *ta_p, + thread_t tid, + td_thrhandle_t *th_p); +static td_err_e (*p_td_ta_map_lwp2thr)(const td_thragent_t *ta_p, + lwpid_t lwpid, + td_thrhandle_t *th_p); +static td_err_e (*p_td_thr_getgregs)(const td_thrhandle_t *th_p, + prgregset_t regset); +static td_err_e (*p_td_thr_setgregs)(const td_thrhandle_t *th_p, + const prgregset_t regset); + - */ +/* Return the libthread_db error string associated with ERRCODE. If + ERRCODE is unknown, return an appropriate message. */ static char * td_err_string (td_err_e errcode) { - static struct string_map - td_err_table[] = + static struct string_map td_err_table[] = { - {TD_OK, "generic \"call succeeded\""}, - {TD_ERR, "generic error."}, - {TD_NOTHR, "no thread can be found to satisfy query"}, - {TD_NOSV, "no synch. variable can be found to satisfy query"}, - {TD_NOLWP, "no lwp can be found to satisfy query"}, - {TD_BADPH, "invalid process handle"}, - {TD_BADTH, "invalid thread handle"}, - {TD_BADSH, "invalid synchronization handle"}, - {TD_BADTA, "invalid thread agent"}, - {TD_BADKEY, "invalid key"}, - {TD_NOMSG, "td_thr_event_getmsg() called when there was no message"}, - {TD_NOFPREGS, "FPU register set not available for given thread"}, - {TD_NOLIBTHREAD, "application not linked with libthread"}, - {TD_NOEVENT, "requested event is not supported"}, - {TD_NOCAPAB, "capability not available"}, - {TD_DBERR, "Debugger service failed"}, - {TD_NOAPLIC, "Operation not applicable to"}, - {TD_NOTSD, "No thread specific data for this thread"}, - {TD_MALLOC, "Malloc failed"}, - {TD_PARTIALREG, "Only part of register set was written/read"}, - {TD_NOXREGS, "X register set not available for given thread"} + { TD_OK, "generic \"call succeeded\"" }, + { TD_ERR, "generic error." }, + { TD_NOTHR, "no thread can be found to satisfy query" }, + { TD_NOSV, "no synch. variable can be found to satisfy query" }, + { TD_NOLWP, "no lwp can be found to satisfy query" }, + { TD_BADPH, "invalid process handle" }, + { TD_BADTH, "invalid thread handle" }, + { TD_BADSH, "invalid synchronization handle" }, + { TD_BADTA, "invalid thread agent" }, + { TD_BADKEY, "invalid key" }, + { TD_NOMSG, "td_thr_event_getmsg() called when there was no message" }, + { TD_NOFPREGS, "FPU register set not available for given thread" }, + { TD_NOLIBTHREAD, "application not linked with libthread" }, + { TD_NOEVENT, "requested event is not supported" }, + { TD_NOCAPAB, "capability not available" }, + { TD_DBERR, "Debugger service failed" }, + { TD_NOAPLIC, "Operation not applicable to" }, + { TD_NOTSD, "No thread specific data for this thread" }, + { TD_MALLOC, "Malloc failed" }, + { TD_PARTIALREG, "Only part of register set was written/read" }, + { TD_NOXREGS, "X register set not available for given thread" } }; const int td_err_size = sizeof td_err_table / sizeof (struct string_map); int i; @@ -232,44 +214,30 @@ td_err_string (td_err_e errcode) if (td_err_table[i].num == errcode) return td_err_table[i].str; - sprintf (buf, "Unknown thread_db error code: %d", errcode); + sprintf (buf, "Unknown libthread_db error code: %d", errcode); return buf; } - -/* - LOCAL FUNCTION - - td_state_string - Convert a thread_db state code to a string - - SYNOPSIS - - char * td_state_string (statecode) - - DESCRIPTION - - Return the thread_db state string associated with statecode. If - statecode is unknown, then return a message. - - */ +/* Return the the libthread_db state string assicoated with STATECODE. + If STATECODE is unknown, return an appropriate message. */ static char * td_state_string (td_thr_state_e statecode) { - static struct string_map - td_thr_state_table[] = + static struct string_map td_thr_state_table[] = { - {TD_THR_ANY_STATE, "any state"}, - {TD_THR_UNKNOWN, "unknown"}, - {TD_THR_STOPPED, "stopped"}, - {TD_THR_RUN, "run"}, - {TD_THR_ACTIVE, "active"}, - {TD_THR_ZOMBIE, "zombie"}, - {TD_THR_SLEEP, "sleep"}, - {TD_THR_STOPPED_ASLEEP, "stopped asleep"} + { TD_THR_ANY_STATE, "any state" }, + { TD_THR_UNKNOWN, "unknown" }, + { TD_THR_STOPPED, "stopped" }, + { TD_THR_RUN, "run" }, + { TD_THR_ACTIVE, "active" }, + { TD_THR_ZOMBIE, "zombie" }, + { TD_THR_SLEEP, "sleep" }, + { TD_THR_STOPPED_ASLEEP, "stopped asleep" } }; - const int td_thr_state_table_size = sizeof td_thr_state_table / sizeof (struct string_map); + const int td_thr_state_table_size = + sizeof td_thr_state_table / sizeof (struct string_map); int i; static char buf[50]; @@ -277,32 +245,17 @@ td_state_string (td_thr_state_e statecode) if (td_thr_state_table[i].num == statecode) return td_thr_state_table[i].str; - sprintf (buf, "Unknown thread_db state code: %d", statecode); + sprintf (buf, "Unknown libthread_db state code: %d", statecode); return buf; } -/* - LOCAL FUNCTION +/* Convert a POSIX or Solaris thread ID into a LWP ID. If THREAD_ID + doesn't exist, that's an error. If it's an inactive thread, return + DEFAULT_LPW. - thread_to_lwp - Convert a Posix or Solaris thread id to a LWP id. - - SYNOPSIS - - tpid_t thread_to_lwp (thread_id, default_lwp) - - DESCRIPTION - - This function converts a Posix or Solaris thread id to a lightweight - process id. If thread_id is non-existent, that's an error. If it's - an inactive thread, then we return default_lwp. - - NOTES - - This function probably shouldn't call error()... - - */ + NOTE: This function probably shouldn't call error(). */ static ptid_t thread_to_lwp (ptid_t thread_id, int default_lwp) @@ -312,19 +265,19 @@ thread_to_lwp (ptid_t thread_id, int default_lwp) td_err_e val; if (is_lwp (thread_id)) - return thread_id; /* It's already an LWP id */ + return thread_id; /* It's already an LWP ID. */ - /* It's a thread. Convert to lwp */ + /* It's a thread. Convert to LWP. */ val = p_td_ta_map_id2thr (main_ta, GET_THREAD (thread_id), &th); if (val == TD_NOTHR) - return pid_to_ptid (-1); /* thread must have terminated */ + return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val != TD_OK) error ("thread_to_lwp: td_ta_map_id2thr %s", td_err_string (val)); val = p_td_thr_get_info (&th, &ti); if (val == TD_NOTHR) - return pid_to_ptid (-1); /* thread must have terminated */ + return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val != TD_OK) error ("thread_to_lwp: td_thr_get_info: %s", td_err_string (val)); @@ -338,27 +291,11 @@ thread_to_lwp (ptid_t thread_id, int default_lwp) return BUILD_LWP (ti.ti_lid, PIDGET (thread_id)); } - -/* - LOCAL FUNCTION - - lwp_to_thread - Convert a LWP id to a Posix or Solaris thread id. - - SYNOPSIS - - int lwp_to_thread (lwp_id) - - DESCRIPTION - - This function converts a lightweight process id to a Posix or Solaris - thread id. If thread_id is non-existent, that's an error. - - NOTES +/* Convert an LWP ID into a POSIX or Solaris thread ID. If LWP_ID + doesn't exists, that's an error. - This function probably shouldn't call error()... - - */ + NOTE: This function probably shouldn't call error(). */ static ptid_t lwp_to_thread (ptid_t lwp) @@ -368,29 +305,28 @@ lwp_to_thread (ptid_t lwp) td_err_e val; if (is_thread (lwp)) - return lwp; /* It's already a thread id */ + return lwp; /* It's already a thread ID. */ - /* It's an lwp. Convert it to a thread id. */ + /* It's an LWP. Convert it to a thread ID. */ if (!sol_thread_alive (lwp)) - return pid_to_ptid (-1); /* defunct lwp */ + return pid_to_ptid (-1); /* Must be a defunct LPW. */ val = p_td_ta_map_lwp2thr (main_ta, GET_LWP (lwp), &th); if (val == TD_NOTHR) - return pid_to_ptid (-1); /* thread must have terminated */ + return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val != TD_OK) error ("lwp_to_thread: td_ta_map_lwp2thr: %s.", td_err_string (val)); val = p_td_thr_validate (&th); if (val == TD_NOTHR) - return lwp; /* libthread doesn't know about it; - just return lwp */ + return lwp; /* Unknown to libthread; just return LPW, */ else if (val != TD_OK) error ("lwp_to_thread: td_thr_validate: %s.", td_err_string (val)); val = p_td_thr_get_info (&th, &ti); if (val == TD_NOTHR) - return pid_to_ptid (-1); /* thread must have terminated */ + return pid_to_ptid (-1); /* Thread must have terminated. */ else if (val != TD_OK) error ("lwp_to_thread: td_thr_get_info: %s.", td_err_string (val)); @@ -398,8 +334,9 @@ lwp_to_thread (ptid_t lwp) } -/* Most target vector functions from here on actually just pass through to - procfs.c, as they don't need to do anything specific for threads. */ +/* Most target vector functions from here on actually just pass + through to procfs.c, as they don't need to do anything specific for + threads. */ static void sol_thread_open (char *arg, int from_tty) @@ -407,21 +344,21 @@ sol_thread_open (char *arg, int from_tty) procfs_ops.to_open (arg, from_tty); } -/* Attach to process PID, then initialize for debugging it - and wait for the trace-trap that results from attaching. */ +/* Attach to process PID, then initialize for debugging it and wait + for the trace-trap that results from attaching. */ static void sol_thread_attach (char *args, int from_tty) { procfs_ops.to_attach (args, from_tty); - /* Must get symbols from solibs before libthread_db can run! */ + /* Must get symbols from shared libraries before libthread_db can run! */ SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add); if (sol_thread_active) { printf_filtered ("sol-thread active.\n"); - main_ph.ptid = inferior_ptid; /* Save for xfer_memory */ + main_ph.ptid = inferior_ptid; /* Save for xfer_memory. */ push_target (&sol_thread_ops); inferior_ptid = lwp_to_thread (inferior_ptid); if (PIDGET (inferior_ptid) == -1) @@ -429,16 +366,17 @@ sol_thread_attach (char *args, int from_tty) else add_thread (inferior_ptid); } - /* XXX - might want to iterate over all the threads and register them. */ + + /* FIXME: Might want to iterate over all the threads and register + them. */ } -/* Take a program previously attached to and detaches it. - The program resumes execution and will no longer stop - on signals, etc. We'd better not have left any breakpoints - in the program or it'll die when it hits one. For this - to work, it may be necessary for the process to have been - previously attached. It *might* work if the program was - started via the normal ptrace (PTRACE_TRACEME). */ +/* Take a program previously attached to and detaches it. The program + resumes execution and will no longer stop on signals, etc. We'd + better not have left any breakpoints in the program or it'll die + when it hits one. For this to work, it may be necessary for the + process to have been previously attached. It *might* work if the + program was started via the normal ptrace (PTRACE_TRACEME). */ static void sol_thread_detach (char *args, int from_tty) @@ -448,10 +386,10 @@ sol_thread_detach (char *args, int from_tty) procfs_ops.to_detach (args, from_tty); } -/* Resume execution of process PID. If STEP is nozero, then - just single step it. If SIGNAL is nonzero, restart it with that - signal activated. We may have to convert pid from a thread-id to an LWP id - for procfs. */ +/* Resume execution of process PTID. If STEP is nozero, then just + single step it. If SIGNAL is nonzero, restart it with that signal + activated. We may have to convert PTID from a thread ID to an LWP + ID for procfs. */ static void sol_thread_resume (ptid_t ptid, int step, enum target_signal signo) @@ -469,7 +407,7 @@ sol_thread_resume (ptid_t ptid, int step, enum target_signal signo) ptid_t save_ptid = ptid; ptid = thread_to_lwp (ptid, -2); - if (PIDGET (ptid) == -2) /* Inactive thread */ + if (PIDGET (ptid) == -2) /* Inactive thread. */ error ("This version of Solaris can't start inactive threads."); if (info_verbose && PIDGET (ptid) == -1) warning ("Specified thread %ld seems to have terminated", @@ -481,8 +419,8 @@ sol_thread_resume (ptid_t ptid, int step, enum target_signal signo) do_cleanups (old_chain); } -/* Wait for any threads to stop. We may have to convert PID from a thread id - to a LWP id, and vice versa on the way out. */ +/* Wait for any threads to stop. We may have to convert PIID from a + thread ID to an LWP ID, and vice versa on the way out. */ static ptid_t sol_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) @@ -503,7 +441,7 @@ sol_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) ptid_t save_ptid = ptid; ptid = thread_to_lwp (ptid, -2); - if (PIDGET (ptid) == -2) /* Inactive thread */ + if (PIDGET (ptid) == -2) /* Inactive thread. */ error ("This version of Solaris can't start inactive threads."); if (info_verbose && PIDGET (ptid) == -1) warning ("Specified thread %ld seems to have terminated", @@ -514,12 +452,12 @@ sol_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) if (ourstatus->kind != TARGET_WAITKIND_EXITED) { - /* Map the LWP of interest back to the appropriate thread ID */ + /* Map the LWP of interest back to the appropriate thread ID. */ rtnval = lwp_to_thread (rtnval); if (PIDGET (rtnval) == -1) rtnval = save_ptid; - /* See if we have a new thread */ + /* See if we have a new thread. */ if (is_thread (rtnval) && !ptid_equal (rtnval, save_ptid) && !in_thread_list (rtnval)) @@ -529,9 +467,9 @@ sol_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) } } - /* During process initialization, we may get here without the thread package - being initialized, since that can only happen after we've found the shared - libs. */ + /* During process initialization, we may get here without the thread + package being initialized, since that can only happen after we've + found the shared libs. */ do_cleanups (old_chain); @@ -539,7 +477,7 @@ sol_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus) } static void -sol_thread_fetch_registers (int regno) +sol_thread_fetch_registers (int regnum) { thread_t thread; td_thrhandle_t thandle; @@ -552,54 +490,51 @@ sol_thread_fetch_registers (int regno) #endif if (!is_thread (inferior_ptid)) - { /* LWP: pass the request on to procfs.c */ + { + /* It's an LWP; pass the request on to procfs. */ if (target_has_execution) - procfs_ops.to_fetch_registers (regno); + procfs_ops.to_fetch_registers (regnum); else - orig_core_ops.to_fetch_registers (regno); + orig_core_ops.to_fetch_registers (regnum); return; } - /* Solaris thread: convert inferior_ptid into a td_thrhandle_t */ - + /* Solaris thread: convert INFERIOR_PTID into a td_thrhandle_t. */ thread = GET_THREAD (inferior_ptid); - if (thread == 0) - error ("sol_thread_fetch_registers: thread == 0"); + error ("sol_thread_fetch_registers: thread == 0"); val = p_td_ta_map_id2thr (main_ta, thread, &thandle); if (val != TD_OK) error ("sol_thread_fetch_registers: td_ta_map_id2thr: %s", td_err_string (val)); - /* Get the integer regs */ + /* Get the general-purpose registers. */ val = p_td_thr_getgregs (&thandle, gregset); - if (val != TD_OK - && val != TD_PARTIALREG) + if (val != TD_OK && val != TD_PARTIALREG) error ("sol_thread_fetch_registers: td_thr_getgregs %s", td_err_string (val)); - /* For the sparc, TD_PARTIALREG means that only i0->i7, l0->l7, pc and sp - are saved (by a thread context switch). */ + /* For SPARC, TD_PARTIALREG means that only %i0...%i7, %l0..%l7, %pc + and %sp are saved (by a thread context switch). */ - /* And, now the fp regs */ + /* And, now the floating-point registers. */ val = p_td_thr_getfpregs (&thandle, &fpregset); - if (val != TD_OK - && val != TD_NOFPREGS) + if (val != TD_OK && val != TD_NOFPREGS) error ("sol_thread_fetch_registers: td_thr_getfpregs %s", td_err_string (val)); -/* Note that we must call supply_{g fp}regset *after* calling the td routines - because the td routines call ps_lget* which affect the values stored in the - registers array. */ + /* Note that we must call supply_gregset and supply_fpregset *after* + calling the td routines because the td routines call ps_lget* + which affect the values stored in the registers array. */ - supply_gregset ((gdb_gregset_t *) &gregset); + supply_gregset ((gdb_gregset_t *) &gregset); supply_fpregset ((gdb_fpregset_t *) &fpregset); #if 0 -/* thread_db doesn't seem to handle this right */ + /* FIXME: libthread_db doesn't seem to handle this right. */ val = td_thr_getxregsize (&thandle, &xregsize); if (val != TD_OK && val != TD_NOXREGS) error ("sol_thread_fetch_registers: td_thr_getxregsize %s", @@ -617,12 +552,12 @@ sol_thread_fetch_registers (int regno) } static void -sol_thread_store_registers (int regno) +sol_thread_store_registers (int regnum) { thread_t thread; td_thrhandle_t thandle; td_err_e val; - prgregset_t gregset; + prgregset_t gregset; prfpregset_t fpregset; #if 0 int xregsize; @@ -630,13 +565,13 @@ sol_thread_store_registers (int regno) #endif if (!is_thread (inferior_ptid)) - { /* LWP: pass the request on to procfs.c */ - procfs_ops.to_store_registers (regno); + { + /* It's an LWP; pass the request on to procfs.c. */ + procfs_ops.to_store_registers (regnum); return; } - /* Solaris thread: convert inferior_ptid into a td_thrhandle_t */ - + /* Solaris thread: convert INFERIOR_PTID into a td_thrhandle_t. */ thread = GET_THREAD (inferior_ptid); val = p_td_ta_map_id2thr (main_ta, thread, &thandle); @@ -644,12 +579,13 @@ sol_thread_store_registers (int regno) error ("sol_thread_store_registers: td_ta_map_id2thr %s", td_err_string (val)); - if (regno != -1) - { /* Not writing all the regs */ + if (regnum != -1) + { + /* Not writing all the registers. */ char old_value[MAX_REGISTER_SIZE]; /* Save new register value. */ - regcache_collect (regno, old_value); + regcache_raw_collect (current_regcache, regnum, old_value); val = p_td_thr_getgregs (&thandle, gregset); if (val != TD_OK) @@ -661,10 +597,10 @@ sol_thread_store_registers (int regno) td_err_string (val)); /* Restore new register value. */ - supply_register (regno, old_value); + regcache_raw_supply (current_regcache, regnum, old_value); #if 0 -/* thread_db doesn't seem to handle this right */ + /* FIXME: libthread_db doesn't seem to handle this right. */ val = td_thr_getxregsize (&thandle, &xregsize); if (val != TD_OK && val != TD_NOXREGS) error ("sol_thread_store_registers: td_thr_getxregsize %s", @@ -681,8 +617,8 @@ sol_thread_store_registers (int regno) #endif } - fill_gregset ((gdb_gregset_t *) &gregset, regno); - fill_fpregset ((gdb_fpregset_t *) &fpregset, regno); + fill_gregset ((gdb_gregset_t *) &gregset, regnum); + fill_fpregset ((gdb_fpregset_t *) &fpregset, regnum); val = p_td_thr_setgregs (&thandle, gregset); if (val != TD_OK) @@ -694,22 +630,22 @@ sol_thread_store_registers (int regno) td_err_string (val)); #if 0 -/* thread_db doesn't seem to handle this right */ + /* FIXME: libthread_db doesn't seem to handle this right. */ val = td_thr_getxregsize (&thandle, &xregsize); if (val != TD_OK && val != TD_NOXREGS) error ("sol_thread_store_registers: td_thr_getxregsize %s", td_err_string (val)); - /* Should probably do something about writing the xregs here, but what are - they? */ + /* ??? Should probably do something about writing the xregs here, + but what are they? */ #endif } /* Get ready to modify the registers array. On machines which store - individual registers, this doesn't need to do anything. On machines - which store all the registers in one fell swoop, this makes sure - that registers contains all the registers from the program being - debugged. */ + individual registers, this doesn't need to do anything. On + machines which store all the registers in one fell swoop, this + makes sure that registers contains all the registers from the + program being debugged. */ static void sol_thread_prepare_to_store (void) @@ -721,7 +657,7 @@ sol_thread_prepare_to_store (void) MEMADDR. If DOWRITE is non-zero, transfer them to the target, otherwise transfer them from the target. TARGET is unused. - Returns the number of bytes transferred. */ + Returns the number of bytes transferred. */ static int sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite, @@ -733,26 +669,31 @@ sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite, old_chain = save_inferior_ptid (); - if (is_thread (inferior_ptid) || /* A thread */ - !target_thread_alive (inferior_ptid)) /* An lwp, but not alive */ - inferior_ptid = procfs_first_available (); /* Find any live lwp. */ - /* Note: don't need to call switch_to_thread; we're just reading memory. */ + if (is_thread (inferior_ptid) || !target_thread_alive (inferior_ptid)) + { + /* It's either a thread or an LWP that isn't alive. Any live + LWP will do so use the first available. + + NOTE: We don't need to call switch_to_thread; we're just + reading memory. */ + inferior_ptid = procfs_first_available (); + } if (target_has_execution) - retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len, - dowrite, attrib, target); + retval = procfs_ops.deprecated_xfer_memory (memaddr, myaddr, len, + dowrite, attrib, target); else - retval = orig_core_ops.to_xfer_memory (memaddr, myaddr, len, - dowrite, attrib, target); + retval = orig_core_ops.deprecated_xfer_memory (memaddr, myaddr, len, + dowrite, attrib, target); do_cleanups (old_chain); return retval; } -/* Perform partial transfers on OBJECT. See target_read_partial - and target_write_partial for details of each variant. One, and - only one, of readbuf or writebuf must be non-NULL. */ +/* Perform partial transfers on OBJECT. See target_read_partial and + target_write_partial for details of each variant. One, and only + one, of readbuf or writebuf must be non-NULL. */ static LONGEST sol_thread_xfer_partial (struct target_ops *ops, enum target_object object, @@ -764,10 +705,15 @@ sol_thread_xfer_partial (struct target_ops *ops, enum target_object object, old_chain = save_inferior_ptid (); - if (is_thread (inferior_ptid) || /* A thread */ - !target_thread_alive (inferior_ptid)) /* An lwp, but not alive */ - inferior_ptid = procfs_first_available (); /* Find any live lwp. */ - /* Note: don't need to call switch_to_thread; we're just reading memory. */ + if (is_thread (inferior_ptid) || !target_thread_alive (inferior_ptid)) + { + /* It's either a thread or an LWP that isn't alive. Any live + LWP will do so use the first available. + + NOTE: We don't need to call switch_to_thread; we're just + reading memory. */ + inferior_ptid = procfs_first_available (); + } if (target_has_execution) retval = procfs_ops.to_xfer_partial (ops, object, annex, @@ -804,13 +750,15 @@ sol_thread_notice_signals (ptid_t ptid) /* Fork an inferior process, and start debugging it with /proc. */ static void -sol_thread_create_inferior (char *exec_file, char *allargs, char **env) +sol_thread_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { - procfs_ops.to_create_inferior (exec_file, allargs, env); + procfs_ops.to_create_inferior (exec_file, allargs, env, from_tty); if (sol_thread_active && !ptid_equal (inferior_ptid, null_ptid)) { - main_ph.ptid = inferior_ptid; /* Save for xfer_memory */ + /* Save for xfer_memory. */ + main_ph.ptid = inferior_ptid; push_target (&sol_thread_ops); @@ -823,15 +771,15 @@ sol_thread_create_inferior (char *exec_file, char *allargs, char **env) } } -/* This routine is called whenever a new symbol table is read in, or when all - symbol tables are removed. libthread_db can only be initialized when it - finds the right variables in libthread.so. Since it's a shared library, - those variables don't show up until the library gets mapped and the symbol - table is read in. */ +/* This routine is called whenever a new symbol table is read in, or + when all symbol tables are removed. libthread_db can only be + initialized when it finds the right variables in libthread.so. + Since it's a shared library, those variables don't show up until + the library gets mapped and the symbol table is read in. -/* This new_objfile event is now managed by a chained function pointer. - * It is the callee's responsability to call the next client on the chain. - */ + This new_objfile event is managed by a chained function pointer. + It is the callee's responsability to call the next client on the + chain. */ /* Saved pointer to previous owner of the new_objfile event. */ static void (*target_new_objfile_chain) (struct objfile *); @@ -847,13 +795,14 @@ sol_thread_new_objfile (struct objfile *objfile) goto quit; } - /* don't do anything if init failed to resolve the libthread_db library */ + /* Don't do anything if init failed to resolve the libthread_db + library. */ if (!procfs_suppress_run) goto quit; - /* Now, initialize the thread debugging library. This needs to be done after - the shared libraries are located because it needs information from the - user's thread library. */ + /* Now, initialize libthread_db. This needs to be done after the + shared libraries are located because it needs information from + the user's thread library. */ val = p_td_init (); if (val != TD_OK) @@ -872,8 +821,9 @@ sol_thread_new_objfile (struct objfile *objfile) } sol_thread_active = 1; + quit: - /* Call predecessor on chain, if any. */ + /* Call predecessor on chain, if any. */ if (target_new_objfile_chain) target_new_objfile_chain (objfile); } @@ -887,7 +837,8 @@ sol_thread_mourn_inferior (void) procfs_ops.to_mourn_inferior (); } -/* Mark our target-struct as eligible for stray "run" and "attach" commands. */ +/* Mark our target-struct as eligible for stray "run" and "attach" + commands. */ static int sol_thread_can_run (void) @@ -911,25 +862,28 @@ sol_thread_can_run (void) */ +/* Return true if PTID is still active in the inferior. */ + static int sol_thread_alive (ptid_t ptid) { - if (is_thread (ptid)) /* non-kernel thread */ + if (is_thread (ptid)) { + /* It's a (user-level) thread. */ td_err_e val; td_thrhandle_t th; int pid; pid = GET_THREAD (ptid); if ((val = p_td_ta_map_id2thr (main_ta, pid, &th)) != TD_OK) - return 0; /* thread not found */ + return 0; /* Thread not found. */ if ((val = p_td_thr_validate (&th)) != TD_OK) - return 0; /* thread not valid */ - return 1; /* known thread: return true */ + return 0; /* Thread not valid. */ + return 1; /* Known thread. */ } else - /* kernel thread (LWP): let procfs test it */ { + /* It's an LPW; pass the request on to procfs. */ if (target_has_execution) return procfs_ops.to_thread_alive (ptid); else @@ -943,23 +897,22 @@ sol_thread_stop (void) procfs_ops.to_stop (); } -/* These routines implement the lower half of the thread_db interface. Ie: the - ps_* routines. */ +/* These routines implement the lower half of the thread_db interface, + i.e. the ps_* routines. */ -/* Various versions of <proc_service.h> have slightly - different function prototypes. In particular, we have +/* Various versions of <proc_service.h> have slightly different + function prototypes. In particular, we have NEWER OLDER struct ps_prochandle * const struct ps_prochandle * void* char* - const void* char* - int size_t + const void* char* + int size_t - Which one you have depends on solaris version and what - patches you've applied. On the theory that there are - only two major variants, we have configure check the - prototype of ps_pdwrite (), and use that info to make - appropriate typedefs here. */ + Which one you have depends on the Solaris version and what patches + you've applied. On the theory that there are only two major + variants, we have configure check the prototype of ps_pdwrite (), + and use that info to make appropriate typedefs here. */ #ifdef PROC_SERVICE_IS_OLD typedef const struct ps_prochandle *gdb_ps_prochandle_t; @@ -975,13 +928,12 @@ typedef size_t gdb_ps_size_t; typedef psaddr_t gdb_ps_addr_t; #endif +/* The next four routines are called by libthread_db to tell us to + stop and stop a particular process or lwp. Since GDB ensures that + these are all stopped by the time we call anything in thread_db, + these routines need to do nothing. */ -/* The next four routines are called by thread_db to tell us to stop and stop - a particular process or lwp. Since GDB ensures that these are all stopped - by the time we call anything in thread_db, these routines need to do - nothing. */ - -/* Process stop */ +/* Process stop. */ ps_err_e ps_pstop (gdb_ps_prochandle_t ph) @@ -989,7 +941,7 @@ ps_pstop (gdb_ps_prochandle_t ph) return PS_OK; } -/* Process continue */ +/* Process continue. */ ps_err_e ps_pcontinue (gdb_ps_prochandle_t ph) @@ -997,7 +949,7 @@ ps_pcontinue (gdb_ps_prochandle_t ph) return PS_OK; } -/* LWP stop */ +/* LWP stop. */ ps_err_e ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid) @@ -1005,7 +957,7 @@ ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid) return PS_OK; } -/* LWP continue */ +/* LWP continue. */ ps_err_e ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid) @@ -1017,17 +969,15 @@ ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid) ps_err_e ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name, - const char *ld_symbol_name, gdb_ps_addr_t * ld_symbol_addr) + const char *ld_symbol_name, gdb_ps_addr_t *ld_symbol_addr) { struct minimal_symbol *ms; ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL); - if (!ms) return PS_NOSYM; *ld_symbol_addr = SYMBOL_VALUE_ADDRESS (ms); - return PS_OK; } @@ -1041,10 +991,15 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr, old_chain = save_inferior_ptid (); - if (is_thread (inferior_ptid) || /* A thread */ - !target_thread_alive (inferior_ptid)) /* An lwp, but not alive */ - inferior_ptid = procfs_first_available (); /* Find any live lwp. */ - /* Note: don't need to call switch_to_thread; we're just reading memory. */ + if (is_thread (inferior_ptid) || !target_thread_alive (inferior_ptid)) + { + /* It's either a thread or an LWP that isn't alive. Any live + LWP will do so use the first available. + + NOTE: We don't need to call switch_to_thread; we're just + reading memory. */ + inferior_ptid = procfs_first_available (); + } #if defined (__sparcv9) /* For Sparc64 cross Sparc32, make sure the address has not been @@ -1059,11 +1014,11 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr, /* FIXME: passing 0 as attrib argument. */ if (target_has_execution) - cc = procfs_ops.to_xfer_memory (addr, buf, size, - dowrite, 0, &procfs_ops); + cc = procfs_ops.deprecated_xfer_memory (addr, buf, size, + dowrite, 0, &procfs_ops); else - cc = orig_core_ops.to_xfer_memory (addr, buf, size, - dowrite, 0, &core_ops); + cc = orig_core_ops.deprecated_xfer_memory (addr, buf, size, + dowrite, 0, &core_ops); if (cc < 0) { @@ -1135,11 +1090,10 @@ ps_ptwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, return rw_common (1, ph, addr, (char *) buf, size); } -/* Get integer regs for LWP */ +/* Get general-purpose registers for LWP. */ ps_err_e -ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, - prgregset_t gregset) +ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) { struct cleanup *old_chain; @@ -1158,7 +1112,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, return PS_OK; } -/* Set integer regs for LWP */ +/* Set general-purpose registers for LWP. */ ps_err_e ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, @@ -1184,7 +1138,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, /* Log a message (sends to gdb_stderr). */ void -ps_plog (const char *fmt,...) +ps_plog (const char *fmt, ...) { va_list args; @@ -1267,11 +1221,11 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) return PS_OK; } -/* Get floating-point regs for LWP */ +/* Get floating-point registers for LWP. */ ps_err_e ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, - prfpregset_t * fpregset) + prfpregset_t *fpregset) { struct cleanup *old_chain; @@ -1314,10 +1268,9 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, } #ifdef PR_MODEL_LP64 -/* Identify process as 32-bit or 64-bit. - At the moment I'm using bfd to do this. - There might be a more solaris-specific (eg. procfs) method, - but this ought to work. */ +/* Identify process as 32-bit or 64-bit. At the moment we're using + BFD to do this. There might be a more Solaris-specific + (e.g. procfs) method, but this ought to work. */ ps_err_e ps_pdmodel (gdb_ps_prochandle_t ph, int *data_model) @@ -1341,12 +1294,12 @@ ps_err_e ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid, struct ssd *pldt) { - /* NOTE: only used on Solaris, therefore OK to refer to procfs.c */ + /* NOTE: only used on Solaris, therefore OK to refer to procfs.c. */ extern struct ssd *procfs_find_LDT_entry (ptid_t); struct ssd *ret; - /* FIXME: can't I get the process ID from the prochandle or something? - */ + /* FIXME: can't I get the process ID from the prochandle or + something? */ if (PIDGET (inferior_ptid) <= 0 || lwpid <= 0) return PS_BADLID; @@ -1357,19 +1310,21 @@ ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid, memcpy (pldt, ret, sizeof (struct ssd)); return PS_OK; } - else /* LDT not found. */ + else + /* LDT not found. */ return PS_ERR; } #endif /* TM_I386SOL2_H */ -/* Convert a pid to printable form. */ + +/* Convert PTID to printable form. */ char * solaris_pid_to_str (ptid_t ptid) { static char buf[100]; - /* in case init failed to resolve the libthread_db library */ + /* In case init failed to resolve the libthread_db library. */ if (!procfs_suppress_run) return procfs_pid_to_str (ptid); @@ -1382,7 +1337,8 @@ solaris_pid_to_str (ptid_t ptid) if (PIDGET (lwp) == -1) sprintf (buf, "Thread %ld (defunct)", GET_THREAD (ptid)); else if (PIDGET (lwp) != -2) - sprintf (buf, "Thread %ld (LWP %ld)", GET_THREAD (ptid), GET_LWP (lwp)); + sprintf (buf, "Thread %ld (LWP %ld)", + GET_THREAD (ptid), GET_LWP (lwp)); else sprintf (buf, "Thread %ld ", GET_THREAD (ptid)); } @@ -1395,9 +1351,8 @@ solaris_pid_to_str (ptid_t ptid) } -/* Worker bee for find_new_threads - Callback function that gets called once per USER thread (i.e., not - kernel) thread. */ +/* Worker bee for find_new_threads. Callback function that gets + called once per user-level thread (i.e. not for LWP's). */ static int sol_find_new_threads_callback (const td_thrhandle_t *th, void *ignored) @@ -1406,10 +1361,10 @@ sol_find_new_threads_callback (const td_thrhandle_t *th, void *ignored) td_thrinfo_t ti; ptid_t ptid; - if ((retval = p_td_thr_get_info (th, &ti)) != TD_OK) - { - return -1; - } + retval = p_td_thr_get_info (th, &ti); + if (retval != TD_OK) + return -1; + ptid = BUILD_THREAD (ti.ti_tid, PIDGET (inferior_ptid)); if (!in_thread_list (ptid)) add_thread (ptid); @@ -1420,7 +1375,8 @@ sol_find_new_threads_callback (const td_thrhandle_t *th, void *ignored) static void sol_find_new_threads (void) { - /* don't do anything if init failed to resolve the libthread_db library */ + /* Don't do anything if init failed to resolve the libthread_db + library. */ if (!procfs_suppress_run) return; @@ -1429,7 +1385,11 @@ sol_find_new_threads (void) printf_filtered ("No process.\n"); return; } - procfs_ops.to_find_new_threads (); /* first find new kernel threads */ + + /* First Find any new LWP's. */ + procfs_ops.to_find_new_threads (); + + /* Then find any new user-level threads. */ p_td_ta_thr_iter (main_ta, sol_find_new_threads_callback, (void *) 0, TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); @@ -1460,9 +1420,10 @@ sol_core_files_info (struct target_ops *t) orig_core_ops.to_files_info (t); } -/* Worker bee for info sol-thread command. This is a callback function that - gets called once for each Solaris thread (ie. not kernel thread) in the - inferior. Print anything interesting that we can think of. */ +/* Worker bee for the "info sol-thread" command. This is a callback + function that gets called once for each Solaris user-level thread + (i.e. not for LWPs) in the inferior. Print anything interesting + that we can think of. */ static int info_cb (const td_thrhandle_t *th, void *s) @@ -1470,7 +1431,8 @@ info_cb (const td_thrhandle_t *th, void *s) td_err_e ret; td_thrinfo_t ti; - if ((ret = p_td_thr_get_info (th, &ti)) == TD_OK) + ret = p_td_thr_get_info (th, &ti); + if (ret == TD_OK) { printf_filtered ("%s thread #%d, lwp %d, ", ti.ti_type == TD_THR_SYSTEM ? "system" : "user ", @@ -1500,29 +1462,31 @@ info_cb (const td_thrhandle_t *th, void *s) printf_filtered ("(stopped asleep)"); break; } - /* Print thr_create start function: */ + /* Print thr_create start function. */ if (ti.ti_startfunc != 0) { struct minimal_symbol *msym; msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc); if (msym) - printf_filtered (" startfunc: %s\n", DEPRECATED_SYMBOL_NAME (msym)); + printf_filtered (" startfunc: %s\n", + DEPRECATED_SYMBOL_NAME (msym)); else printf_filtered (" startfunc: 0x%s\n", paddr (ti.ti_startfunc)); } - /* If thread is asleep, print function that went to sleep: */ + /* If thread is asleep, print function that went to sleep. */ if (ti.ti_state == TD_THR_SLEEP) { struct minimal_symbol *msym; msym = lookup_minimal_symbol_by_pc (ti.ti_pc); if (msym) - printf_filtered (" - Sleep func: %s\n", DEPRECATED_SYMBOL_NAME (msym)); + printf_filtered (" - Sleep func: %s\n", + DEPRECATED_SYMBOL_NAME (msym)); else printf_filtered (" - Sleep func: 0x%s\n", paddr (ti.ti_startfunc)); } - /* Wrap up line, if necessary */ + /* Wrap up line, if necessary. */ if (ti.ti_state != TD_THR_SLEEP && ti.ti_startfunc == 0) printf_filtered ("\n"); /* don't you hate counting newlines? */ } @@ -1532,7 +1496,8 @@ info_cb (const td_thrhandle_t *th, void *s) return 0; } -/* List some state about each Solaris user thread in the inferior. */ +/* List some state about each Solaris user-level thread in the + inferior. */ static void info_solthreads (char *args, int from_tty) @@ -1543,10 +1508,8 @@ info_solthreads (char *args, int from_tty) } static int -sol_find_memory_regions (int (*func) (CORE_ADDR, - unsigned long, - int, int, int, - void *), +sol_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, + int, int, int, void *), void *data) { return procfs_ops.to_find_memory_regions (func, data); @@ -1564,7 +1527,6 @@ ignore (CORE_ADDR addr, char *contents) return 0; } - static void init_sol_thread_ops (void) { @@ -1579,7 +1541,7 @@ init_sol_thread_ops (void) sol_thread_ops.to_fetch_registers = sol_thread_fetch_registers; sol_thread_ops.to_store_registers = sol_thread_store_registers; sol_thread_ops.to_prepare_to_store = sol_thread_prepare_to_store; - sol_thread_ops.to_xfer_memory = sol_thread_xfer_memory; + sol_thread_ops.deprecated_xfer_memory = sol_thread_xfer_memory; sol_thread_ops.to_xfer_partial = sol_thread_xfer_partial; sol_thread_ops.to_files_info = sol_thread_files_info; sol_thread_ops.to_insert_breakpoint = memory_insert_breakpoint; @@ -1611,7 +1573,6 @@ init_sol_thread_ops (void) sol_thread_ops.to_magic = OPS_MAGIC; } - static void init_sol_core_ops (void) { @@ -1623,7 +1584,7 @@ init_sol_core_ops (void) sol_core_ops.to_attach = sol_thread_attach; sol_core_ops.to_detach = sol_core_detach; sol_core_ops.to_fetch_registers = sol_thread_fetch_registers; - sol_core_ops.to_xfer_memory = sol_thread_xfer_memory; + sol_core_ops.deprecated_xfer_memory = sol_thread_xfer_memory; sol_core_ops.to_xfer_partial = sol_thread_xfer_partial; sol_core_ops.to_files_info = sol_core_files_info; sol_core_ops.to_insert_breakpoint = ignore; @@ -1636,18 +1597,20 @@ init_sol_core_ops (void) sol_core_ops.to_has_thread_control = tc_none; sol_core_ops.to_thread_alive = sol_thread_alive; sol_core_ops.to_pid_to_str = solaris_pid_to_str; - /* On Solaris/x86, when debugging a threaded core file from process <n>, - the following causes "info threads" to produce "procfs: couldn't find pid - <n> in procinfo list" where <n> is the pid of the process that produced - the core file. Disable it for now. */ - /* sol_core_ops.to_find_new_threads = sol_find_new_threads; */ + /* On Solaris/x86, when debugging a threaded core file from process + <n>, the following causes "info threads" to produce "procfs: + couldn't find pid <n> in procinfo list" where <n> is the pid of + the process that produced the core file. Disable it for now. */ +#if 0 + sol_core_ops.to_find_new_threads = sol_find_new_threads; +#endif sol_core_ops.to_magic = OPS_MAGIC; } -/* we suppress the call to add_target of core_ops in corelow because - if there are two targets in the stratum core_stratum, find_core_target - won't know which one to return. see corelow.c for an additonal - comment on coreops_suppress_target. */ +/* We suppress the call to add_target of core_ops in corelow because + if there are two targets in the stratum core_stratum, + find_core_target won't know which one to return. See corelow.c for + an additonal comment on coreops_suppress_target. */ int coreops_suppress_target = 1; void @@ -1701,19 +1664,19 @@ _initialize_sol_thread (void) memcpy (&core_ops, &sol_core_ops, sizeof (struct target_ops)); add_target (&core_ops); - /* Hook into new_objfile notification. */ - target_new_objfile_chain = target_new_objfile_hook; - target_new_objfile_hook = sol_thread_new_objfile; + /* Hook into new_objfile notification. */ + target_new_objfile_chain = deprecated_target_new_objfile_hook; + deprecated_target_new_objfile_hook = sol_thread_new_objfile; return; -die: - - fprintf_unfiltered (gdb_stderr, "[GDB will not be able to debug user-mode threads: %s]\n", dlerror ()); + die: + fprintf_unfiltered (gdb_stderr, "\ +[GDB will not be able to debug user-mode threads: %s]\n", dlerror ()); if (dlhandle) dlclose (dlhandle); - /* allow the user to debug non-threaded core files */ + /* Allow the user to debug non-threaded core files. */ add_target (&core_ops); return; diff --git a/gnu/usr.bin/binutils/gdb/solib.c b/gnu/usr.bin/binutils/gdb/solib.c index a98c3bdfed7..35480bfbbb9 100644 --- a/gnu/usr.bin/binutils/gdb/solib.c +++ b/gnu/usr.bin/binutils/gdb/solib.c @@ -42,6 +42,7 @@ #include "filenames.h" /* for DOSish file names */ #include "exec.h" #include "solist.h" +#include "observer.h" #include "readline/readline.h" /* external data declarations */ @@ -156,15 +157,15 @@ solib_open (char *in_pathname, char **found_pathname) /* If not found, search the solib_search_path (if any). */ if (found_file < 0 && solib_search_path != NULL) - found_file = openp (solib_search_path, - 1, in_pathname, O_RDONLY, 0, &temp_pathname); + found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST, + in_pathname, O_RDONLY, 0, &temp_pathname); /* If not found, next search the solib_search_path (if any) for the basename only (ignoring the path). This is to allow reading solibs from a path that differs from the opened path. */ if (found_file < 0 && solib_search_path != NULL) - found_file = openp (solib_search_path, - 1, lbasename (in_pathname), O_RDONLY, 0, + found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST, + lbasename (in_pathname), O_RDONLY, 0, &temp_pathname); /* If not found, try to use target supplied solib search method */ @@ -175,13 +176,15 @@ solib_open (char *in_pathname, char **found_pathname) /* If not found, next search the inferior's $PATH environment variable. */ if (found_file < 0 && solib_absolute_prefix == NULL) found_file = openp (get_in_environ (inferior_environ, "PATH"), - 1, in_pathname, O_RDONLY, 0, &temp_pathname); + OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY, 0, + &temp_pathname); /* If not found, next search the inferior's $LD_LIBRARY_PATH environment variable. */ if (found_file < 0 && solib_absolute_prefix == NULL) found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"), - 1, in_pathname, O_RDONLY, 0, &temp_pathname); + OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY, 0, + &temp_pathname); /* Done. If not found, tough luck. Return found_file and (optionally) found_pathname. */ @@ -333,6 +336,14 @@ free_so (struct so_list *so) } +/* Return address of first so_list entry in master shared object list. */ +struct so_list * +master_so_list (void) +{ + return so_list_head; +} + + /* A small stub to get us past the arg-passing pinhole of catch_errors. */ static int @@ -468,6 +479,10 @@ update_solib_list (int from_tty, struct target_ops *target) /* If it's not on the inferior's list, remove it from GDB's tables. */ else { + /* Notify any observer that the SO has been unloaded + before we remove it from the gdb tables. */ + observer_notify_solib_unloaded (gdb); + *gdb_link = gdb->next; /* Unless the user loaded it explicitly, free SO's objfile. */ @@ -630,18 +645,11 @@ info_sharedlibrary_command (char *ignore, int from_tty) struct so_list *so = NULL; /* link map state variable */ int header_done = 0; int addr_width; - char *addr_fmt; if (TARGET_PTR_BIT == 32) - { - addr_width = 8 + 4; - addr_fmt = "08l"; - } + addr_width = 8 + 4; else if (TARGET_PTR_BIT == 64) - { - addr_width = 16 + 4; - addr_fmt = "016l"; - } + addr_width = 16 + 4; else { internal_error (__FILE__, __LINE__, @@ -665,15 +673,15 @@ info_sharedlibrary_command (char *ignore, int from_tty) printf_unfiltered ("%-*s", addr_width, so->textsection != NULL - ? local_hex_string_custom ( + ? hex_string_custom ( (LONGEST) so->textsection->addr, - addr_fmt) + addr_width - 4) : ""); printf_unfiltered ("%-*s", addr_width, so->textsection != NULL - ? local_hex_string_custom ( + ? hex_string_custom ( (LONGEST) so->textsection->endaddr, - addr_fmt) + addr_width - 4) : ""); printf_unfiltered ("%-12s", so->symbols_loaded ? "Yes" : "No"); printf_unfiltered ("%s\n", so->so_name); @@ -877,7 +885,7 @@ _initialize_solib (void) add_com ("nosharedlibrary", class_files, no_shared_libraries, "Unload all shared object library symbols."); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("auto-solib-add", class_support, var_boolean, (char *) &auto_solib_add, "Set autoloading of shared library symbols.\n\ @@ -893,7 +901,7 @@ inferior. Otherwise, symbols must be loaded manually, using `sharedlibrary'.", "Set prefix for loading absolute shared library symbol files.\n\ For other (relative) files, you can add values using `set solib-search-path'.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); set_cmd_cfunc (c, reload_shared_libraries); set_cmd_completer (c, filename_completer); @@ -906,7 +914,7 @@ For other (relative) files, you can add values using `set solib-search-path'.", "Set the search path for loading non-absolute shared library symbol files.\n\ This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); set_cmd_cfunc (c, reload_shared_libraries); set_cmd_completer (c, filename_completer); } diff --git a/gnu/usr.bin/binutils/gdb/somread.c b/gnu/usr.bin/binutils/gdb/somread.c index 4ffa4c1c9e4..560eb887c84 100644 --- a/gnu/usr.bin/binutils/gdb/somread.c +++ b/gnu/usr.bin/binutils/gdb/somread.c @@ -219,6 +219,7 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, if ((symname[0] == 'L' && symname[1] == '$') || (symname[0] == '$' && symname[strlen (symname) - 1] == '$') || (symname[0] == 'D' && symname[1] == '$') + || (strncmp (symname, "L0\001", 3) == 0) || (strncmp (symname, "$PIC", 4) == 0)) continue; break; @@ -403,7 +404,7 @@ som_symfile_finish (struct objfile *objfile) { if (objfile->sym_stab_info != NULL) { - xmfree (objfile->md, objfile->sym_stab_info); + xfree (objfile->sym_stab_info); } hpread_symfile_finish (objfile); } diff --git a/gnu/usr.bin/binutils/gdb/somsolib.c b/gnu/usr.bin/binutils/gdb/somsolib.c index 7ecc97e64d1..e70d6bdfef3 100644 --- a/gnu/usr.bin/binutils/gdb/somsolib.c +++ b/gnu/usr.bin/binutils/gdb/somsolib.c @@ -43,6 +43,7 @@ #include "regcache.h" #include "gdb_assert.h" #include "exec.h" +#include "hppa-tdep.h" #include <fcntl.h> @@ -215,7 +216,8 @@ som_solib_sizeof_symbol_table (char *filename) /* We believe that filename was handed to us by the dynamic linker, and is therefore always an absolute path. */ - desc = openp (getenv ("PATH"), 1, filename, O_RDONLY | O_BINARY, 0, &absolute_name); + desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename, + O_RDONLY | O_BINARY, 0, &absolute_name); if (desc < 0) { perror_with_name (filename); @@ -278,7 +280,7 @@ static void som_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty, CORE_ADDR text_addr) { - obj_private_data_t *obj_private; + struct hppa_objfile_private *obj_private; struct obj_section *s; so->objfile = symbol_file_add (name, from_tty, NULL, 0, OBJF_SHARED); @@ -307,17 +309,18 @@ som_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty, */ so->objfile->flags |= OBJF_SHARED; - if (so->objfile->obj_private == NULL) + obj_private = (struct hppa_objfile_private *) + objfile_data (so->objfile, hppa_objfile_priv_data); + if (obj_private == NULL) { - obj_private = (obj_private_data_t *) + obj_private = (struct hppa_objfile_private *) obstack_alloc (&so->objfile->objfile_obstack, - sizeof (obj_private_data_t)); + sizeof (struct hppa_objfile_private)); + set_objfile_data (so->objfile, hppa_objfile_priv_data, obj_private); obj_private->unwind_info = NULL; obj_private->so_info = NULL; - so->objfile->obj_private = obj_private; } - obj_private = (obj_private_data_t *) so->objfile->obj_private; obj_private->so_info = so; if (!bfd_check_format (so->abfd, bfd_object)) @@ -1062,7 +1065,7 @@ som_solib_remove_inferior_hook (int pid) CORE_ADDR addr; struct minimal_symbol *msymbol; int status; - char dld_flags_buffer[TARGET_INT_BIT / TARGET_CHAR_BIT]; + char dld_flags_buffer[4]; unsigned int dld_flags_value; struct cleanup *old_cleanups = save_inferior_ptid (); @@ -1079,16 +1082,13 @@ som_solib_remove_inferior_hook (int pid) msymbol = lookup_minimal_symbol ("__dld_flags", NULL, NULL); addr = SYMBOL_VALUE_ADDRESS (msymbol); - status = target_read_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT); + status = target_read_memory (addr, dld_flags_buffer, 4); - dld_flags_value = extract_unsigned_integer (dld_flags_buffer, - sizeof (dld_flags_value)); + dld_flags_value = extract_unsigned_integer (dld_flags_buffer, 4); dld_flags_value &= ~DLD_FLAGS_HOOKVALID; - store_unsigned_integer (dld_flags_buffer, - sizeof (dld_flags_value), - dld_flags_value); - status = target_write_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT); + store_unsigned_integer (dld_flags_buffer, 4, dld_flags_value); + status = target_write_memory (addr, dld_flags_buffer, 4); do_cleanups (old_cleanups); } @@ -1135,7 +1135,7 @@ som_solib_have_load_event (int pid) { CORE_ADDR event_kind; - event_kind = read_register (ARG0_REGNUM); + event_kind = read_register (HPPA_ARG0_REGNUM); return (event_kind == SHL_LOAD); } @@ -1144,7 +1144,7 @@ som_solib_have_unload_event (int pid) { CORE_ADDR event_kind; - event_kind = read_register (ARG0_REGNUM); + event_kind = read_register (HPPA_ARG0_REGNUM); return (event_kind == SHL_UNLOAD); } @@ -1158,7 +1158,7 @@ som_solib_library_pathname (int pid) static char dll_pathname[1024]; /* Read the descriptor of this newly-loaded library. */ - dll_handle_address = read_register (ARG1_REGNUM); + dll_handle_address = read_register (HPPA_ARG1_REGNUM); read_memory (dll_handle_address, (char *) &dll_descriptor, sizeof (dll_descriptor)); /* We can find a pointer to the dll's pathname within the descriptor. */ @@ -1463,17 +1463,17 @@ som_sharedlibrary_info_command (char *ignore, int from_tty) if (so_list->objfile == NULL) printf_unfiltered (" (symbols not loaded)"); printf_unfiltered ("\n"); - printf_unfiltered (" %-12s", local_hex_string_custom (flags, "08l")); + printf_unfiltered (" %-12s", hex_string_custom (flags, 8)); printf_unfiltered ("%-12s", - local_hex_string_custom (so_list->som_solib.text_addr, "08l")); + hex_string_custom (so_list->som_solib.text_addr, 8)); printf_unfiltered ("%-12s", - local_hex_string_custom (so_list->som_solib.text_end, "08l")); + hex_string_custom (so_list->som_solib.text_end, 8)); printf_unfiltered ("%-12s", - local_hex_string_custom (so_list->som_solib.data_start, "08l")); + hex_string_custom (so_list->som_solib.data_start, 8)); printf_unfiltered ("%-12s", - local_hex_string_custom (so_list->som_solib.data_end, "08l")); + hex_string_custom (so_list->som_solib.data_end, 8)); printf_unfiltered ("%-12s\n", - local_hex_string_custom (so_list->som_solib.got_value, "08l")); + hex_string_custom (so_list->som_solib.got_value, 8)); so_list = so_list->next; } } @@ -1584,7 +1584,7 @@ _initialize_som_solib (void) add_info ("sharedlibrary", som_sharedlibrary_info_command, "Status of loaded shared object libraries."); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("auto-solib-add", class_support, var_boolean, (char *) &auto_solib_add, "Set autoloading of shared library symbols.\n\ @@ -1595,7 +1595,7 @@ inferior. Otherwise, symbols must be loaded manually, using `sharedlibrary'.", &setlist), &showlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("auto-solib-limit", class_support, var_zinteger, (char *) &auto_solib_limit, "Set threshold (in Mb) for autoloading shared library symbols.\n\ diff --git a/gnu/usr.bin/binutils/gdb/source.c b/gnu/usr.bin/binutils/gdb/source.c index 92cdce426e6..f0dc5542b8e 100644 --- a/gnu/usr.bin/binutils/gdb/source.c +++ b/gnu/usr.bin/binutils/gdb/source.c @@ -1,6 +1,6 @@ /* List lines of source files for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -46,16 +46,16 @@ #include "ui-out.h" #include "readline/readline.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #ifdef CRLF_SOURCE_FILES /* Define CRLF_SOURCE_FILES in an xm-*.h file if source files on the host use \r\n rather than just \n. Defining CRLF_SOURCE_FILES is much faster than defining LSEEK_NOT_LINEAR. */ -#ifndef O_BINARY -#define O_BINARY 0 -#endif - #define OPEN_MODE (O_RDONLY | O_BINARY) #define FDOPEN_MODE FOPEN_RB @@ -325,12 +325,12 @@ forget_cached_source_info (void) { if (s->line_charpos != NULL) { - xmfree (objfile->md, s->line_charpos); + xfree (s->line_charpos); s->line_charpos = NULL; } if (s->fullname != NULL) { - xmfree (objfile->md, s->fullname); + xfree (s->fullname); s->fullname = NULL; } } @@ -636,12 +636,18 @@ is_regular_file (const char *name) /* Open a file named STRING, searching path PATH (dir names sep by some char) using mode MODE and protection bits PROT in the calls to open. - If TRY_CWD_FIRST, try to open ./STRING before searching PATH. + OPTS specifies the function behaviour in specific cases. + + If OPF_TRY_CWD_FIRST, try to open ./STRING before searching PATH. (ie pretend the first element of PATH is "."). This also indicates that a slash in STRING disables searching of the path (this is so that "exec-file ./foo" or "symbol-file ./foo" insures that you get that particular version of foo or an error message). + If OPTS has OPF_SEARCH_IN_PATH set, absolute names will also be + searched in path (we usually want this for source files but not for + executables). + If FILENAME_OPENED is non-null, set it to a newly allocated string naming the actual file opened (this string will always start with a "/"). We have to take special pains to avoid doubling the "/" between the directory @@ -654,7 +660,7 @@ is_regular_file (const char *name) /* >>>> This should only allow files of certain types, >>>> eg executable, non-directory */ int -openp (const char *path, int try_cwd_first, const char *string, +openp (const char *path, int opts, const char *string, int mode, int prot, char **filename_opened) { @@ -668,11 +674,9 @@ openp (const char *path, int try_cwd_first, const char *string, if (!path) path = "."; -#if defined(_WIN32) || defined(__CYGWIN__) mode |= O_BINARY; -#endif - if (try_cwd_first || IS_ABSOLUTE_PATH (string)) + if ((opts & OPF_TRY_CWD_FIRST) || IS_ABSOLUTE_PATH (string)) { int i; @@ -690,11 +694,16 @@ openp (const char *path, int try_cwd_first, const char *string, fd = -1; } - for (i = 0; string[i]; i++) - if (IS_DIR_SEPARATOR (string[i])) - goto done; + if (!(opts & OPF_SEARCH_IN_PATH)) + for (i = 0; string[i]; i++) + if (IS_DIR_SEPARATOR (string[i])) + goto done; } + /* /foo => foo, to avoid multiple slashes that Emacs doesn't like. */ + while (IS_DIR_SEPARATOR(string[0])) + string++; + /* ./foo => foo */ while (string[0] == '.' && IS_DIR_SEPARATOR (string[1])) string += 2; @@ -741,11 +750,11 @@ openp (const char *path, int try_cwd_first, const char *string, strcat (filename, string); if (is_regular_file (filename)) - { - fd = open (filename, mode); - if (fd >= 0) - break; - } + { + fd = open (filename, mode); + if (fd >= 0) + break; + } } done: @@ -765,9 +774,9 @@ done: /* Beware the // my son, the Emacs barfs, the botch that catch... */ char *f = concat (current_directory, - IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) - ? "" : SLASH_STRING, - filename, NULL); + IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) + ? "" : SLASH_STRING, + filename, NULL); *filename_opened = xfullpath (f); xfree (f); } @@ -787,14 +796,14 @@ done: If the file was found, this function returns 1, and FULL_PATHNAME is set to the fully-qualified pathname. - Else, this functions returns 0, and FULL_PATHNAME is set to NULL. - */ + Else, this functions returns 0, and FULL_PATHNAME is set to NULL. */ int source_full_path_of (char *filename, char **full_pathname) { int fd; - fd = openp (source_path, 1, filename, O_RDONLY, 0, full_pathname); + fd = openp (source_path, OPF_TRY_CWD_FIRST | OPF_SEARCH_IN_PATH, filename, + O_RDONLY, 0, full_pathname); if (fd < 0) { *full_pathname = NULL; @@ -805,30 +814,46 @@ source_full_path_of (char *filename, char **full_pathname) return 1; } +/* This function is capable of finding the absolute path to a + source file, and opening it, provided you give it an + OBJFILE and FILENAME. Both the DIRNAME and FULLNAME are only + added suggestions on where to find the file. -/* Open a source file given a symtab S. Returns a file descriptor or - negative number for error. */ + OBJFILE should be the objfile associated with a psymtab or symtab. + FILENAME should be the filename to open. + DIRNAME is the compilation directory of a particular source file. + Only some debug formats provide this info. + FULLNAME can be the last known absolute path to the file in question. + On Success + A valid file descriptor is returned. ( the return value is positive ) + FULLNAME is set to the absolute path to the file just opened. + + On Failure + A non valid file descriptor is returned. ( the return value is negitive ) + FULLNAME is set to NULL. */ int -open_source_file (struct symtab *s) +find_and_open_source (struct objfile *objfile, + const char *filename, + const char *dirname, + char **fullname) { char *path = source_path; const char *p; int result; - char *fullname; /* Quick way out if we already know its full name */ - if (s->fullname) + if (*fullname) { - result = open (s->fullname, OPEN_MODE); + result = open (*fullname, OPEN_MODE); if (result >= 0) return result; /* Didn't work -- free old one, try again. */ - xmfree (s->objfile->md, s->fullname); - s->fullname = NULL; + xfree (*fullname); + *fullname = NULL; } - if (s->dirname != NULL) + if (dirname != NULL) { /* Replace a path entry of $cdir with the compilation directory name */ #define cdir_len 5 @@ -841,61 +866,106 @@ open_source_file (struct symtab *s) int len; path = (char *) - alloca (strlen (source_path) + 1 + strlen (s->dirname) + 1); + alloca (strlen (source_path) + 1 + strlen (dirname) + 1); len = p - source_path; strncpy (path, source_path, len); /* Before $cdir */ - strcpy (path + len, s->dirname); /* new stuff */ + strcpy (path + len, dirname); /* new stuff */ strcat (path + len, source_path + len + cdir_len); /* After $cdir */ } } - result = openp (path, 0, s->filename, OPEN_MODE, 0, &s->fullname); + result = openp (path, OPF_SEARCH_IN_PATH, filename, OPEN_MODE, 0, fullname); if (result < 0) { /* Didn't work. Try using just the basename. */ - p = lbasename (s->filename); - if (p != s->filename) - result = openp (path, 0, p, OPEN_MODE, 0, &s->fullname); + p = lbasename (filename); + if (p != filename) + result = openp (path, OPF_SEARCH_IN_PATH, p, OPEN_MODE, 0, fullname); } if (result >= 0) { - fullname = s->fullname; - s->fullname = mstrsave (s->objfile->md, s->fullname); - xfree (fullname); + char *tmp_fullname; + tmp_fullname = *fullname; + *fullname = xstrdup (tmp_fullname); + xfree (tmp_fullname); } return result; } -/* Return the path to the source file associated with symtab. Returns NULL - if no symtab. */ +/* Open a source file given a symtab S. Returns a file descriptor or + negative number for error. + + This function is a convience function to find_and_open_source. */ +int +open_source_file (struct symtab *s) +{ + if (!s) + return -1; + + return find_and_open_source (s->objfile, s->filename, s->dirname, + &s->fullname); +} + +/* Finds the fullname that a symtab represents. + + If this functions finds the fullname, it will save it in ps->fullname + and it will also return the value. + + If this function fails to find the file that this symtab represents, + NULL will be returned and ps->fullname will be set to NULL. */ char * -symtab_to_filename (struct symtab *s) +symtab_to_fullname (struct symtab *s) { - int fd; + int r; if (!s) return NULL; - /* If we've seen the file before, just return fullname. */ + /* Don't check s->fullname here, the file could have been + deleted/moved/..., look for it again */ + r = find_and_open_source (s->objfile, s->filename, s->dirname, + &s->fullname); - if (s->fullname) - return s->fullname; + if (r) + { + close (r); + return s->fullname; + } - /* Try opening the file to setup fullname */ + return NULL; +} - fd = open_source_file (s); - if (fd < 0) - return s->filename; /* File not found. Just use short name */ +/* Finds the fullname that a partial_symtab represents. - /* Found the file. Cleanup and return the full name */ + If this functions finds the fullname, it will save it in ps->fullname + and it will also return the value. - close (fd); - return s->fullname; + If this function fails to find the file that this partial_symtab represents, + NULL will be returned and ps->fullname will be set to NULL. */ +char * +psymtab_to_fullname (struct partial_symtab *ps) +{ + int r; + + if (!ps) + return NULL; + + /* Don't check ps->fullname here, the file could have been + deleted/moved/..., look for it again */ + r = find_and_open_source (ps->objfile, ps->filename, ps->dirname, + &ps->fullname); + + if (r) + { + close (r); + return ps->fullname; + } + + return NULL; } - /* Create and initialize the table S->line_charpos that records the positions of the lines in the source file, which is assumed to be open on descriptor DESC. @@ -912,8 +982,7 @@ find_source_lines (struct symtab *s, int desc) long mtime = 0; int size; - line_charpos = (int *) xmmalloc (s->objfile->md, - lines_allocated * sizeof (int)); + line_charpos = (int *) xmalloc (lines_allocated * sizeof (int)); if (fstat (desc, &st) < 0) perror_with_name (s->filename); @@ -943,8 +1012,8 @@ find_source_lines (struct symtab *s, int desc) { lines_allocated *= 2; line_charpos = - (int *) xmrealloc (s->objfile->md, (char *) line_charpos, - sizeof (int) * lines_allocated); + (int *) xrealloc ((char *) line_charpos, + sizeof (int) * lines_allocated); } line_charpos[nlines++] = lseek (desc, 0, SEEK_CUR); } @@ -981,8 +1050,8 @@ find_source_lines (struct symtab *s, int desc) { lines_allocated *= 2; line_charpos = - (int *) xmrealloc (s->objfile->md, (char *) line_charpos, - sizeof (int) * lines_allocated); + (int *) xrealloc ((char *) line_charpos, + sizeof (int) * lines_allocated); } line_charpos[nlines++] = p - data; } @@ -992,8 +1061,7 @@ find_source_lines (struct symtab *s, int desc) #endif /* lseek linear. */ s->nlines = nlines; s->line_charpos = - (int *) xmrealloc (s->objfile->md, (char *) line_charpos, - nlines * sizeof (int)); + (int *) xrealloc ((char *) line_charpos, nlines * sizeof (int)); } @@ -1587,7 +1655,7 @@ The matching line number is also stored as the value of \"$_\"."); add_com_alias ("?", "reverse-search", class_files, 0); } - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("listsize", class_support, var_uinteger, (char *) &lines_to_list, "Set number of source lines gdb will list by default.", diff --git a/gnu/usr.bin/binutils/gdb/sparc-nat.c b/gnu/usr.bin/binutils/gdb/sparc-nat.c index 955e65e3140..a3836ce892e 100644 --- a/gnu/usr.bin/binutils/gdb/sparc-nat.c +++ b/gnu/usr.bin/binutils/gdb/sparc-nat.c @@ -35,6 +35,7 @@ #include "sparc-tdep.h" #include "sparc-nat.h" +#include "inf-ptrace.h" /* With some trickery we can use the code in this file for most (if not all) ptrace(2) based SPARC systems, which includes SunOS 4, @@ -166,7 +167,7 @@ fetch_inferior_registers (int regnum) { gregset_t regs; - if (ptrace (PTRACE_GETREGS, pid, (PTRACE_ARG3_TYPE) ®s, 0) == -1) + if (ptrace (PTRACE_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); sparc_supply_gregset (sparc_gregset, regcache, -1, ®s); @@ -178,7 +179,7 @@ fetch_inferior_registers (int regnum) { fpregset_t fpregs; - if (ptrace (PTRACE_GETFPREGS, pid, (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + if (ptrace (PTRACE_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't get floating point status"); sparc_supply_fpregset (regcache, -1, &fpregs); @@ -201,12 +202,12 @@ store_inferior_registers (int regnum) { gregset_t regs; - if (ptrace (PTRACE_GETREGS, pid, (PTRACE_ARG3_TYPE) ®s, 0) == -1) + if (ptrace (PTRACE_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); sparc_collect_gregset (sparc_gregset, regcache, regnum, ®s); - if (ptrace (PTRACE_SETREGS, pid, (PTRACE_ARG3_TYPE) ®s, 0) == -1) + if (ptrace (PTRACE_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't write registers"); /* Deal with the stack regs. */ @@ -227,7 +228,7 @@ store_inferior_registers (int regnum) { fpregset_t fpregs, saved_fpregs; - if (ptrace (PTRACE_GETFPREGS, pid, (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + if (ptrace (PTRACE_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't get floating-point registers"); memcpy (&saved_fpregs, &fpregs, sizeof (fpregs)); @@ -240,7 +241,7 @@ store_inferior_registers (int regnum) if (memcmp (&saved_fpregs, &fpregs, sizeof (fpregs)) != 0) { if (ptrace (PTRACE_SETFPREGS, pid, - (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) + (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name ("Couldn't write floating-point registers"); } @@ -284,7 +285,7 @@ sparc_xfer_wcookie (struct target_ops *ops, enum target_object object, gdb_assert (sizeof (wcookie) == sizeof (register_t)); /* Fetch the cookie. */ - if (ptrace (PT_WCOOKIE, pid, (PTRACE_ARG3_TYPE) &wcookie, 0) == -1) + if (ptrace (PT_WCOOKIE, pid, (PTRACE_TYPE_ARG3) &wcookie, 0) == -1) { if (errno != EINVAL) perror_with_name ("Couldn't get StackGhost cookie"); @@ -304,6 +305,20 @@ sparc_xfer_wcookie (struct target_ops *ops, enum target_object object, memcpy (readbuf, buf + offset, len); return len; } + +/* Create a prototype generic SPARC target. The client can override + it with local methods. */ + +struct target_ops * +sparc_target (void) +{ + struct target_ops *t; + + t = inf_ptrace_target (); + t->to_fetch_registers = fetch_inferior_registers; + t->to_store_registers = store_inferior_registers; + return t; +} /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gnu/usr.bin/binutils/gdb/sparc-tdep.c b/gnu/usr.bin/binutils/gdb/sparc-tdep.c index ac8eb48f439..7fbd9de62b0 100644 --- a/gnu/usr.bin/binutils/gdb/sparc-tdep.c +++ b/gnu/usr.bin/binutils/gdb/sparc-tdep.c @@ -43,12 +43,11 @@ struct regset; -/* This file implements the The SPARC 32-bit ABI as defined by the - section "Low-Level System Information" of the SPARC Compliance - Definition (SCD) 2.4.1, which is the 32-bit System V psABI for - SPARC. The SCD lists changes with respect to the origional 32-bit - psABI as defined in the "System V ABI, SPARC Processor - Supplement". +/* This file implements the SPARC 32-bit ABI as defined by the section + "Low-Level System Information" of the SPARC Compliance Definition + (SCD) 2.4.1, which is the 32-bit System V psABI for SPARC. The SCD + lists changes with respect to the original 32-bit psABI as defined + in the "System V ABI, SPARC Processor Supplement". Note that if we talk about SunOS, we mean SunOS 4.x, which was BSD-based, which is sometimes (retroactively?) referred to as @@ -186,7 +185,7 @@ sparc_integral_or_pointer_p (const struct type *type) { /* We have byte, half-word, word and extended-word/doubleword integral types. The doubleword is an extension to the - origional 32-bit ABI by the SCD 2.4.x. */ + original 32-bit ABI by the SCD 2.4.x. */ int len = TYPE_LENGTH (type); return (len == 1 || len == 2 || len == 4 || len == 8); } @@ -451,7 +450,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs, } static CORE_ADDR -sparc32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +sparc32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) diff --git a/gnu/usr.bin/binutils/gdb/sparc64-tdep.c b/gnu/usr.bin/binutils/gdb/sparc64-tdep.c index 437650876b8..a4398d57adb 100644 --- a/gnu/usr.bin/binutils/gdb/sparc64-tdep.c +++ b/gnu/usr.bin/binutils/gdb/sparc64-tdep.c @@ -568,8 +568,7 @@ sparc64_frame_base_address (struct frame_info *next_frame, void **this_cache) struct sparc_frame_cache *cache = sparc64_frame_cache (next_frame, this_cache); - /* ??? Should we take BIAS into account here? */ - return cache->base; + return cache->base + BIAS; } static const struct frame_base sparc64_frame_base = @@ -932,7 +931,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, gdb_assert (element < 6); regnum = SPARC_O0_REGNUM + element; regcache_cooked_write (regcache, regnum, valbuf); - regcache_cooked_write (regcache, regnum + 1, valbuf); + regcache_cooked_write (regcache, regnum + 1, valbuf + 8); } } @@ -949,7 +948,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, } static CORE_ADDR -sparc64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +sparc64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) diff --git a/gnu/usr.bin/binutils/gdb/sparc64nbsd-nat.c b/gnu/usr.bin/binutils/gdb/sparc64nbsd-nat.c index 7d554cf6089..fe9e006b8dc 100644 --- a/gnu/usr.bin/binutils/gdb/sparc64nbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/sparc64nbsd-nat.c @@ -21,6 +21,7 @@ #include "defs.h" #include "regcache.h" +#include "target.h" #include "sparc64-tdep.h" #include "sparc-nat.h" @@ -169,6 +170,9 @@ _initialize_sparc64nbsd_nat (void) sparc_gregset_supplies_p = sparc64nbsd_gregset_supplies_p; sparc_fpregset_supplies_p = sparc64nbsd_fpregset_supplies_p; + /* We've got nothing to add to the generic SPARC target. */ + add_target (sparc_target ()); + /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (sparc64nbsd_supply_pcb); } diff --git a/gnu/usr.bin/binutils/gdb/sparc64obsd-tdep.c b/gnu/usr.bin/binutils/gdb/sparc64obsd-tdep.c index 760522f254f..fdd5e8184ce 100644 --- a/gnu/usr.bin/binutils/gdb/sparc64obsd-tdep.c +++ b/gnu/usr.bin/binutils/gdb/sparc64obsd-tdep.c @@ -25,13 +25,13 @@ #include "osabi.h" #include "regset.h" #include "symtab.h" +#include "objfiles.h" #include "solib-svr4.h" #include "trad-frame.h" #include "gdb_assert.h" #include "sparc64-tdep.h" -#include "nbsd-tdep.h" /* OpenBSD uses the traditional NetBSD core file format, even for ports that use ELF. The core files don't use multiple register @@ -61,7 +61,7 @@ sparc64obsd_supply_gregset (const struct regset *regset, { const char *regs = gregs; - sparc64_supply_gregset (regset->descr, regcache, regnum, regs); + sparc64_supply_gregset (&sparc64obsd_core_gregset, regcache, regnum, regs); sparc64_supply_fpregset (regcache, regnum, regs + 288); } @@ -164,8 +164,8 @@ sparc64obsd_frame_prev_register (struct frame_info *next_frame, struct sparc_frame_cache *cache = sparc64obsd_frame_cache (next_frame, this_cache); - trad_frame_prev_register (next_frame, cache->saved_regs, regnum, - optimizedp, lvalp, addrp, realnump, valuep); + trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); } static const struct frame_unwind sparc64obsd_frame_unwind = @@ -194,18 +194,18 @@ sparc64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - tdep->gregset = XMALLOC (struct regset); - tdep->gregset->descr = &sparc64obsd_core_gregset; - tdep->gregset->supply_regset = sparc64obsd_supply_gregset; + tdep->gregset = regset_alloc (gdbarch, sparc64obsd_supply_gregset, NULL); tdep->sizeof_gregset = 832; - set_gdbarch_pc_in_sigtramp (gdbarch, sparc64obsd_pc_in_sigtramp); frame_unwind_append_sniffer (gdbarch, sparc64obsd_sigtramp_frame_sniffer); sparc64_init_abi (info, gdbarch); + /* OpenBSD/sparc64 has SVR4-style shared libraries... */ + set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); + set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); set_solib_svr4_fetch_link_map_offsets - (gdbarch, nbsd_lp64_solib_svr4_fetch_link_map_offsets); + (gdbarch, svr4_lp64_fetch_link_map_offsets); } diff --git a/gnu/usr.bin/binutils/gdb/sparcnbsd-nat.c b/gnu/usr.bin/binutils/gdb/sparcnbsd-nat.c index 01089eeef32..4b0eb12136c 100644 --- a/gnu/usr.bin/binutils/gdb/sparcnbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/sparcnbsd-nat.c @@ -20,8 +20,8 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" -#include "gdbcore.h" #include "regcache.h" +#include "target.h" #include "sparc-tdep.h" #include "sparc-nat.h" @@ -38,7 +38,7 @@ sparc32nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) { /* The following is true for NetBSD 1.6.2: - The pcb contains %sp, %sp, %psr and %wim. From this information + The pcb contains %sp, %pc, %psr and %wim. From this information we reconstruct the register state as it would look when we just returned from cpu_switch(). */ @@ -66,6 +66,9 @@ _initialize_sparcnbsd_nat (void) { sparc_gregset = &sparc32nbsd_gregset; + /* We've got nothing to add to the generic SPARC target. */ + add_target (sparc_target ()); + /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (sparc32nbsd_supply_pcb); } diff --git a/gnu/usr.bin/binutils/gdb/stabsread.c b/gnu/usr.bin/binutils/gdb/stabsread.c index 5cee516bcb3..e91a9809052 100644 --- a/gnu/usr.bin/binutils/gdb/stabsread.c +++ b/gnu/usr.bin/binutils/gdb/stabsread.c @@ -178,11 +178,11 @@ invalid_cpp_abbrev_complaint (const char *arg1) } static void -reg_value_complaint (int arg1, int arg2, const char *arg3) +reg_value_complaint (int regnum, int num_regs, const char *sym) { complaint (&symfile_complaints, - "register number %d too large (max %d) in symbol %s", arg1, arg2, - arg3); + "register number %d too large (max %d) in symbol %s", + regnum, num_regs - 1, sym); } static void @@ -978,61 +978,17 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, TYPE_FLAG_UNSIGNED, "unsigned int", NULL); - if (BELIEVE_PCC_PROMOTION_TYPE) + /* If PCC says a parameter is a short or a char, it is + really an int. */ + if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type) + && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT) { - /* This is defined on machines (e.g. sparc) where we - should believe the type of a PCC 'short' argument, - but shouldn't believe the address (the address is the - address of the corresponding int). - - My guess is that this correction, as opposed to - changing the parameter to an 'int' (as done below, - for PCC on most machines), is the right thing to do - on all machines, but I don't want to risk breaking - something that already works. On most PCC machines, - the sparc problem doesn't come up because the calling - function has to zero the top bytes (not knowing - whether the called function wants an int or a short), - so there is little practical difference between an - int and a short (except perhaps what happens when the - GDB user types "print short_arg = 0x10000;"). - - Hacked for SunOS 4.1 by gnu@cygnus.com. In 4.1, the - compiler actually produces the correct address (we - don't need to fix it up). I made this code adapt so - that it will offset the symbol if it was pointing at - an int-aligned location and not otherwise. This way - you can use the same gdb for 4.0.x and 4.1 systems. - - If the parameter is shorter than an int, and is - integral (e.g. char, short, or unsigned equivalent), - and is claimed to be passed on an integer boundary, - don't believe it! Offset the parameter's address to - the tail-end of that integer. */ - - if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type) - && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT - && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (pcc_promotion_type)) - { - SYMBOL_VALUE (sym) += TYPE_LENGTH (pcc_promotion_type) - - TYPE_LENGTH (SYMBOL_TYPE (sym)); - } - break; - } - else - { - /* If PCC says a parameter is a short or a char, - it is really an int. */ - if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type) - && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT) - { - SYMBOL_TYPE (sym) = - TYPE_UNSIGNED (SYMBOL_TYPE (sym)) - ? pcc_unsigned_promotion_type - : pcc_promotion_type; - } - break; + SYMBOL_TYPE (sym) = + TYPE_UNSIGNED (SYMBOL_TYPE (sym)) + ? pcc_unsigned_promotion_type + : pcc_promotion_type; } + break; } case 'P': diff --git a/gnu/usr.bin/binutils/gdb/stack.c b/gnu/usr.bin/binutils/gdb/stack.c index 18d9a7c303e..5d7af0a1959 100644 --- a/gnu/usr.bin/binutils/gdb/stack.c +++ b/gnu/usr.bin/binutils/gdb/stack.c @@ -52,7 +52,7 @@ void args_info (char *, int); void locals_info (char *, int); -void (*selected_frame_level_changed_hook) (int); +void (*deprecated_selected_frame_level_changed_hook) (int); void _initialize_stack (void); @@ -95,9 +95,9 @@ static int print_block_frame_locals (struct block *, struct ui_file *); static void print_frame (struct frame_info *fi, - int level, - int source, - int args, + int print_level, + enum print_what print_what, + int print_args, struct symtab_and_line sal); static void backtrace_command (char *, int); @@ -120,42 +120,38 @@ int annotation_level = 0; struct print_stack_frame_args { struct frame_info *fi; - int level; - int source; - int args; + int print_level; + enum print_what print_what; + int print_args; }; /* Show or print the frame arguments. Pass the args the way catch_errors wants them. */ -static int print_stack_frame_stub (void *args); static int print_stack_frame_stub (void *args) { struct print_stack_frame_args *p = (struct print_stack_frame_args *) args; - print_frame_info (p->fi, p->level, p->source, p->args); + print_frame_info (p->fi, p->print_level, p->print_what, p->print_args); return 0; } -/* Show or print a stack frame briefly. FRAME_INFI should be the frame info - and LEVEL should be its level in the stack (or -1 for level not defined). - This prints the level, the function executing, the arguments, - and the file name and line number. - If the pc is not at the beginning of the source line, - the actual pc is printed at the beginning. - - If SOURCE is 1, print the source line as well. - If SOURCE is -1, print ONLY the source line. */ +/* Show or print a stack frame FI briefly. The output is format + according to PRINT_LEVEL and PRINT_WHAT printing the frame's + relative level, function name, argument list, and file name and + line number. If the frame's PC is not at the beginning of the + source line, the actual PC is printed at the beginning. */ void -print_stack_frame (struct frame_info *fi, int level, int source) +print_stack_frame (struct frame_info *fi, int print_level, + enum print_what print_what) { struct print_stack_frame_args args; args.fi = fi; - args.level = level; - args.source = source; - args.args = 1; + args.print_level = print_level; + args.print_what = print_what; + args.print_args = 1; catch_errors (print_stack_frame_stub, (char *) &args, "", RETURN_MASK_ALL); } @@ -418,7 +414,8 @@ print_args_stub (void *args) LOC_AND_SRC: Print location and source line. */ void -print_frame_info (struct frame_info *fi, int level, int source, int args) +print_frame_info (struct frame_info *fi, int print_level, + enum print_what print_what, int print_args) { struct symtab_and_line sal; int source_print; @@ -430,14 +427,16 @@ print_frame_info (struct frame_info *fi, int level, int source, int args) struct cleanup *uiout_cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "frame"); - annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); + annotate_frame_begin (print_level ? frame_relative_level (fi) : 0, + get_frame_pc (fi)); /* Do this regardless of SOURCE because we don't have any source to list for this frame. */ - if (level >= 0) + if (print_level) { ui_out_text (uiout, "#"); - ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); + ui_out_field_fmt_int (uiout, 2, ui_left, "level", + frame_relative_level (fi)); } if (ui_out_is_mi_like_p (uiout)) { @@ -471,14 +470,14 @@ print_frame_info (struct frame_info *fi, int level, int source, int args) line containing fi->pc. */ find_frame_sal (fi, &sal); - location_print = (source == LOCATION - || source == LOC_AND_ADDRESS - || source == SRC_AND_LOC); + location_print = (print_what == LOCATION + || print_what == LOC_AND_ADDRESS + || print_what == SRC_AND_LOC); if (location_print || !sal.symtab) - print_frame (fi, level, source, args, sal); + print_frame (fi, print_level, print_what, print_args, sal); - source_print = (source == SRC_LINE || source == SRC_AND_LOC); + source_print = (print_what == SRC_LINE || print_what == SRC_AND_LOC); if (sal.symtab) set_current_source_symtab_and_line (&sal); @@ -487,15 +486,16 @@ print_frame_info (struct frame_info *fi, int level, int source, int args) { struct symtab_and_line cursal; int done = 0; - int mid_statement = (source == SRC_LINE) && (get_frame_pc (fi) != sal.pc); + int mid_statement = ((print_what == SRC_LINE) + && (get_frame_pc (fi) != sal.pc)); if (annotation_level) done = identify_source_line (sal.symtab, sal.line, mid_statement, get_frame_pc (fi)); if (!done) { - if (print_frame_info_listing_hook) - print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0); + if (deprecated_print_frame_info_listing_hook) + deprecated_print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0); else { /* We used to do this earlier, but that is clearly @@ -522,7 +522,7 @@ print_frame_info (struct frame_info *fi, int level, int source, int args) set_current_source_symtab_and_line (&cursal); } - if (source != 0) + if (print_what != LOCATION) set_default_breakpoint (1, get_frame_pc (fi), sal.symtab, sal.line); annotate_frame_end (); @@ -532,9 +532,9 @@ print_frame_info (struct frame_info *fi, int level, int source, int args) static void print_frame (struct frame_info *fi, - int level, - int source, - int args, + int print_level, + enum print_what print_what, + int print_args, struct symtab_and_line sal) { struct symbol *func; @@ -571,14 +571,6 @@ print_frame (struct frame_info *fi, && (SYMBOL_VALUE_ADDRESS (msymbol) > BLOCK_START (SYMBOL_BLOCK_VALUE (func)))) { -#if 0 - /* There is no particular reason to think the line number - information is wrong. Someone might have just put in - a label with asm() but left the line numbers alone. */ - /* In this case we have no way of knowing the source file - and line number, so don't print them. */ - sal.symtab = 0; -#endif /* We also don't know anything about the function besides its address and name. */ func = 0; @@ -622,19 +614,21 @@ print_frame (struct frame_info *fi, } } - annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); + annotate_frame_begin (print_level ? frame_relative_level (fi) : 0, + get_frame_pc (fi)); list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame"); - if (level >= 0) + if (print_level) { ui_out_text (uiout, "#"); - ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); + ui_out_field_fmt_int (uiout, 2, ui_left, "level", + frame_relative_level (fi)); } if (addressprint) if (get_frame_pc (fi) != sal.pc || !sal.symtab - || source == LOC_AND_ADDRESS) + || print_what == LOC_AND_ADDRESS) { annotate_frame_address (); ui_out_field_core_addr (uiout, "addr", get_frame_pc (fi)); @@ -649,7 +643,7 @@ print_frame (struct frame_info *fi, annotate_frame_args (); ui_out_text (uiout, " ("); - if (args) + if (print_args) { struct print_args_args args; struct cleanup *args_list_chain; @@ -940,14 +934,6 @@ frame_info (char *addr_exp, int from_tty) print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout); printf_filtered ("\n"); - { - int frameless; - frameless = (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P () - && DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (fi)); - if (frameless) - printf_filtered (" (FRAMELESS),"); - } - if (calling_frame_info) { printf_filtered (" called by frame at "); @@ -1017,9 +1003,6 @@ frame_info (char *addr_exp, int from_tty) } } - if (DEPRECATED_FRAME_INIT_SAVED_REGS_P () - && deprecated_get_frame_saved_regs (fi) == NULL) - DEPRECATED_FRAME_INIT_SAVED_REGS (fi); /* Print as much information as possible on the location of all the registers. */ { @@ -1051,7 +1034,7 @@ frame_info (char *addr_exp, int from_tty) /* NOTE: cagney/2003-05-22: This is assuming that the stack pointer was packed as an unsigned integer. That may or may not be valid. */ - sp = extract_unsigned_integer (value, DEPRECATED_REGISTER_RAW_SIZE (SP_REGNUM)); + sp = extract_unsigned_integer (value, register_size (current_gdbarch, SP_REGNUM)); printf_filtered (" Previous frame's sp is "); print_address_numeric (sp, 1, gdb_stdout); printf_filtered ("\n"); @@ -1102,33 +1085,6 @@ frame_info (char *addr_exp, int from_tty) } } -#if 0 -/* Set a limit on the number of frames printed by default in a - backtrace. */ - -static int backtrace_limit; - -static void -set_backtrace_limit_command (char *count_exp, int from_tty) -{ - int count = parse_and_eval_long (count_exp); - - if (count < 0) - error ("Negative argument not meaningful as backtrace limit."); - - backtrace_limit = count; -} - -static void -backtrace_limit_info (char *arg, int from_tty) -{ - if (arg) - error ("\"Info backtrace-limit\" takes no arguments."); - - printf_unfiltered ("Backtrace limit: %d.\n", backtrace_limit); -} -#endif - /* Print briefly all stack frames or just the innermost COUNT frames. */ static void backtrace_command_1 (char *count_exp, int show_locals, @@ -1220,7 +1176,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty) means further attempts to backtrace would fail (on the other hand, perhaps the code does or could be fixed to make sure the frame->prev field gets set to NULL in that case). */ - print_frame_info (fi, trailing_level + i, 0, 1); + print_frame_info (fi, 1, LOCATION, 1); if (show_locals) print_frame_local_vars (fi, 1, gdb_stdout); } @@ -1353,7 +1309,7 @@ print_block_frame_labels (struct block *b, int *have_default, ALL_BLOCK_SYMBOLS (b, iter, sym) { - if (DEPRECATED_STREQ (DEPRECATED_SYMBOL_NAME (sym), "default")) + if (strcmp (DEPRECATED_SYMBOL_NAME (sym), "default") == 0) { if (*have_default) continue; @@ -1507,10 +1463,6 @@ catch_info (char *ignore, int from_tty) /* Ideally, here we should interact with the C++ runtime system to find the list of active handlers, etc. */ fprintf_filtered (gdb_stdout, "Info catch not supported with this target/compiler combination.\n"); -#if 0 - if (!deprecated_selected_frame) - error ("No frame selected."); -#endif } else { @@ -1606,9 +1558,7 @@ select_and_print_frame (struct frame_info *fi) { select_frame (fi); if (fi) - { - print_stack_frame (fi, frame_relative_level (fi), 1); - } + print_stack_frame (fi, 1, SRC_AND_LOC); } /* Return the symbol-block in which the selected frame is executing. @@ -1625,7 +1575,7 @@ get_selected_block (CORE_ADDR *addr_in_block) return 0; /* NOTE: cagney/2002-11-28: Why go to all this effort to not create - a selected/current frame? Perhaphs this function is called, + a selected/current frame? Perhaps this function is called, indirectly, by WFI in "infrun.c" where avoiding the creation of an inner most frame is very important (it slows down single step). I suspect, though that this was true in the deep dark @@ -1695,7 +1645,6 @@ void select_frame_command (char *level_exp, int from_tty) { struct frame_info *frame; - int level = frame_relative_level (deprecated_selected_frame); if (!target_has_stack) error ("No stack."); @@ -1703,8 +1652,6 @@ select_frame_command (char *level_exp, int from_tty) frame = parse_frame_specification (level_exp); select_frame (frame); - if (level != frame_relative_level (deprecated_selected_frame)) - selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame)); } /* The "frame" command. With no arg, print selected frame briefly. @@ -1715,8 +1662,7 @@ void frame_command (char *level_exp, int from_tty) { select_frame_command (level_exp, from_tty); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); } /* The XDB Compatibility command to print the current frame. */ @@ -1726,8 +1672,7 @@ current_frame_command (char *level_exp, int from_tty) { if (target_has_stack == 0 || deprecated_selected_frame == 0) error ("No stack."); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); } /* Select the frame up one or COUNT stack levels @@ -1749,7 +1694,6 @@ up_silently_base (char *count_exp) if (count1 != 0 && count_exp == 0) error ("Initial frame selected; you cannot go up."); select_frame (fi); - selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame)); } static void @@ -1762,8 +1706,7 @@ static void up_command (char *count_exp, int from_tty) { up_silently_base (count_exp); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); } /* Select the frame down one or COUNT stack levels @@ -1794,7 +1737,6 @@ down_silently_base (char *count_exp) } select_frame (frame); - selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame)); } static void @@ -1807,8 +1749,7 @@ static void down_command (char *count_exp, int from_tty) { down_silently_base (count_exp); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); } void @@ -1844,6 +1785,7 @@ return_command (char *retval_exp, int from_tty) return_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (thisfun)); if (return_type == NULL) return_type = builtin_type_int; + CHECK_TYPEDEF (return_type); return_value = value_cast (return_type, return_value); /* Make sure the value is fully evaluated. It may live in the @@ -1925,42 +1867,18 @@ If you continue, the return value that you specified will be ignored.\n"; if (return_value != NULL) { struct type *return_type = VALUE_TYPE (return_value); - if (!gdbarch_return_value_p (current_gdbarch)) - { - STORE_RETURN_VALUE (return_type, current_regcache, - VALUE_CONTENTS (return_value)); - } - /* FIXME: cagney/2004-01-17: If extract_returned_value_address - is available and the function is using - RETURN_VALUE_STRUCT_CONVENTION, should use it to find the - address of the returned value so that it can be assigned. */ - else - { - gdb_assert (gdbarch_return_value (current_gdbarch, return_type, - NULL, NULL, NULL) - == RETURN_VALUE_REGISTER_CONVENTION); - gdbarch_return_value (current_gdbarch, return_type, - current_regcache, NULL /*read*/, - VALUE_CONTENTS (return_value) /*write*/); - } + gdb_assert (gdbarch_return_value (current_gdbarch, return_type, + NULL, NULL, NULL) + == RETURN_VALUE_REGISTER_CONVENTION); + gdbarch_return_value (current_gdbarch, return_type, + current_regcache, NULL /*read*/, + VALUE_CONTENTS (return_value) /*write*/); } /* If we are at the end of a call dummy now, pop the dummy frame too. */ - /* NOTE: cagney/2003-01-18: Is this silly? Instead of popping all - the frames in sequence, should this code just pop the dummy frame - directly? */ -#ifdef DEPRECATED_CALL_DUMMY_HAS_COMPLETED - /* Since all up-to-date architectures return direct to the dummy - breakpoint address, a dummy frame has, by definition, always - completed. Hence this method is no longer needed. */ - if (DEPRECATED_CALL_DUMMY_HAS_COMPLETED (read_pc(), read_sp (), - get_frame_base (get_current_frame ()))) - frame_pop (get_current_frame ()); -#else if (get_frame_type (get_current_frame ()) == DUMMY_FRAME) frame_pop (get_current_frame ()); -#endif /* If interactive, print the frame that is now current. */ if (from_tty) diff --git a/gnu/usr.bin/binutils/gdb/standalone.c b/gnu/usr.bin/binutils/gdb/standalone.c deleted file mode 100644 index 906e37a2b6e..00000000000 --- a/gnu/usr.bin/binutils/gdb/standalone.c +++ /dev/null @@ -1,580 +0,0 @@ -/* Interface to bare machine for GDB running as kernel debugger. - - Copyright 1986, 1989, 1991, 1992, 1993, 1995, 1996, 2000, 2001, - 2003 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 <stdio.h> -#include <sys/ioctl.h> -#include <errno.h> -#include <sys/types.h> -#include "gdb_stat.h" - -#if defined (SIGTSTP) && defined (SIGIO) -#include <sys/time.h> -#include <sys/resource.h> -#endif /* SIGTSTP and SIGIO defined (must be 4.2) */ - -#include "defs.h" -#include <signal.h> -#include "symtab.h" -#include "frame.h" -#include "inferior.h" -#include "gdb_wait.h" - - -/* Random system calls, mostly no-ops to prevent link problems */ - -ioctl (int desc, int code, int arg) -{ -} - -int (*signal ()) () -{ -} - -kill (void) -{ -} - -getpid (void) -{ - return 0; -} - -sigsetmask (void) -{ -} - -chdir (void) -{ -} - -char * -getcwd (char *buf, unsigned int len) -{ - buf[0] = '/'; - buf[1] = 0; - return buf; -} - -/* Used to check for existence of .gdbinit. Say no. */ - -access (void) -{ - return -1; -} - -exit (void) -{ - error ("Fatal error; restarting."); -} - -/* Reading "files". The contents of some files are written into kdb's - data area before it is run. These files are used to contain the - symbol table for kdb to load, and the source files (in case the - kdb user wants to print them). The symbols are stored in a file - named "kdb-symbols" in a.out format (except that all the text and - data have been stripped to save room). - - The files are stored in the following format: - int number of bytes of data for this file, including these four. - char[] name of the file, ending with a null. - padding to multiple of 4 boundary. - char[] file contents. The length can be deduced from what was - specified before. There is no terminating null here. - - If the int at the front is zero, it means there are no more files. - - Opening a file in kdb returns a nonzero value to indicate success, - but the value does not matter. Only one file can be open, and only - for reading. All the primitives for input from the file know - which file is open and ignore what is specified for the descriptor - or for the stdio stream. - - Input with fgetc can be done either on the file that is open - or on stdin (which reads from the terminal through tty_input () */ - -/* Address of data for the files stored in format described above. */ -char *files_start; - -/* The file stream currently open: */ - -char *sourcebeg; /* beginning of contents */ -int sourcesize; /* size of contents */ -char *sourceptr; /* current read pointer */ -int sourceleft; /* number of bytes to eof */ - -/* "descriptor" for the file now open. - Incremented at each close. - If specified descriptor does not match this, - it means the program is trying to use a closed descriptor. - We report an error for that. */ - -int sourcedesc; - -open (char *filename, int modes) -{ - char *next; - - if (modes) - { - errno = EROFS; - return -1; - } - - if (sourceptr) - { - errno = EMFILE; - return -1; - } - - for (next = files_start; *(int *) next; next += *(int *) next) - { - if (!strcmp (next + 4, filename)) - { - sourcebeg = next + 4 + strlen (next + 4) + 1; - sourcebeg = (char *) (((int) sourcebeg + 3) & (-4)); - sourceptr = sourcebeg; - sourcesize = next + *(int *) next - sourceptr; - sourceleft = sourcesize; - return sourcedesc; - } - } - return 0; -} - -close (int desc) -{ - sourceptr = 0; - sourcedesc++; - /* Don't let sourcedesc get big enough to be confused with stdin. */ - if (sourcedesc == 100) - sourcedesc = 5; -} - -FILE * -fopen (char *filename, char *modes) -{ - return (FILE *) open (filename, *modes == 'w'); -} - -FILE * -fdopen (int desc) -{ - return (FILE *) desc; -} - -fclose (int desc) -{ - close (desc); -} - -fstat (int desc, struct stat *statbuf) -{ - if (desc != sourcedesc) - { - errno = EBADF; - return -1; - } - statbuf->st_size = sourcesize; -} - -myread (int desc, char *destptr, int size, char *filename) -{ - int len = min (sourceleft, size); - - if (desc != sourcedesc) - { - errno = EBADF; - return -1; - } - - memcpy (destptr, sourceptr, len); - sourceleft -= len; - return len; -} - -int -fread (int bufp, int numelts, int eltsize, int stream) -{ - int elts = min (numelts, sourceleft / eltsize); - int len = elts * eltsize; - - if (stream != sourcedesc) - { - errno = EBADF; - return -1; - } - - memcpy (bufp, sourceptr, len); - sourceleft -= len; - return elts; -} - -int -fgetc (int desc) -{ - - if (desc == (int) stdin) - return tty_input (); - - if (desc != sourcedesc) - { - errno = EBADF; - return -1; - } - - if (sourceleft-- <= 0) - return EOF; - return *sourceptr++; -} - -lseek (int desc, int pos) -{ - - if (desc != sourcedesc) - { - errno = EBADF; - return -1; - } - - if (pos < 0 || pos > sourcesize) - { - errno = EINVAL; - return -1; - } - - sourceptr = sourcebeg + pos; - sourceleft = sourcesize - pos; -} - -/* Output in kdb can go only to the terminal, so the stream - specified may be ignored. */ - -printf (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) -{ - char buffer[1024]; - sprintf (buffer, a1, a2, a3, a4, a5, a6, a7, a8, a9); - display_string (buffer); -} - -fprintf (int ign, int a1, int a2, int a3, int a4, int a5, int a6, int a7, - int a8, int a9) -{ - char buffer[1024]; - sprintf (buffer, a1, a2, a3, a4, a5, a6, a7, a8, a9); - display_string (buffer); -} - -fwrite (char *buf, int numelts, int size, int stream) -{ - int i = numelts * size; - while (i-- > 0) - fputc (*buf++, stream); -} - -fputc (int c, int ign) -{ - char buf[2]; - buf[0] = c; - buf[1] = 0; - display_string (buf); -} - -/* sprintf refers to this, but loading this from the - library would cause fflush to be loaded from it too. - In fact there should be no need to call this (I hope). */ - -_flsbuf (void) -{ - error ("_flsbuf was actually called."); -} - -fflush (int ign) -{ -} - -/* Entries into core and inflow, needed only to make things link ok. */ - -exec_file_command (void) -{ -} - -core_file_command (void) -{ -} - -char * -get_exec_file (int err) -{ - /* Makes one printout look reasonable; value does not matter otherwise. */ - return "run"; -} - -/* Nonzero if there is a core file. */ - -have_core_file_p (void) -{ - return 0; -} - -kill_command (void) -{ - inferior_ptid = null_ptid; -} - -terminal_inferior (void) -{ -} - -terminal_ours (void) -{ -} - -terminal_init_inferior (void) -{ -} - -write_inferior_register (void) -{ -} - -read_inferior_register (void) -{ -} - -read_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - memcpy (myaddr, memaddr, len); -} - -/* Always return 0 indicating success. */ - -write_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - memcpy (memaddr, myaddr, len); - return 0; -} - -static REGISTER_TYPE saved_regs[NUM_REGS]; - -REGISTER_TYPE -read_register (int regno) -{ - if (regno < 0 || regno >= NUM_REGS) - error ("Register number %d out of range.", regno); - return saved_regs[regno]; -} - -void -write_register (int regno, REGISTER_TYPE value) -{ - if (regno < 0 || regno >= NUM_REGS) - error ("Register number %d out of range.", regno); - saved_regs[regno] = value; -} - -/* System calls needed in relation to running the "inferior". */ - -vfork (void) -{ - /* Just appear to "succeed". Say the inferior's pid is 1. */ - return 1; -} - -/* These are called by code that normally runs in the inferior - that has just been forked. That code never runs, when standalone, - and these definitions are so it will link without errors. */ - -ptrace (void) -{ -} - -setpgrp (void) -{ -} - -execle (void) -{ -} - -_exit (void) -{ -} - -/* Malloc calls these. */ - -malloc_warning (char *str) -{ - printf ("\n%s.\n\n", str); -} - -char *next_free; -char *memory_limit; - -char * -sbrk (int amount) -{ - if (next_free + amount > memory_limit) - return (char *) -1; - next_free += amount; - return next_free - amount; -} - -/* Various ways malloc might ask where end of memory is. */ - -char * -ulimit (void) -{ - return memory_limit; -} - -int -vlimit (void) -{ - return memory_limit - next_free; -} - -getrlimit (struct rlimit *addr) -{ - addr->rlim_cur = memory_limit - next_free; -} - -/* Context switching to and from program being debugged. */ - -/* GDB calls here to run the user program. - The frame pointer for this function is saved in - gdb_stack by save_frame_pointer; then we restore - all of the user program's registers, including PC and PS. */ - -static int fault_code; -static REGISTER_TYPE gdb_stack; - -resume (void) -{ - REGISTER_TYPE restore[NUM_REGS]; - - PUSH_FRAME_PTR; - save_frame_pointer (); - - memcpy (restore, saved_regs, sizeof restore); - POP_REGISTERS; - /* Control does not drop through here! */ -} - -save_frame_pointer (CORE_ADDR val) -{ - gdb_stack = val; -} - -/* Fault handlers call here, running in the user program stack. - They must first push a fault code, - old PC, old PS, and any other info about the fault. - The exact format is machine-dependent and is known only - in the definition of PUSH_REGISTERS. */ - -fault (void) -{ - /* Transfer all registers and fault code to the stack - in canonical order: registers in order of GDB register number, - followed by fault code. */ - PUSH_REGISTERS; - - /* Transfer them to saved_regs and fault_code. */ - save_registers (); - - restore_gdb (); - /* Control does not reach here */ -} - -restore_gdb (void) -{ - CORE_ADDR new_fp = gdb_stack; - /* Switch to GDB's stack */ - POP_FRAME_PTR; - /* Return from the function `resume'. */ -} - -/* Assuming register contents and fault code have been pushed on the stack as - arguments to this function, copy them into the standard place - for the program's registers while GDB is running. */ - -save_registers (int firstreg) -{ - memcpy (saved_regs, &firstreg, sizeof saved_regs); - fault_code = (&firstreg)[NUM_REGS]; -} - -/* Store into the structure such as `wait' would return - the information on why the program faulted, - converted into a machine-independent signal number. */ - -static int fault_table[] = FAULT_TABLE; - -int -wait (WAITTYPE *w) -{ - WSETSTOP (*w, fault_table[fault_code / FAULT_CODE_UNITS]); - return PIDGET (inferior_ptid); -} - -/* Allocate a big space in which files for kdb to read will be stored. - Whatever is left is where malloc can allocate storage. - - Initialize it, so that there will be space in the executable file - for it. Then the files can be put into kdb by writing them into - kdb's executable file. */ - -/* The default size is as much space as we expect to be available - for kdb to use! */ - -#ifndef HEAP_SIZE -#define HEAP_SIZE 400000 -#endif - -char heap[HEAP_SIZE] = -{0}; - -#ifndef STACK_SIZE -#define STACK_SIZE 100000 -#endif - -int kdb_stack_beg[STACK_SIZE / sizeof (int)]; -int kdb_stack_end; - -_initialize_standalone (void) -{ - char *next; - - /* Find start of data on files. */ - - files_start = heap; - - /* Find the end of the data on files. */ - - for (next = files_start; *(int *) next; next += *(int *) next) - { - } - - /* That is where free storage starts for sbrk to give out. */ - next_free = next; - - memory_limit = heap + sizeof heap; -} diff --git a/gnu/usr.bin/binutils/gdb/sun3-nat.c b/gnu/usr.bin/binutils/gdb/sun3-nat.c deleted file mode 100644 index 6c52d3388c2..00000000000 --- a/gnu/usr.bin/binutils/gdb/sun3-nat.c +++ /dev/null @@ -1,166 +0,0 @@ -/* Host-dependent code for Sun-3 for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1996, 1999, 2000, 2001 - 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 "inferior.h" -#include "gdbcore.h" -#include "regcache.h" - -#include <sys/ptrace.h> -#define KERNEL /* To get floating point reg definitions */ -#include <machine/reg.h> - -static void fetch_core_registers (char *, unsigned, int, CORE_ADDR); - -void -fetch_inferior_registers (int regno) -{ - struct regs inferior_registers; - struct fp_status inferior_fp_registers; - - deprecated_registers_fetched (); - - ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers); - - if (FP0_REGNUM >= 0) - ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers); - - memcpy (deprecated_registers, &inferior_registers, 16 * 4); - if (FP0_REGNUM >= 0) - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - &inferior_fp_registers, sizeof inferior_fp_registers.fps_regs); - - *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; - *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; - if (FP0_REGNUM >= 0) - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)], - &inferior_fp_registers.fps_control, - sizeof inferior_fp_registers - - sizeof inferior_fp_registers.fps_regs); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ - -void -store_inferior_registers (int regno) -{ - struct regs inferior_registers; - struct fp_status inferior_fp_registers; - - memcpy (&inferior_registers, deprecated_registers, 16 * 4); - if (FP0_REGNUM >= 0) - memcpy (&inferior_fp_registers, - &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - sizeof inferior_fp_registers.fps_regs); - - inferior_registers.r_ps = *(int *) &&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = *(int *) &&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)]; - - if (FP0_REGNUM >= 0) - memcpy (&inferior_fp_registers.fps_control, - &&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)], - sizeof inferior_fp_registers - - sizeof inferior_fp_registers.fps_regs); - - ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers); - if (FP0_REGNUM >= 0) - ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers); -} - - -/* All of this stuff is only relevant if both host and target are sun3. */ - -/* Provide registers to GDB from a core file. - - CORE_REG_SECT points to an array of bytes, which were obtained from - a core file which BFD thinks might contain register contents. - CORE_REG_SIZE is its size. - - WHICH says which register set corelow suspects this is: - 0 --- the general-purpose register set - 2 --- the floating-point register set - - REG_ADDR isn't used. */ - -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, - int which, CORE_ADDR reg_addr) -{ - struct regs *regs = (struct regs *) core_reg_sect; - - if (which == 0) - { - if (core_reg_size < sizeof (struct regs)) - error ("Can't find registers in core file"); - - memcpy (&deprecated_registers, (char *) regs, 16 * 4); - supply_register (PS_REGNUM, (char *) ®s->r_ps); - supply_register (PC_REGNUM, (char *) ®s->r_pc); - - } - else if (which == 2) - { - -#define fpustruct ((struct fpu *) core_reg_sect) - - if (core_reg_size >= sizeof (struct fpu)) - { - if (FP0_REGNUM >= 0) - { - memcpy (&&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - fpustruct->f_fpstatus.fps_regs, - sizeof fpustruct->f_fpstatus.fps_regs); - memcpy (&&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)], - &fpustruct->f_fpstatus.fps_control, - sizeof fpustruct->f_fpstatus - - sizeof fpustruct->f_fpstatus.fps_regs); - } - } - else - fprintf_unfiltered (gdb_stderr, - "Couldn't read float regs from core file\n"); - } -} - - -/* Register that we are able to handle sun3 core file formats. - FIXME: is this really bfd_target_unknown_flavour? */ - -static struct core_fns sun3_core_fns = -{ - bfd_target_unknown_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - -void -_initialize_core_sun3 (void) -{ - add_core_fns (&sun3_core_fns); -} diff --git a/gnu/usr.bin/binutils/gdb/symfile.c b/gnu/usr.bin/binutils/gdb/symfile.c index 19ae2943301..ee9336d30e7 100644 --- a/gnu/usr.bin/binutils/gdb/symfile.c +++ b/gnu/usr.bin/binutils/gdb/symfile.c @@ -60,28 +60,15 @@ #define O_BINARY 0 #endif -#ifdef HPUXHPPA - -/* Some HP-UX related globals to clear when a new "main" - symbol file is loaded. HP-specific. */ - -extern int hp_som_som_object_present; -extern int hp_cxx_exception_support_initialized; -#define RESET_HP_UX_GLOBALS() do {\ - hp_som_som_object_present = 0; /* indicates HP-compiled code */ \ - hp_cxx_exception_support_initialized = 0; /* must reinitialize exception stuff */ \ - } while (0) -#endif - -int (*ui_load_progress_hook) (const char *section, unsigned long num); -void (*show_load_progress) (const char *section, - unsigned long section_sent, - unsigned long section_size, - unsigned long total_sent, +int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num); +void (*deprecated_show_load_progress) (const char *section, + unsigned long section_sent, + unsigned long section_size, + unsigned long total_sent, unsigned long total_size); -void (*pre_add_symbol_hook) (char *); -void (*post_add_symbol_hook) (void); -void (*target_new_objfile_hook) (struct objfile *); +void (*deprecated_pre_add_symbol_hook) (const char *); +void (*deprecated_post_add_symbol_hook) (void); +void (*deprecated_target_new_objfile_hook) (struct objfile *); static void clear_symtab_users_cleanup (void *ignore); @@ -208,8 +195,8 @@ compare_psymbols (const void *s1p, const void *s2p) struct partial_symbol *const *s1 = s1p; struct partial_symbol *const *s2 = s2p; - return strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*s1), - SYMBOL_NATURAL_NAME (*s2)); + return strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*s1), + SYMBOL_SEARCH_NAME (*s2)); } void @@ -294,8 +281,8 @@ psymtab_to_symtab (struct partial_symtab *pst) return pst->symtab; } -/* Remember the lowest-addressed loadable section we've seen. - This function is called via bfd_map_over_sections. +/* Remember the lowest-addressed loadable section we've seen. + This function is called via bfd_map_over_sections. In case of equal vmas, the section with the largest size becomes the lowest-addressed loadable section. @@ -337,6 +324,32 @@ alloc_section_addr_info (size_t num_sections) return sap; } + +/* Return a freshly allocated copy of ADDRS. The section names, if + any, are also freshly allocated copies of those in ADDRS. */ +struct section_addr_info * +copy_section_addr_info (struct section_addr_info *addrs) +{ + struct section_addr_info *copy + = alloc_section_addr_info (addrs->num_sections); + int i; + + copy->num_sections = addrs->num_sections; + for (i = 0; i < addrs->num_sections; i++) + { + copy->other[i].addr = addrs->other[i].addr; + if (addrs->other[i].name) + copy->other[i].name = xstrdup (addrs->other[i].name); + else + copy->other[i].name = NULL; + copy->other[i].sectindex = addrs->other[i].sectindex; + } + + return copy; +} + + + /* Build (allocate and populate) a section_addr_info struct from an existing section table. */ @@ -352,12 +365,12 @@ build_section_addr_info_from_section_table (const struct section_table *start, for (stp = start, oidx = 0; stp != end; stp++) { - if (bfd_get_section_flags (stp->bfd, + if (bfd_get_section_flags (stp->bfd, stp->the_bfd_section) & (SEC_ALLOC | SEC_LOAD) && oidx < end - start) { sap->other[oidx].addr = stp->addr; - sap->other[oidx].name + sap->other[oidx].name = xstrdup (bfd_section_name (stp->bfd, stp->the_bfd_section)); sap->other[oidx].sectindex = stp->the_bfd_section->index; oidx++; @@ -388,21 +401,21 @@ init_objfile_sect_indices (struct objfile *objfile) { asection *sect; int i; - + sect = bfd_get_section_by_name (objfile->obfd, ".text"); - if (sect) + if (sect) objfile->sect_index_text = sect->index; sect = bfd_get_section_by_name (objfile->obfd, ".data"); - if (sect) + if (sect) objfile->sect_index_data = sect->index; sect = bfd_get_section_by_name (objfile->obfd, ".bss"); - if (sect) + if (sect) objfile->sect_index_bss = sect->index; sect = bfd_get_section_by_name (objfile->obfd, ".rodata"); - if (sect) + if (sect) objfile->sect_index_rodata = sect->index; /* This is where things get really weird... We MUST have valid @@ -437,7 +450,7 @@ init_objfile_sect_indices (struct objfile *objfile) /* Parse the user's idea of an offset for dynamic linking, into our idea - of how to represent it for fast symbol reading. This is the default + of how to represent it for fast symbol reading. This is the default version of the sym_fns.sym_offsets function for symbol readers that don't need to do anything special. It allocates a section_offsets table for the objectfile OBJFILE and stuffs ADDR into all of the offsets. */ @@ -450,9 +463,9 @@ default_symfile_offsets (struct objfile *objfile, objfile->num_sections = bfd_count_sections (objfile->obfd); objfile->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->objfile_obstack, + obstack_alloc (&objfile->objfile_obstack, SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); - memset (objfile->section_offsets, 0, + memset (objfile->section_offsets, 0, SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)); /* Now calculate offsets for section that were specified by the @@ -537,7 +550,7 @@ syms_from_objfile (struct objfile *objfile, no load address was specified. */ if (! addrs && ! offsets) { - local_addr + local_addr = alloc_section_addr_info (bfd_count_sections (objfile->obfd)); make_cleanup (xfree, local_addr); addrs = local_addr; @@ -580,7 +593,7 @@ syms_from_objfile (struct objfile *objfile, CORE_ADDR lower_offset; int i; - /* Find lowest loadable section to be used as starting point for + /* Find lowest loadable section to be used as starting point for continguous sections. FIXME!! won't work without call to find .text first, but this assumes text is lowest section. */ lower_sect = bfd_get_section_by_name (objfile->obfd, ".text"); @@ -590,7 +603,7 @@ syms_from_objfile (struct objfile *objfile, if (lower_sect == NULL) warning ("no loadable sections found in added symbol-file %s", objfile->name); - else + else if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0) warning ("Lowest section in %s is %s at %s", objfile->name, @@ -600,11 +613,11 @@ syms_from_objfile (struct objfile *objfile, lower_offset = bfd_section_vma (objfile->obfd, lower_sect); else lower_offset = 0; - + /* Calculate offsets for the loadable sections. FIXME! Sections must be in order of increasing loadable section so that contiguous sections can use the lower-offset!!! - + Adjust offsets if the segments are not contiguous. If the section is contiguous, its offset should be set to the offset of the highest loadable section lower than it @@ -628,7 +641,7 @@ syms_from_objfile (struct objfile *objfile, else { warning ("section %s not found in %s", - addrs->other[i].name, + addrs->other[i].name, objfile->name); addrs->other[i].addr = 0; } @@ -684,24 +697,24 @@ syms_from_objfile (struct objfile *objfile, { struct obj_section *s; - /* Map section offsets in "addr" back to the object's - sections by comparing the section names with bfd's + /* Map section offsets in "addr" back to the object's + sections by comparing the section names with bfd's section names. Then adjust the section address by the offset. */ /* for gdb/13815 */ - + ALL_OBJFILE_OSECTIONS (objfile, s) { CORE_ADDR s_addr = 0; int i; - for (i = 0; + for (i = 0; !s_addr && i < addrs->num_sections && addrs->other[i].name; i++) - if (strcmp (bfd_section_name (s->objfile->obfd, - s->the_bfd_section), + if (strcmp (bfd_section_name (s->objfile->obfd, + s->the_bfd_section), addrs->other[i].name) == 0) s_addr = addrs->other[i].addr; /* end added for gdb/13815 */ - + s->addr -= s->offset; s->addr += s_addr; s->endaddr -= s->offset; @@ -761,8 +774,8 @@ new_symfile_objfile (struct objfile *objfile, int mainline, int verbo) /* Process a symbol file, as either the main file or as a dynamically loaded file. - NAME is the file name (which will be tilde-expanded and made - absolute herein) (but we don't free or modify NAME itself). + ABFD is a BFD already open on the file, as from symfile_bfd_open. + This BFD will be closed on error, and is always consumed by this function. FROM_TTY says how verbose to be. @@ -776,7 +789,7 @@ new_symfile_objfile (struct objfile *objfile, int mainline, int verbo) Upon success, returns a pointer to the objfile that was added. Upon failure, jumps back to command level (never returns). */ static struct objfile * -symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, +symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty, struct section_addr_info *addrs, struct section_offsets *offsets, int num_offsets, @@ -785,14 +798,14 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, struct objfile *objfile; struct partial_symtab *psymtab; char *debugfile; - bfd *abfd; - struct section_addr_info *orig_addrs; + struct section_addr_info *orig_addrs = NULL; struct cleanup *my_cleanups; + const char *name = bfd_get_filename (abfd); - /* Open a bfd for the file, and give user a chance to burp if we'd be - interactively wiping out any existing symbols. */ + my_cleanups = make_cleanup_bfd_close (abfd); - abfd = symfile_bfd_open (name); + /* Give user a chance to burp if we'd be + interactively wiping out any existing symbols. */ if ((have_full_symbols () || have_partial_symbols ()) && mainline @@ -801,15 +814,12 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, error ("Not confirmed."); objfile = allocate_objfile (abfd, flags); + discard_cleanups (my_cleanups); - orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd)); - my_cleanups = make_cleanup (xfree, orig_addrs); if (addrs) { - int i; - orig_addrs->num_sections = addrs->num_sections; - for (i = 0; i < addrs->num_sections; i++) - orig_addrs->other[i] = addrs->other[i]; + orig_addrs = copy_section_addr_info (addrs); + make_cleanup_free_section_addr_info (orig_addrs); } /* We either created a new mapped symbol table, mapped an existing @@ -817,8 +827,8 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, performed, or need to read an unmapped symbol table. */ if (from_tty || info_verbose) { - if (pre_add_symbol_hook) - pre_add_symbol_hook (name); + if (deprecated_pre_add_symbol_hook) + deprecated_pre_add_symbol_hook (name); else { printf_unfiltered ("Reading symbols from %s...", name); @@ -866,25 +876,29 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, } objfile->separate_debug_objfile->separate_debug_objfile_backlink = objfile; - + /* Put the separate debug object before the normal one, this is so that usage of the ALL_OBJFILES_SAFE macro will stay safe. */ put_objfile_before (objfile->separate_debug_objfile, objfile); - + xfree (debugfile); } - + if (!have_partial_symbols () && !have_full_symbols ()) { wrap_here (""); - printf_unfiltered ("(no debugging symbols found)..."); + printf_filtered ("(no debugging symbols found)"); + if (from_tty || info_verbose) + printf_filtered ("..."); + else + printf_filtered ("\n"); wrap_here (""); } if (from_tty || info_verbose) { - if (post_add_symbol_hook) - post_add_symbol_hook (); + if (deprecated_post_add_symbol_hook) + deprecated_post_add_symbol_hook (); else { printf_unfiltered ("done.\n"); @@ -903,13 +917,30 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty, new_symfile_objfile (objfile, mainline, from_tty); - if (target_new_objfile_hook) - target_new_objfile_hook (objfile); + if (deprecated_target_new_objfile_hook) + deprecated_target_new_objfile_hook (objfile); + bfd_cache_close_all (); return (objfile); } +/* Process the symbol file ABFD, as either the main file or as a + dynamically loaded file. + + See symbol_file_add_with_addrs_or_offsets's comments for + details. */ +struct objfile * +symbol_file_add_from_bfd (bfd *abfd, int from_tty, + struct section_addr_info *addrs, + int mainline, int flags) +{ + return symbol_file_add_with_addrs_or_offsets (abfd, + from_tty, addrs, 0, 0, + mainline, flags); +} + + /* Process a symbol file, as either the main file or as a dynamically loaded file. See symbol_file_add_with_addrs_or_offsets's comments for details. */ @@ -917,8 +948,8 @@ struct objfile * symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, int mainline, int flags) { - return symbol_file_add_with_addrs_or_offsets (name, from_tty, addrs, 0, 0, - mainline, flags); + return symbol_file_add_from_bfd (symfile_bfd_open (name), from_tty, + addrs, mainline, flags); } @@ -929,7 +960,7 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs, The auxiliary function, symbol_file_add_main_1(), has the flags argument for the switches that can only be specified in the symbol_file command itself. */ - + void symbol_file_add_main (char *args, int from_tty) { @@ -941,10 +972,6 @@ symbol_file_add_main_1 (char *args, int from_tty, int flags) { symbol_file_add (args, from_tty, NULL, 1, flags); -#ifdef HPUXHPPA - RESET_HP_UX_GLOBALS (); -#endif - /* Getting new symbols may change our opinion about what is frameless. */ reinit_frame_cache (); @@ -973,9 +1000,6 @@ symbol_file_clear (int from_tty) symfile_objfile = NULL; if (from_tty) printf_unfiltered ("No symbol file now.\n"); -#ifdef HPUXHPPA - RESET_HP_UX_GLOBALS (); -#endif } static char * @@ -987,14 +1011,14 @@ get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out) char *contents; int crc_offset; unsigned char *p; - + sect = bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink"); if (sect == NULL) return NULL; debuglink_size = bfd_section_size (objfile->obfd, sect); - + contents = xmalloc (debuglink_size); bfd_get_section_contents (objfile->obfd, sect, contents, (file_ptr)0, (bfd_size_type)debuglink_size); @@ -1004,7 +1028,7 @@ get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out) crc_offset = (crc_offset + 3) & ~3; crc32 = bfd_get_32 (objfile->obfd, (bfd_byte *) (contents + crc_offset)); - + *crc32_out = crc32; return contents; } @@ -1051,7 +1075,7 @@ find_separate_debug_file (struct objfile *objfile) if (basename == NULL) return NULL; - + dir = xstrdup (objfile->name); /* Strip off the final filename part, leaving the directory name, @@ -1065,12 +1089,12 @@ find_separate_debug_file (struct objfile *objfile) } gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i])); dir[i+1] = '\0'; - + debugfile = alloca (strlen (debug_file_directory) + 1 + strlen (dir) + strlen (DEBUG_SUBDIRECTORY) + strlen ("/") - + strlen (basename) + + strlen (basename) + 1); /* First try in the same directory as the original file. */ @@ -1083,7 +1107,7 @@ find_separate_debug_file (struct objfile *objfile) xfree (dir); return xstrdup (debugfile); } - + /* Then try in the subdirectory named DEBUG_SUBDIRECTORY. */ strcpy (debugfile, dir); strcat (debugfile, DEBUG_SUBDIRECTORY); @@ -1096,7 +1120,7 @@ find_separate_debug_file (struct objfile *objfile) xfree (dir); return xstrdup (debugfile); } - + /* Then try in the global debugfile directory. */ strcpy (debugfile, debug_file_directory); strcat (debugfile, "/"); @@ -1109,7 +1133,7 @@ find_separate_debug_file (struct objfile *objfile) xfree (dir); return xstrdup (debugfile); } - + xfree (basename); xfree (dir); return NULL; @@ -1160,7 +1184,7 @@ symbol_file_command (char *args, int from_tty) else { name = *argv; - + symbol_file_add_main_1 (name, from_tty, flags); } argv++; @@ -1224,14 +1248,15 @@ symfile_bfd_open (char *name) name = tilde_expand (name); /* Returns 1st new malloc'd copy */ /* Look down path for it, allocate 2nd new malloc'd copy. */ - desc = openp (getenv ("PATH"), 1, name, O_RDONLY | O_BINARY, 0, &absolute_name); + desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, name, O_RDONLY | O_BINARY, + 0, &absolute_name); #if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__) if (desc < 0) { char *exename = alloca (strlen (name) + 5); strcat (strcpy (exename, name), ".exe"); - desc = openp (getenv ("PATH"), 1, exename, O_RDONLY | O_BINARY, - 0, &absolute_name); + desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, exename, + O_RDONLY | O_BINARY, 0, &absolute_name); } #endif if (desc < 0) @@ -1353,7 +1378,7 @@ add_section_size_callback (bfd *abfd, asection *asec, void *data) { bfd_size_type *sum = data; - *sum += bfd_get_section_size_before_reloc (asec); + *sum += bfd_get_section_size (asec); } /* Opaque data for load_section_callback. */ @@ -1373,7 +1398,7 @@ load_section_callback (bfd *abfd, asection *asec, void *data) if (bfd_get_section_flags (abfd, asec) & SEC_LOAD) { - bfd_size_type size = bfd_get_section_size_before_reloc (asec); + bfd_size_type size = bfd_get_section_size (asec); if (size > 0) { char *buffer; @@ -1422,7 +1447,7 @@ load_section_callback (bfd *abfd, asection *asec, void *data) that. remote.c could implement that method using the ``qCRC'' packet. */ char *check = xmalloc (len); - struct cleanup *verify_cleanups = + struct cleanup *verify_cleanups = make_cleanup (xfree, check); if (target_read_memory (lma, check, len) != 0) @@ -1439,13 +1464,14 @@ load_section_callback (bfd *abfd, asection *asec, void *data) args->write_count += 1; sent += len; if (quit_flag - || (ui_load_progress_hook != NULL - && ui_load_progress_hook (sect_name, sent))) + || (deprecated_ui_load_progress_hook != NULL + && deprecated_ui_load_progress_hook (sect_name, sent))) error ("Canceled the download"); - if (show_load_progress != NULL) - show_load_progress (sect_name, sent, size, - args->data_count, args->total_size); + if (deprecated_show_load_progress != NULL) + deprecated_show_load_progress (sect_name, sent, size, + args->data_count, + args->total_size); } while (sent < size); @@ -1511,7 +1537,7 @@ generic_load (char *args, int from_tty) bfd_errmsg (bfd_get_error ())); } - bfd_map_over_sections (loadfile_bfd, add_section_size_callback, + bfd_map_over_sections (loadfile_bfd, add_section_size_callback, (void *) &cbdata.total_size); start_time = time (NULL); @@ -1534,9 +1560,9 @@ generic_load (char *args, int from_tty) to a comment from remote-mips.c (where a call to symbol_file_add was commented out), making the call confuses GDB if more than one file is loaded in. Some targets do (e.g., remote-vx.c) but - others don't (or didn't - perhaphs they have all been deleted). */ + others don't (or didn't - perhaps they have all been deleted). */ - print_transfer_performance (gdb_stdout, cbdata.data_count, + print_transfer_performance (gdb_stdout, cbdata.data_count, cbdata.write_count, end_time - start_time); do_cleanups (old_cleanups); @@ -1552,7 +1578,7 @@ void report_transfer_performance (unsigned long data_count, time_t start_time, time_t end_time) { - print_transfer_performance (gdb_stdout, data_count, + print_transfer_performance (gdb_stdout, data_count, end_time - start_time, 0); } @@ -1565,14 +1591,14 @@ print_transfer_performance (struct ui_file *stream, ui_out_text (uiout, "Transfer rate: "); if (time_count > 0) { - ui_out_field_fmt (uiout, "transfer-rate", "%lu", + ui_out_field_fmt (uiout, "transfer-rate", "%lu", (data_count * 8) / time_count); ui_out_text (uiout, " bits/sec"); } else { ui_out_field_fmt (uiout, "transferred-bits", "%lu", (data_count * 8)); - ui_out_text (uiout, " bits in <1 sec"); + ui_out_text (uiout, " bits in <1 sec"); } if (write_count > 0) { @@ -1618,7 +1644,7 @@ add_symbol_file_command (char *args, int from_tty) struct cleanup *my_cleanups = make_cleanup (null_cleanup, NULL); num_sect_opts = 16; - sect_opts = (struct sect_opt *) xmalloc (num_sect_opts + sect_opts = (struct sect_opt *) xmalloc (num_sect_opts * sizeof (struct sect_opt)); dont_repeat (); @@ -1661,12 +1687,12 @@ add_symbol_file_command (char *args, int from_tty) to load the program. */ sect_opts[section_index].name = ".text"; sect_opts[section_index].value = arg; - if (++section_index > num_sect_opts) + if (++section_index > num_sect_opts) { num_sect_opts *= 2; - sect_opts = ((struct sect_opt *) + sect_opts = ((struct sect_opt *) xrealloc (sect_opts, - num_sect_opts + num_sect_opts * sizeof (struct sect_opt))); } } @@ -1697,12 +1723,12 @@ add_symbol_file_command (char *args, int from_tty) { sect_opts[section_index].value = arg; expecting_sec_addr = 0; - if (++section_index > num_sect_opts) + if (++section_index > num_sect_opts) { num_sect_opts *= 2; - sect_opts = ((struct sect_opt *) + sect_opts = ((struct sect_opt *) xrealloc (sect_opts, - num_sect_opts + num_sect_opts * sizeof (struct sect_opt))); } } @@ -1716,9 +1742,9 @@ add_symbol_file_command (char *args, int from_tty) /* Print the prompt for the query below. And save the arguments into a sect_addr_info structure to be passed around to other functions. We have to split this up into separate print - statements because local_hex_string returns a local static + statements because hex_string returns a local static string. */ - + printf_unfiltered ("add symbol table from file \"%s\" at\n", filename); section_addrs = alloc_section_addr_info (section_index); make_cleanup (xfree, section_addrs); @@ -1727,7 +1753,7 @@ add_symbol_file_command (char *args, int from_tty) CORE_ADDR addr; char *val = sect_opts[i].value; char *sec = sect_opts[i].name; - + addr = parse_and_eval_address (val); /* Here we store the section offsets in the order they were @@ -1735,13 +1761,12 @@ add_symbol_file_command (char *args, int from_tty) section_addrs->other[sec_num].name = sec; section_addrs->other[sec_num].addr = addr; printf_unfiltered ("\t%s_addr = %s\n", - sec, - local_hex_string ((unsigned long)addr)); + sec, hex_string ((unsigned long)addr)); sec_num++; - /* The object's sections are initialized when a + /* The object's sections are initialized when a call is made to build_objfile_section_table (objfile). - This happens in reread_symbols. + This happens in reread_symbols. At this point, we don't know what file type this is, so we can't determine what section names are valid. */ } @@ -1846,9 +1871,9 @@ reread_symbols (void) /* Save the offsets, we will nuke them with the rest of the objfile_obstack. */ num_offsets = objfile->num_sections; - offsets = ((struct section_offsets *) + offsets = ((struct section_offsets *) alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets))); - memcpy (offsets, objfile->section_offsets, + memcpy (offsets, objfile->section_offsets, SIZEOF_N_SECTION_OFFSETS (num_offsets)); /* Nuke all the state that we will re-read. Much of the following @@ -1858,11 +1883,11 @@ reread_symbols (void) /* FIXME: Do we have to free a whole linked list, or is this enough? */ if (objfile->global_psymbols.list) - xmfree (objfile->md, objfile->global_psymbols.list); + xfree (objfile->global_psymbols.list); memset (&objfile->global_psymbols, 0, sizeof (objfile->global_psymbols)); if (objfile->static_psymbols.list) - xmfree (objfile->md, objfile->static_psymbols.list); + xfree (objfile->static_psymbols.list); memset (&objfile->static_psymbols, 0, sizeof (objfile->static_psymbols)); @@ -1915,9 +1940,9 @@ reread_symbols (void) /* We use the same section offsets as from last time. I'm not sure whether that is always correct for shared libraries. */ objfile->section_offsets = (struct section_offsets *) - obstack_alloc (&objfile->objfile_obstack, + obstack_alloc (&objfile->objfile_obstack, SIZEOF_N_SECTION_OFFSETS (num_offsets)); - memcpy (objfile->section_offsets, offsets, + memcpy (objfile->section_offsets, offsets, SIZEOF_N_SECTION_OFFSETS (num_offsets)); objfile->num_sections = num_offsets; @@ -1927,9 +1952,6 @@ reread_symbols (void) if (objfile == symfile_objfile) { (*objfile->sf->sym_new_init) (objfile); -#ifdef HPUXHPPA - RESET_HP_UX_GLOBALS (); -#endif } (*objfile->sf->sym_init) (objfile); @@ -2002,7 +2024,7 @@ reread_separate_symbols (struct objfile *objfile) separated debug info, or - if the new primary objfile has separate debug info, but it's under a different filename. - + If the old and new objfiles both have separate debug info, under the same filename, then we're okay --- if the separated file's contents have @@ -2023,7 +2045,7 @@ reread_separate_symbols (struct objfile *objfile) Preserve the flags from objfile that make sense. */ objfile->separate_debug_objfile = (symbol_file_add_with_addrs_or_offsets - (debug_file, + (symfile_bfd_open (debug_file), info_verbose, /* from_tty: Don't override the default. */ 0, /* No addr table. */ objfile->section_offsets, objfile->num_sections, @@ -2055,7 +2077,7 @@ add_filename_language (char *ext, enum language lang) if (fl_table_next >= fl_table_size) { fl_table_size += 10; - filename_language_table = + filename_language_table = xrealloc (filename_language_table, fl_table_size * sizeof (*filename_language_table)); } @@ -2163,6 +2185,10 @@ init_filename_language_table (void) add_filename_language (".pas", language_pascal); add_filename_language (".p", language_pascal); add_filename_language (".pp", language_pascal); + add_filename_language (".adb", language_ada); + add_filename_language (".ads", language_ada); + add_filename_language (".a", language_ada); + add_filename_language (".ada", language_ada); } } @@ -2310,8 +2336,8 @@ clear_symtab_users (void) set_default_breakpoint (0, 0, 0, 0); clear_current_source_symtab_and_line (); clear_pc_function_cache (); - if (target_new_objfile_hook) - target_new_objfile_hook (NULL); + if (deprecated_target_new_objfile_hook) + deprecated_target_new_objfile_hook (NULL); } static void @@ -2324,7 +2350,7 @@ clear_symtab_users_cleanup (void *ignore) This function is run after symbol reading, or from a cleanup. If an old symbol table was obsoleted, the old symbol table - has been blown away, but the other GDB data structures that may + has been blown away, but the other GDB data structures that may reference it have not yet been cleared or re-directed. (The old symtab was zapped, and the cleanup queued, in free_named_symtab() below.) @@ -2549,7 +2575,7 @@ start_psymtab_common (struct objfile *objfile, } /* Add a symbol with a long value to a psymtab. - Since one arg is a struct, we pass in a ptr and deref it (sigh). + Since one arg is a struct, we pass in a ptr and deref it (sigh). Return the partial symbol that has been added. */ /* NOTE: carlton/2003-09-11: The reason why we return the partial @@ -2689,11 +2715,11 @@ init_psymbol_list (struct objfile *objfile, int total_symbols) if (objfile->global_psymbols.list) { - xmfree (objfile->md, objfile->global_psymbols.list); + xfree (objfile->global_psymbols.list); } if (objfile->static_psymbols.list) { - xmfree (objfile->md, objfile->static_psymbols.list); + xfree (objfile->static_psymbols.list); } /* Current best guess is that approximately a twentieth @@ -2707,15 +2733,15 @@ init_psymbol_list (struct objfile *objfile, int total_symbols) { objfile->global_psymbols.next = objfile->global_psymbols.list = (struct partial_symbol **) - xmmalloc (objfile->md, (objfile->global_psymbols.size - * sizeof (struct partial_symbol *))); + xmalloc ((objfile->global_psymbols.size + * sizeof (struct partial_symbol *))); } if (objfile->static_psymbols.size > 0) { objfile->static_psymbols.next = objfile->static_psymbols.list = (struct partial_symbol **) - xmmalloc (objfile->md, (objfile->static_psymbols.size - * sizeof (struct partial_symbol *))); + xmalloc ((objfile->static_psymbols.size + * sizeof (struct partial_symbol *))); } } @@ -2727,10 +2753,10 @@ init_psymbol_list (struct objfile *objfile, int total_symbols) same VMA, each with its own unique LMA (or load address). 2) It is assumed that some runtime mechanism exists for mapping the sections, one by one, from the load address into the VMA address. - 3) This code provides a mechanism for gdb to keep track of which + 3) This code provides a mechanism for gdb to keep track of which sections should be considered to be mapped from the VMA to the LMA. This information is used for symbol lookup, and memory read/write. - For instance, if a section has been mapped then its contents + For instance, if a section has been mapped then its contents should be read from the VMA, otherwise from the LMA. Two levels of debugger support for overlays are available. One is @@ -2754,7 +2780,7 @@ init_psymbol_list (struct objfile *objfile, int total_symbols) Functional interface: find_pc_mapped_section(pc): if the pc is in the range of a mapped section, return that section. - find_pc_overlay(pc): find any overlay section that contains + find_pc_overlay(pc): find any overlay section that contains the pc, either in its VMA or its LMA overlay_is_mapped(sect): true if overlay is marked as mapped section_is_overlay(sect): true if section's VMA != LMA @@ -2778,7 +2804,7 @@ static void simple_overlay_update (struct obj_section *); void (*target_overlay_update) (struct obj_section *) = simple_overlay_update; /* Function: section_is_overlay (SECTION) - Returns true if SECTION has VMA not equal to LMA, ie. + Returns true if SECTION has VMA not equal to LMA, ie. SECTION is loaded at an address different from where it will "run". */ int @@ -2809,7 +2835,7 @@ overlay_invalidate_all (void) } /* Function: overlay_is_mapped (SECTION) - Returns true if section is an overlay, and is currently mapped. + Returns true if section is an overlay, and is currently mapped. Private: public access is thru function section_is_mapped. Access to the ovly_mapped flag is restricted to this function, so @@ -2830,7 +2856,7 @@ overlay_is_mapped (struct obj_section *osect) case ovly_off: return 0; /* overlay debugging off */ case ovly_auto: /* overlay debugging automatic */ - /* Unles there is a target_overlay_update function, + /* Unles there is a target_overlay_update function, there's really nothing useful to do here (can't really go auto) */ if (target_overlay_update) { @@ -2879,7 +2905,7 @@ pc_in_unmapped_range (CORE_ADDR pc, asection *section) if (overlay_debugging) if (section && section_is_overlay (section)) { - size = bfd_get_section_size_before_reloc (section); + size = bfd_get_section_size (section); if (section->lma <= pc && pc < section->lma + size) return 1; } @@ -2899,7 +2925,7 @@ pc_in_mapped_range (CORE_ADDR pc, asection *section) if (overlay_debugging) if (section && section_is_overlay (section)) { - size = bfd_get_section_size_before_reloc (section); + size = bfd_get_section_size (section); if (section->vma <= pc && pc < section->vma + size) return 1; } @@ -2915,9 +2941,9 @@ sections_overlap (asection *a, asection *b) /* FIXME: need bfd *, so we can use bfd_section_vma methods. */ CORE_ADDR a_start = a->vma; - CORE_ADDR a_end = a->vma + bfd_get_section_size_before_reloc (a); + CORE_ADDR a_end = a->vma + bfd_get_section_size (a); CORE_ADDR b_start = b->vma; - CORE_ADDR b_end = b->vma + bfd_get_section_size_before_reloc (b); + CORE_ADDR b_end = b->vma + bfd_get_section_size (b); return (a_start < b_end && b_start < a_end); } @@ -2957,7 +2983,7 @@ overlay_mapped_address (CORE_ADDR pc, asection *section) } -/* Function: symbol_overlayed_address +/* Function: symbol_overlayed_address Return one of two addresses (relative to the VMA or to the LMA), depending on whether the section is mapped or not. */ @@ -2984,7 +3010,7 @@ symbol_overlayed_address (CORE_ADDR address, asection *section) return address; } -/* Function: find_pc_overlay (PC) +/* Function: find_pc_overlay (PC) Return the best-match overlay section for PC: If PC matches a mapped overlay section's VMA, return that section. Else if PC matches an unmapped section's VMA, return that section. @@ -3014,7 +3040,7 @@ find_pc_overlay (CORE_ADDR pc) } /* Function: find_pc_mapped_section (PC) - If PC falls into the VMA address range of an overlay section that is + If PC falls into the VMA address range of an overlay section that is currently marked as MAPPED, return that section. Else return NULL. */ asection * @@ -3052,7 +3078,7 @@ list_overlays_command (char *args, int from_tty) vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section); lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section); - size = bfd_get_section_size_before_reloc (osect->the_bfd_section); + size = bfd_get_section_size (osect->the_bfd_section); name = bfd_section_name (objfile->obfd, osect->the_bfd_section); printf_filtered ("Section %s, loaded at ", name); @@ -3122,7 +3148,7 @@ the 'overlay manual' command."); } /* Function: unmap_overlay_command - Mark the overlay section as unmapped + Mark the overlay section as unmapped (ie. resident in its LMA address range, rather than the VMA range). */ void @@ -3216,10 +3242,10 @@ overlay_command (char *args, int from_tty) /* Target Overlays for the "Simplest" overlay manager: - This is GDB's default target overlay layer. It works with the - minimal overlay manager supplied as an example by Cygnus. The - entry point is via a function pointer "target_overlay_update", - so targets that use a different runtime overlay manager can + This is GDB's default target overlay layer. It works with the + minimal overlay manager supplied as an example by Cygnus. The + entry point is via a function pointer "target_overlay_update", + so targets that use a different runtime overlay manager can substitute their own overlay_update function and take over the function pointer. @@ -3377,7 +3403,7 @@ simple_read_overlay_region_table (void) } #endif -/* Function: simple_overlay_update_1 +/* Function: simple_overlay_update_1 A helper function for simple_overlay_update. Assuming a cached copy of _ovly_table exists, look through it to find an entry whose vma, lma and size match those of OSECT. Re-read the entry and make sure @@ -3392,7 +3418,7 @@ simple_overlay_update_1 (struct obj_section *osect) bfd *obfd = osect->objfile->obfd; asection *bsect = osect->the_bfd_section; - size = bfd_get_section_size_before_reloc (osect->the_bfd_section); + size = bfd_get_section_size (osect->the_bfd_section); for (i = 0; i < cache_novlys; i++) if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) @@ -3414,11 +3440,11 @@ simple_overlay_update_1 (struct obj_section *osect) } /* Function: simple_overlay_update - If OSECT is NULL, then update all sections' mapped state - (after re-reading the entire target _ovly_table). - If OSECT is non-NULL, then try to find a matching entry in the + If OSECT is NULL, then update all sections' mapped state + (after re-reading the entire target _ovly_table). + If OSECT is non-NULL, then try to find a matching entry in the cached ovly_table and update only OSECT's mapped state. - If a cached entry can't be found or the cache isn't valid, then + If a cached entry can't be found or the cache isn't valid, then re-read the entire cache, and go ahead and update all sections. */ static void @@ -3453,7 +3479,7 @@ simple_overlay_update (struct obj_section *osect) bfd *obfd = osect->objfile->obfd; asection *bsect = osect->the_bfd_section; - size = bfd_get_section_size_before_reloc (osect->the_bfd_section); + size = bfd_get_section_size (bsect); for (i = 0; i < cache_novlys; i++) if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect) && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect) @@ -3538,7 +3564,7 @@ with the text. SECT is a section name to be loaded at SECT_ADDR.", for access from GDB.", &cmdlist); set_cmd_completer (c, filename_completer); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("symbol-reloading", class_support, var_boolean, (char *) &symbol_reloading, "Set dynamic symbol table reloading multiple times in one run.", @@ -3582,7 +3608,7 @@ Usage: set extension-language .foo bar", add_info ("extensions", info_ext_lang_command, "All filename extensions associated with a source language."); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("download-write-size", class_obscure, var_integer, (char *) &download_write_size, "Set the write size used when downloading a program.\n" @@ -3600,11 +3626,11 @@ Usage: set extension-language .foo bar", (char *) &debug_file_directory, "Set the directory where separate debug symbols are searched for.\n" "Separate debug symbols are first searched for in the same\n" - "directory as the binary, then in the `" DEBUG_SUBDIRECTORY + "directory as the binary, then in the `" DEBUG_SUBDIRECTORY "' subdirectory,\n" "and lastly at the path of the directory of the binary with\n" "the global debug-file directory prepended\n", &setlist)); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); set_cmd_completer (c, filename_completer); } diff --git a/gnu/usr.bin/binutils/gdb/symfile.h b/gnu/usr.bin/binutils/gdb/symfile.h index baa353e494c..0fa9c46a34b 100644 --- a/gnu/usr.bin/binutils/gdb/symfile.h +++ b/gnu/usr.bin/binutils/gdb/symfile.h @@ -189,11 +189,20 @@ extern void new_symfile_objfile (struct objfile *, int, int); extern struct objfile *symbol_file_add (char *, int, struct section_addr_info *, int, int); +extern struct objfile *symbol_file_add_from_bfd (bfd *, int, + struct section_addr_info *, + int, int); + /* Create a new section_addr_info, with room for NUM_SECTIONS. */ extern struct section_addr_info *alloc_section_addr_info (size_t num_sections); +/* Return a freshly allocated copy of ADDRS. The section names, if + any, are also freshly allocated copies of those in ADDRS. */ +extern struct section_addr_info *(copy_section_addr_info + (struct section_addr_info *addrs)); + /* Build (allocate and populate) a section_addr_info struct from an existing section table. */ @@ -315,7 +324,7 @@ extern void dwarf_build_psymtabs (struct objfile *, int, file_ptr, /* From dwarf2read.c */ -extern int dwarf2_has_info (bfd *abfd); +extern int dwarf2_has_info (struct objfile *); extern void dwarf2_build_psymtabs (struct objfile *, int); extern void dwarf2_build_frame_info (struct objfile *); diff --git a/gnu/usr.bin/binutils/gdb/symmisc.c b/gnu/usr.bin/binutils/gdb/symmisc.c index c17bda4783d..45e2a44ecd7 100644 --- a/gnu/usr.bin/binutils/gdb/symmisc.c +++ b/gnu/usr.bin/binutils/gdb/symmisc.c @@ -99,12 +99,12 @@ free_symtab_block (struct objfile *objfile, struct block *b) ALL_BLOCK_SYMBOLS (b, iter, sym) { - xmfree (objfile->md, DEPRECATED_SYMBOL_NAME (sym)); - xmfree (objfile->md, sym); + xfree (DEPRECATED_SYMBOL_NAME (sym)); + xfree (sym); } dict_free (BLOCK_DICT (b)); - xmfree (objfile->md, b); + xfree (b); } /* Free all the storage associated with the struct symtab <- S. @@ -138,7 +138,7 @@ free_symtab (struct symtab *s) for (i = 0; i < n; i++) free_symtab_block (s->objfile, BLOCKVECTOR_BLOCK (bv, i)); /* Free the blockvector itself. */ - xmfree (s->objfile->md, bv); + xfree (bv); /* Also free the linetable. */ case free_linetable: @@ -146,7 +146,7 @@ free_symtab (struct symtab *s) or by some other symtab, except for our linetable. Free that now. */ if (LINETABLE (s)) - xmfree (s->objfile->md, LINETABLE (s)); + xfree (LINETABLE (s)); break; } @@ -156,12 +156,12 @@ free_symtab (struct symtab *s) /* Free source-related stuff */ if (s->line_charpos != NULL) - xmfree (s->objfile->md, s->line_charpos); + xfree (s->line_charpos); if (s->fullname != NULL) - xmfree (s->objfile->md, s->fullname); + xfree (s->fullname); if (s->debugformat != NULL) - xmfree (s->objfile->md, s->debugformat); - xmfree (s->objfile->md, s); + xfree (s->debugformat); + xfree (s); } void @@ -1232,14 +1232,14 @@ extend_psymbol_list (struct psymbol_allocation_list *listp, { new_size = 255; listp->list = (struct partial_symbol **) - xmmalloc (objfile->md, new_size * sizeof (struct partial_symbol *)); + xmalloc (new_size * sizeof (struct partial_symbol *)); } else { new_size = listp->size * 2; listp->list = (struct partial_symbol **) - xmrealloc (objfile->md, (char *) listp->list, - new_size * sizeof (struct partial_symbol *)); + xrealloc ((char *) listp->list, + new_size * sizeof (struct partial_symbol *)); } /* Next assumes we only went one over. Should be good if program works correctly */ diff --git a/gnu/usr.bin/binutils/gdb/symtab.c b/gnu/usr.bin/binutils/gdb/symtab.c index 6995891b5ae..8ed6d9e9da3 100644 --- a/gnu/usr.bin/binutils/gdb/symtab.c +++ b/gnu/usr.bin/binutils/gdb/symtab.c @@ -41,6 +41,7 @@ #include "source.h" #include "filenames.h" /* for FILENAME_CMP */ #include "objc-lang.h" +#include "ada-lang.h" #include "hashtab.h" @@ -69,7 +70,7 @@ static void variables_info (char *, int); static void sources_info (char *, int); -static void output_source_filename (char *, int *); +static void output_source_filename (const char *, int *); static int find_line_common (struct linetable *, int, int *); @@ -114,9 +115,9 @@ struct symbol *lookup_symbol_aux_minsyms (const char *name, struct symtab **symtab); #endif -/* This flag is used in hppa-tdep.c, and set in hp-symtab-read.c */ -/* Signals the presence of objects compiled by HP compilers */ -int hp_som_som_object_present = 0; +/* This flag is used in hppa-tdep.c, and set in hp-symtab-read.c. + Signals the presence of objects compiled by HP compilers. */ +int deprecated_hp_som_som_object_present = 0; static void fixup_section (struct general_symbol_info *, struct objfile *); @@ -181,21 +182,25 @@ got_symtab: if (full_path != NULL) { - const char *fp = symtab_to_filename (s); - if (FILENAME_CMP (full_path, fp) == 0) - { - return s; - } + const char *fp = symtab_to_fullname (s); + if (fp != NULL && FILENAME_CMP (full_path, fp) == 0) + { + return s; + } } if (real_path != NULL) { - char *rp = gdb_realpath (symtab_to_filename (s)); - make_cleanup (xfree, rp); - if (FILENAME_CMP (real_path, rp) == 0) - { - return s; - } + char *fullname = symtab_to_fullname (s); + if (fullname != NULL) + { + char *rp = gdb_realpath (fullname); + make_cleanup (xfree, rp); + if (FILENAME_CMP (real_path, rp) == 0) + { + return s; + } + } } } @@ -268,8 +273,7 @@ lookup_partial_symtab (const char *name) this symtab and use its absolute path. */ if (full_path != NULL) { - if (pst->fullname == NULL) - source_full_path_of (pst->filename, &pst->fullname); + psymtab_to_fullname (pst); if (pst->fullname != NULL && FILENAME_CMP (full_path, pst->fullname) == 0) { @@ -280,8 +284,7 @@ lookup_partial_symtab (const char *name) if (real_path != NULL) { char *rp = NULL; - if (pst->fullname == NULL) - source_full_path_of (pst->filename, &pst->fullname); + psymtab_to_fullname (pst); if (pst->fullname != NULL) { rp = gdb_realpath (pst->fullname); @@ -427,9 +430,9 @@ create_demangled_names_hash (struct objfile *objfile) Choosing a much larger table size wastes memory, and saves only about 1% in symbol reading. */ - objfile->demangled_names_hash = htab_create_alloc_ex + objfile->demangled_names_hash = htab_create_alloc (256, htab_hash_string, (int (*) (const void *, const void *)) streq, - NULL, objfile->md, xmcalloc, xmfree); + NULL, xcalloc, xfree); } /* Try to determine the demangled name for a symbol, based on the @@ -632,17 +635,24 @@ symbol_init_demangled_name (struct general_symbol_info *gsymbol, char * symbol_natural_name (const struct general_symbol_info *gsymbol) { - if ((gsymbol->language == language_cplus - || gsymbol->language == language_java - || gsymbol->language == language_objc) - && (gsymbol->language_specific.cplus_specific.demangled_name != NULL)) + switch (gsymbol->language) { - return gsymbol->language_specific.cplus_specific.demangled_name; - } - else - { - return gsymbol->name; + case language_cplus: + case language_java: + case language_objc: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + break; + case language_ada: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + else + return ada_decode_symbol (gsymbol); + break; + default: + break; } + return gsymbol->name; } /* Return the demangled name for a symbol based on the language for @@ -650,13 +660,35 @@ symbol_natural_name (const struct general_symbol_info *gsymbol) char * symbol_demangled_name (struct general_symbol_info *gsymbol) { - if (gsymbol->language == language_cplus - || gsymbol->language == language_java - || gsymbol->language == language_objc) - return gsymbol->language_specific.cplus_specific.demangled_name; + switch (gsymbol->language) + { + case language_cplus: + case language_java: + case language_objc: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + break; + case language_ada: + if (gsymbol->language_specific.cplus_specific.demangled_name != NULL) + return gsymbol->language_specific.cplus_specific.demangled_name; + else + return ada_decode_symbol (gsymbol); + break; + default: + break; + } + return NULL; +} - else - return NULL; +/* Return the search name of a symbol---generally the demangled or + linkage name of the symbol, depending on how it will be searched for. + If there is no distinct demangled name, then returns the same value + (same pointer) as SYMBOL_LINKAGE_NAME. */ +char *symbol_search_name (const struct general_symbol_info *gsymbol) { + if (gsymbol->language == language_ada) + return gsymbol->name; + else + return symbol_natural_name (gsymbol); } /* Initialize the structure fields to zero values. */ @@ -868,6 +900,62 @@ fixup_section (struct general_symbol_info *ginfo, struct objfile *objfile) ginfo->bfd_section = SYMBOL_BFD_SECTION (msym); ginfo->section = SYMBOL_SECTION (msym); } + else if (objfile) + { + /* Static, function-local variables do appear in the linker + (minimal) symbols, but are frequently given names that won't + be found via lookup_minimal_symbol(). E.g., it has been + observed in frv-uclinux (ELF) executables that a static, + function-local variable named "foo" might appear in the + linker symbols as "foo.6" or "foo.3". Thus, there is no + point in attempting to extend the lookup-by-name mechanism to + handle this case due to the fact that there can be multiple + names. + + So, instead, search the section table when lookup by name has + failed. The ``addr'' and ``endaddr'' fields may have already + been relocated. If so, the relocation offset (i.e. the + ANOFFSET value) needs to be subtracted from these values when + performing the comparison. We unconditionally subtract it, + because, when no relocation has been performed, the ANOFFSET + value will simply be zero. + + The address of the symbol whose section we're fixing up HAS + NOT BEEN adjusted (relocated) yet. It can't have been since + the section isn't yet known and knowing the section is + necessary in order to add the correct relocation value. In + other words, we wouldn't even be in this function (attempting + to compute the section) if it were already known. + + Note that it is possible to search the minimal symbols + (subtracting the relocation value if necessary) to find the + matching minimal symbol, but this is overkill and much less + efficient. It is not necessary to find the matching minimal + symbol, only its section. + + Note that this technique (of doing a section table search) + can fail when unrelocated section addresses overlap. For + this reason, we still attempt a lookup by name prior to doing + a search of the section table. */ + + CORE_ADDR addr; + struct obj_section *s; + + addr = ginfo->value.address; + + ALL_OBJFILE_OSECTIONS (objfile, s) + { + int idx = s->the_bfd_section->index; + CORE_ADDR offset = ANOFFSET (objfile->section_offsets, idx); + + if (s->addr - offset <= addr && addr < s->endaddr - offset) + { + ginfo->bfd_section = s->the_bfd_section; + ginfo->section = idx; + return; + } + } + } } struct symbol * @@ -932,7 +1020,7 @@ lookup_symbol (const char *name, const struct block *block, modified_name = name; - /* If we are using C++ language, demangle the name before doing a lookup, so + /* If we are using C++ or Java, demangle the name before doing a lookup, so we can always binary search. */ if (current_language->la_language == language_cplus) { @@ -944,6 +1032,17 @@ lookup_symbol (const char *name, const struct block *block, needtofreename = 1; } } + else if (current_language->la_language == language_java) + { + demangled_name = cplus_demangle (name, + DMGL_ANSI | DMGL_PARAMS | DMGL_JAVA); + if (demangled_name) + { + mangled_name = name; + modified_name = demangled_name; + needtofreename = 1; + } + } if (case_sensitivity == case_sensitive_off) { @@ -1467,7 +1566,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, { do_linear_search = 1; } - if (strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*center), name) >= 0) + if (strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*center), name) >= 0) { top = center; } @@ -1482,7 +1581,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, while (top <= real_top && (linkage_name != NULL ? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0 - : SYMBOL_MATCHES_NATURAL_NAME (*top,name))) + : SYMBOL_MATCHES_SEARCH_NAME (*top,name))) { if (SYMBOL_DOMAIN (*top) == domain) { @@ -1503,7 +1602,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, { if (linkage_name != NULL ? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0 - : SYMBOL_MATCHES_NATURAL_NAME (*psym, name)) + : SYMBOL_MATCHES_SEARCH_NAME (*psym, name)) { return (*psym); } @@ -2349,7 +2448,7 @@ find_function_start_sal (struct symbol *sym, int funfirstline) !section_is_mapped (section)) pc = overlay_unmapped_address (pc, section); - pc += FUNCTION_START_OFFSET; + pc += DEPRECATED_FUNCTION_START_OFFSET; pc = SKIP_PROLOGUE (pc); /* For overlays, map pc back into its mapped VMA range */ @@ -2554,7 +2653,7 @@ filename_seen (const char *file, int add, int *first) NAME is the name to print and *FIRST is nonzero if this is the first name printed. Set *FIRST to zero. */ static void -output_source_filename (char *name, int *first) +output_source_filename (const char *name, int *first) { /* Since a single source file can result in several partial symbol tables, we need to avoid printing it more than once. Note: if @@ -2603,7 +2702,8 @@ sources_info (char *ignore, int from_tty) first = 1; ALL_SYMTABS (objfile, s) { - output_source_filename (s->filename, &first); + const char *fullname = symtab_to_fullname (s); + output_source_filename (fullname ? fullname : s->filename, &first); } printf_filtered ("\n\n"); @@ -2614,7 +2714,8 @@ sources_info (char *ignore, int from_tty) { if (!ps->readin) { - output_source_filename (ps->filename, &first); + const char *fullname = psymtab_to_fullname (ps); + output_source_filename (fullname ? fullname : ps->filename, &first); } } printf_filtered ("\n"); @@ -3068,12 +3169,12 @@ print_msymbol_info (struct minimal_symbol *msymbol) char *tmp; if (TARGET_ADDR_BIT <= 32) - tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol) - & (CORE_ADDR) 0xffffffff, - "08l"); + tmp = hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol) + & (CORE_ADDR) 0xffffffff, + 8); else - tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol), - "016l"); + tmp = hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol), + 16); printf_filtered ("%s %s\n", tmp, SYMBOL_PRINT_NAME (msymbol)); } @@ -3921,7 +4022,7 @@ skip_prologue_using_sal (CORE_ADDR func_addr) /* Get an initial range for the function. */ find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc); - start_pc += FUNCTION_START_OFFSET; + start_pc += DEPRECATED_FUNCTION_START_OFFSET; prologue_sal = find_pc_line (start_pc, 0); if (prologue_sal.line != 0) diff --git a/gnu/usr.bin/binutils/gdb/symtab.h b/gnu/usr.bin/binutils/gdb/symtab.h index 5a6c3984bd1..dfde99788e2 100644 --- a/gnu/usr.bin/binutils/gdb/symtab.h +++ b/gnu/usr.bin/binutils/gdb/symtab.h @@ -258,6 +258,20 @@ extern char *symbol_demangled_name (struct general_symbol_info *symbol); #define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \ (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0) +/* Macro that returns the name to be used when sorting and searching symbols. + In C++, Chill, and Java, we search for the demangled form of a name, + and so sort symbols accordingly. In Ada, however, we search by mangled + name. If there is no distinct demangled name, then SYMBOL_SEARCH_NAME + returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */ +#define SYMBOL_SEARCH_NAME(symbol) \ + (symbol_search_name (&(symbol)->ginfo)) +extern char *symbol_search_name (const struct general_symbol_info *); + +/* Analogous to SYMBOL_MATCHES_NATURAL_NAME, but uses the search + name. */ +#define SYMBOL_MATCHES_SEARCH_NAME(symbol, name) \ + (strcmp_iw (SYMBOL_SEARCH_NAME (symbol), (name)) == 0) + /* Classification types for a minimal symbol. These should be taken as "advisory only", since if gdb can't easily figure out a classification it simply selects mst_unknown. It may also have to @@ -877,6 +891,10 @@ struct partial_symtab char *fullname; + /* Directory in which it was compiled, or NULL if we don't know. */ + + char *dirname; + /* Information about the object file from which symbols should be read. */ struct objfile *objfile; @@ -1067,9 +1085,6 @@ extern int find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *, extern void clear_pc_function_cache (void); -extern int find_pc_sect_partial_function (CORE_ADDR, asection *, - char **, CORE_ADDR *, CORE_ADDR *); - /* from symtab.c: */ /* lookup partial symbol table by filename */ @@ -1365,4 +1380,9 @@ extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search extern void set_main_name (const char *name); extern /*const */ char *main_name (void); +/* Global to indicate presence of HP-compiled objects, + in particular, SOM executable file with SOM debug info + Defined in symtab.c, used in hppa-tdep.c. */ +extern int deprecated_hp_som_som_object_present; + #endif /* !defined(SYMTAB_H) */ diff --git a/gnu/usr.bin/binutils/gdb/target.c b/gnu/usr.bin/binutils/gdb/target.c index ff47ac13bf7..81389a778fb 100644 --- a/gnu/usr.bin/binutils/gdb/target.c +++ b/gnu/usr.bin/binutils/gdb/target.c @@ -41,8 +41,6 @@ static void target_info (char *, int); -static void maybe_kill_then_create_inferior (char *, char *, char **); - static void maybe_kill_then_attach (char *, int); static void kill_or_be_killed (int); @@ -88,6 +86,8 @@ static int target_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, static void init_dummy_target (void); +static struct target_ops debug_target; + static void debug_to_open (char *, int); static void debug_to_close (int); @@ -108,8 +108,9 @@ static void debug_to_store_registers (int); static void debug_to_prepare_to_store (void); -static int debug_to_xfer_memory (CORE_ADDR, char *, int, int, - struct mem_attrib *, struct target_ops *); +static int deprecated_debug_xfer_memory (CORE_ADDR, char *, int, int, + struct mem_attrib *, + struct target_ops *); static void debug_to_files_info (struct target_ops *); @@ -129,7 +130,7 @@ static int debug_to_remove_watchpoint (CORE_ADDR, int, int); static int debug_to_stopped_by_watchpoint (void); -static CORE_ADDR debug_to_stopped_data_address (void); +static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); static int debug_to_region_size_ok_for_hw_watchpoint (int); @@ -151,8 +152,6 @@ static void debug_to_load (char *, int); static int debug_to_lookup_symbol (char *, CORE_ADDR *); -static void debug_to_create_inferior (char *, char *, char **); - static void debug_to_mourn_inferior (void); static int debug_to_can_run (void); @@ -163,6 +162,12 @@ static int debug_to_thread_alive (ptid_t); static void debug_to_stop (void); +/* NOTE: cagney/2004-09-29: Many targets reference this variable in + wierd and mysterious ways. Putting the variable here lets those + wierd and mysterious ways keep building while they are being + converted to the inferior inheritance structure. */ +struct target_ops deprecated_child_ops; + /* Pointer to array of target architecture structures; the size of the array; the current index into the array; the allocated size of the array. */ @@ -339,10 +344,11 @@ maybe_kill_then_attach (char *args, int from_tty) } static void -maybe_kill_then_create_inferior (char *exec, char *args, char **env) +maybe_kill_then_create_inferior (char *exec, char *args, char **env, + int from_tty) { kill_or_be_killed (0); - target_create_inferior (exec, args, env); + target_create_inferior (exec, args, env, from_tty); } /* Go through the target stack from top to bottom, copying over zero @@ -382,11 +388,10 @@ update_current_target (void) INHERIT (to_disconnect, t); INHERIT (to_resume, t); INHERIT (to_wait, t); - INHERIT (to_post_wait, t); INHERIT (to_fetch_registers, t); INHERIT (to_store_registers, t); INHERIT (to_prepare_to_store, t); - INHERIT (to_xfer_memory, t); + INHERIT (deprecated_xfer_memory, t); INHERIT (to_files_info, t); INHERIT (to_insert_breakpoint, t); INHERIT (to_remove_breakpoint, t); @@ -484,9 +489,6 @@ update_current_target (void) de_fault (to_wait, (ptid_t (*) (ptid_t, struct target_waitstatus *)) noprocess); - de_fault (to_post_wait, - (void (*) (ptid_t, int)) - target_ignore); de_fault (to_fetch_registers, (void (*) (int)) target_ignore); @@ -496,7 +498,7 @@ update_current_target (void) de_fault (to_prepare_to_store, (void (*) (void)) noprocess); - de_fault (to_xfer_memory, + de_fault (deprecated_xfer_memory, (int (*) (CORE_ADDR, char *, int, int, struct mem_attrib *, struct target_ops *)) nomemory); de_fault (to_files_info, @@ -525,7 +527,7 @@ update_current_target (void) (int (*) (void)) return_zero); de_fault (to_stopped_data_address, - (CORE_ADDR (*) (void)) + (int (*) (struct target_ops *, CORE_ADDR *)) return_zero); de_fault (to_region_size_ok_for_hw_watchpoint, default_region_size_ok_for_hw_watchpoint); @@ -782,7 +784,7 @@ target_read_string (CORE_ADDR memaddr, char **string, int len, int *errnop) tlen = MIN (len, 4 - (memaddr & 3)); offset = memaddr & 3; - errcode = target_xfer_memory (memaddr & ~3, buf, 4, 0); + errcode = target_read_memory (memaddr & ~3, buf, 4); if (errcode != 0) { /* The transfer request might have crossed the boundary to an @@ -790,7 +792,7 @@ target_read_string (CORE_ADDR memaddr, char **string, int len, int *errnop) a single byte. */ tlen = 1; offset = 0; - errcode = target_xfer_memory (memaddr, buf, 1, 0); + errcode = target_read_memory (memaddr, buf, 1); if (errcode != 0) goto done; } @@ -841,6 +843,147 @@ target_section_by_addr (struct target_ops *target, CORE_ADDR addr) return NULL; } +/* Return non-zero when the target vector has supplied an xfer_partial + method and it, rather than xfer_memory, should be used. */ +static int +target_xfer_partial_p (void) +{ + return (target_stack != NULL + && target_stack->to_xfer_partial != default_xfer_partial); +} + +static LONGEST +target_xfer_partial (struct target_ops *ops, + enum target_object object, const char *annex, + void *readbuf, const void *writebuf, + ULONGEST offset, LONGEST len) +{ + LONGEST retval; + + gdb_assert (ops->to_xfer_partial != NULL); + retval = ops->to_xfer_partial (ops, object, annex, readbuf, writebuf, + offset, len); + if (targetdebug) + { + const unsigned char *myaddr = NULL; + + fprintf_unfiltered (gdb_stdlog, + "%s:target_xfer_partial (%d, %s, 0x%lx, 0x%lx, 0x%s, %s) = %s", + ops->to_shortname, + (int) object, + (annex ? annex : "(null)"), + (long) readbuf, (long) writebuf, + paddr_nz (offset), paddr_d (len), paddr_d (retval)); + + if (readbuf) + myaddr = readbuf; + if (writebuf) + myaddr = writebuf; + if (retval > 0 && myaddr != NULL) + { + int i; + + fputs_unfiltered (", bytes =", gdb_stdlog); + for (i = 0; i < retval; i++) + { + if ((((long) &(myaddr[i])) & 0xf) == 0) + { + if (targetdebug < 2 && i > 0) + { + fprintf_unfiltered (gdb_stdlog, " ..."); + break; + } + fprintf_unfiltered (gdb_stdlog, "\n"); + } + + fprintf_unfiltered (gdb_stdlog, " %02x", myaddr[i] & 0xff); + } + } + + fputc_unfiltered ('\n', gdb_stdlog); + } + return retval; +} + +/* Attempt a transfer all LEN bytes starting at OFFSET between the + inferior's KIND:ANNEX space and GDB's READBUF/WRITEBUF buffer. If + the transfer succeeds, return zero, otherwize the host ERRNO is + returned. + + The inferior is formed from several layers. In the case of + corefiles, inf-corefile is layered above inf-exec and a request for + text (corefiles do not include text pages) will be first sent to + the core-stratum, fail, and then sent to the object-file where it + will succeed. + + NOTE: cagney/2004-09-30: + + The old code tried to use four separate mechanisms for mapping an + object:offset:len tuple onto an inferior and its address space: the + target stack; the inferior's TO_SECTIONS; solib's SO_LIST; + overlays. + + This is stupid. + + The code below is instead using a single mechanism (currently + strata). If that mechanism proves insufficient then re-factor it + implementing another singluar mechanism (for instance, a generic + object:annex onto inferior:object:annex say). */ + +static LONGEST +xfer_using_stratum (enum target_object object, const char *annex, + ULONGEST offset, LONGEST len, void *readbuf, + const void *writebuf) +{ + LONGEST xfered; + struct target_ops *target; + + /* Always successful. */ + if (len == 0) + return 0; + /* Never successful. */ + if (target_stack == NULL) + return EIO; + + target = target_stack; + while (1) + { + xfered = target_xfer_partial (target, object, annex, + readbuf, writebuf, offset, len); + if (xfered > 0) + { + /* The partial xfer succeeded, update the counts, check that + the xfer hasn't finished and if it hasn't set things up + for the next round. */ + len -= xfered; + if (len <= 0) + return 0; + offset += xfered; + if (readbuf != NULL) + readbuf = (bfd_byte *) readbuf + xfered; + if (writebuf != NULL) + writebuf = (bfd_byte *) writebuf + xfered; + target = target_stack; + } + else if (xfered < 0) + { + /* Something totally screwed up, abandon the attempt to + xfer. */ + if (errno) + return errno; + else + return EIO; + } + else + { + /* This "stratum" didn't work, try the next one down. */ + target = target->beneath; + if (target == NULL) + return EIO; + } + } +} + /* Read LEN bytes of target memory at address MEMADDR, placing the results in GDB's memory at MYADDR. Returns either 0 for success or an errno value if any error occurs. @@ -854,14 +997,37 @@ target_section_by_addr (struct target_ops *target, CORE_ADDR addr) int target_read_memory (CORE_ADDR memaddr, char *myaddr, int len) { - return target_xfer_memory (memaddr, myaddr, len, 0); + if (target_xfer_partial_p ()) + return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL, + memaddr, len, myaddr, NULL); + else + return target_xfer_memory (memaddr, myaddr, len, 0); } int target_write_memory (CORE_ADDR memaddr, char *myaddr, int len) { - return target_xfer_memory (memaddr, myaddr, len, 1); + if (target_xfer_partial_p ()) + return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL, + memaddr, len, NULL, myaddr); + else + return target_xfer_memory (memaddr, myaddr, len, 1); +} + +#ifndef target_stopped_data_address_p +int +target_stopped_data_address_p (struct target_ops *target) +{ + if (target->to_stopped_data_address + == (int (*) (struct target_ops *, CORE_ADDR *)) return_zero) + return 0; + if (target->to_stopped_data_address == debug_to_stopped_data_address + && (debug_target.to_stopped_data_address + == (int (*) (struct target_ops *, CORE_ADDR *)) return_zero)) + return 0; + return 1; } +#endif static int trust_readonly = 0; @@ -882,8 +1048,8 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, if (len == 0) return 0; - /* to_xfer_memory is not guaranteed to set errno, even when it returns - 0. */ + /* deprecated_xfer_memory is not guaranteed to set errno, even when + it returns 0. */ errno = 0; if (!write && trust_readonly) @@ -900,7 +1066,7 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, } /* The quick case is that the top target can handle the transfer. */ - res = current_target.to_xfer_memory + res = current_target.deprecated_xfer_memory (memaddr, myaddr, len, write, attrib, ¤t_target); /* If res <= 0 then we call it again in the loop. Ah well. */ @@ -911,7 +1077,7 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, if (!t->to_has_memory) continue; - res = t->to_xfer_memory (memaddr, myaddr, len, write, attrib, t); + res = t->deprecated_xfer_memory (memaddr, myaddr, len, write, attrib, t); if (res > 0) break; /* Handled all or part of xfer */ if (t->to_has_all_memory) @@ -1066,13 +1232,21 @@ target_xfer_memory_partial (CORE_ADDR memaddr, char *myaddr, int len, int target_read_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err) { - return target_xfer_memory_partial (memaddr, buf, len, 0, err); + if (target_xfer_partial_p ()) + return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL, + buf, NULL, memaddr, len); + else + return target_xfer_memory_partial (memaddr, buf, len, 0, err); } int target_write_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err) { - return target_xfer_memory_partial (memaddr, buf, len, 1, err); + if (target_xfer_partial_p ()) + return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL, + NULL, buf, memaddr, len); + else + return target_xfer_memory_partial (memaddr, buf, len, 1, err); } /* More generic transfers. */ @@ -1083,9 +1257,9 @@ default_xfer_partial (struct target_ops *ops, enum target_object object, const void *writebuf, ULONGEST offset, LONGEST len) { if (object == TARGET_OBJECT_MEMORY - && ops->to_xfer_memory != NULL) - /* If available, fall back to the target's "to_xfer_memory" - method. */ + && ops->deprecated_xfer_memory != NULL) + /* If available, fall back to the target's + "deprecated_xfer_memory" method. */ { int xfered = -1; errno = 0; @@ -1094,25 +1268,25 @@ default_xfer_partial (struct target_ops *ops, enum target_object object, void *buffer = xmalloc (len); struct cleanup *cleanup = make_cleanup (xfree, buffer); memcpy (buffer, writebuf, len); - xfered = ops->to_xfer_memory (offset, buffer, len, 1/*write*/, NULL, - ops); + xfered = ops->deprecated_xfer_memory (offset, buffer, len, + 1/*write*/, NULL, ops); do_cleanups (cleanup); } if (readbuf != NULL) - xfered = ops->to_xfer_memory (offset, readbuf, len, 0/*read*/, NULL, - ops); + xfered = ops->deprecated_xfer_memory (offset, readbuf, len, 0/*read*/, + NULL, ops); if (xfered > 0) return xfered; else if (xfered == 0 && errno == 0) - /* "to_xfer_memory" uses 0, cross checked against ERRNO as one - indication of an error. */ + /* "deprecated_xfer_memory" uses 0, cross checked against + ERRNO as one indication of an error. */ return 0; else return -1; } else if (ops->beneath != NULL) - return ops->beneath->to_xfer_partial (ops->beneath, object, annex, - readbuf, writebuf, offset, len); + return target_xfer_partial (ops->beneath, object, annex, + readbuf, writebuf, offset, len); else return -1; } @@ -1129,8 +1303,7 @@ target_read_partial (struct target_ops *ops, const char *annex, void *buf, ULONGEST offset, LONGEST len) { - gdb_assert (ops->to_xfer_partial != NULL); - return ops->to_xfer_partial (ops, object, annex, buf, NULL, offset, len); + return target_xfer_partial (ops, object, annex, buf, NULL, offset, len); } LONGEST @@ -1139,8 +1312,7 @@ target_write_partial (struct target_ops *ops, const char *annex, const void *buf, ULONGEST offset, LONGEST len) { - gdb_assert (ops->to_xfer_partial != NULL); - return ops->to_xfer_partial (ops, object, annex, NULL, buf, offset, len); + return target_xfer_partial (ops, object, annex, NULL, buf, offset, len); } /* Wrappers to perform the full transfer. */ @@ -1219,11 +1391,6 @@ target_info (char *args, int from_tty) if (symfile_objfile != NULL) printf_unfiltered ("Symbols from \"%s\".\n", symfile_objfile->name); -#ifdef FILES_INFO_HOOK - if (FILES_INFO_HOOK ()) - return; -#endif - for (t = target_stack; t != NULL; t = t->beneath) { if (!t->to_has_memory) @@ -1268,20 +1435,12 @@ target_preopen (int from_tty) void target_detach (char *args, int from_tty) { - /* Handle any optimized stores to the inferior. */ -#ifdef DO_DEFERRED_STORES - DO_DEFERRED_STORES; -#endif (current_target.to_detach) (args, from_tty); } void target_disconnect (char *args, int from_tty) { - /* Handle any optimized stores to the inferior. */ -#ifdef DO_DEFERRED_STORES - DO_DEFERRED_STORES; -#endif (current_target.to_disconnect) (args, from_tty); } @@ -1348,12 +1507,13 @@ find_default_attach (char *args, int from_tty) } void -find_default_create_inferior (char *exec_file, char *allargs, char **env) +find_default_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { struct target_ops *t; t = find_default_run_target ("run"); - (t->to_create_inferior) (exec_file, allargs, env); + (t->to_create_inferior) (exec_file, allargs, env, from_tty); return; } @@ -1425,6 +1585,13 @@ target_resize_to_sections (struct target_ops *target, int num_added) (*t)->to_sections_end = target->to_sections_end; } } + /* There is a flattened view of the target stack in current_target, + so its to_sections pointer might also need updating. */ + if (current_target.to_sections == old_value) + { + current_target.to_sections = target->to_sections; + current_target.to_sections_end = target->to_sections_end; + } } return old_count; @@ -1536,11 +1703,6 @@ generic_mourn_inferior (void) breakpoint_init_inferior (inf_exited); registers_changed (); -#ifdef CLEAR_DEFERRED_STORES - /* Delete any pending stores to the inferior... */ - CLEAR_DEFERRED_STORES; -#endif - reopen_exec_file (); reinit_frame_cache (); @@ -1551,8 +1713,8 @@ generic_mourn_inferior (void) if (!show_breakpoint_hit_counts) breakpoint_clear_ignore_counts (); - if (detach_hook) - detach_hook (); + if (deprecated_detach_hook) + deprecated_detach_hook (); } /* Helper function for child_wait and the Lynx derivatives of child_wait. @@ -1634,9 +1796,6 @@ init_dummy_target (void) dummy_target.to_magic = OPS_MAGIC; } - -static struct target_ops debug_target; - static void debug_to_open (char *args, int from_tty) { @@ -1754,15 +1913,6 @@ debug_to_wait (ptid_t ptid, struct target_waitstatus *status) } static void -debug_to_post_wait (ptid_t ptid, int status) -{ - debug_target.to_post_wait (ptid, status); - - fprintf_unfiltered (gdb_stdlog, "target_post_wait (%d, %d)\n", - PIDGET (ptid), status); -} - -static void debug_print_register (const char * func, int regno) { fprintf_unfiltered (gdb_stdlog, "%s ", func); @@ -1777,11 +1927,11 @@ debug_print_register (const char * func, int regno) unsigned char buf[MAX_REGISTER_SIZE]; deprecated_read_register_gen (regno, buf); fprintf_unfiltered (gdb_stdlog, " = "); - for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i++) + for (i = 0; i < register_size (current_gdbarch, regno); i++) { fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]); } - if (DEPRECATED_REGISTER_RAW_SIZE (regno) <= sizeof (LONGEST)) + if (register_size (current_gdbarch, regno) <= sizeof (LONGEST)) { fprintf_unfiltered (gdb_stdlog, " 0x%s %s", paddr_nz (read_register (regno)), @@ -1815,22 +1965,20 @@ debug_to_prepare_to_store (void) } static int -debug_to_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, - struct mem_attrib *attrib, - struct target_ops *target) +deprecated_debug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, + int write, struct mem_attrib *attrib, + struct target_ops *target) { int retval; - retval = debug_target.to_xfer_memory (memaddr, myaddr, len, write, - attrib, target); + retval = debug_target.deprecated_xfer_memory (memaddr, myaddr, len, write, + attrib, target); fprintf_unfiltered (gdb_stdlog, "target_xfer_memory (0x%x, xxx, %d, %s, xxx) = %d", (unsigned int) memaddr, /* possable truncate long long */ len, write ? "write" : "read", retval); - - if (retval > 0) { int i; @@ -1839,7 +1987,15 @@ debug_to_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, for (i = 0; i < retval; i++) { if ((((long) &(myaddr[i])) & 0xf) == 0) - fprintf_unfiltered (gdb_stdlog, "\n"); + { + if (targetdebug < 2 && i > 0) + { + fprintf_unfiltered (gdb_stdlog, " ..."); + break; + } + fprintf_unfiltered (gdb_stdlog, "\n"); + } + fprintf_unfiltered (gdb_stdlog, " %02x", myaddr[i] & 0xff); } } @@ -1928,16 +2084,17 @@ debug_to_stopped_by_watchpoint (void) return retval; } -static CORE_ADDR -debug_to_stopped_data_address (void) +static int +debug_to_stopped_data_address (struct target_ops *target, CORE_ADDR *addr) { - CORE_ADDR retval; + int retval; - retval = debug_target.to_stopped_data_address (); + retval = debug_target.to_stopped_data_address (target, addr); fprintf_unfiltered (gdb_stdlog, - "target_stopped_data_address () = 0x%lx\n", - (unsigned long) retval); + "target_stopped_data_address ([0x%lx]) = %ld\n", + (unsigned long)*addr, + (unsigned long)retval); return retval; } @@ -2073,12 +2230,13 @@ debug_to_lookup_symbol (char *name, CORE_ADDR *addrp) } static void -debug_to_create_inferior (char *exec_file, char *args, char **env) +debug_to_create_inferior (char *exec_file, char *args, char **env, + int from_tty) { - debug_target.to_create_inferior (exec_file, args, env); + debug_target.to_create_inferior (exec_file, args, env, from_tty); - fprintf_unfiltered (gdb_stdlog, "target_create_inferior (%s, %s, xxx)\n", - exec_file, args); + fprintf_unfiltered (gdb_stdlog, "target_create_inferior (%s, %s, xxx, %d)\n", + exec_file, args, from_tty); } static void @@ -2273,25 +2431,6 @@ debug_to_stop (void) fprintf_unfiltered (gdb_stdlog, "target_stop ()\n"); } -static LONGEST -debug_to_xfer_partial (struct target_ops *ops, enum target_object object, - const char *annex, void *readbuf, const void *writebuf, - ULONGEST offset, LONGEST len) -{ - LONGEST retval; - - retval = debug_target.to_xfer_partial (&debug_target, object, annex, - readbuf, writebuf, offset, len); - - fprintf_unfiltered (gdb_stdlog, - "target_xfer_partial (%d, %s, 0x%lx, 0x%lx, 0x%s, %s) = %s\n", - (int) object, (annex ? annex : "(null)"), - (long) readbuf, (long) writebuf, paddr_nz (offset), - paddr_d (len), paddr_d (retval)); - - return retval; -} - static void debug_to_rcmd (char *command, struct ui_file *outbuf) @@ -2346,11 +2485,10 @@ setup_target_debug (void) current_target.to_disconnect = debug_to_disconnect; current_target.to_resume = debug_to_resume; current_target.to_wait = debug_to_wait; - current_target.to_post_wait = debug_to_post_wait; current_target.to_fetch_registers = debug_to_fetch_registers; current_target.to_store_registers = debug_to_store_registers; current_target.to_prepare_to_store = debug_to_prepare_to_store; - current_target.to_xfer_memory = debug_to_xfer_memory; + current_target.deprecated_xfer_memory = deprecated_debug_xfer_memory; current_target.to_files_info = debug_to_files_info; current_target.to_insert_breakpoint = debug_to_insert_breakpoint; current_target.to_remove_breakpoint = debug_to_remove_breakpoint; @@ -2389,7 +2527,6 @@ setup_target_debug (void) current_target.to_thread_alive = debug_to_thread_alive; current_target.to_find_new_threads = debug_to_find_new_threads; current_target.to_stop = debug_to_stop; - current_target.to_xfer_partial = debug_to_xfer_partial; current_target.to_rcmd = debug_to_rcmd; current_target.to_enable_exception_callback = debug_to_enable_exception_callback; current_target.to_get_current_exception_event = debug_to_get_current_exception_event; @@ -2427,20 +2564,23 @@ initialize_targets (void) add_info ("target", target_info, targ_desc); add_info ("files", target_info, targ_desc); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("target", class_maintenance, var_zinteger, (char *) &targetdebug, "Set target debugging.\n\ -When non-zero, target debugging is enabled.", &setdebuglist), +When non-zero, target debugging is enabled. Higher numbers are more\n\ +verbose. Changes do not take effect until the next \"run\" or \"target\"\n\ +command.", &setdebuglist), &showdebuglist); add_setshow_boolean_cmd ("trust-readonly-sections", class_support, &trust_readonly, "\ -Set mode for reading from readonly sections.\n\ +Set mode for reading from readonly sections.", "\ +Show mode for reading from readonly sections.", "\ When this mode is on, memory reads from readonly sections (such as .text)\n\ will be read from the object file instead of from the target. This will\n\ result in significant performance improvement for remote targets.", "\ -Show mode for reading from readonly sections.\n", +Mode for reading from readonly sections is %s.", NULL, NULL, &setlist, &showlist); diff --git a/gnu/usr.bin/binutils/gdb/target.h b/gnu/usr.bin/binutils/gdb/target.h index 2d8ce372fc5..84c284b268c 100644 --- a/gnu/usr.bin/binutils/gdb/target.h +++ b/gnu/usr.bin/binutils/gdb/target.h @@ -304,7 +304,6 @@ struct target_ops void (*to_disconnect) (char *, int); void (*to_resume) (ptid_t, int, enum target_signal); ptid_t (*to_wait) (ptid_t, struct target_waitstatus *); - void (*to_post_wait) (ptid_t, int); void (*to_fetch_registers) (int); void (*to_store_registers) (int); void (*to_prepare_to_store) (void); @@ -325,12 +324,15 @@ struct target_ops negative (call its absolute value N) means that we cannot transfer right at MEMADDR, but we could transfer at least - something at MEMADDR + N. */ + something at MEMADDR + N. - int (*to_xfer_memory) (CORE_ADDR memaddr, char *myaddr, - int len, int write, - struct mem_attrib *attrib, - struct target_ops *target); + NOTE: cagney/2004-10-01: This has been entirely superseeded by + to_xfer_partial and inferior inheritance. */ + + int (*deprecated_xfer_memory) (CORE_ADDR memaddr, char *myaddr, + int len, int write, + struct mem_attrib *attrib, + struct target_ops *target); void (*to_files_info) (struct target_ops *); int (*to_insert_breakpoint) (CORE_ADDR, char *); @@ -342,7 +344,7 @@ struct target_ops int (*to_insert_watchpoint) (CORE_ADDR, int, int); int (*to_stopped_by_watchpoint) (void); int to_have_continuable_watchpoint; - CORE_ADDR (*to_stopped_data_address) (void); + int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *); int (*to_region_size_ok_for_hw_watchpoint) (int); void (*to_terminal_init) (void); void (*to_terminal_inferior) (void); @@ -353,7 +355,7 @@ struct target_ops void (*to_kill) (void); void (*to_load) (char *, int); int (*to_lookup_symbol) (char *, CORE_ADDR *); - void (*to_create_inferior) (char *, char *, char **); + void (*to_create_inferior) (char *, char *, char **, int); void (*to_post_startup_inferior) (ptid_t); void (*to_acknowledge_created_inferior) (int); int (*to_insert_fork_catchpoint) (int); @@ -507,19 +509,6 @@ extern void target_disconnect (char *, int); #define target_wait(ptid, status) \ (*current_target.to_wait) (ptid, status) -/* The target_wait operation waits for a process event to occur, and - thereby stop the process. - - On some targets, certain events may happen in sequences. gdb's - correct response to any single event of such a sequence may require - knowledge of what earlier events in the sequence have been seen. - - This operation provides a target-specific hook that allows the - necessary bookkeeping to be performed to track such sequences. */ - -#define target_post_wait(ptid, status) \ - (*current_target.to_post_wait) (ptid, status) - /* Fetch at least register REGNO, or all regs if regno == -1. No result. */ #define target_fetch_registers(regno) \ @@ -578,8 +567,6 @@ extern char *child_core_file_to_sym_file (char *); extern void child_post_attach (int); #endif -extern void child_post_wait (ptid_t, int); - extern void child_post_startup_inferior (ptid_t); extern void child_acknowledge_created_inferior (int); @@ -712,8 +699,8 @@ extern void target_load (char *arg, int from_tty); ENV is the environment vector to pass. Errors reported with error(). On VxWorks and various standalone systems, we ignore exec_file. */ -#define target_create_inferior(exec_file, args, env) \ - (*current_target.to_create_inferior) (exec_file, args, env) +#define target_create_inferior(exec_file, args, env, FROM_TTY) \ + (*current_target.to_create_inferior) (exec_file, args, env, (FROM_TTY)) /* Some targets (such as ttrace-based HPUX) don't allow us to request @@ -949,19 +936,19 @@ extern char *normal_pid_to_str (ptid_t ptid); * The old way of doing this is to define a macro 'target_new_objfile' * that points to the function that you want to be called on every * objfile/shlib load. - * - * The new way is to grab the function pointer, 'target_new_objfile_hook', - * and point it to the function that you want to be called on every - * objfile/shlib load. - * - * If multiple clients are willing to be cooperative, they can each - * save a pointer to the previous value of target_new_objfile_hook - * before modifying it, and arrange for their function to call the - * previous function in the chain. In that way, multiple clients - * can receive this notification (something like with signal handlers). - */ -extern void (*target_new_objfile_hook) (struct objfile *); + The new way is to grab the function pointer, + 'deprecated_target_new_objfile_hook', and point it to the function + that you want to be called on every objfile/shlib load. + + If multiple clients are willing to be cooperative, they can each + save a pointer to the previous value of + deprecated_target_new_objfile_hook before modifying it, and arrange + for their function to call the previous function in the chain. In + that way, multiple clients can receive this notification (something + like with signal handlers). */ + +extern void (*deprecated_target_new_objfile_hook) (struct objfile *); #ifndef target_pid_or_tid_to_str #define target_pid_or_tid_to_str(ID) \ @@ -1083,18 +1070,14 @@ extern void (*target_new_objfile_hook) (struct objfile *); (*current_target.to_remove_hw_breakpoint) (addr, save) #endif -#ifndef target_stopped_data_address -#define target_stopped_data_address() \ - (*current_target.to_stopped_data_address) () -#endif - -/* Sometimes gdb may pick up what appears to be a valid target address - from a minimal symbol, but the value really means, essentially, - "This is an index into a table which is populated when the inferior - is run. Therefore, do not attempt to use this as a PC." */ +extern int target_stopped_data_address_p (struct target_ops *); -#if !defined(PC_REQUIRES_RUN_BEFORE_USE) -#define PC_REQUIRES_RUN_BEFORE_USE(pc) (0) +#ifndef target_stopped_data_address +#define target_stopped_data_address(target, x) \ + (*target.to_stopped_data_address) (target, x) +#else +/* Horrible hack to get around existing macros :-(. */ +#define target_stopped_data_address_p(CURRENT_TARGET) (1) #endif /* This will only be defined by a target that supports catching vfork events, @@ -1182,7 +1165,7 @@ extern void noprocess (void); extern void find_default_attach (char *, int); -extern void find_default_create_inferior (char *, char *, char **); +extern void find_default_create_inferior (char *, char *, char **, int); extern struct target_ops *find_run_target (void); @@ -1246,4 +1229,6 @@ extern void push_remote_target (char *name, int from_tty); /* Blank target vector entries are initialized to target_ignore. */ void target_ignore (void); +extern struct target_ops deprecated_child_ops; + #endif /* !defined (TARGET_H) */ diff --git a/gnu/usr.bin/binutils/gdb/testsuite/ChangeLog b/gnu/usr.bin/binutils/gdb/testsuite/ChangeLog index 061a9ba8271..7ba5c695220 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/ChangeLog +++ b/gnu/usr.bin/binutils/gdb/testsuite/ChangeLog @@ -1,8 +1,1183 @@ +2004-10-14 Andrew Cagney <cagney@gnu.org> + + * gdb.mi/gdb701.c (main): Return 0. + +2004-10-13 Daniel Jacobowitz <dan@debian.org> + + * gdb.dwarf2/dw2-intercu.S, gdb.dwarf2/dw2-intercu.exp: New files. + +2004-10-12 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.threads/schedlock.c: Add comment markers to use to find + line numbers. + * gdb.threads/schedlock.exp: Adjust regex to handle the new + comments. + * gdb.threads/watchthreads.exp: Use gdb_get_line_number to find + breakpoint lines. + +2004-10-12 Daniel Jacobowitz <dan@debian.org> + + * gdb.dwarf2/dw2-basic.exp: Run on Hurd also. + +2004-10-12 Daniel Jacobowitz <dan@debian.org> + + * configure.in: Add gdb.dwarf2. + * configure: Regenerated. + * Makefile.in: Add gdb.dwarf2. + * gdb.dwarf2/Makefile.in, gdb.dwarf2/dw2-basic.S, + gdb.dwarf2/dw2-basic.exp, gdb.dwarf2/main.c, + gdb.dwarf2/file1.txt: New files. + +2004-10-11 Orjan Friberg <orjanf@axis.com> + + * gdb.threads/bp_in_thread.exp: Use runto_main and "continue" instead + of "run", since the latter doesn't work with remote targets. Adjust + the breakpoint numbering accordingly. + * gdb.threads/pthread_cond_wait.exp: Ditto. + +2004-10-08 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/overlays.exp: Update copyright years. + +2004-10-08 Kei Sakamoto <sakamoto.kei@renesas.com> + + * gdb.base/overlays.exp: Disable if target is Linux. + +2004-10-06 Felix Lee <felix+log1@specifixinc.com> + + * config/gdbserver.exp (gdb_load): Use right filename on remote. + +2004-10-05 Kei Sakamoto <sakamoto.kei@renesas.com> + + * gdb.asm/asm-source.exp: Add m32r-linux target. + * gdb.asm/m32r-linux.inc: New file. + +2004-09-24 Andrew Cagney <cagney@redhat.com> + David Anderson <anderson@redhat.com> + + * gdb.base/bigcore.exp (extract_heap): If the expect "file size" + command fails, assume things will work. + * gdb.base/bigcore.c: Include <sys/stat.h> and <fcntl.h>. + (_GNU_SOURCE): Define. + (print_unsigned, print_hex): Change parameter to "long long". + (print_byte_count): New function, use to print byte counts. + (large_off_t, large_lseek, O_LARGEFILE): Define dependant on + O_LARGEFILE. + (main): Compute an upper bound on a corefile in max_core_size. + Limit memory chunk size to max_core_size. Limit total memory + allocated to max_core_size. + +2004-09-23 Andrew Cagney <cagney@gnu.org> + + * gdb.base/bigcore.exp: Replace the code that creates a corefile + from a separate process with code that creates a corefile by + making the inferior dump core. + +2004-09-23 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/sigstep.exp: Avoid comments withing gdb_test_multiple + block. + +2004-09-23 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/constvars.exp (local_compiler_xfail_check_2): + New proc. Accept both gcc 3.x.x and gcc 4.x.x. + * gdb.base/volatile.exp (local_compiler_xfail_check_2): + Likewise. + +2004-09-20 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.java/jprint.exp: New test case for java inferior call. + * gdb.java/jprint.java: Ditto. + +2004-09-15 Joel Brobecker <brobecker@gnat.com> + + * gdb.base/bigcore.exp: Deactivate on IRIX targets. + +2004-09-14 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.threads/killed.c: Include <stdlib.h>. + * gdb.threads/pthreads.c: Likewise. + +2004-09-14 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.threads/killed.c: Add copyright notice. + +2004-09-10 Jason Molenda (jmolenda@apple.com) + + * gdb.base/define.exp: Two new tests to verify zero space chars + after 'if' and 'while' commands in a user-defined command is correctly + parsed. + +2004-09-08 Andrew Cagney <cagney@gnu.org> + + * gdb.base/signals.exp (signal_tests_1): Delete. Merge signal + delivery test with duplicate at end of file. + +2004-09-06 Mark Kettenis <kettenis@jive.nl> + + * gdb.base/unload.exp: Link with -dl on *-*-solaris*. + +2004-09-05 Michael Chastain <mec.gnu@mindspring.com> + + * config/hppro.exp: Removed. + +2004-09-05 Michael Chastain <mec.gnu@mindspring.com> + + * config/sparclet.exp: Removed. + +2004-09-05 Michael Chastain <mec.gnu@mindspring.com> + + * config/udi.exp: Removed. + +2004-09-02 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/sigstep.exp (advance): Use "-continue_timer" option + of "exp_continue". + (advancei): Likewise. + +2004-09-01 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.base/unload.exp: Fix so messages aren't duplicated. + +2004-09-01 Manoj Iyer <manjo@austin.ibm.com> + + * gdb.gdb/complaints.exp (setup_test): Use new gdb.exp functionality + to check for nodebug in executable. + * gdb.gdb/observer.exp (setup_test): Likewise. + * gdb.gdb/selftest.exp (test_with_self): Likewise. + * gdb.gdb/xfullpath.exp (setup_test): Likewise. + +2004-09-01 Andrew Cagney <cagney@gnu.org> + + * gdb.threads/staticthreads.c, gdb.threads/staticthreads.exp: New + files. + +2004-09-01 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.base/unload.exp: Fix expected warning message to match + latest format. + +2004-09-01 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/call-rt-st.exp: Fix typos. + +2004-08-31 Manoj Iyer <manjo@austin.ibm.com> + + * gdb.threads/thread_check.exp: New testcase. + * gdb.threads/thread_check.c: New testcase. + +2004-08-31 Andrew Cagney <cagney@gnu.org> + + * gdb.base/sigstep.exp (breakpoint_to_handler_entry) + (skip_to_handler_entry): New procedures. Test stepping into a + handler when the breakpoint is at the handler's entry point. + +2004-08-30 Andrew Cagney <cagney@gnu.org> + + * gdb.base/sigstep.exp (breakpoint_over_handler): Remove kfail + gdb/1757. + +2004-08-27 Michael Chastain <mec.gnu@mindspring.com> + + With code from Manoj Iyer <manjo@austin.ibm.com>: + * lib/gdb.exp (gdb_file_cmd): Return more information in the + return value. Add an arm for "no debugging symbols found". + Change a stray "error" to "perror". + (gdb_run_cmd): Adapt to new return value. + * gdb.base/remote.exp: Adapt to new return value. + * gdb.gdb/complaints.exp: Likewise. + * gdb.gdb/observer.exp: Likewise. + * gdb.gdb/selftest.exp: Likewise. + * gdb.gdb/xfullpath.exp: Likewise. + +2004-08-27 Joel Brobecker <brobecker@gnat.com> + + * gdb.threads/bp_in_thread.exp: New testcase. + +2004-08-27 Michael Chastain <mec.gnu@mindspring.com> + + Fix PR testsuite/1735. + * gdb.threads/schedlock.c (thread_function): Add a cast + to suppress a gcc warning. + * gdb.threads/thread-specific.c (thread_function): Likewise. + +2004-08-26 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/unload.c: Include <stdlib.h>. + +2004-08-26 Michael Chastain <mec.gnu@mindspring.com> + + From Paul Gilliam <pgilliam@us.ibm.com>: + * gdb.base/call-sc.exp (test_scalar_returns): Make sure PC is + synchronized after the "return". + +2004-08-26 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.mi/basics.c: Include <stdio.h>. + * gdb.mi/pthreads.c: Include <stdlib.h>. + * gdb.mi/var-cmd.c: Include <stdlib.h>. + +2004-08-26 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.threads/schedlock.c: Add copyright notice. + +2004-08-25 Andrew Cagney <cagney@gnu.org> + + * gdb.base/sigstep.exp (breakpoint_to_handler, skip_to_handler) + (skip_over_handler, breakpoint_over_hander): New test procedures. + (advance, advancei): Add a proper prefix, do not use + rerun_to_main. + * gdb.base/sigstep.c (main): Change to use an infinite loop. + +2004-08-24 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.mi/basics.c: Add copyright notice. + * gdb.mi/var-cmd.c: Add copyright notice. + +2004-08-23 Michael Chastain <mec.gnu@mindspring.com> + + * lib/gdb.exp: Remove signed_keyword_not_used. + * lib/compiler.c: Likewise. + * lib/compiler.cc: Likewise. + +2004-08-23 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/whatis.c: Remove conditional disabling of "signed". + * gdb.base/whatis.exp: Remove signed_keyword_not_used. + +2004-08-23 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/whatis.c: Add copyright notice. + +2004-08-20 Mark Kettenis <kettenis@gnu.org> + + * gdb.arch/i386-prologue.exp (skip_breakpoint): New function. Use + it to skip the breakpoints encoded in the inline assembly. + +2004-08-20 Michael Chastain <mec.gnu@mindspring.com> + + * Makefile.in: Add gdb.fortran. + +2004-08-20 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/call-sc.exp (test_scalar_returns): + Fix cut-and-paste glitch in "Make fun return now". + +2004-08-17 Michael Chastain <mec.gnu@mindspring.com> + + * configure.in: Add gdb.fortran. + * configure: Regenerate. + * gdb.fortran/Makefile.in: New file. + * lib/gdb.exp (skip_fortran_tests): New procedure. + +2004-08-17 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.mi/mi-var-block.exp: Use gdb_get_line_number. Remove + reference to bug-gnu@prep.ai.mit.edu. + * gdb.mi/mi-var-child.exp: Likewise. + * gdb.mi/mi-var-cmd.exp: Likewise. + * gdb.mi/mi-var-display.exp: Likewise. + * gdb.mi/mi2-var-block.exp: Likewise. + * gdb.mi/mi2-var-child.exp: Likewise. + * gdb.mi/mi2-var-cmd.exp: Likewise. + * gdb.mi/mi2-var-display.exp: Likewise. + +2004-08-15 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/unload.c (main): Make local variable msg const. + +2004-08-15 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.mi/mi-cli.exp: Use gdb_get_line_number. Remove reference + to bug-gnu@prep.ai.mit.edu. + * gdb.mi/mi-disassemble.exp: Likewise. + * gdb.mi/mi-eval.exp: Likewise. + * gdb.mi/mi-file.exp: Likewise. Also, add comment about the + default line number. + * gdb.mi/mi-return.exp: Likewise. + * gdb.mi/mi-simplerun.exp: Likewise. + * gdb.mi/mi-stack.exp: Likewise. + * gdb.mi/mi-stepi.exp: Likewise. Also, replace wildcarded line + number with explicit range test. + * gdb.mi/mi-watch.exp: Likewise. + * gdb.mi/mi2-break.exp: Likewise. + * gdb.mi/mi2-cli.exp: Likewise. + * gdb.mi/mi2-disassemble.exp: Likewise. + * gdb.mi/mi2-eval.exp: Likewise. + * gdb.mi/mi2-file.exp: Likewise. Also, add comment about the + default line number. + * gdb.mi/mi2-return.exp: Likewise. + * gdb.mi/mi2-simplerun.exp: Likewise. + * gdb.mi/mi2-stack.exp: Likewise. + * gdb.mi/mi2-stepi.exp: Likewise. Also, replace wildcarded line + number with explicit range test. + * gdb.mi/mi2-watch.exp: Likewise. + +2004-08-15 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/ctti.exp: Tweak srcfile and objfile to have no slashes. + * gdb.cp/m-static.exp: Likewise. + * gdb.cp/rtti.exp: Likewise. + +2004-08-14 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/bigcore.c: Include <sys/types.h> and <sys/time.h>. + +2004-08-14 Eli Zaretskii <eliz@gnu.org> + + * ChangeLog: Prefix Local Variables with semi-colons and indent + the reference to older ChangeLog files, to fix fontification in + Emacs. + +2004-08-13 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.mi/mi-break.exp: Use gdb_get_line_number. + * gdb.mi/mi2-break.exp: Likewise. + +2004-08-13 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.gdb/selftest.exp: Revert removal of call to init_malloc. + +2004-08-13 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/inherit.exp: Use cp_test_ptype_class. + +2004-08-13 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/classes.exp: Remove unused declarations. Just let + test names default instead of providing special names. Remove + extraneous demangler test. + +2004-08-12 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.base/unload.exp: New test for breakpoints in dynamically + loaded libraries. + * gdb.base/unload.c: Ditto. + * gdb.base/unloadshr.c: Ditto. + +2004-08-12 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/classes.exp (test_ptype_class_objects): Call + cp_test_ptype_class. + (test_enums): Likewise. + +2004-08-10 Andrew Cagney <cagney@gnu.org> + + * gdb.threads/staticthreads.c, gdb.threads/staticthreads.exp: New + files. + +2004-08-10 Andrew Cagney <cagney@gnu.org> + + * gdb.gdb/selftest.exp (do_steps_and_nexts): Remove code to skip + init_malloc call. + +2004-08-10 Michael Chastain <mec.gnu@mindspring.com> + + * ChangeLog: Add copyright notice. The notice is copied + from emacs 21.3 top level ChangeLog. + +2004-08-09 Michael Chastain <mec.gnu@mindspring.com> + + * lib/cp-support.exp: New file. + * lib/cp-support.exp (cp_test_type_class): New function. + * gdb.cp/derivation.exp: Use cp_test_ptype_class. + * gdb.cp/virtfunc.exp (test_one_ptype): Removed. + * gdb.cp/virtfunc.exp (test_ptype_of_classes): Use + cp_test_ptype_class. + +2004-08-09 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.mi/mi2-basics.exp, gdb.mi/mi2-break.exp, + gdb.mi/mi2-console.exp, gdb.mi/mi2-disassemble.exp, + gdb.mi/mi2-eval.exp, gdb.mi/mi2-file.exp, gdb.mi/mi2-hack-cli.exp, + gdb.mi/mi2-read-memory.exp, gdb.mi/mi2-regs.exp, + gdb.mi/mi2-return.exp, gdb.mi/mi2-simplerun.exp, + gdb.mi/mi2-stack.exp, gdb.mi/mi2-stepi.exp, gdb.mi/mi2-until.exp, + gdb.mi/mi2-var-block.exp, gdb.mi/mi2-var-child.exp, + gdb.mi/mi2-var-cmd.exp, gdb.mi/mi2-var-display.exp, + gdb.mi/mi2-watch.exp: Update copyright years. + +2004-08-09 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/sigaltstack.exp: Provide proper anchoring. + +2004-08-09 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.mi/gdb792.exp, gdb.mi/mi-basics.exp, gdb.mi/mi-break.exp, + gdb.mi/mi-console.exp, gdb.mi/mi-disassemble.exp, + gdb.mi/mi-eval.exp, gdb.mi/mi-file.exp, gdb.mi/mi-hack-cli.exp, + gdb.mi/mi-read-memory.exp, gdb.mi/mi-regs.exp, + gdb.mi/mi-return.exp, gdb.mi/mi-simplerun.exp, + gdb.mi/mi-stack.exp, gdb.mi/mi-stepi.exp, gdb.mi/mi-until.exp, + gdb.mi/mi-var-block.exp, gdb.mi/mi-var-child.exp, + gdb.mi/mi-var-cmd.exp, gdb.mi/mi-var-display.exp, + gdb.mi/mi-watch.exp: Update copyright years. + +2004-08-08 Daniel Jacobowitz <dan@debian.org> + + PR gdb/1738 + * gdb.base/signals.exp (signal_tests_1): KFAIL bug in continuing + from a breakpoint with a pending signal. + +2004-08-08 Daniel Jacobowitz <dan@debian.org> + + PR gdb/1736 + * lib/gdb.exp (gdb_test_multiple): Handle return -code return. + * gdb.base/sigaltstack.exp (finish_test): Consume output until + the prompt. + * gdb.base/sigstep.exp: Add KFAIL for gdb/1736. + +2004-08-08 Daniel Jacobowitz <dan@debian.org> + + * gdb.cp/templates.exp: Handle (char)115 for template argument 's'. + +2004-08-08 Daniel Jacobowitz <dan@debian.org> + + PR gdb/1736 + * gdb.base/sigaltstack.exp (finish_test): New procedure. KFAIL + for i?86-*-linux*. + +2004-08-08 Daniel Jacobowitz <dan@debian.org> + + * gdb.arch/i386-prologue.exp: Compile without debug information. + +2004-08-08 Michael Chastain <mec.gnu@mindspring.com> + + * lib/gdb.exp (gdb_get_line_number): Rewrite with native tcl + rather than asking gdb to search. + +2004-08-05 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/gcore.c: Include <string.h>. + +2004-08-05 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/gcore.c: Add copyright notice. + +2004-08-05 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/freebpcmd.c: Include <stdio.h>. + * gdb.base/long_long.c: Include <string.h>. + * gdb.base/sigaltstack.c: Include <stdlib.h> <string.h>. + * gdb.base/siginfo.c: Include <string.h>. + * gdb.base/sigstep.c: Include <string.h>. + +2004-08-04 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/complex.c: Include <stdlib.h>. + +2004-08-04 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/complex.c: Add copyright notice. + +2004-08-04 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/charset.c: Include <stdlib.h>. + +2004-08-04 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/auxv.c: Include <stdlib.h>. + +2004-08-04 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/auxv.c: Add copyright notice. + +2004-08-04 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/coremaker.c: Add copyright notice. + * gdb.base/coremaker2.c: Add copyright notice. + +2004-08-04 Andrew Cagney <cagney@gnu.org> + + * gdb.base/store.exp: Update copyright. + (check_set, up_set, check_struct, up_struct): Add a prefix to test + names, do not import gdb_prompt. + +2004-08-01 Andrew Cagney <cagney@gnu.org> + + Fix PR testsuite/1729. + * gdb.base/dump.exp: Add test name to callers of capture_value, do + not use capture_value with value 4. + (capture_value): Add optional test name parameter. + (test_reload_saved_value, test_restore_saved_value): Use $msg as + the prefix, pass to capture_value. + +2004-08-01 Mark Kettenis <kettenis@gnu.org> + + * gdb.arch/i386-prologue.exp: Add testcase for standard prolgue. + * gdb.arch/i386-prologue.c (standard): New prototype and function. + (main): Call new function. + +2004-07-31 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/namespace.exp: Accept more varieties of ptype output. + +2004-07-31 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/virtfunc.exp: Accept more varieties of ptype output. + +2004-07-31 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/inherit.exp: Accept more varieties of ptype output. + Accept more values of vtbl pointer. Remove some messages + about "obsolete gcc or gdb". + +2004-07-30 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/classes.exp: Accept more varieties of ptype output. + +2004-07-30 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/asm-source.exp: Properly convert target board + debug flags from gcc format to binutils format. + +2004-07-28 Mark Kettenis <kettenis@gnu.org> + + * gdb.arch/i386-prologue.exp: Remove KFAIL of "backtrace in + gdb1718". PR backtrace/1718 partially fixed. + +2004-07-27 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.threads/watchthreads.exp: New test for threaded watchpoints. + +2004-07-26 Nick Clifton <nickc@redhat.com> + + * gdb.asm/asm-source.exp (debug-flags): New variable. If a known + good default value for a specific architecture is available then + set it to that value. Otherwise default to the -gstabs switch. + Remove the -g... switches from the asm-flags variable. Allow the + target board info to override the value if it wants to. Pass the + switch on the assembler command line. + +2004-07-23 Mark Kettenis <kettenis@gnu.org> + + * gdb.arch/i386-prologue.exp: Add testcase for PR backtrace/1718. + * gdb.arch/i386-prologue.c (gdb1718): New prototype and function. + (main): Call new function. + +2004-07-22 Michael Chastain <mec.gnu@mindspring.com> + + Test for PR exp/1715. + * gdb.base/radix.exp: Refactor common procedures. Make all + test names unique. Change XFAIL to KFAIL. + +2004-07-20 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.ada/gnat_ada.gpr.in: Rename from here ... + * gdb.ada/gnat_ada.gin: ... to here. + * configure.in: Use gnat_ada.gin. + * configure: Regenerate. + +2004-07-20 Andrew Cagney <cagney@gnu.org> + + * gdb.base/signals.exp: Replace send_gdb and gdb_expect with + gdb_test and gdb_test_multiple. Delete bash_bug. Delete suspect + XFAILs. Clean up test messages and comments. Check backtraces. + Delete re-sync code. + +2004-07-19 Michael Chastain <mec.gnu@mindspring.com> + + Fix PR cli/740. + * gdb.base/annota1.exp: Honor gdb,nosignals. + * gdb.base/annota3.exp: Likewise. + +2004-07-19 Michael Chastain <mec.gnu@mindspring.com> + + * lib/java.exp: Update copyright notice. + +2004-07-19 Andrew Cagney <cagney@gnu.org> + + * gdb.base/selftest.exp: Copy file from here ... + * gdb.gdb/selftest.exp: ... to here. + +2004-07-16 Andrew Cagney <cagney@redhat.com> + + * lib/insight-support.exp: Delete file. + * lib/java.exp (java_init): Fix copyright. + +2004-07-16 Andrew Cagney <cagney@gnu.org> + + * gdb.base/restore.c: Append "prologue" to comments marking the a + function's prologue. + * gdb.base/restore.exp: Update copyright, re-indent. + (restore_tests): Use gdb_test_multiple. Add "calleeN calls + callerN" prefix where needed. Update patterns that match a + function's prologue. + +2004-07-16 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/restore.c: Add copyright notice. + +2004-07-16 Andrew Cagney <cagney@gnu.org> + + * gdb.base/logical.exp: Update copyright. + (evaluate): New procedure. Use to re-implement tests using + several tables. + +2004-07-14 Martin Hunt <hunt@redhat.com> + + * lib/insight-support.exp (gdbtk_start): Unset TCL_LIBRARY + which fixes some problems where init.tcl was not found. + +2004-07-13 Andrew Cagney <cagney@gnu.org> + + * gdb.base/sizeof.exp: Skip test when no inferior I/O. + (check_sizeof, check_valueof): Do not include the output in the + test name. Use gdb_test. + (get_valueof): Use gdb_test_multiple. + + * gdb.base/step-test.exp: Update copyright. Use + gdb_test_multiple. Ensure that test names do not include + architecture dependent output. + + * gdb.gdb/observer.exp: Update copyright. + (setup_test): Use gdb_test_multiple. + (attach_first_observer, attach_second_observer) + (attach_third_observer, detach_first_observer) + (detach_second_observer, detach_third_observer) + (reset_counters, check_counters): Make $message a prefix. + (test_normal_stop_notifications): Add "args" parameter - a list of + init functions to be called. Make $message a prefix, + (test_observer_normal_stop): Change the message prefixes so that + they are unique, pass the attach / detach procedures to + test_normal_stop_notifications. + + * gdb.base/signull.exp (test_segv): Prefix all tests with + "${name}". Clean up test messages. + + * gdb.base/annota3.exp, gdb.base/annota1.exp: Update copyright. + + * gdb.base/ena-dis-br.exp: Update copyright. + (break_at): New function. Replace send_gdb with gdb_test, + break_at, and gdb_test_multiple. Replace XFAIL of "continue with + ignore count, not stopped at bpt", with KFAIL. + +2004-07-13 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/attach.exp: Remove cleanupfile handling. + +2004-07-12 Andrew Cagney <cagney@gnu.org> + + * gdb.base/annota1.exp: Cleanup corefile test name. + * gdb.base/annota3.exp: Ditto. + +2004-07-12 Andrew Cagney <cagney@gnu.org> + + * gdb.base/signals.exp: Clean up copyright, re-indent. + + * gdb.base/attach.exp: Replace send_gdb and gdb_expect with + gdb_test and gdb_test_multiple. + +2004-07-08 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.java/jmain.exp: Fix expected line number for main to + break at. Set XFAIL for break at main test since gcj does not + provide line number info for first statement in main. + +2004-07-08 Andrew Cagney <cagney@gnu.org> + + * gdb.base/attach.exp: Cleanup copyright. Re-indent. + + * gdb.base/sigbpt.exp: Make the common part of each test name a + prefix instead of suffix. + +2004-07-07 Bob Rossi <bob_rossi@cox.net> + + * gdb.mi/mi2-file.exp: Revert to version 1.1, except changed name of + test from test_tbreak_creation_and_listing to + test_file_list_exec_source_file + * gdb.mi/mi-file.exp: Add test for -file-list-exec-source-files + Changed name of test from test_tbreak_creation_and_listing to + test_file_list_exec_source_file + +2004-07-07 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.java/jmisc.exp: Fix expected output of ptype to look for + the jmisc() constructor instead of <init>. + * gdb.java/jmisc1.exp: Ditto. + +2004-07-07 Andrew Cagney <cagney@gnu.org> + + * gdb.base/sigbpt.exp (stepi_out): Check for a single step + corrupting the PC. + +2004-07-06 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/templates.exp: Accept whitespace change in demangler + output. + +2004-07-06 Andrew Cagney <cagney@gnu.org> + + * gdb.base/sigbpt.exp, gdb.base/sigbpt.c: New test. + +2004-07-02 Michael Chastain <mec.gnu@mindspring.com> + + * lib/compiler.c: Accept __HP_CXD_SPP for old hp ansi c compiler. + * lib/compiler.cc: Likewise. + +2004-06-30 Michael Chastain <mec.gnu@mindspring.com> + + * lib/compiler.cc: Work around string preprocessing problem + with old hp c++ compiler. + * lib/compiler.c: Likewise. + +2004-06-29 Corinna Vinschen <vinschen@redhat.com> + + * gdb.arch/i386-prologue.c: Add copyright header. Use preprocessor + directives to conditionalize symbol prefixing. + * gdb.arch/i386-prologue.exp: Allow symbol prefixing by adding + additional_flags handling. Add underscore prefix for Cygwin. + * gdb.arch/i386-unwind.c: Use preprocessor directives to + conditionalize symbol prefixing. + * gdb.arch/i386-unwind.exp: Allow symbol prefixing by adding + additional_flags handling. Add underscore prefix for Cygwin. + +2004-06-29 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/bigcore.exp: Skip test on Cygwin. + +2004-06-28 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.hp/gdb.base-hp/reg.exp: Accept both old and new gdb output + formats for "info register". Use gdb_test_multiple. Fix + the "invalid register" test. + +2004-06-28 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/attach.exp: Fix copyright date. Set testpid to Windows + PID for Cygwin. Add Cygwin specific strings to check for in some + tests. + (do_attach_tests): Add a test for user interaction when attaching + to a process with no matching symbol table already loaded. + +2004-06-26 Andrew Cagney <cagney@gnu.org> + + Test PR java/1567 and PR java/1565. + * gdb.java/jmain.exp, gdb.java/jmain.java: New files. + * gdb.java/jmisc2.exp: Delete file. + +2004-06-26 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.hp/gdb.base-hp/reg.exp: Update copyright notice. + +2004-06-25 Corinna Vinschen <vinschen@redhat.com> + + * gdb.base/attach.exp (do_attach_tests): Don't forget to kill second + attach process. + +2004-06-23 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/pr-1553.exp: Remove. + +2004-06-22 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/pr-1553.cc: Remove. + * gdb.cp/pr-1553.exp: Disable this test. + +2004-06-20 Jim Blandy <jimb@redhat.com> + + Fix PR testsuite/1680. + * gdb.arch/i386-sse.exp: Properly quote curly braces in + regular expressions. + +2004-06-19 Michael Chastain <mec.gnu@mindspring.com> + + Fix PR testsuite/1679. + * gdb.arch/i386-sse.exp: Do not call gdb_suppress_entire_file. + Issue an UNSUPPORTED result instead. + +2004-06-18 Jim Blandy <jimb@redhat.com> + + * gdb.base/charset.exp: Only send a control-C if we see a new + prompt and incomplete command. + +2004-06-18 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/pr-574.cc: Add copyright notice. + +2004-06-17 Jim Blandy <jimb@redhat.com> + + * gdb.base/charset.exp: Don't refer to $expect_out(1,string) in + cases where the regexp has no groups; this grabs random text from + the previous test suite, whatever that was. + +2004-06-17 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/printmethod.cc: Add copyright notice. + +2004-06-16 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/psmang1.cc, gdb.cp/psmang2.cc: Add copyright notice. + +2004-06-16 Andrew Cagney <cagney@gnu.org> + + * gdb.base/signull.c: Update copyright. Include <string.h>. + (bowler): Replace data_pointer with data_read + and data_write cases. Add code_descriptor case. + (zero, desc): New array and pointer. + (data, code): Change to simple pointers. + * gdb.base/signull.exp: Fix probe pattern matching a function + descriptor SIGSEGV. Replace data_pointer with data_read and + data_write tests. + +2004-06-16 Andrew Cagney <cagney@gnu.org> + + * gdb.base/long_long.exp, gdb.base/long_long.c: Rewrite. + +2004-06-15 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/long_long.c: Add copyright notice. + +2004-06-15 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.base/long_long.exp: Remove reference to + bug-gdb@prep.ai.mit.edu. Change line-number-specific breakpoint + to gdb_breakpoint and gdb_continue_to_breakpoint. + +2004-06-14 Jim Blandy <jimb@redhat.com> + + * gdb.arch/e500-regs.exp: Fix up 'print' pattern for the little- + endian case. + +2004-06-14 Andrew Cagney <cagney@gnu.org> + + * gdb.base/gcore.exp (capture_command_output): Delete the always + passing tests containing inferior values. + * gdb.base/ending-run.exp: Do not include the breakpoint address + in the test message. Update copyright. + * gdb.base/sizeof.exp (check_sizeof): Do not include the type's + size in the test name, use gdb_test_multiple. Update copyright. + +2004-06-14 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/ref-types.cc: Add copyright notice. + +2004-06-14 Michael Chastain <mec.gnu@mindspring.com> + + * lib/compiler.c: Remove gcc_compiled, hp_cc_compiler, + hp_aCC_compiler. + * lib/compiler.cc: Likewise. + * lib/gdb.exp (get_compiler_info): Eval lines only if they are + 'set' commands. Log diagnostics for other lines. Set + gcc_compiled, hp_cc_compiler, and hp_aCC_compiler. + +2004-06-13 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/try_catch.cc: Add copyright notice. + +2004-06-12 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/userdef.cc: Add copyright notice. + +2004-06-11 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.cp/virtfunc.cc: Add copyright notice. + +2004-06-11 Randolph Chung <tausq@debian.org> + + * gdb.base/structs2.exp: Mark two tests as xfail because of a compiler + problem. + +2004-06-10 Andrew Cagney <cagney@gnu.org> + + * lib/compiler.cc, lib/compiler.c: Append either + __GNUC_PATCHLEVEL__, or "unknown" to the compiler_info. + * gdb.base/structs.exp (test_struct_calls): Check for gcc-3-3-* + instead of gcc-3-3. + +2004-06-09 Andrew Cagney <cagney@gnu.org> + + * gdb.base/structs.exp (test_struct_calls): Fix KFAIL for + gdb/1455, bug is specific to "long long" and "double". + + * gdb.base/structs.exp (test_struct_returns, test_struct_returns) + (test_struct_calls): Remove KFAIL of "long double" on i*86-*-*, + x86_64-*-*, sparc64-*-*, and sparc*-*-solaris2*. PR tdep/1447 + fixed. + +2004-06-09 Andrew Cagney <cagney@gnu.org> + + * gdb.base/structs.exp (test_struct_returns): Replace + "return_value_unknown" and "finish_value_unknown" by + "return_value_known" and "finish_value_known". Instead of + "return_value_unknown" iff "finish_value_unknown", check + "return_value_known" implies "finish_value_known". + +2004-06-08 Martin Hunt <hunt@redhat.com> + + * gdb.base/float.exp: Add pattern for mips targets. + +2004-06-08 Randolph Chung <tausq@debian.org> + + * gdb.base/float.exp: Add pattern for hppa*-* target; make the failure + message for unknown architectures more clear. + +2004-06-08 Joel Brobecker <brobecker@gnat.com> + + * gdb.ada/null_record.exp: Use "start" instead of "begin" to + start the execution of the program. + +2004-06-07 Jim Blandy <jimb@redhat.com> + + * gdb.arch/i386-sse.exp, gdb.arch/i386-sse.c: New tests. + * gdb.arch/i386-cpuid.h: New helper file. + +2004-06-07 Randolph Chung <tausq@debian.org> + + * gdb.base/shlib-call.exp: Allow breakpoint to be added after inferior + has started. + +2004-06-04 Roland McGrath <roland@redhat.com> + + Fix PR gdb/1647. + * gdb.base/auxv.exp (fetch_auxv): Revert last change and fix it + differently to be robust to output buffering differences. + +2004-06-04 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.threads/pthreads.exp: Update copyright years. + (check_control_c): Change asynchronous 'after' to synchronous. + +2004-06-04 Roland McGrath <roland@redhat.com> + + * gdb.base/auxv.exp (fetch_auxv): Consume output fully through + next gdb prompt. + +2004-06-02 Michael Chastain <mec.gnu@mindspring.com> + + Fix PR gdb/1636. + * gdb.threads/manythreads.exp: Change asynchronous 'after' + calls to synchronous. + +2004-05-26 Jim Blandy <jimb@redhat.com> + + * gdb.arch/e500-prologue.exp, gdb.arch/e500-prologue.c: New tests. + +2004-05-24 Randolph Chung <tausq@debian.org> + + * gdb.asm/asm-source.exp: Enable test for hppa-linux target. + * gdb.asm/pa.inc: New file. + +2004-05-22 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/signull.c: Use sigjmp_buf instead of jmp_buf. + +2004-05-21 Joel Brobecker <brobecker@gnat.com> + Daniel Jacobowitz <drow@mvista.com> + + * lib/gdb.exp (gdb_test_multiple): Improve regexp matching the + GDB prompt. + +2004-05-20 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + * gdb.base/signull.c: Use sigsetjmp/siglongjmp instead of + setjmp/longjmp. Use sigaction instead of signal. + +2004-05-19 J. Brobecker <brobecker@gnat.com> + Michael Snyder <msnyder@redhat.com> + + * gdb.threads/pthread_cond_wait.c: New file. + * gdb.threads/pthread_cond_wait.exp: New testcase. + +2004-05-13 Andrew Cagney <cagney@redhat.com> + + * gdb.base/signull.exp, gdb.base/signull.c: New files. + * gdb.base/gdb1476.c, gdb.base/gdb1476.exp: Delete files. + +2004-05-11 Andrew Cagney <cagney@redhat.com> + + * gdb.base/sigstep.exp (advancei): Update KFAILs. gdb/1613 is + fixed but revealed gdb/1639. + +2004-05-10 Andrew Cagney <cagney@redhat.com> + + * gdb.base/signals.exp (signal_tests_1): Simplify "continue to + func1" and "next to 2nd alarm", kernel bug avoided. + +2004-05-10 Daniel Jacobowitz <dan@debian.org> + + PR external/1568 + * gdb.base/bigcore.exp: Check the size of the dumped core file. + XFAIL if it is smaller than bytes_allocated. + * gdb.base/bigcore.c (bytes_allocated): Make static and unsigned. + (main): Make chunks_allocated unsigned. Correct comment. + +2004-05-07 Joel Brobecker <brobecker@gnat.com> + + * gdb.arch/powerpc-aix-prologue.c: New file. + * gdb.arch/powerpc-aix-prologue.exp: New file. + +2004-05-07 Jim Blandy <jimb@redhat.com> + + * gdb.base/lineinc.exp, gdb.base/lineinc1.h, gdb.base/lineinc2.h, + gdb.base/lineinc3.h, gdb.base/lineinc.c: New tests. + +2004-05-06 Joel Brobecker <brobecker@gnat.com> + + * gdb.base/sep.exp: No longer setup_kfail when the program was + built with dwarf2. + +2004-05-05 Jim Ingham <jingham@apple.com> + + * gdb.base/pending.exp: Make sure pending breakpoints + preserve the ignore count. + +2004-04-27 Jerome Guitton <guitton@gnat.com> + + * i386-prologue.exp: Add testcase for jump instruction as first + instruction of the real code. + * i386-prologue.c (jump_at_beginning): New function. + +2004-04-28 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/call-sc.exp: Remove patterns to KFAIL PR gdb/1624 on + x86_64-*-*. + +2004-04-28 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/call-sc.exp: Remove patterns to KFAIL PR gdb/1623 on + i*86-*-*. + +2004-04-25 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/call-sc.exp (start_scalars_test): Fix regular + expression that checks the return type. + +2004-04-23 Andrew Cagney <cagney@redhat.com> + + * gdb.base/call-sc.exp: New test of scalar call/return values. + * gdb.base/call-sc.c: Ditto. + +2004-04-23 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + * gdb.threads/manythreads.c: Reduce thread stack size. + +2004-04-23 Jeff Johnston <jjohnstn@redhat.com> + + * gdb.threads/manythreads.c: Add copyright notice. + +2004-04-23 Andrew Cagney <cagney@redhat.com> + + * gdb.base/siginfo.exp: Better handle step out of signal. + * gdb.base/sigstep.exp: Ditto. + +2004-04-22 Jeff Johnston <jjohnstn@redhat.com> + Daniel Jacobowitz <drow@mvista.com> + + * gdb.threads/manythreads.c: New testcase. + * gdb.threads/manythreads.exp: Ditto. + +2004-04-22 Jim Blandy <jimb@redhat.com> + + * gdb.stabs/exclfwd.exp, gdb.stabs/exclfwd1.c, + gdb.stabs/exclfwd2.c, gdb.stabs/exclfwd.h: New test. + +2004-04-21 Michael Chastain <mec.gnu@mindspring.com> + + * gdb.stabs/weird.exp: Accept full pathname for $binfile. + +2004-04-21 Andrew Cagney <cagney@redhat.com> + + * gdb.base/sigstep.c: New file. + * gdb.base/sigstep.exp: New file. + +2004-04-16 Joel Brobecker <brobecker@gnat.com> + + * gdb.gdb/observer.exp (test_normal_stop_notifications): Update + call to observer_notify_normal_stop. + +2004-04-15 Andrew Cagney <cagney@redhat.com> + + * gdb.base/siginfo.c: New file. + * gdb.base/siginfo.exp: New file. + +2004-04-12 J. Brobecker <brobecker@gnat.com> + + * gdb.base/sep.exp: Fix typo in comment. + +2004-04-12 J. Brobecker <brobecker@gnat.com> + + * gdb.base/sep.c: New file. + * gdb.base/sep-proc.c: New file. + * gdb.base/sep.exp: New testcase. + +2004-04-09 Mark Kettenis <kettenis@gnu.org> + + * gdb.base/bigcore.exp: Disable on Solaris; no sparse core file + support. + +2004-04-05 Andrew Cagney <cagney@redhat.com> + + * gdb.base/sigaltstack.c: New file. + * gdb.base/sigaltstack.exp: New file. + +2004-04-04 Joel Brobecker <brobecker@gnat.com> + + * gdb.base/foll-fork.exp: Update the expected output for + "help set follow-fork-mode", to match a change that was made + to the help of this variable on 2004-01-13. + +2004-04-01 Joel Brobecker <brobecker@gnat.com> + + * lib/ada.exp: Add copyright notice. + * bar.ads: Likewise. + * bar.adb: Likewise. + * null_record.adb: Likewise. + * null_record.exp: Likewise. + * gnat_ada.gpr.in: Likewise. Fix typo in a comment, clarify another. + +2004-04-01 Joel Brobecker <brobecker@gnat.com> + + * configure.in: Generate gdb.ada/Makefile and gdb.ada/gnat_ada.gpr. + * configure: Regenerate. + +2004-04-01 Joel Brobecker <brobecker@gnat.com> + + * lib/ada.exp (gdb_compile_ada): Emit UNSUPPORTED if we failed + to build the application. Remove the message printed when in + verbose mode, redundant with the UNSUPPORTED message above. + +2004-03-31 Joel Brobecker <brobecker@gnat.com> + + * gdb.ada (bar.ads, bar.adb, null_record.adb): New files. + * gdb.ada (null_record.exp): New testcase. + +2004-03-31 Joel Brobecker <brobecker@gnat.com> + + * Makefile.in (ALL_SUBDIRS) Add gdb.ada. + +2004-03-31 Joel Brobecker <brobecker@gnat.com> + + * gdb.ada: New subdirectory. + * gdb.ada/Makefile.in: New file. + * gdb.ada/gnat_ada.gpr.in: New file. + +2004-03-31 Joel Brobecker <brobecker@gnat.com> + + * lib/ada.exp: New file. + 2004-03-24 Daniel Jacobowitz <drow@mvista.com> * gdb.base/gdb1250.exp: Use runto {allow-pending}. * lib/gdb.exp (runto, gdb_breakpoint): Support {allow-pending}. +2004-03-22 Andrew Cagney <cagney@redhat.com> + + * gdb.base/watchpoint.exp (test_stepping): Delete bogus XFAILs + hiding problems with DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. + Problem identified by Ulrich Weigand. + +2004-03-17 David Carlton <carlton@kealia.com> + + * gdb.cp/classes.exp (test_enums): Refer to PR c++/1588 instead of + PR c++/826. + +2004-03-16 Roland McGrath <roland@redhat.com> + + * gdb.base/auxv.exp: New file. + * gdb.base/auxv.c: New file, copied verbatim from coremaker2.c. + 2004-03-12 David Carlton <carlton@kealia.com> * gdb.cp/pr-1553.exp: New. Tests for PR c++/1553. @@ -42,6 +1217,15 @@ * gdb.cp/rtti2.cc: Update copyright. (n2::create3): New. +2004-03-04 Mark Kettenis <kettenis@gnu.org> + + * gdb.asm/openbsd.inc: Fix typo. + +2004-03-03 Fred Fish <fnf@redhat.com> + + * gdb.base/pc-fp.exp (get_valueofx): Fix apparent typo to now set + "val" instead of unused "size". Update copyright year. + 2004-02-29 Daniel Jacobowitz <drow@mvista.com> * gdb.cp/ctti.exp: Handle unsigned char type. Expect templates @@ -74,7 +1258,7 @@ support. 2004-02-26 Fred Fish <fnf@redhat.com> - + * gdb.arch/gdb1431.c: Remove. * gdb.arch/gdb1431.s: New file, copy of gdb1291.s * gdb.arch/gdb1431.exp: Use "advance" correctly instead @@ -1005,7 +2189,7 @@ * lib/gdb.exp (gdb_internal_error_resync): Issue a perror when the resync count exceeded. - + * gdb.base/maint.exp: Use gdb_internal_error_resync to recover from the internal error. * lib/gdb.exp (gdb_internal_error_resync): New procedure. @@ -1038,7 +2222,7 @@ 2003-11-13 Elena Zannoni <ezannoni@redhat.com> * gdb.base/break.c: Add comments to aid finding line numbers for - breakpoints. + breakpoints. * gdb.base/break.exp: Remove all references to explicit line numbers. @@ -1158,7 +2342,7 @@ 2003-09-23 Elena Zannoni <ezannoni@redhat.com> - * gdb.base/selftest.exp: Accomodate more instruction reordering + * gdb.base/selftest.exp: Accomodate more instruction reordering weirdness. 2003-09-17 Michael Chastain <mec@shout.net> @@ -1265,7 +2449,7 @@ escaped correctly. 2003-08-07 Elena Zannoni <ezannoni@redhat.com> - + * configure.in: Don't generate config.h from config.hin. * configure: Regenerate. * config.hin: Remove file. @@ -1313,12 +2497,12 @@ 2003-07-22 Michael Snyder <msnyder@redhat.com> - * gdb.disasm/8300s.s: Fix syntax of bsr insn. + * gdb.disasm/8300s.s: Fix syntax of bsr insn. * gdb.disasm/h8300s.exp : Minor changes in disassembler output require patterns to be more general, accepting old and new output. Some output chars (such as '+') also must be quoted. - Some addresses are displayed numerically instead of + Some addresses are displayed numerically instead of symbolically. 2003-07-23 Michael Snyder <msnyder@redhat.com> @@ -1399,7 +2583,7 @@ * gdb.base/annota1.exp: Make sure that we properly escape the full path of the source file. Xfail more permissive patterns, - due to a compiler debug info problem. + due to a compiler debug info problem. 2003-07-07 Andreas Schwab <schwab@suse.de> @@ -1506,7 +2690,7 @@ * gdb.base/fileio.exp: Disable target when nointerrupts and noinferiorio, instead of limiting it to remote. Use remote_exec instead of system. - + 2003-06-12 Jeff Johnston <jjohnstn@redhat.com> * gdb.base/float.exp: Add ia64 support. @@ -1594,7 +2778,7 @@ * gdb.base/corefile.exp: Tolerate stuff after argument parens in backtrace. - + 2003-05-20 David Carlton <carlton@math.stanford.edu> * gdb.c++/namespace1.cc: Actually do 'cvs add' before committing @@ -1617,13 +2801,13 @@ 2003-05-14 Jeff Johnston <jjohnstn@redhat.com> Roland McGrath <roland@redhat.com> - * gdb.threads/linux-dp.exp: Account for fact that in nptl model + * gdb.threads/linux-dp.exp: Account for fact that in nptl model there is no manager thread. 2003-05-08 Jeff Johnston <jjohnstn@redhat.com> - * gdb.threads/schedlock.exp: Remove assumption that all threads - will run in a particular small time slice. Also ensure we break + * gdb.threads/schedlock.exp: Remove assumption that all threads + will run in a particular small time slice. Also ensure we break in one of the child threads rather than the main thread. 2003-05-07 Jim Blandy <jimb@redhat.com> @@ -1695,7 +2879,7 @@ * gdb.base/attach.exp: Add new message from ptrace in case of attaching to nonexistent process. - + 2003-04-11 Jim Blandy <jimb@redhat.com> * gdb.c++/derivation.exp, gdb.c++/overload.exp, @@ -1712,7 +2896,7 @@ 2003-04-10 Elena Zannoni <ezannoni@redhat.com> - * gdb.base/completion.exp: Use string_to_regexp to match the + * gdb.base/completion.exp: Use string_to_regexp to match the working directory name. 2003-04-09 Jim Blandy <jimb@redhat.com> @@ -1748,9 +2932,9 @@ * lib/gdb.exp: Put "the program is no longer running", and "the program exited" in parenthesis. * lib/mi-support.exp: Ditto. - + 2003-04-02 Bob Rossi <bob_rossi@cox.net> - + * gdb.mi/mi-file.exp: New file for -file-list-exec-source-file. 2003-03-29 Andrew Cagney <cagney@redhat.com> @@ -1879,7 +3063,7 @@ 2003-02-27 Michael Snyder <msnyder@redhat.com> - * gdb.base/restore.c (main): Return zero, so exit code + * gdb.base/restore.c (main): Return zero, so exit code will be consistant. 2003-02-26 David Carlton <carlton@math.stanford.edu> @@ -1951,7 +3135,7 @@ Andrew Cagney <ac131313@redhat.com> * gdb.mi/mi-cli.exp: New file. - + 2003-02-04 Michael Chastain <mec@shout.net> * gdb.c++/anon-union.exp: Do not call gdb_suppress_entire_file. @@ -2057,7 +3241,7 @@ * gdb.asm/asm-source.exp: Ditto. * gdb.base/advance.exp: Ditto. * gdb.base/display.exp: Ditto. - * gdb.base/long_long.exp: Ditto. + * gdb.base/long_long.exp: Ditto. * gdb.base/mips_pro.exp: Ditto. * gdb.base/overlays.exp: Ditto. * gdb.base/relocate.exp: Ditto. @@ -2391,8 +3575,8 @@ 2002-11-08 Jeff Johnston <jjohnstn@redhat.com> - * lib/mi-support.exp (mi_gdb_start): Verify the startup message - for mi1 and current mi is in correct format. New mi startup message + * lib/mi-support.exp (mi_gdb_start): Verify the startup message + for mi1 and current mi is in correct format. New mi startup message should be in mi console format. This is part of fix for PR gdb/604. 2002-09-18 Fernando Nasser <fnasser@redhat.com> @@ -2447,7 +3631,7 @@ * mi0-stack.exp, mi0-stepi.exp, mi0-until.exp: Delete. * mi0-var-block.exp, mi0-var-child.exp: Delete. * mi0-var-cmd.exp, mi0-var-display.exp, mi0-watch.exp: Delete. - + 2002-09-27 Kevin Buettner <kevinb@redhat.com> * gdb.base/annota1.exp (info break): Make directory components of @@ -2474,7 +3658,7 @@ (test_empty_complaint): New function. (test_empty_complaints): New function. Check no output when no complaints. - + 2002-09-19 Jim Blandy <jimb@redhat.com> * gdb.base/charset.exp, gdb.base/charset.c: New files. @@ -2717,7 +3901,7 @@ to avoid having GDB convert them to pointers (with loss of information). - * gdb.base/d10v.ld: Merge in several years worth of + * gdb.base/d10v.ld: Merge in several years worth of default linker script changes. * gdb.base/long_long.exp: Add check for sizeof (long double). @@ -2725,7 +3909,7 @@ * gdb.asm/asm-source.exp: Add x86-64 target. * gdb.asm/x86_64.inc: New. - + 2002-05-30 Michael Chastain <mec@shout.net> From Benjamin Kosnik <bkoz@redhat.com>: @@ -2747,7 +3931,7 @@ From Benjamin Kosnik <bkoz@redhat.com>: * gdb.c++/try_catch.cc: New file. - * gdb.c++/try_catch.exp: New file. + * gdb.c++/try_catch.exp: New file. 2002-05-27 Michael Chastain <mec@shout.net> @@ -2767,7 +3951,7 @@ 2002-05-23 Michael Snyder <msnyder@redhat.com> - * gdb.base/all-bin.exp: Revise previous patch by just reducing + * gdb.base/all-bin.exp: Revise previous patch by just reducing the precision of the floating point test results. * gdb.base/call-rt-st.exp: Ditto. @@ -2799,7 +3983,7 @@ * gdb.base/maint.exp (maint print type): Update for new type structure. - + 2002-05-14 Elena Zannoni <ezannoni@redhat.com> * gdb.arch: New directory. @@ -2845,7 +4029,7 @@ * gdb.base/default.exp: Merge clauses for arm, strongarm, xscale. * gdb.base/long_long.exp: Merge clauses for arm and xscale. Add iftarget clause for strongarm. - + 2002-05-06 Michael Snyder <msnyder@redhat.com> * lib/gdb.exp (gdb_test): Add case to allow for status wrapper. @@ -3075,7 +4259,7 @@ From Jim Blandy <jimb@redhat.com> 2002-03-27 Michael Snyder <msnyder@redhat.com> - * gdb.base/help.exp: Modify expect strings to reflect + * gdb.base/help.exp: Modify expect strings to reflect clean-ups in help messages. 2002-03-26 Fred Fish <fnf@redhat.com> @@ -3361,7 +4545,7 @@ From Jim Blandy <jimb@redhat.com> print foo_instance1.overload1arg((unsigned int)arg8) print foo_instance1.overload1arg((float)arg11) print foo_instance1.overload1arg((double)arg12) - + 2002-01-07 Michael Snyder <msnyder@redhat.com> * gdb.base/huge.exp: New test. Print a very large target data object. @@ -3483,7 +4667,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) * gdb.base/break.exp: Fix HP specific search string when testing backtracing in a called function. - * gdb.base/constvars.exp: Only set lang to C++ if we're + * gdb.base/constvars.exp: Only set lang to C++ if we're compiling the test with HP's compilers. * gdb.base/volatile.exp: Similarly. @@ -3566,7 +4750,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) 2001-12-06 Michael Snyder <msnyder@redhat.com> - * gdb.asm/asm-source.exp: Add tests for info target, info symbol, + * gdb.asm/asm-source.exp: Add tests for info target, info symbol, and detect whether the start symbol has a leading underscore. 2001-12-04 Jim Blandy <jimb@redhat.com> @@ -3618,7 +4802,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) * gdb.asm/asm-source.exp: Recognize sparc target. * gdb.asm/configure.in: Recognize sparc target. * gdb.asm/configure: Regenerate. - + 2001-11-21 Michael Snyder <msnyder@redhat.com> * gdb.asm/m32r.inc: New file. @@ -3665,7 +4849,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) * gdb.mi/mi0-simplerun.exp: Likewise. * gdb.mi/mi-var-cmd.exp: Likewise. * gdb.mi/mi0-var-cmd.exp: Likewise. - + 2001-11-10 Andrew Cagney <ac131313@redhat.com> * gdb.asm/asmsrc1.s: Add ``gdbasm_'' prefix to all macros. @@ -3688,21 +4872,21 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) 2001-11-07 Michael Snyder <msnyder@redhat.com> - * gdb.c++/templates.exp (test_template_breakpoints): - If we get an overload menu, but it does not match what + * gdb.c++/templates.exp (test_template_breakpoints): + If we get an overload menu, but it does not match what we expect, we still need to issue the "cancel" command. * gdb.c++/templates.exp: Replace "void \\*" with "void ?\\*", making the whitespace optional. Argument for "new" may be "unsigned" as well as "unsigned int/long". - * gdb.c++/templates.exp: Replace "const &" with "const ?&", + * gdb.c++/templates.exp: Replace "const &" with "const ?&", making the whitespace optional. Also replace "(void) with "((void|)), making the keyword "void" optional. - * gdb.c++/virtfunc.exp: Replace "const &" with "const ?&", + * gdb.c++/virtfunc.exp: Replace "const &" with "const ?&", making the whitespace optional. Also replace "(void) with "((void|)), making the keyword "void" optional. * gdb.base/callfuncs.c (t_float_values): This function must _not_ be prototyped, and the following function (t_float_values2) - must be prototyped (if the compiler supports it), so that GDB + must be prototyped (if the compiler supports it), so that GDB can be tested against both cases. Usually one case involves promotion of float to double, while the other does not. * gdb.base/callfwmall.c: Ditto. @@ -3757,7 +4941,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) * gdb.base/ending-run.exp: Create identical output when passing `step to end of run' case. Add regular expression branch satisfying - Stormy16 target. + Stormy16 target. 2001-10-28 Mark Kettenis <kettenis@gnu.org> @@ -3965,7 +5149,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) 2001-07-17 Stephane Carrez <Stephane.Carrez@worldnet.fr> - * gdb.base/remote.c (RANDOM_DATA_SIZE): New define, defaults to 48K + * gdb.base/remote.c (RANDOM_DATA_SIZE): New define, defaults to 48K and defined to 1K for m68hc11. (random_data): Reduce table to 1K for embedded platforms (68hc11). * gdb.base/remote.exp (get_sizeof): New function from sizeof.exp. @@ -4051,13 +5235,13 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) 2001-06-04 Michael Snyder <msnyder@redhat.com> * gdb.threads/pthreads.exp (check_control_c): Return 0 for success, - non-zero if control_c fails. Terminate the test on failure, + non-zero if control_c fails. Terminate the test on failure, rather than wait for 12 more tests to time out. 2001-06-06 Jim Blandy <jimb@redhat.com> * gdb.base/exprs.exp ("sizeof (long long) > sizeof (long) (true)"): - Don't forget to match the GDB prompt. + Don't forget to match the GDB prompt. * gdb.trace/gdb_c_test.c, actions.c: Fix misspellings. @@ -4098,7 +5282,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) Don't assume that short is shorter than int. * gdb.base/exprs.exp ("print unsigned short == (~0)"): Don't assume that shorts are smaller than ints. On a 16-bit machine, - this isn't true. + this isn't true. ("print unsigned char == (~0)"): Add test that verifies that ~0, an int, is not equal to ~0 stored in an unsigned char. This tests the same thing that the previous test meant to, but works on @@ -4108,7 +5292,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) 2001-05-24 Michael Snyder <msnyder@redhat.com> * gdb.threads/pthreads.exp (all_threads_running): Add an explicit - test for (full_coverage == 0). This makes the test run faster, + test for (full_coverage == 0). This makes the test run faster, and prevents dejagnu getting out of step. 2001-05-23 Kevin Buettner <kevinb@redhat.com> @@ -4176,7 +5360,7 @@ Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com) * config/sid.exp (gdb_target_sid): Check for error messages. On error or timeout, don't make expect exit (which will terminate all subsequent tests); instead just make gdb exit. - (gdb_load): Check for error messages. On error or timeout, + (gdb_load): Check for error messages. On error or timeout, return a negative value. 2001-04-24 Jim Blandy <jimb@redhat.com> @@ -4422,7 +5606,7 @@ Sun Feb 4 17:32:21 2001 Andrew Cagney <cagney@redhat.com> 2001-01-25 matthew green <mrg@redhat.com> * config/sid.exp (sid_start): Use `remote_spawn' instead of `spawn.' - Deprecate $sid_spawn_id. + Deprecate $sid_spawn_id. (sid_exit): Remove code necessary only for `spawn.' 2001-01-25 matthew green <mrg@redhat.com> @@ -4470,7 +5654,7 @@ Fri Jan 12 18:29:01 2001 Andrew Cagney <cagney@b1.cygnus.com> 2000-12-18 Michael Snyder <msnyder@cygnus.com> - * gdb.base/setvar.exp: Use double '\\' to quote curly braces + * gdb.base/setvar.exp: Use double '\\' to quote curly braces in regexp. One '\' does not suffice on Linux. 2000-12-09 Michael Chastain <chastain@redhat.com> @@ -4549,7 +5733,7 @@ Fri Jan 12 18:29:01 2001 Andrew Cagney <cagney@b1.cygnus.com> * config/monitor.exp (gdb_target_cmd): Abstracts some of the code from gdb_target_monitor, so it can be used independantly for gdbserver. Also comment out an unnecessary PUTS. - + 2000-11-03 Michael Snyder <msnyder@cygnus.com> * gdb.base/a2-run.exp: Use gdb_skip_stdio_test. @@ -4629,7 +5813,7 @@ Fri Jan 12 18:29:01 2001 Andrew Cagney <cagney@b1.cygnus.com> gnu-oldld case on ARM. * gdb.base/watchpoint.exp (test_stepping): Clear xfail for ARM targets. - + Mon Jul 24 07:46:02 CDT 2000 Clinton Popetz <cpopetz@cygnus.com> * gdb.java/configure.in (AC_INIT): Use jmisc.exp. @@ -4685,7 +5869,7 @@ Tue Jul 4 03:43:49 2000 Andrew Cagney <cagney@b1.cygnus.com> compile/link program. Update line numbers. * gdb.asm/d10v.inc: Define ``startup''. * gdb.asm/asmsrc1.s: Add definition of _start. - + Fri Jun 23 17:45:52 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdb.base/call-ar-st.exp: More rewrites of multi-line patterns. @@ -4709,12 +5893,12 @@ Wed Jun 7 13:02:40 2000 Andrew Cagney <cagney@b1.cygnus.com> 2000-06-03 Daniel Berlin <dan@cgsoftware.com> * gdb.c++/templates.exp (do_tests): Make all of these work under - g++, and stop skipping them. + g++, and stop skipping them. * gdb.c++/namespace.exp: Move from gdb.hp/gdb.aCC to here, make it work under g++. - * gdb.c++/misc.cc: Fix ambiguous initialization with correct + * gdb.c++/misc.cc: Fix ambiguous initialization with correct initialization. 2000-06-02 Michael Snyder <msnyder@cygnus.com> @@ -4736,7 +5920,7 @@ Wed Jun 7 13:02:40 2000 Andrew Cagney <cagney@b1.cygnus.com> 2000-05-12 Kevin Buettner <kevinb@redhat.com> * gdb.base/step-test.exp: On IA-64 targets, when stepping out of - a call, do not require that gdb stop on the line after the call. + a call, do not require that gdb stop on the line after the call. Instead, it is permissible for gdb to stop on the line of the call itself. @@ -4753,7 +5937,7 @@ Wed Jun 7 13:02:40 2000 Andrew Cagney <cagney@b1.cygnus.com> 2000-05-08 Michael Snyder <msnyder@cygnus.com> - * gdb.base/interrupt.exp: Make "pass" message say "send" + * gdb.base/interrupt.exp: Make "pass" message say "send" rather than "send_gdb" (for consistancy). Mon May 1 15:37:58 2000 Andrew Cagney <cagney@b1.cygnus.com> @@ -4764,7 +5948,7 @@ Mon May 1 15:37:58 2000 Andrew Cagney <cagney@b1.cygnus.com> 2000-04-28 Michael Snyder <msnyder@cygnus.com> - * gdb.base/break.exp: When compiled with -O2 optimization, + * gdb.base/break.exp: When compiled with -O2 optimization, gdb may not stop at the first line of main, due to code motion. 2000-04-26 Michael Snyder <msnyder@cygnus.com> @@ -4858,7 +6042,7 @@ Mon Mar 27 14:46:37 2000 Andrew Cagney <cagney@b1.cygnus.com> 2000-03-13 James Ingham <jingham@leda.cygnus.com> * lib/gdb.exp: Fix the gdbtk_start routine to correctly find all - the library directories. + the library directories. Mon Feb 21 13:05:36 2000 Andrew Cagney <cagney@b1.cygnus.com> @@ -4866,7 +6050,7 @@ Mon Feb 21 13:05:36 2000 Andrew Cagney <cagney@b1.cygnus.com> * configure: Re-generate. * gdb.mi: New directory. - + 2000-02-25 Scott Bambrough <scottb@netwinder.org> * gdb.base/long_long.exp: Correct test suite failure when printing @@ -4927,7 +6111,7 @@ Mon Feb 21 13:05:36 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdb.base/so-indr-cl.exp: Don't execute the test if not on HPUX. Don't use xfail's because that affects only the following test. - + * gdb.base/so-impl-ld.exp: Don't execute the tests if not on hpux, solaris or linux. @@ -4935,7 +6119,7 @@ Mon Feb 21 13:05:36 2000 Andrew Cagney <cagney@b1.cygnus.com> 2000-01-07 Michael Snyder <msnyder@cygnus.com> - * gdb.base/display.exp: Some yacc parsers like to say + * gdb.base/display.exp: Some yacc parsers like to say "A syntax error" rather than "A parse error". Accept both. 2000-01-06 Fernando Nasser <fnasser@totem.to.cygnus.com> @@ -5062,13 +6246,13 @@ Sat Dec 4 15:21:18 1999 Andrew Cagney <cagney@b1.cygnus.com> * gdb.c++/derivation.exp: remove redundant get compiler info code. - * gdb.base/commands.exp: add '$gdb_prompt $' anchor to + * gdb.base/commands.exp: add '$gdb_prompt $' anchor to 'continue with watch' test point. 1999-11-08 Jim Blandy <jimb@zenia.red-bean.com> Merged from p2linux-990323-branch: - + * lib/gdb.exp (gdb_continue_to_breakpoint): New function. Mon Nov 8 23:07:09 1999 Andrew Cagney <cagney@amy.cygnus.com> @@ -5134,7 +6318,7 @@ Mon Oct 11 13:57:21 1999 Andrew Cagney <cagney@amy.cygnus.com> containing exp_continue into a while within an expect. Don't attempt a start more than three times. Check return value from gdb_load. - + Wed Oct 6 12:05:58 1999 Andrew Cagney <cagney@b1.cygnus.com> * gdb.base/watchpoint.exp: Match fail ``finish from marker1'' with @@ -5149,7 +6333,7 @@ Wed Oct 6 12:05:58 1999 Andrew Cagney <cagney@b1.cygnus.com> 1999-10-01 Fred Fish <fnf@cygnus.com> - * gdb.base/help.exp (help add-symbol-file): Update to match current + * gdb.base/help.exp (help add-symbol-file): Update to match current gdb output. 1999-09-18 Jim Blandy <jimb@cris.red-bean.com> @@ -5380,7 +6564,7 @@ Tue Aug 10 15:25:16 1999 Andrew Cagney <cagney@b1.cygnus.com> * gdb.c++/virtfunc.cc: Add return type and value for main. * gdb.c++/virtfunc.exp: Run if HP compiler used, add some match alternatives. - + 1999-07-30 Elena Zannoni <ezannoni@kwikemart.cygnus.com> * gdb.base/display.exp: Fix output of 'p/a &&j' test. @@ -5434,8 +6618,8 @@ Tue Aug 10 15:25:16 1999 Andrew Cagney <cagney@b1.cygnus.com> * gdb.c++/annota2.exp: Fix delete breakpoint query testcase. Fix run to main failures. Watchpoint can be hardware watchpoint. - - * gdb.base/annota1.exp: Clean up some more, in case printf has + + * gdb.base/annota1.exp: Clean up some more, in case printf has debug info. Deal with lack of signal hanlder info in stack. From Jim Kingdon <kingdon@redhat.com>: @@ -5577,7 +6761,7 @@ Fri Jun 25 19:27:28 1999 Andrew Cagney <cagney@b1.cygnus.com> print_double_array(double_array)", "continuing to breakpoint 1018", "print print_double_array(array_d)" and "continuing to 1034" tests. - + 1999-06-24 Jason Molenda (jsm@bugshack.cygnus.com) * Makefile.in: Add empty html and install-html targets. @@ -5650,9 +6834,9 @@ Wed Jun 2 17:37:05 1999 Andrew Cagney <cagney@b1.cygnus.com> 1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - * gdb.base/annota1.exp: Allow any number of "frames-invalid" and + * gdb.base/annota1.exp: Allow any number of "frames-invalid" and "breakpoint-invalid" to be printed. - * gdb.base/annota2.exp: Revise line number for main breakpoint. Allow any + * gdb.base/annota2.exp: Revise line number for main breakpoint. Allow any number of "frames-invalid" and "breakpoint-invalid" to be printed. * gdb.base/annota2.cc: Initialize a.x to 0. @@ -5669,7 +6853,7 @@ Wed Jun 2 17:37:05 1999 Andrew Cagney <cagney@b1.cygnus.com> "skip_float_tests" is set. * gdb.base/varargs.exp: Skip "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" when "skip_float_tests" set. - + 1999-05-06 Keith Seitz <keiths@cygnus.com> * gdb.base/annota2.cc: Include stdio.h. @@ -5751,7 +6935,7 @@ Wed May 5 17:44:31 1999 Stan Shebs <shebs@andros.cygnus.com> change, to mollify finicky HP compiler. * gdb.hp/reg-test.exp (testfile): Fix file name. * gdb.stabs/weird.exp: Don't try to run if HP compiler in use. - + * gdb.c++/misc.cc (main): Initialize obj_with_enum. * gdb.c++/classes.exp: Fix test of obj_with_enum values, allow alternate form of enum ptype. @@ -5770,7 +6954,7 @@ Wed May 5 17:44:31 1999 Stan Shebs <shebs@andros.cygnus.com> Tue Mar 23 14:56:36 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com> * gdb.base/commands.exp: Add test for correct position of '>' - when issuing the 'commands' command after a 'while' or 'if' + when issuing the 'commands' command after a 'while' or 'if' command. 1999-03-18 James Ingham <jingham@cygnus.com> @@ -5783,7 +6967,7 @@ Tue Mar 23 14:56:36 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com> * gdb.base/watchpoint.exp: Use gdb_continue_to_end. * gdb.base/step-test.exp: Catch a case where finish is broken and - keep it from killing the rest of the tests. + keep it from killing the rest of the tests. Use gdb_continue_to_end. * gdb.base/sigall.exp: use gdb_continue_to_end. @@ -5792,11 +6976,11 @@ Tue Mar 23 14:56:36 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com> * gdb.base/display.exp: use runto_main, not run. - * gdb.base/default.exp: Check for the current error message in the - r abbreviation test. + * gdb.base/default.exp: Check for the current error message in the + r abbreviation test. Add strongarm to the targets that know info float. - * gdb.base/condbreak.exp: Use the gdb_run command rather than just + * gdb.base/condbreak.exp: Use the gdb_run command rather than just run which doesn't work with monitors. * gdb.base/call-ar-st.exp: fixed bogus regexp in continuing to 1034 test. @@ -5804,8 +6988,8 @@ Tue Mar 23 14:56:36 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com> * gdb.base/break.exp: use the gdb_continue_to_end proc. * lib/gdb.exp: I had added gdb_continue_to_end used to run to the end of a - program. Traps the case (in Cygmon) when the program never really - exits. Same as Mark's continue_to_exit, but I had put it in a lot + program. Traps the case (in Cygmon) when the program never really + exits. Same as Mark's continue_to_exit, but I had put it in a lot more places, so I used my name. Sorry Mark... * config/monitor.exp (gdb_target_monitor): added another @@ -5843,7 +7027,7 @@ Fri Mar 12 18:06:21 1999 Stan Shebs <shebs@andros.cygnus.com> * gdb.base/call-ar-st.c (main): Terminate char_array with a null character, so GDB won't print garbage after its end. - + * gdb.base/call-ar-st.exp: Don't step into sum_array_print; set a breakpoint there instead. Sometimes GCC emits memcpy to handle the large structures being passed by value, so we step into that @@ -5867,7 +7051,7 @@ Fri Mar 12 18:06:21 1999 Stan Shebs <shebs@andros.cygnus.com> 1999-03-05 Nick Clifton <nickc@cygnus.com> - * gdb.base/a2-run.exp: Add expected fails for strongarm-coff. + * gdb.base/a2-run.exp: Add expected fails for strongarm-coff. 1999-03-04 Jim Blandy <jimb@zwingli.cygnus.com> @@ -5931,12 +7115,12 @@ Fri Feb 5 12:42:56 1999 Stan Shebs <shebs@andros.cygnus.com> * gdb.base/long_long.c (known_types): Initialize values to zero. * gdb.base/long_long.exp: Step one more line so 'dec' is initialized in "get to known place". GDB removes - leading zeros. Explicitly ask for hex formatting. Use + leading zeros. Explicitly ask for hex formatting. Use unique test case names. Tue Feb 2 10:16:08 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - * lib/gdb.exp (gdb_preprocess): Remove 'puts' statement. + * lib/gdb.exp (gdb_preprocess): Remove 'puts' statement. * gdb.c++/method.exp: Add missing close brace. @@ -5986,8 +7170,8 @@ Tue Jan 19 17:20:09 1999 David Taylor <taylor@texas.cygnus.com> Fri Jan 15 14:04:57 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com> - * gdb.hp/xdb3.exp: do not execute unless on hppa-hpux platform - and compiled w/o GCC. + * gdb.hp/xdb3.exp: do not execute unless on hppa-hpux platform + and compiled w/o GCC. * gdb.hp/watch-cmd.exp: ditto. @@ -6127,7 +7311,7 @@ Wed Jan 6 18:41:15 1999 David Taylor <taylor@texas.cygnus.com> * gdb.c++/ref-types.exp: new file. * gdb.c++/ref-types2.exp: new file. * gdb.c++/userdef.exp: new file. - + Wed Jan 6 13:50:57 1999 Stan Shebs <shebs@andros.cygnus.com> * gdb.base/default.exp: Reflect wording change in remote.c. @@ -6165,22 +7349,22 @@ Tue Jan 5 13:05:32 1999 David Taylor <taylor@texas.cygnus.com> * gdb.c++/ref-types.cc: new file. * gdb.c++/ref-types2.cc: new file. * gdb.c++/userdef.cc: new file. - + * gdb.base/scope.exp: compile one file at a time, then link. * gdb.base/langs.exp: ditto. * gdb.base/list.exp: ditto. - + Mon Jan 4 10:06:43 1999 David Taylor <taylor@texas.cygnus.com> The following changes were made by David Taylor <taylor@cygnus.com>, Elena Zannoni <ezannoni@cygnus.com>, and Edith Epstein <eepstein@cygnus.com> as part of a project to merge in changes by HP. - + * gdb.c++/inherit.exp: if on hppa*-*-hpux* and not using gcc, skip tests. When compiling pass c++ flag to gdb_compile. * gdb.c++/ - + * lib/gdb.exp (get_compiler_info): new, optional argument -- args; test for on hppa*-*-hpux*; use args to see if c++ was specified. (skip_hp_tests): new function. @@ -6209,7 +7393,7 @@ Mon Jan 4 10:06:43 1999 David Taylor <taylor@texas.cygnus.com> run the tests. tell gdb_compile that it's a c++ compilation. * gdb.threads/pthreads.exp: fix typo in message. - + * gdb.base/all-bin.exp: new file. * gdb.base/arithmet.exp: new file. * gdb.base/assign.exp: new file. @@ -6293,7 +7477,7 @@ Mon Dec 21 14:08:38 1998 David Taylor <taylor@texas.cygnus.com> T1<char>::~T1(void) (test_hp_style_demangling): new hp specific demangling test cases. - + Mon Dec 14 15:07:03 1998 Jeffrey A Law (law@cygnus.com) * gdb.trace/actions.exp: Ignore compiler warnings compiling actions.c @@ -6382,7 +7566,7 @@ Mon Sep 14 20:00:04 1998 Michael Snyder <msnyder@cygnus.com> * gdb.trace/{packetlen.exp passc-dyn.exp passcount.exp}: New files. * gdb.trace/{report.exp save-trace.exp tracecmd.exp}: New files. * gdb.trace/{while-dyn.exp while-stepping.exp}: New files. - + Fri Sep 11 13:58:02 1998 Michael Snyder <msnyder@cygnus.com> * gdb.c++/classes.exp: Change all regular expressions to match @@ -6413,7 +7597,7 @@ Thu Jul 16 18:20:46 1998 Jeffrey A Law (law@cygnus.com) Thurs Jul 9 11:08:31 1998 Dawn Perchik <dawn@cygnus.com> - * gdb.base/commands.exp: Break up infrun_breakpoint_command_test + * gdb.base/commands.exp: Break up infrun_breakpoint_command_test into two parts to get around a synchronization problem in expect. Fri Jun 26 14:27:13 1998 Keith Seitz <keiths@cygnus.com> @@ -6536,15 +7720,15 @@ Mon Apr 13 22:32:51 1998 Frank Ch. Eigler <fche@cygnus.com> Fri Apr 10 22:38:12 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * gdb.base/help.exp: Clean up `help set args' and `help show args' - tests. + tests. * gdb.base/interrupt.exp: Add "i*86-*-solaris2*" xfail for calling - function when asleep. + function when asleep. * gdb.base/signals.exp: Add "i*86-*-solaris2*" xfails. Add comment - for i*86 Linux and SVR4 signal handling problems. - Remove linux xfail for `next to handler in signals_tests_1', fixed - by recent infrun.c change. + for i*86 Linux and SVR4 signal handling problems. + Remove linux xfail for `next to handler in signals_tests_1', fixed + by recent infrun.c change. Limit backtrace to 10 frames to avoid timeout problems with infinite - stack backtraces. + stack backtraces. Adjust expect pattern in `handle all print' test to match Apr 28 1997 target.[ch] change. @@ -6581,7 +7765,7 @@ Mon Feb 23 08:22:44 1998 Mark Alexander <marka@cygnus.com> * config/mn10300-eval.exp: New file to support MN10300 eval board. Wed Feb 18 16:43:46 1998 Michael Snyder (msnyder@cygnus.com) - + * gdb.base/overlays (several files): Merge the two overlay managers into one. Change variables (foox, barx, bazx, grbxx) back into ints but force them to load in their proper sections. @@ -6604,7 +7788,7 @@ Tue Feb 10 17:23:22 1998 Andrew Cagney <cagney@b1.cygnus.com> * gdb.base/d10vovly.c (D10VTranslate): New function, handle updated d10v memory VMA/LMA map. (D10VCopy): Call D10VTranslate. - + Fri Feb 6 14:13:12 1998 Andrew Cagney <cagney@b1.cygnus.com> * gdb.base/m32rovly.c: Force variable _novlys into .data section. @@ -6618,12 +7802,12 @@ Fri Feb 6 14:13:12 1998 Andrew Cagney <cagney@b1.cygnus.com> * gdb.base/overlays.exp: Expect variables barx, bazx, foox, grbxx to be arrays. - + Thu Jan 29 14:48:19 1998 Michael Snyder (msnyder@cygnus.com) - + * gdb.base/overlays.exp: fix up and get working again. Add tests for backtraces from an overlay function. - + Fri Jan 23 07:52:45 1998 Fred Fish <fnf@cygnus.com> * gdb.base/watchpoint.exp: Set "d10v*-*-*" clear_xfail for @@ -6666,7 +7850,7 @@ Tue Nov 25 12:46:36 1997 Andrew Cagney <cagney@b1.cygnus.com> target_sizeof_long and target_bigendian_p. (structs_by_value, structs_by_reference): Check values according to targets word size and endianess. - + Mon Nov 24 16:37:06 1997 Andrew Cagney <cagney@b1.cygnus.com> * gdb.base/langs.exp: For "continue to exit" ignore any trailing @@ -6726,7 +7910,7 @@ Fri Sep 12 16:56:38 1997 Bob Manson <manson@charmed.cygnus.com> exists, reload the executable and do a "continue" instead of doing a jump. (runto_main): Use gdb_step_for_stub. - + * gdb.base/break.exp: Use gdb_step_for_stub. Also, rename certain tests to have unique names. * gdb.base/callfuncs.exp: Ditto. @@ -6737,7 +7921,7 @@ Fri Sep 12 16:56:38 1997 Bob Manson <manson@charmed.cygnus.com> * gdb.base/opaque.exp: Ditto. * gdb.base/printcmds.exp: Ditto. Use a loop to emit multiple similar tests. - + * gdb.base/setshow.c: Add set_debug_traps/breakpoint calls. * gdb.c++/cplusfuncs.cc: Ditto. * gdb.c++/virtfunc.cc: Ditto. @@ -6808,7 +7992,7 @@ Fri Jun 27 07:44:25 1997 Fred Fish <fnf@cygnus.com> * gdb.c++/inherit.exp: Ditto. * gdb.c++/templates.exp: Ditto. * gdb.c++/virtfunc.exp: Ditto. - + Wed Jun 25 09:08:51 1997 Bob Manson <manson@charmed.cygnus.com> * lib/gdb.exp(default_gdb_exit): Don't give an error if the remote @@ -6939,7 +8123,7 @@ Thu May 1 18:01:50 1997 Bob Manson <manson@charmed.cygnus.com> Mon Apr 28 17:27:40 1997 Michael Snyder <msnyder@cygnus.com> - * gdb.base/printcmds.exp: add a couple more tests a la + * gdb.base/printcmds.exp: add a couple more tests a la "p 123DEADBEEF", to check parse_number. * top.c: change "to enable to enable" to "to enable" in a couple of help strings. @@ -6948,7 +8132,7 @@ Thu Apr 24 14:38:18 1997 Jeffrey A Law (law@cygnus.com) * gdb.base/callfuncs.exp: Mark some tests as expected to fail on the mn10300. - + Mon Apr 21 15:05:42 1997 Fred Fish <fnf@cygnus.com> * gdb.base/a2-run.exp: Add arm-*-coff setup_xfails for cases @@ -6993,7 +8177,7 @@ Thu Apr 3 15:21:26 1997 Michael Snyder <msnyder@cygnus.com> d10v.ld m32r.ld d10vovly.c m32rovly.c: add test case for overlays. * gdb.base/sigall.c: add usestubs code frag * gdb.base/watchpoint.exp: turn on complex watchpoint test for M32R. - + Thu Apr 3 09:38:53 1997 Bob Manson <manson@charmed.cygnus.com> * lib/gdb.exp(gdb_suppress_tests): Add explanation for subsequent @@ -7148,7 +8332,7 @@ Sun Feb 23 19:56:02 1997 Bob Manson <manson@charmed.cygnus.com> * config/vr4300.exp: New file. * gdb.*/*.exp: Call gdb_expect instead of expect. - + * lib/gdb.exp(gdb_expect): New function. Thu Feb 20 13:57:01 1997 Bob Manson <manson@charmed.cygnus.com> @@ -7323,7 +8507,7 @@ Sun Feb 2 00:55:14 1997 Bob Manson <manson@charmed.cygnus.com> Sat Feb 1 23:51:01 1997 Bob Manson <manson@charmed.cygnus.com> * gdb.*/*.exp: Replace $prompt with $gdb_prompt. - + * gdb.base/scope.exp: Use gdb_test. * gdb.c++/classes.exp: Ditto. * gdb.c++/inherit.exp: Ditto. @@ -7353,7 +8537,7 @@ Thu Jan 30 16:49:25 1997 Bob Manson <manson@charmed.cygnus.com> Tue Jan 28 14:42:31 1997 Bob Manson <manson@charmed.cygnus.com> Major rewrite for testsuite revision. - + * lib/gdb.exp: Remove references to global CC, CXX, B_OPTIONS, TARGET_INCLUDES, LDFLAGS and target_alias. Use gdb_spawn_id instead of relying on spawn_id to always contain a valid @@ -7361,7 +8545,7 @@ Tue Jan 28 14:42:31 1997 Bob Manson <manson@charmed.cygnus.com> (get_compiler_info): New procedure to build the ${binfile}.ci file, instead of replicating this in N different places. (gdb_compile): New procedure. - + gdb.*/*.exp: Use gdb_compile and get_compiler_info (with appropriate arguments) instead of compile. Use gdb_test in a lot more places. Use send_gdb instead of send. Always run gdb_start @@ -7425,7 +8609,7 @@ Sat Nov 23 13:32:15 1996 Fred Fish <fnf@cygnus.com> * gdb.base/signals.exp (signal_tests_1): Remove setup_xfail "i*86-*-linux" for "signal SIGUSR1". Now works, at least with RedHat 4.0. - + * gdb.threads/pthreads.c (_MIT_POSIX_THREADS): Define if target is linux. This allows the test case to at least compile on latest linux, but still not run due to missing the threads runtime library. @@ -7454,7 +8638,7 @@ Thu Nov 21 09:17:19 1996 Fred Fish <fnf@cygnus.com> (xgcc): Set variable to full path of gcc in build tree. Use findfile to verify that gcc exists in build tree, and if so set CC to that gcc and to use B_OPTIONS and TARGET_INCLUDES. - + Tue Nov 12 16:20:13 1996 Fred Fish <fnf@cygnus.com> * gdb.c++/inherit.exp (test_print_anon_union): Reenable @@ -7498,7 +8682,7 @@ Tue Nov 5 10:44:23 1996 Michael Snyder <msnyder@cygnus.com> * gdb.base/[bitfields.exp crossload.exp funcargs.exp interrupt.exp list.exp scope.exp watchpoint.exp] Make all timeout error msgs explicitly say "(timeout)". - + Mon Nov 4 12:03:06 1996 Michael Snyder <msnyder@cygnus.com> * config/monitor.exp: Increase download timeout to 1000 seconds. @@ -7567,7 +8751,7 @@ Fri Oct 11 17:05:22 1996 Fred Fish <fnf@cygnus.com> (distclean maintainer-clean realclean): No need to remove files twice. Nuke the duplicates. * gdb.base/Makefile.in (EXECUTABLES): Add "structs". - * gdb.threads/Makefile.in (distclean maintainer-clean realclean): + * gdb.threads/Makefile.in (distclean maintainer-clean realclean): Remove config.h along with other config files. Mon Sep 30 20:16:22 1996 Fred Fish <fnf@cygnus.com> @@ -7592,7 +8776,7 @@ Mon Sep 30 20:16:22 1996 Fred Fish <fnf@cygnus.com> * lib/gdb.exp (gdb_test): When a gdb aborts, print a more meaningful error message and return -1 so the caller can suppress further tests and avoid a cascade of errors. - + Fri Sep 27 10:34:51 1996 Fred Fish <fnf@cygnus.com> * gdb.base/a1-selftest.exp: Tweak tests to account for new @@ -7600,7 +8784,7 @@ Fri Sep 27 10:34:51 1996 Fred Fish <fnf@cygnus.com> * gdb.base/default.exp: Ditto. * gdb.base/interrupt.exp: Fix problem with cascade of errors if child process dies while calling a function. - + Fri Sep 13 21:43:48 1996 Fred Fish <fnf@cygnus.com> * Makefile.in (VPATH): Add @@ -7632,7 +8816,7 @@ Mon Sep 2 06:36:02 1996 Fred Fish <fnf@cygnus.com> executable, give more meaningful message. * gdb.threads/pthreads.c: Hpux also uses old definition of second arg for pthread_create. - + Mon Aug 19 09:58:59 1996 Fred Fish <fnf@cygnus.com> * gdb.threads/pthreads.c (PTHREAD_CREATE_ARG2, @@ -7651,7 +8835,7 @@ Mon Aug 19 09:58:59 1996 Fred Fish <fnf@cygnus.com> for not compiled with gcc. * gdb.base/mips_pro.exp: Only do setup_xfail hppa*-*-* for backtrace when compiled with gcc. - * lib/gdb.exp (runto_main): Return result of "runto main" rather + * lib/gdb.exp (runto_main): Return result of "runto main" rather than always return success. Sat Aug 17 13:28:00 1996 Fred Fish <fnf@cygnus.com> @@ -7675,7 +8859,7 @@ Mon Aug 12 15:29:08 1996 Fred Fish <fnf@cygnus.com> tests. gdb.c++/virtfunc.exp (do_tests): Add "mips-*-irix5*" setup_xfail for "runto test_calls(void)" test. - + Sun Aug 11 13:11:24 1996 Fred Fish <fnf@cygnus.com> * gdb.base/term.exp: Set 7-bit strings, address off, width to 0, @@ -7714,7 +8898,7 @@ Wed Aug 7 11:05:47 1996 Fred Fish <fnf@cygnus.com> * gdb.threads/{config.in, pthreads.c, pthreads.exp}: New. * gdb.threads/{Makefile.in, configure.in}: Complete rewrites. * gdb.threads/configure: New, generated with autoconf. - + Tue Aug 6 10:23:04 1996 Tom Tromey <tromey@rtl.cygnus.com> * lib/gdb.exp (gdb_test_exact): Turn \n in pattern into \r\n. @@ -7784,9 +8968,9 @@ Tue Jun 25 23:16:58 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) Tue Jun 25 17:02:39 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) * configure.in (AC_PREREQ): autoconf 2.5 or higher. - * gdb.{base,c++,chill,disasm,stabs}/Makefile.in (VPATH): set to + * gdb.{base,c++,chill,disasm,stabs}/Makefile.in (VPATH): set to @srcdir@. - * gdb.{base,c++,chill,disasm,stabs}/configure.in (AC_PREREQ): + * gdb.{base,c++,chill,disasm,stabs}/configure.in (AC_PREREQ): autoconf 2.5 or higher. * gdb.{base,c++,chill,disasm,stabs}/configure: Rebuilt. @@ -7850,7 +9034,7 @@ Wed May 15 08:47:42 1996 Jeffrey A Law (law@cygnus.com) * gdb.base/ptype.exp: Likewise. * gdb.base/setvar.exp: Handle sizeof (int) != 4 for h8300. Add h8300 xfails. - * gdb.base/return.exp: Handle float/double precision problems + * gdb.base/return.exp: Handle float/double precision problems on the h8300. * gdb.base/funcargs.c: Explicitly make last constant argument to call_after_alloca_subr an unsigned long type. @@ -7887,13 +9071,13 @@ Wed Mar 20 08:48:03 1996 Fred Fish <fnf@cygnus.com> gdb.stabs/weird.exp: Remove use of compiler options "-c -o ..." since some compilers don't allow both options to be given on the same command line. Create object file and move it. - + Tue Mar 19 23:49:31 1996 Fred Fish <fnf@cygnus.com> * gdb.base/corefile.exp: Always regenerate the core file, since we always regenerate the coremaker program. Detect special case where registers cannot be read from core file. - + Tue Mar 19 16:52:49 1996 Fred Fish <fnf@cygnus.com> From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE> @@ -7906,7 +9090,7 @@ Tue Mar 19 16:52:49 1996 Fred Fish <fnf@cygnus.com> * configure: Regenerate. * gdb.base/Makefile.in (clean): Remove generated file twice-tmp.c here, rather than in distclean. - + Sun Mar 17 13:35:31 1996 Fred Fish <fnf@cygnus.com> * gdb.base/mips_pro.exp: Create mips_pro.ci to get gcc_compiled @@ -7944,10 +9128,10 @@ Fri Mar 15 17:49:57 1996 Fred Fish (fnf@cygnus.com) * gdb.base/ptype.exp: Change "i*86-*-sysv4*" setup_xfail for "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)" and "ptype t_char_array" to be for native cc only. - + Fri Mar 15 16:17:22 1996 Fred Fish <fnf@cygnus.com> - * gdb.base/corefile.exp: Remove "alpha-dec-osf2*" native compiled + * gdb.base/corefile.exp: Remove "alpha-dec-osf2*" native compiled setup_xfail for "print coremaker_bss", "print coremaker_ro", "print func2::coremaker_local", and "backtrace in corefile.exp". @@ -7990,7 +9174,7 @@ Sun Feb 18 11:39:12 1996 Fred Fish <fnf@cygnus.com> Change "alpha-dec-osf2*" setup_xfail for "bt in signals.exp" to be for gcc only. * lib/gdb.exp: Move verbose statements outside conditionals. - + Sat Feb 17 02:22:14 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * gdb.base/sigall.exp: Remove setup_xfail for irix4. Fixed by @@ -8068,7 +9252,7 @@ Mon Jan 15 09:33:00 1996 Fred Fish <fnf@cygnus.com> * gdb.stabs/configure.in (alpha-*-*,mips-*-*): Replace [] tests with "test" and enclose string in quotes. * gdb.stabs/configure: Rebuild - + Thu Jan 11 09:43:14 1996 Tom Tromey <tromey@creche.cygnus.com> Changes in sync with expect: @@ -8092,7 +9276,7 @@ Wed Jan 3 01:30:41 1996 Jeffrey A Law (law@cygnus.com) * gdb.stabs/weird.exp: Use ${target_triplet} to determine which sed script to run. Expect failure for v_comb test on PA targets too. - + Sat Dec 30 16:09:04 1995 Fred Fish <fnf@rtl.cygnus.com> * gdb.base/corefile.exp: Remove "i*86-*-linux" xfail for @@ -8174,7 +9358,7 @@ Sat Nov 25 11:03:42 1995 Fred Fish <fnf@cygnus.com> to returns as necessary, arrange for test to compile own testcase executable. * lib/gdb.exp: Changes for testsuite to compile own test cases. - + Tue Nov 21 16:15:45 1995 Fred Fish <fnf@cygnus.com> * gdb.c++/classes.exp (test_pointers_to_class_members): Add @@ -8239,13 +9423,13 @@ Wed Oct 18 11:27:47 1995 Jeffrey A Law (law@cygnus.com) Tue Oct 17 23:02:12 1995 Jeffrey A Law (law@cygnus.com) - * Many files: When warning about suppressed tests due to a + * Many files: When warning about suppressed tests due to a nonexistant test binary, avoid incrementing the warning count. Tue Oct 10 11:00:41 1995 Fred Fish <fnf@cygnus.com> * Makefile.in (TARGET_FLAGS_TO_PASS): Remove BISON. - + Sun Oct 8 04:23:14 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * gdb.base/return.exp: Change xfail from "sparc-*-solaris2.*" to @@ -8351,7 +9535,7 @@ Sat Sep 2 06:41:26 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) Sat Sep 2 00:17:31 1995 Fred Fish <fnf@cygnus.com> - * gdb.base/callfuncs.exp (do_function_calls): Remove + * gdb.base/callfuncs.exp (do_function_calls): Remove mips-sgi-irix* xfail for "call inferior func with struct - returns char *" and fix test so that an optional (unsigned char *) cast is @@ -8367,7 +9551,7 @@ Fri Sep 1 13:42:01 1995 Fred Fish <fnf@cygnus.com> Sun Aug 27 23:35:35 1995 Fred Fish <fnf@cygnus.com> - * gdb.base/callfuncs.exp (do_function_calls): Add alpha-dec-osf2* + * gdb.base/callfuncs.exp (do_function_calls): Add alpha-dec-osf2* clear_xfail for "p t_float_values2(3.14159,float_val2)" for gcc compiled test. * gdb.base/opaque.exp (setup_xfail_on_opaque_pointer): @@ -8407,11 +9591,11 @@ Sun Aug 27 23:35:35 1995 Fred Fish <fnf@cygnus.com> * gdb.base/callfuncs.exp (do_function_calls): Add mips-sgi-irix* xfail, when compiled with native compiler, for "call inferior func with struct - returns char *". - * gdb.base/return.exp (return_tests): Change xfail for + * gdb.base/return.exp (return_tests): Change xfail for "correct value returned double test" to include Solaris 2.4. * gdb.base/funcargs.exp (float_and_integral_args): Add sparc-sun-solaris2* xfail for "print f1 after run to call2a". - + Sat Aug 26 00:26:11 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * gdb.base/setvar.c, gdb.base/setvar.exp: Add new tests for @@ -8480,14 +9664,14 @@ Tue Aug 15 09:42:44 1995 Fred Fish <fnf@cygnus.com> "print 'scope1.c'::bar::funclocal" and "print 'scope1.c'::bar::funclocal_bss" to only be xfail'd when not compiled with gcc. - Add rs6000-*-* xfail for + Add rs6000-*-* xfail for "print 'scope0.c'::filelocal_bss before run" when compiled with gcc. (test_at_main): Add rs6000-*-* xfail for "print filelocal_ro in test_at_main" when compiled with gcc. * gdb.base/ptype.exp: Source gdb.base/ptype.ci. - Add rs6000-*-aix* xfail for + Add rs6000-*-aix* xfail for "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)" and "ptype t_char_array", not compiled with gcc. * gdb.base/list.exp (test_list_function): Add rs6000-*-* @@ -8530,7 +9714,7 @@ Tue Aug 15 09:42:44 1995 Fred Fish <fnf@cygnus.com> * gdb.base/opaque.exp: Source gdb.base/opaque0.ci rather than opaque-info.exp. Setup rs6000-*-* xfail for - "ptype on opaque struct pointer (statically)" and + "ptype on opaque struct pointer (statically)" and "ptype on opaque struct pointer (dynamically)" when not compiled with gcc. * gdb.base/callfuncs.exp: Source gdb.base/callfuncs.ci @@ -8557,7 +9741,7 @@ Tue Aug 15 09:42:44 1995 Fred Fish <fnf@cygnus.com> Add rs6000-*-* xfail for "up to foo in langs.exp" "up to cppsub_ in langs.exp" and "up to fsub in langs.exp" when not gcc compiled. - + Sat Aug 12 15:05:36 1995 Jeffrey A. Law <law@rtl.cygnus.com> * gdb.base/callfuncs.exp: Add xfails for the powerpc. @@ -8588,7 +9772,7 @@ Mon Aug 14 09:01:59 1995 Fred Fish <fnf@cygnus.com> "print 'scope0.c'::filelocal_bss in test_at_foo", "print 'scope0.c'::filelocal at bar", "print 'scope0.c'::filelocal_bss in test_at_bar" - + * gdb.base/list.exp: Remove rs6000-*-* xfail for "list function in source file 1". This bug seems to have been fixed with both gcc and native cc (was native assembler bug?). @@ -8613,7 +9797,7 @@ Wed Aug 9 08:04:12 1995 Fred Fish (fnf@cygnus.com) * gdb.base/callfuncs.exp: Change xfail to "i*86-*-*" for "call inferior function with struct - returns float" and "call inferior function with struct - returns double". - + Mon Aug 7 02:43:28 1995 Jeff Law (law@snake.cs.utah.edu) * gdb.disasm/sh3.s: Source for sh3 disassembler tests. @@ -9718,7 +10902,7 @@ Fri Nov 25 13:37:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) and 'value' method to T5 class for template tests. * gdb.c++/templates.exp: Add testcases for printing of template types, setting breakpoints on template methods and calling a - template method. + template method. Sat Nov 5 00:20:17 1994 Jeff Law (law@snake.cs.utah.edu) @@ -10161,7 +11345,7 @@ Thu Apr 21 12:48:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com) Thu Apr 21 11:54:04 1994 Kung Hsu (kung@mexican.cygnus.com) - * gdb.t24/demangle.exp: change expect pattern of + * gdb.t24/demangle.exp: change expect pattern of __t10ListS_link1ZUiRCUiPT0 Wed Apr 13 15:05:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu) @@ -10228,7 +11412,7 @@ Wed Mar 30 00:31:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) Tue Mar 29 23:55:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu) - * gdb.t07/watchpoint.exp (test_watchpoint_triggered_in_syscall): + * gdb.t07/watchpoint.exp (test_watchpoint_triggered_in_syscall): Fix typo(s). Sun Mar 27 16:53:14 1994 Jeffrey A. Law (law@snake.cs.utah.edu) @@ -10300,7 +11484,7 @@ Thu Feb 24 19:49:25 1994 Rob Savoye (rob@poseidon.cygnus.com) one from the path. * Makefile.in: Use a fresh expect if there is one, use runtest from the src tree if there is one. - + Thu Feb 24 18:49:37 1994 Jim Kingdon (kingdon@deneb.cygnus.com) * gdb.t06/break.exp (test_next_with_recursion): Remove xfail for @@ -10487,7 +11671,7 @@ Thu Jan 13 17:16:09 1994 Stan Shebs (shebs@andros.cygnus.com) * Makefile.in: Pass LDFLAGS and LIBS to sub-makes. * gdb.t06/configure.in: Don't try to compile signals test program - if doing mips-idt-ecoff. + if doing mips-idt-ecoff. Thu Jan 13 08:25:55 1994 Rob Savoye (rob@darkstar.cygnus.com) @@ -10635,7 +11819,7 @@ Tue Oct 19 14:57:38 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * gdb.t15/funcargs.exp: Don't put comments on same line as setup_xfail (@#$*%& tcl braindamage!). - + Mon Oct 18 21:50:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * gdb.disasm/hppa.exp: Use $objdir/$subdir/$binfile not just $binfile. @@ -10926,7 +12110,7 @@ Thu Aug 12 15:24:28 1993 Fred Fish (fnf@deneb.cygnus.com) * Makefile.in (distclean): Remove *.log *.plog *.sum *.psum site.*. * gdb.t17/interrupt.exp: Fix 'missing Continuing' case so pattern - to match does not match the passing case but still matches the + to match does not match the passing case but still matches the failing case. Thu Aug 12 16:58:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com) @@ -11588,7 +12772,7 @@ Thu Mar 25 21:05:16 1993 Fred Fish (fnf@cygnus.com) * gdb.t10/crossload.exp: Disable the i860-elf test until such time as i860 support works. - * gdb.t15/funcargs.exp: Fix expected outputs to include + * gdb.t15/funcargs.exp: Fix expected outputs to include "backtrace 100\r" rather than just "backtrace\r", to match last change. @@ -11767,7 +12951,7 @@ Wed Feb 24 08:03:38 1993 Fred Fish (fnf@cygnus.com) * gdb.t31/chillvars.exp (test_strings): Expect "CHAR" now, rather than "char". * gdb.t31/in-gdbme.ch (simple_struct, nested_struct, struct1, - struct2): New struct definitions and initializations to test + struct2): New struct definitions and initializations to test simple Chill STRUCT types. Tue Feb 23 11:55:06 1993 Fred Fish (fnf@cygnus.com) @@ -11809,11 +12993,16 @@ Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com) will allow them to work with the new version of dejagnu will be made in a future update. -For additional changes see gdb.mi/ChangeLog-1999-2003. + For additional changes see gdb.mi/ChangeLog-1999-2003. -Local Variables: -mode: change-log -left-margin: 8 -fill-column: 74 -version-control: never -End: +;; Local Variables: +;; mode: change-log +;; left-margin: 8 +;; fill-column: 74 +;; version-control: never +;; End: + + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. + Copying and distribution of this file, with or without modification, + are permitted provided the copyright notice and this notice are preserved. diff --git a/gnu/usr.bin/binutils/gdb/testsuite/Makefile.in b/gnu/usr.bin/binutils/gdb/testsuite/Makefile.in index 3f3b7ad2bb9..5aa82622dd7 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/Makefile.in +++ b/gnu/usr.bin/binutils/gdb/testsuite/Makefile.in @@ -1,5 +1,5 @@ # Makefile for regression testing the GNU debugger. -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003 +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # This file is part of GDB. @@ -35,8 +35,10 @@ SHELL = @SHELL@ EXEEXT = @EXEEXT@ SUBDIRS = @subdirs@ RPATH_ENVVAR = @RPATH_ENVVAR@ -ALL_SUBDIRS = gdb.arch gdb.asm gdb.base gdb.cp gdb.disasm gdb.java gdb.mi \ - gdb.objc gdb.threads gdb.trace $(SUBDIRS) +ALL_SUBDIRS = gdb.ada gdb.arch gdb.asm gdb.base gdb.cp gdb.disasm \ + gdb.dwarf2 \ + gdb.fortran gdb.java gdb.mi gdb.objc gdb.threads gdb.trace \ + $(SUBDIRS) EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ echo $${rootme}/../../expect/expect ; \ diff --git a/gnu/usr.bin/binutils/gdb/testsuite/config/gdbserver.exp b/gnu/usr.bin/binutils/gdb/testsuite/config/gdbserver.exp index ed812f81aa4..6dc6b23f494 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/config/gdbserver.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/config/gdbserver.exp @@ -207,7 +207,7 @@ proc gdb_load { arg } { } } - set res [gdbserver_gdb_load $host_exec] + set res [gdbserver_gdb_load $server_exec] set protocol [lindex $res 0] set gdbport [lindex $res 1] diff --git a/gnu/usr.bin/binutils/gdb/testsuite/config/hppro.exp b/gnu/usr.bin/binutils/gdb/testsuite/config/hppro.exp deleted file mode 100644 index e341ae6e9e5..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/config/hppro.exp +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 1997 Free Software Foundation, Inc. - -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -load_lib ../config/monitor.exp - -# Hppro monitor is very slow... -set timeout 540 -verbose "Timeout is now $timeout seconds" 2 diff --git a/gnu/usr.bin/binutils/gdb/testsuite/config/sparclet.exp b/gnu/usr.bin/binutils/gdb/testsuite/config/sparclet.exp deleted file mode 100644 index 4e2e96b60d9..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/config/sparclet.exp +++ /dev/null @@ -1,388 +0,0 @@ -# Copyright 1996, 1997 Free Software Foundation, Inc. - -# 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. - -# This file was written by Michael Snyder <msnyder@cygnus.com>. - -# GDB support routines for a board using the sparclet remote debugging -# protocol. - -load_lib remote.exp -load_lib gdb.exp - -# -# Sparclet remote run command. -# - -proc gdb_start { } { - global gdb_prompt - - if ![file exists loader] { - global libdir - set loader loader; - - if [target_info exists gdb_stub_offset] { - set result [target_compile "${libdir}/stub-loader.c" $loader executable "libs=-Wl,-Ttext,[target_info gdb_stub_offset]"]; - } else { - set result [target_compile "${libdir}/stub-loader.c" $loader executable "ldscript=[target_info gdb_stub_ldscript]"]; - } - } - - verbose -log "$gdb_prompt is gdb prompt" - - set result 0; - for { set y 0; } { $y < 4 } { incr y } { - if { [default_gdb_start] != 0 } { - return -1; - } - - if [target_info exists baud] { - send_gdb "set remotebaud [target_info baud]\n" - gdb_expect { - -re "$gdb_prompt" { } - default { - perror "Error setting baud rate." - return -1; - } - } - } - - for {set x 1;} { $x < 4 } {incr x} { - set result [gdb_sparclet_startup $result]; - if { $result > 0 } { - return 1; - } - # mmmmm, magic numbers. - if { $result == -42 || $result == -43 } { - break; - } else { - reboot_target; - } - } - if { $x == 4 } { - return -1; - } - gdb_exit; - sleep 5; - } - return -1; -} - -proc gdb_sparclet_startup { arg } { - global gdb_prompt - global GDB - global verbose - - set is_running_stub 0; - - if [target_info exists serial] { - set serial [target_info serial]; - } else { - set serial [target_info netport]; - } - set protocol [target_info gdb_protocol]; - set check_stub 1; - if { $arg != -42 } { - send_gdb "target $protocol $serial\n"; - # 10 seconds may be a bit short. - gdb_expect 10 { - -re "already.*y or n." { - gdb_send "y\n"; - exp_continue; - } - -re "Remote target.*connected to.*$gdb_prompt" { set check_stub 0; } - -re "$gdb_prompt" { } - timeout { } - } - if { $check_stub } { - verbose "timed out, checking if stub is already running" - send_gdb "\003"; - sleep 1; - send_gdb "\003"; - gdb_expect 10 { - -re "$gdb_prompt" { } - default { - remote_close host; - return -42; - } - } - } - } - if [target_info exists gdb_serial] { - set gdb_serial [target_info gdb_serial]; - } else { - set gdb_serial $serial; - } - if { $check_stub } { - send_gdb "target remote $gdb_serial\n"; - gdb_expect 15 { - -re "Remote debugging.*$gdb_prompt" { - verbose "stub is already running" - set is_running_stub 1; - } - default { - warning "board isn't responding"; - remote_close host; - remote_reboot target; - return -43; - } - } - } - - if { $is_running_stub == 0 } { - global srcdir - - if [is_remote host] { - set loader [remote_download host "loader"]; - } else { - set loader "loader"; - } - send_gdb "file $loader\n"; - gdb_expect { - -re "A program is being debug.*Kill it.*y or n. $" { - send_gdb "y\n" - exp_continue - } - -re "Load new symbol table.*y or n. $" { - send_gdb "y\n" - exp_continue - } - -re "Reading symbols from.*done..*$gdb_prompt $" {} - -re "$gdb_prompt $" { perror "GDB couldn't find loader" } - timeout { - perror "(timeout) read symbol file" ; - return -1 - } - } - - send_gdb "target $protocol $serial\n"; - gdb_expect { - -re "Remote target.*connected to.*$gdb_prompt" { } - default { - perror "Error reconnecting to board."; - return -1; - } - } - - send_gdb "load $loader [target_info gdb_stub_offset]\n" - verbose "Loading $loader into $GDB" 2 - set no_run_command 0; - gdb_expect 1200 { - -re "Loading.*$gdb_prompt $" { - verbose "Loaded $loader into $GDB" 1 - } - -re "Transfer rate:.*Switching to remote protocol.*Remote debugging" { - set no_run_command 1; - } - -re "$gdb_prompt $" { - if $verbose>1 then { - perror "GDB couldn't load." - } - } - timeout { - if $verbose>1 then { - perror "Timed out trying to load $arg." - } - } - } - - if !$no_run_command { - send_gdb "run\n"; - gdb_expect 60 { - -re "A program is being debug.*Kill it.*y or n. $" { - send_gdb "y\n" - exp_continue - } - -re "The program being debugged .*y or n. $" { - send_gdb "y\n" - exp_continue - } - -re "Starting program:.*loader.*$" { - verbose "Starting loader succeeded" - } - timeout { - perror "(timeout) starting the loader" ; - return -1 - } - default { - perror "error starting the loader"; - } - } - } - sleep 2; - send_gdb "" - sleep 1; - send_gdb "" - verbose "Sent ^C^C" - gdb_expect 10 { - -re "Give up .and stop debugging it.*$" { - send_gdb "y\n" - exp_continue - } - -re "$gdb_prompt $" { - verbose "Running loader succeeded" - } - timeout { - warning "(timeout) interrupting the loader" ; - remote_close host; - } - default { - warning "error interrupting the loader"; - } - } - - gdb_exit; - return [gdb_start]; - } - return 1; -} - -proc gdb_run_cmd { args } { - global gdb_prompt - - gdb_breakpoint exit; - send_gdb "set \$fp=0\n"; - gdb_expect { - -re "$gdb_prompt" { } - } - # This is needed for the SparcLite. Whee. - if [target_info exists gdb,start_symbol] { - set start_comm "jump *[target_info gdb,start_symbol]\n"; - } else { - set start_comm "jump *start\n"; - } - send_gdb "break copyloop\n"; - gdb_expect 10 { - -re "Breakpoint.*$gdb_prompt $" { - set start_comm "continue\n"; - } - -re "$gdb_prompt $" { } - timeout { warning "break copyloop failed badly"; } - } - send_gdb $start_comm; - gdb_expect 10 { - -re "y or n. $" { - remote_send host "y\n" - exp_continue; - } - -re "Breakpoint.*in copyloop.*$gdb_prompt $" { - remote_send host "jump relocd\n"; - exp_continue; - } - -re "Continuing at.*\[\r\n\]" { } - default { - return -1; - } - } - - return ""; -} - - -# -# gdb_load -- load a file into the GDB. -# Returns a 0 if there was an error, -# 1 if it load successfully. -# -proc gdb_load { arg } { - global verbose - global loadpath - global loadfile - global gdb_prompt - global GDB - global expect_out - - set loadfile [file tail $arg] - set loadpath [file dirname $arg] - - set protocol [target_info gdb_protocol]; - - if [is_remote host] { - set arg [remote_download host $arg]; - } - send_gdb "file $arg\n" - gdb_expect 30 { - -re "A program is being debug.*Kill it.*y or n. $" { - send_gdb "y\n" - exp_continue - } - -re "Load new symbol table.*y or n. $" { - send_gdb "y\n" - exp_continue - } - -re "Reading symbols from.*done..*$gdb_prompt $" {} - -re "$gdb_prompt $" { perror "GDB couldn't read file" } - timeout { - perror "(timeout) read symbol file" ; - return -1 - } - } - - if [target_info exists gdb_serial] { - set gdb_serial [target_info gdb_serial]; - } else { - if [target_info exists serial] { - set gdb_serial [target_info serial]; - } else { - set gdb_serial [target_info netport]; - } - } - send_gdb "target remote $gdb_serial\n" - gdb_expect 30 { - -re "Kill it?.*y or n.*" { - send_gdb "y\n"; - exp_continue - } - -re "$gdb_prompt $" { - verbose "Set remote target to $gdb_serial" 2 - } - timeout { - perror "Couldn't set remote target." - return -1 - } - } - if [target_info exists gdb_load_offset] { - set offset "[target_info gdb_load_offset]"; - } else { - set offset ""; - } - send_gdb "load $arg $offset\n" - verbose "Loading $arg into $GDB" 2 - gdb_expect 1200 { - -re "Loading.*$gdb_prompt $" { - verbose "Loaded $arg into $GDB" 1 - } - -re "$gdb_prompt $" { - if $verbose>1 then { - perror "GDB couldn't load." - } - } - timeout { - if $verbose>1 then { - perror "Timed out trying to load $arg." - } - } - } - send_gdb "list main\n"; - gdb_expect 60 { - -re "$gdb_prompt" { } - default { - perror "command for list main never completed"; - return -1; - } - } - - return 0 -} diff --git a/gnu/usr.bin/binutils/gdb/testsuite/config/udi.exp b/gnu/usr.bin/binutils/gdb/testsuite/config/udi.exp deleted file mode 100644 index 4a35232729c..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/config/udi.exp +++ /dev/null @@ -1,110 +0,0 @@ -# Test Framework Driver for GDB driving Universal Debug Interface on 29K -# Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1997 -# Free Software Foundation, Inc. -# -# 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. - -# This file was written by Rob Savoye. (rob@cygnus.com) - -load_lib gdb.exp - -# -# gdb_target_udi -# Set gdb to the desired UDI target -# -proc gdb_target_udi { } { - global gdb_prompt - global verbose - global exit_status - - set targetname [target_info mondfe,name]; - # set targets hostname - send_gdb "target udi $targetname\n" - set timeout 60 - verbose "Timeout is now $timeout seconds" 2 - gdb_expect { - -re "target udi $targetname\[\r\n\]+" { - exp_continue - } - -re "TIP UDI 1.2 Conformant.*$gdb_prompt $" { - verbose "Set target to $targetname" - } - -re "TIP-ipc WARNING,.*failed:" { - warning "$expect_out(buffer)" - } - -re "TIP-ipc ERROR,.*failed:" { - perror "$expect_out(buffer)" - } - -re "A program is being debugged already. Kill it\? \(y or n\)" { - send "y\n" - exp_continue - } - timeout { - perror "Couldn't set target for UDI." - cleanup - exit $exit_status - } - } - set timeout 10 - verbose "Timeout is now $timeout seconds" 2 -} - -# -# gdb_load -- load a file into the debugger. -# return a -1 if anything goes wrong. -# - -proc gdb_load { arg } { - global verbose - global loadpath - global loadfile - global GDB - global gdb_prompt - - if [gdb_file_cmd $arg] { - return -1 - } - - gdb_target_udi -} - -# -# gdb_start -- start GDB running. This assumes that there the -# UDICONF enviroment variable is set. -# -proc gdb_start { } { - global env; - - set env(UDICONF) [target_info mondfe,udi_soc]; - default_gdb_start - verbose "Setting up target, Please wait..." - gdb_target_udi -} - -# -# gdb_exit -- exit gdb -# -proc gdb_exit { } { - catch default_gdb_exit - set in [open [concat "|ls -F"] r] - while {[gets $in line]>-1} { - if [regexp "=$" $line] then { - set line [string trimright $line "="] - verbose "Removing the $line named socket" - exec rm -f $line - } - } - close $in -} diff --git a/gnu/usr.bin/binutils/gdb/testsuite/configure b/gnu/usr.bin/binutils/gdb/testsuite/configure index 1419ba1f59c..43a843f3d8f 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/configure +++ b/gnu/usr.bin/binutils/gdb/testsuite/configure @@ -917,7 +917,7 @@ else if { (eval echo configure:918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1049,8 +1049,11 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo "Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ - gdb.cp/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \ +trap 'rm -fr `echo "Makefile \ + gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ + gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ + gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ + gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF @@ -1143,8 +1146,11 @@ EOF cat >> $CONFIG_STATUS <<EOF -CONFIG_FILES=\${CONFIG_FILES-"Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ - gdb.cp/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \ +CONFIG_FILES=\${CONFIG_FILES-"Makefile \ + gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ + gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ + gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ + gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile"} EOF cat >> $CONFIG_STATUS <<\EOF diff --git a/gnu/usr.bin/binutils/gdb/testsuite/configure.in b/gnu/usr.bin/binutils/gdb/testsuite/configure.in index 49b0444ad88..02c0a04e9e0 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/configure.in +++ b/gnu/usr.bin/binutils/gdb/testsuite/configure.in @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -# Copyright 2002, 2003 +# Copyright 2002, 2003, 2004 # Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -19,6 +19,12 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. +# NOTE ON AUTOCONF VERSION: +# AC_PREREQ says 2.13. +# The output file says "Generated automatically using autoconf version 2.13". +# But that is wrong. This file must be processed with autoconf 000227, +# a special version which identifies itself as autoconf 2.13. + AC_PREREQ(2.13) AC_INIT(gdb.base) @@ -112,6 +118,9 @@ AC_CHECK_HEADERS(pthread.h) AC_EXEEXT AC_CONFIG_SUBDIRS($configdirs) -AC_OUTPUT([Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ - gdb.cp/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \ +AC_OUTPUT([Makefile \ + gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ + gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ + gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ + gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile]) diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/coremaker.c b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/coremaker.c index 4bb16d46aa4..a7fbd94141a 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/coremaker.c +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/coremaker.c @@ -1,3 +1,23 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + 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. */ + /* Simple little program that just generates a core dump from inside some nested function calls. */ diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/gdb1476.c b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/gdb1476.c deleted file mode 100644 index c3f43760bf3..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/gdb1476.c +++ /dev/null @@ -1,12 +0,0 @@ -void x() -{ - void (*fp)() = 0; - fp(); -} - -int -main() -{ - x(); - return 0; -} diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/gdb1476.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/gdb1476.exp deleted file mode 100644 index b88b2de0652..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/gdb1476.exp +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 2004 Free Software Foundation, Inc. - -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@gnu.org - -# This file is part of the gdb testsuite. - -if $tracelevel { - strace $tracelevel -} - -# Testcase for backtrace/gdb1476. - -set prms_id 0 -set bug_id 0 - -set testfile "gdb1476" -set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - -# -# Run to `main' where we begin our tests. -# - -if ![runto_main] then { - gdb_suppress_tests -} - -# If we can examine what's at memory address 0, it is possible that we -# could also execute it. This could probably make us run away, -# executing random code, which could have all sorts of ill effects, -# especially on targets without an MMU. Don't run the tests in that -# case. - -send_gdb "x 0\n" -gdb_expect { - -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { } - -re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { } - -re ".*$gdb_prompt $" { - untested "Memory at address 0 is possibly executable" - return - } -} - -gdb_test "continue" "Program received signal SIGSEGV.*" \ - "continue to null pointer call" - -gdb_test "backtrace 10" \ - "#0\[ \t\]*0x0* in .*\r\n#1\[ \t\]*$hex in x.*\r\n#2\[ \t\]*$hex in main.*" \ - "backtrace from null pointer call" diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/radix.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/radix.exp index 057751f9aab..7ca03c8a1ea 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/radix.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/radix.exp @@ -1,4 +1,5 @@ -# Copyright 1993, 1997 Free Software Foundation, Inc. +# This testcase is part of GDB, the GNU debugger. +# Copyright 1993, 1997, 2004 Free Software Foundation, Inc. # 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 @@ -14,10 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - # This file was written by Fred Fish. (fnf@cygnus.com) +# And rewritten by Michael Chastain (mec.gnu@mindspring.com) if $tracelevel then { strace $tracelevel @@ -26,176 +25,133 @@ if $tracelevel then { set prms_id 0 set bug_id 0 -proc test_input_radix_2 {} { - gdb_test "set radix" \ - "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #1" - gdb_test "set input-radix 2" \ - "Input radix now set to decimal 2, hex 2, octal 2." - gdb_test "show radix" \ - "Input radix set to decimal 2, hex 2, octal 2.\r\nOutput radix set to decimal 10, hex a, octal 12." \ - "show radix #1" - gdb_test "p 010" "8" - gdb_test "p 20." "20" - gdb_test "p (int) 20." "20" - gdb_test "p 0xf" "15" - gdb_test "p 10" "2" - gdb_test "p -101" "-5" - gdb_test "p 101" "5" - gdb_test "p 10101" "21" - gdb_test "p 4" "Invalid number \"4\"\\." - gdb_test "p -2" "Invalid number \"2\"\\." -} +# Start with a fresh gdb. -# Test input radix 3 (an non-typical radix) +gdb_exit +gdb_start -proc test_input_radix_3 {} { - gdb_test "set radix" \ - "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #2" - gdb_test "set input-radix 3" \ - "Input radix now set to decimal 3, hex 3, octal 3." - gdb_test "show radix" \ - "Input radix set to decimal 3, hex 3, octal 3.\r\nOutput radix set to decimal 10, hex a, octal 12." \ - "show radix #2" - gdb_test "p 010" "8" - gdb_test "p 20." "20" - gdb_test "p (int) 20." "20" - gdb_test "p 0xf" "15" - gdb_test "p 10" "3" - gdb_test "p 0" "0" - gdb_test "p 1" "1" - gdb_test "p 2" "2" - gdb_test "p 10" "3" - gdb_test "p 20" "6" - gdb_test "p 100" "9" - gdb_test "p -100" "-9" - gdb_test "p 3" "Invalid number \"3\"." - gdb_test "p 30" "Invalid number \"30\"." -} +# Test input radices. -proc test_input_radix_8 {} { - gdb_test "set radix" \ - "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #3" - gdb_test "set input-radix 8" \ - "Input radix now set to decimal 8, hex 8, octal 10." - gdb_test "show radix" \ - "Input radix set to decimal 8, hex 8, octal 10.\r\nOutput radix set to decimal 10, hex a, octal 12." \ - "set radix #3" - gdb_test "p 010" "8" - gdb_test "p 20." "20" - gdb_test "p (int) 20." "20" - gdb_test "p 0xf" "15" - gdb_test "p 10" "8" - gdb_test "p 20" "16" - gdb_test "p -20" "-16" - gdb_test "p 100" "64" - gdb_test "p 8" "Invalid number \"8\"." - gdb_test "p -9" "Invalid number \"9\"." +proc test_one_input { iradix input output } { + gdb_test "print $input" "$output" \ + "print $input; expect $output; input radix $iradix" } -proc test_input_radix_10 {} { +proc test_input_radix { iradix iradixhex iradixoctal } { + # set input-radix = $iradix, output-radix = ten gdb_test "set radix" \ "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #4" - gdb_test "set input-radix 10" \ - "Input radix now set to decimal 10, hex a, octal 12." - gdb_test "show radix" \ - "Input and output radices set to decimal 10, hex a, octal 12." \ - "show radix #4" - gdb_test "p 010" "8" - gdb_test "p 20." "20" - gdb_test "p (int) 20." "20" - gdb_test "p 0xf" "15" - gdb_test "p 10" "10" - gdb_test "p -12" "-12" + "initialize radix, input radix $iradix" + gdb_test "set input-radix $iradix" \ + "Input radix now set to decimal $iradix, hex $iradixhex, octal $iradixoctal." + if { $iradix == 10 } then { + gdb_test "show radix" \ + "Input and output radices set to decimal 10, hex a, octal 12." \ + "show radix, input radix $iradix" + } else { + gdb_test "show radix" \ + "Input radix set to decimal $iradix, hex $iradixhex, octal $iradixoctal.\r\nOutput radix set to decimal 10, hex a, octal 12." \ + "show radix, input radix $iradix" + } + + # test constants with specific bases that do not use $iradix + test_one_input $iradix "010" "8" + test_one_input $iradix "20." "20" + test_one_input $iradix "(int) 20." "20" + test_one_input $iradix "0xf" "15" + + # test simple one-digit constants + test_one_input $iradix "0" "0" + test_one_input $iradix "1" "1" + test_one_input $iradix "-1" "-1" + + # test simple two-digit constants + test_one_input $iradix "10" [expr $iradix] + test_one_input $iradix "11" [expr $iradix + 1] + test_one_input $iradix "-10" [expr 0 - $iradix] + test_one_input $iradix "-11" [expr 0 - $iradix - 1] + + # test simple three-digit constants + test_one_input $iradix "100" [expr $iradix * $iradix] + test_one_input $iradix "101" [expr $iradix * $iradix + 1] + test_one_input $iradix "-100" [expr 0 - $iradix * $iradix] + test_one_input $iradix "-101" [expr 0 - $iradix * $iradix - 1] + + # test a five-digit constant + test_one_input $iradix "10101" \ + [expr $iradix * $iradix * $iradix * $iradix + $iradix * $iradix + 1] } -proc test_input_radix_16 {} { - gdb_test "set radix" \ - "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #5" - gdb_test "set input-radix 16" \ - "Input radix now set to decimal 16, hex 10, octal 20." - gdb_test "show radix" \ - "Input radix set to decimal 16, hex 10, octal 20.\r\nOutput radix set to decimal 10, hex a, octal 12." \ - "show radix #5" - gdb_test "p 010" "8" - gdb_test "p 20." "20" - gdb_test "p (int) 20." "20" - gdb_test "p 0xf" "15" - gdb_test "p 10" "16" - gdb_test "p 100" "256" -} +test_input_radix 2 "2" "2" + test_one_input 2 "4" "Invalid number \"4\"\\." + test_one_input 2 "-2" "Invalid number \"2\"\\." -proc test_output_radix_8 {} { - gdb_test "set radix" \ - "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #6" - gdb_test "set output-radix 8" \ - "Output radix now set to decimal 8, hex 8, octal 10." - gdb_test "show radix" \ - "Input radix set to decimal 10, hex a, octal 12.\r\nOutput radix set to decimal 8, hex 8, octal 10." \ - "show radix #6" - gdb_test "p 010" "010" - # FIXME: If gdb can't handle float printing in different radices, it - # should at least warn once the first time that is attempted. - setup_xfail "*-*-*" - gdb_test "p 20." "24" "Float printing when output radix is 8" - gdb_test "p (int) 20." "24" - gdb_test "p 0xf" "17" - gdb_test "p 10" "12" - gdb_test "p 100" "144" -} +test_input_radix 3 "3" "3" + test_one_input 3 "2" "2" + test_one_input 3 "20" "6" + test_one_input 3 "3" "Invalid number \"3\"\\." + test_one_input 2 "30" "Invalid number \"30\"\\." -proc test_output_radix_10 {} { - gdb_test "set radix" \ - "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #7" - gdb_test "set output-radix 10" \ - "Output radix now set to decimal 10, hex a, octal 12." - gdb_test "show radix" \ - "Input and output radices set to decimal 10, hex a, octal 12." \ - "show radix #7" - gdb_test "p 010" "8" - gdb_test "p 20." "20" - gdb_test "p (int) 20." "20" - gdb_test "p 0xf" "15" - gdb_test "p 10" "10" - gdb_test "p 100" "100" +test_input_radix 8 "8" "10" + test_one_input 8 "20" "16" + test_one_input 8 "-20" "-16" + test_one_input 8 "8" "Invalid number \"8\"." + test_one_input 8 "-9" "Invalid number \"9\"." + +test_input_radix 10 "a" "12" + test_one_input 10 "-12" "-12" + +test_input_radix 16 "10" "20" + +# Test output radices. + +proc test_one_output { oradix input output } { + gdb_test "print $input" "$output" \ + "print $input; expect $output; output radix $oradix" } -proc test_output_radix_16 {} { +proc test_output_radix { oradix oradixhex oradixoctal } { + # set input-radix = ten, output-radix = $oradix gdb_test "set radix" \ "Input and output radices now set to decimal 10, hex a, octal 12." \ - "set radix #8" - gdb_test "set output-radix 16" \ - "Output radix now set to decimal 16, hex 10, octal 20." - gdb_test "show radix" \ - "Input radix set to decimal 10, hex a, octal 12.\r\nOutput radix set to decimal 16, hex 10, octal 20." \ - "show radix #8" - gdb_test "p 010" "8" - # FIXME: If gdb can't handle float printing in different radices, it - # should at least warn once the first time that is attempted. - setup_xfail "*-*-*" - gdb_test "p 20." "14" "Float printing when output radix is 16" - gdb_test "p (int) 20." "14" - gdb_test "p 0xf" "f" - gdb_test "p 10" "a" - gdb_test "p 100" "64" + "initialize radix, output radix $oradix" + gdb_test "set output-radix $oradix" \ + "Output radix now set to decimal $oradix, hex $oradixhex, octal $oradixoctal." + if { $oradix == 10 } then { + gdb_test "show radix" \ + "Input and output radices set to decimal 10, hex a, octal 12." \ + "show radix, output radix $oradix" + } else { + gdb_test "show radix" \ + "Input radix set to decimal 10, hex a, octal 12.\r\nOutput radix set to decimal $oradix, hex $oradixhex, octal $oradixoctal." \ + "show radix, output radix $oradix" + } + + # no standard tests for output radix } -# Start with a fresh gdb. - -gdb_exit -gdb_start - -test_input_radix_2 -test_input_radix_3 -test_input_radix_8 -test_input_radix_10 -test_input_radix_16 -test_output_radix_8 -test_output_radix_10 -test_output_radix_16 +test_output_radix 8 "8" "10" + test_one_output 8 "010" "010" + test_one_output 8 "0xf" "17" + test_one_output 8 "10" "12" + test_one_output 8 "100" "144" + setup_kfail *-*-* "gdb/1715" + test_one_output 8 "20." "24" + test_one_output 8 "(int) 20." "24" + +test_output_radix 10 "a" "12" + test_one_output 10 "010" "8" + test_one_output 10 "0xf" "15" + test_one_output 10 "10" "10" + test_one_output 10 "100" "100" + test_one_output 10 "20." "20" + test_one_output 10 "(int) 20." "20" + +test_output_radix 16 "10" "20" + test_one_output 16 "010" "8" + test_one_output 16 "0xf" "f" + test_one_output 16 "10" "a" + test_one_output 16 "100" "64" + setup_kfail *-*-* "gdb/1715" + test_one_output 16 "20." "14" + test_one_output 16 "(int) 20." "14" diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/selftest.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/selftest.exp deleted file mode 100644 index 4196b74e786..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/selftest.exp +++ /dev/null @@ -1,516 +0,0 @@ -# Copyright 1988, 1990, 1991, 1992, 1994, 1997, 1999, 2000, 2002, 2003 -# Free Software Foundation, Inc. - -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# This file was written by Rob Savoye. (rob@cygnus.com) - -if $tracelevel then { - strace $tracelevel -} - -set prms_id 0 -set bug_id 0 - -# are we on a target board -if [is_remote target] { - return -} - -# Not all of the lines of code near the start of main are executed for -# every machine. Also, optimization may reorder some of the lines. -# So all we do is try to step or next over everything until we get -# to a line that we know is always executed. - -proc do_steps_and_nexts {} { - global gdb_prompt - global srcdir - - gdb_reinitialize_dir $srcdir/.. - - for {set count 0} {$count < 32} {incr count} { - send_gdb "list\n" - # NOTE: carlton/2002-12-11: The "initial brace" and - # "current_directory initialization" possibilities happen to - # me with GCC 3.1 on i686-pc-linux-gnu when I compile with - # optimization. - gdb_expect { - -re ".*context = data.*$gdb_prompt $" { - set description "step over context initialization" - set command "step" - } - -re ".*argc = context->argc.*$gdb_prompt $" { - set description "step over argc initialization" - set command "step" - } - -re ".*argv = context->argv.*$gdb_prompt $" { - set description "step over argv initialization" - set command "step" - } - -re ".*quiet = 0.*$gdb_prompt $" { - set description "step over quiet initialization" - set command "step" - } - -re ".*batch = 0.*$gdb_prompt $" { - set description "step over batch initialization" - set command "step" - } - -re ".*symarg = NULL.*$gdb_prompt $" { - set description "step over symarg initialization" - set command "step" - } - -re ".*execarg = NULL.*$gdb_prompt $" { - set description "step over execarg initialization" - set command "step" - } - -re ".*corearg = NULL.*$gdb_prompt $" { - set description "step over corearg initialization" - set command "step" - } - -re ".*cdarg = NULL.*$gdb_prompt $" { - set description "step over cdarg initialization" - set command "step" - } - -re ".*ttyarg = NULL.*$gdb_prompt $" { - set description "step over ttyarg initialization" - set command "step" - } - -re ".*time_at_startup = get_run_time.*$gdb_prompt $" { - set description "next over get_run_time and everything it calls" - set command "next" - } - -re ".*START_PROGRESS.*$gdb_prompt $" { - # Note: ezannoni/2004/02/17: This check should be - # removed, since as of today that source line is not - # in gdb anymore. - set description "next over START_PROGRESS and everything it calls" - set command "next" - } - -re ".*mac_init.*$gdb_prompt $" { - set description "next over mac_init and everything it calls" - set command "next" - } - -re ".*init_malloc.*$gdb_prompt $" { - set description "next over init_malloc and everything it calls" - set command "next" - } - -re ".*lim_at_start.*$gdb_prompt $" { - set description "next over lim_at_start initialization" - set command "next" - } - -re ".*count . 0x3.*$gdb_prompt $" { - set description "next over conditional stack alignment code 1" - set command "next" - } - -re ".*if .i != 0.*$gdb_prompt $" { - set description "next over conditional stack alignment code 2" - set command "next" - } - -re ".*alloca .i - 4.*$gdb_prompt $" { - set description "next over conditional stack alignment alloca" - set command "next" - } - -re ".*cmdsize = 1.*$gdb_prompt $" { - set description "step over cmdsize initialization" - set command "next" - } - -re ".*cmdarg = .* xmalloc.*$gdb_prompt $" { - set description "next over cmdarg initialization via xmalloc" - set command "next" - } - -re ".*ncmd = 0.*$gdb_prompt $" { - set description "next over ncmd initialization" - set command "next" - } - -re ".*dirsize = 1.*$gdb_prompt $" { - set description "next over dirsize initialization" - set command "next" - } - -re ".*dirarg = .* xmalloc.*$gdb_prompt $" { - return - } - -re ".*setlocale .LC_MESSAGES,.*$gdb_prompt $" { - set description "next over setlocale LC_MESSAGES" - set command "next" - } - -re ".*setlocale .LC_CTYPE,.*$gdb_prompt $" { - set description "next over setlocale LC_CTYPE" - set command "next" - } - -re ".*bindtextdomain .PACKAGE, LOCALEDIR.;.*$gdb_prompt $" { - set description "next over bindtextdomain" - set command "next" - } - -re ".*textdomain .PACKAGE.;.*$gdb_prompt $" { - set description "next over textdomain PACKAGE" - set command "next" - } - -re "\[0-9\]*\t\{\r\n$gdb_prompt $" { - set description "step over initial brace" - set command "step" - } - -re ".*current_directory = gdb_dirbuf.*$gdb_prompt $" { - set description "step over current_directory initialization" - set command "step" - } - -re ".*gdb_sysroot = .*$gdb_prompt $" { - # NOTE: carlton/2003-01-15: More optimization reordering, - # observed on GCC 3.1. - set description "step over gdb_sysroot initialization" - set command "step" - } - -re ".*ndir = 0.*$gdb_prompt $" { - set description "step over ndir initialization" - set command "step" - } - -re ".*instream = stdin.*$gdb_prompt $" { - set description "step over instream initialization" - set command "step" - } - -re ".*getcwd .gdb_dirbuf, sizeof .gdb_dirbuf..;.*$gdb_prompt $" { - set description "next over getcwd" - set command "next" - } - -re "\[ \t\]+\{\r\n$gdb_prompt $" { - setup_xfail "mips-*-irix5*" - fail "$description ended up at odd location" - } - -re ".*main.c.*No such file or directory.*$gdb_prompt $" { - setup_xfail "rs6000-*-aix3*" - fail "must be able to list source lines" - return - } - -re ".*$gdb_prompt $" { - fail "unknown source line after $description" - return - } - default { - fail "unknown source line near main" - return - } - } - send_gdb "$command\n" - gdb_expect { - -re ".*No such file or directory.\r\n$gdb_prompt $" { - fail "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$gdb_prompt $" { - fail "$description (no source available)" - } - -re ".*$gdb_prompt $" { - pass "$description" - } - timeout { - fail "$description (timeout)" - } - } - } -} - -proc test_with_self { executable } { - global gdb_prompt - global tool - global det_file - global decimal - global timeout - - # load yourself into the debugger - # This can take a relatively long time, particularly for testing where - # the executable is being accessed over a network, or where gdb does not - # support partial symbols for a particular target and has to load the - # entire symbol table. Set the timeout to 10 minutes, which should be - # adequate for most environments (it *has* timed out with 5 min on a - # SPARCstation SLC under moderate load, so this isn't unreasonable). - # After gdb is started, set the timeout to 30 seconds for the duration - # of this test, and then back to the original value. - - set oldtimeout $timeout - set timeout 600 - verbose "Timeout is now $timeout seconds" 2 - if {[gdb_load $executable] <0} then { - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - return -1 - } - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - - # disassemble yourself - gdb_test "x/10i main" \ - "x/10i.*main.*main.$decimal.*main.$decimal.*" \ - "Disassemble main" - - # Set a breakpoint at main - gdb_test "break captured_main" \ - "Breakpoint.*at.* file.*, line.*" \ - "breakpoint in captured_main" - - # We'll need this when we send a ^C to GDB. Need to do it before we - # run the program and gdb starts saving and restoring tty states. - # On Ultrix, we don't need it and it is really slow (because shell_escape - # doesn't use vfork). - if ![istarget "*-*-ultrix*"] then { - gdb_test "shell stty intr '^C'" "" \ - "set interrupt character in test_with_self" - } - - # FIXME: If we put this after the run to main, the first list - # command doesn't print the same line as the current line where - # gdb is stopped. - gdb_test "set listsize 1" "" "set listsize to 1" - - # run yourself - # It may take a very long time for the inferior gdb to start (lynx), - # so we bump it back up for the duration of this command. - set timeout 600 - - set description "run until breakpoint at captured_main" - send_gdb "run -nw\n" - gdb_expect { - -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.* at .*main.c:.*$gdb_prompt $" { - pass "$description" - } - -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.*$gdb_prompt $" { - xfail "$description (line numbers scrambled?)" - } - -re "vfork: No more processes.*$gdb_prompt $" { - fail "$description (out of virtual memory)" - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - return -1 - } - -re ".*$gdb_prompt $" { - fail "$description" - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - return -1 - } - timeout { - fail "$description (timeout)" - } - } - - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - - # do we have a version number ? - send_gdb "print version\n" - gdb_expect { - -re ".\[0-9\]+ = .\[0-9.\]+.*$gdb_prompt $" { - pass "printed version as string" - } - -re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" { - pass "printed version as pointer" - } - -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" { - pass "printed version with cast" - } - -re ".*$gdb_prompt $" { fail "printed version" } - timeout { fail "(timeout) printed version" } - } - - do_steps_and_nexts - - gdb_test "print \"foo\"" ".\[0-9\]+ = \"foo\"" "print a string" - - # do_steps_and_nexts left us ready to execute an xmalloc call, - # so give that a try. - # If we don't actually enter the xmalloc call when we give a - # step command that seems like a genuine bug. It seems to happen - # on most RISC processors. - # NOTE drow/2003-06-22: However, if we step back to the preceding two - # lines, just keep stepping until we enter. - set stepped_back 0 - setup_xfail "alpha-*-*" "mips-*-*" - set description "step into xmalloc call" - send_gdb "step\n" - gdb_expect { - -re "ncmd = 0;.*$gdb_prompt $" { - set stepped_back 1 - send_gdb "step\n" - exp_continue - } - -re ".*cmdarg = .* xmalloc.*$gdb_prompt $" { - set stepped_back 1 - send_gdb "step\n" - exp_continue - } - -re "dirsize = 1;.*$gdb_prompt $" { - set stepped_back 1 - send_gdb "step\n" - exp_continue - } - -re ".*dirarg = .* xmalloc.*$gdb_prompt $" { - if { $stepped_back == 1 } { - send_gdb "step\n" - exp_continue - } else { - fail "$description" - } - } - -re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" { - pass "$description" - } - -re ".*No such file or directory.\r\n$gdb_prompt $" { - pass "$description (no source available)" - } - -re "A file or directory .* does not exist..\r\n$gdb_prompt $" { - pass "$description (no source available)" - } - -re ".*$gdb_prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - - # start the "xgdb" process - send_gdb "continue\n" - gdb_expect { - -re "GNU gdb \[0-9\.\]*.* -Copyright \[0-9\]* Free Software Foundation, Inc.* -GDB is free software, covered by the GNU General Public License, and you are.* -welcome to change it and/or distribute copies of it under certain conditions.* -Type \"show copying\" to see the conditions.* -There is absolutely no warranty for GDB. Type \"show warranty\" for details.* -This GDB was configured as .*$gdb_prompt $"\ - { pass "xgdb is at prompt" } - -re "GDB is free software and you are welcome to distribute copies of it.* - under certain conditions; type \"show copying\" to see the conditions..* -There is absolutely no warranty for GDB; type \"show warranty\" for details..* -GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\ - { pass "xgdb is at prompt (obsolescent gdb)" } - -re ".*$gdb_prompt $" { fail "xgdb is at prompt" } - timeout { fail "(timeout) xgdb is at prompt" } - } - - # set xgdb prompt so we can tell which is which - send_gdb "set prompt (xgdb) \n" - gdb_expect { - -re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" } - -re ".*$gdb_prompt $" { fail "Set xgdb prompt" } - default { fail "(timeout) Set xgdb prompt" } - } - - # kill the xgdb process - set description "send ^C to child process" - send_gdb "\003" - gdb_expect { - -re "Program received signal SIGINT.*$gdb_prompt $" { - pass "$description" - } - -re ".*$gdb_prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - - set description "send SIGINT signal to child process" - send_gdb "signal SIGINT\n" - gdb_expect { - -re "Continuing with signal SIGINT.*$gdb_prompt $" { - pass "$description" - } - -re ".*$gdb_prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - - # get a stack trace - # - # This fails on some linux systems for unknown reasons. On the - # systems where it fails, sometimes it works fine when run manually. - # The testsuite failures may not be limited to just aout systems. - setup_xfail "i*86-pc-linuxaout-gnu" - set description "backtrace through signal handler" - send_gdb "backtrace\n" - gdb_expect { - -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" { - pass "$description" - } - -re ".*$gdb_prompt $" { - # On the alpha, we hit the infamous problem about gdb - # being unable to get the frame pointer (mentioned in - # gdb/README). As it is intermittent, there is no way to - # XFAIL it which will give us an XPASS if the problem goes - # away. - setup_xfail "alpha*-*-osf*" - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - - - # Set the timeout back to the value it had when we were called. - set timeout $oldtimeout - verbose "Timeout is now $timeout seconds" 2 - - # Restart gdb in case next test expects it to be started already. - return 0 -} - -# Find a pathname to a file that we would execute if the shell was asked -# to run $arg using the current PATH. - -proc find_gdb { arg } { - - # If the arg directly specifies an existing executable file, then - # simply use it. - - if [file executable $arg] then { - return $arg - } - - set result [which $arg] - if [string match "/" [ string range $result 0 0 ]] then { - return $result - } - - # If everything fails, just return the unqualified pathname as default - # and hope for best. - - return $arg -} - -# Run the test with self. -# Copy the file executable file in case this OS doesn't like to edit its own -# text space. - -set GDB_FULLPATH [find_gdb $GDB] - -# Remove any old copy lying around. -remote_file host delete x$tool - -gdb_start -set file [remote_download host $GDB_FULLPATH x$tool] -set result [test_with_self $file]; -gdb_exit; -catch "remote_file host delete $file"; - -if {$result <0} then { - warning "Couldn't test self" - return -1 -} diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/signals.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/signals.exp index a07e3a8500a..cbe00bf3b12 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/signals.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/signals.exp @@ -1,4 +1,4 @@ -# Copyright 1997, 1998, 1999, 2003 Free Software Foundation, Inc. +# Copyright 1997, 1998, 1999, 2003, 2004 Free Software Foundation, Inc. # 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 @@ -14,9 +14,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - if [target_info exists gdb,nosignals] { verbose "Skipping signals.exp because of nosignals." continue @@ -33,7 +30,7 @@ set testfile signals set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } # Create and source the file that provides information about the compiler @@ -48,294 +45,13 @@ if {$hp_cc_compiler} { set void void } -proc signal_tests_1 {} { - global gdb_prompt - if [runto_main] then { - gdb_test "next" "signal \\(SIGUSR1.*" \ - "next over signal (SIGALRM, handler)" - gdb_test "next" "alarm \\(.*" \ - "next over signal (SIGUSR1, handler)" - gdb_test "next" "\\+\\+count; /\\* first \\*/" \ - "next over alarm (1)" - # An alarm has been signaled, give the signal time to get delivered. - sleep 2 - - # i386 BSD currently fails the next test with a SIGTRAP. - setup_xfail "i*86-*-bsd*" - # But Dynix has a DECR_PC_AFTER_BREAK of zero, so the failure - # is shadowed by hitting the through_sigtramp_breakpoint. - clear_xfail "i*86-sequent-bsd*" - # Univel SVR4 i386 continues instead of stepping. - setup_xfail "i*86-univel-sysv4*" - # lynx fails with "next" acting like "continue" - setup_xfail "*-*-*lynx*" - # linux (aout versions) also fails with "next" acting like "continue" - # this is probably more dependant on the kernel version than on the - # object file format or utils. (sigh) - setup_xfail "i*86-pc-linuxaout-gnu" "i*86-pc-linuxoldld-gnu" - send_gdb "next\n" - gdb_expect { - -re "alarm .*$gdb_prompt $" { pass "next to 2nd alarm (1)" } - -re "Program received signal SIGTRAP.*first.*$gdb_prompt $" { - - # This can happen on machines that have a trace flag - # in their PS register. - # The trace flag in the PS register will be set due to - # the `next' command. - # Before calling the signal handler, the PS register - # is pushed along with the context on the user stack. - # When the signal handler has finished, it reenters the - # the kernel via a sigreturn syscall, which restores the - # PS register along with the context. - # If the kernel erroneously does not clear the trace flag - # in the pushed context, gdb will receive a SIGTRAP from - # the set trace flag in the restored context after the - # signal handler has finished. - - # I do not yet understand why the SIGTRAP does not occur - # after stepping the instruction at the restored PC on - # i386 BSDI 1.0 systems. - - # Note that the vax under Ultrix also exhibits - # this behaviour (it is uncovered by the `continue from - # a break in a signal handler' test below). - # With this test the failure is shadowed by hitting the - # through_sigtramp_breakpoint upon return from the signal - # handler. - - # SVR4 and Linux based i*86 systems exhibit this behaviour - # as well (it is uncovered by the `continue from a break - # in a signal handler' test below). - # As these systems use procfs, where we tell the kernel not - # to tell gdb about `pass' signals, and the trace flag is - # cleared by the kernel before entering the sigtramp - # routine, GDB will not notice the execution of the signal - # handler. - # Upon return from the signal handler, GDB will receive - # a SIGTRAP from the set trace flag in the restored context. - # The SIGTRAP marks the end of a (albeit long winded) - # single step for GDB, causing this test to pass. - - fail "next to 2nd alarm (1) (probably kernel bug)" - gdb_test "next" "alarm.*" "next to 2nd alarm (1)" - } - -re "Program exited with code.*$gdb_prompt $" { - - # This is apparently a bug in the UnixWare kernel (but - # has not been investigated beyond the - # resume/target_wait level, and has not been reported - # to Univel). If it steps when a signal is pending, - # it does a continue instead. I don't know whether - # there is a workaround. - - # Perhaps this problem exists on other SVR4 systems; - # but (a) we have no reason to think so, and (b) if we - # put a wrong xfail here, we never get an XPASS to let - # us know that it was incorrect (and then if such a - # configuration regresses we have no way of knowing). - # Solaris is not a relevant data point either way - # because it lacks single stepping. - - # fnf: I don't agree with the above philosophy. We - # can never be sure that any particular XFAIL is - # specified 100% correctly in that no systems with - # the bug are missed and all systems without the bug - # are excluded. If we include an XFAIL that isn't - # appropriate for a particular system, then when that - # system gets tested it will XPASS, and someone should - # investigate and fix the setup_xfail as appropriate, - # or more preferably, the actual bug. Each such case - # adds more data to narrowing down the scope of the - # problem and ultimately fixing it. - - setup_xfail "i*86-*-sysv4*" - fail "'next' behaved as 'continue (known SVR4 bug)'" - return 0 - } - -re ".*$gdb_prompt $" { fail "next to 2nd alarm (1)" } - timeout { fail "next to 2nd alarm (1); (timeout)" } - eof { fail "next to 2nd alarm (1); (eof)" } - } - - gdb_test "break handler" "Breakpoint \[0-9\]+ .*" - gdb_test "next" "\\+\\+count; /\\* second \\*/" \ - "next to 2nd ++count in signals_tests_1" - # An alarm has been signaled, give the signal time to get delivered. - sleep 2 - - set bash_bug 0 - send_gdb "next\n" - gdb_expect { - -re "Breakpoint.*handler.*$gdb_prompt $" { - pass "next to handler in signals_tests_1" - } - -re "Program received signal SIGEMT.*$gdb_prompt $" { - # Bash versions before 1.13.5 cause this behaviour - # by blocking SIGTRAP. - fail "next to handler in signals_tests_1 (known problem with bash versions before 1.13.5)" - set bash_bug 1 - gdb_test "signal 0" "Breakpoint.*handler.*" - } - -re ".*$gdb_prompt $" { fail "next to handler in signals_tests_1" } - timeout { fail "next to handler in signals_tests_1 (timeout)" } - eof { fail "next to handler in signals_tests_1 (eof)" } - } - - # This doesn't test that main is frame #2, just that main is frame - # #2, #3, or higher. At some point this should be fixed (but - # it quite possibly would introduce new FAILs on some systems). - setup_xfail "i*86-*-bsdi2.0" - gdb_test "backtrace 10" "#0.*handler.*#1.*signal handler.*#2.* main .*" \ - "backtrace in signals_tests_1" - - gdb_test "break func1" "Breakpoint \[0-9\]+ .*" - gdb_test "break func2" "Breakpoint \[0-9\]+ .*" - - # Vax Ultrix and i386 BSD currently fail the next test with - # a SIGTRAP, but with different symptoms. - setup_xfail "vax-*-ultrix*" - setup_xfail "i*86-*-bsd*" - setup_xfail "i*86-*-freebsd*" - setup_xfail "i*86-pc-linux-gnu*" - setup_xfail "i*86-*-solaris2*" - send_gdb "continue\n" - gdb_expect { - -re "Breakpoint.*func1.*$gdb_prompt $" { pass "continue to func1" } - -re "Program received signal SIGTRAP.*second.*$gdb_prompt $" { - - # See explanation for `next to 2nd alarm (1)' fail above. - # We did step into the signal handler, hit a breakpoint - # in the handler and continued from the breakpoint. - # The set trace flag in the restored context is causing - # the SIGTRAP, without stepping an instruction. - - fail "continue to func1 (probably kernel bug)" - gdb_test "continue" "Breakpoint.*func1.*" \ - "extra continue to func1" - } - -re "Program received signal SIGTRAP.*func1 ..;.*$gdb_prompt $" { - - # On the vax under Ultrix the set trace flag in the restored - # context is causing the SIGTRAP, but after stepping one - # instruction, as expected. - - fail "continue to func1 (probably kernel bug)" - gdb_test "continue" "Breakpoint.*func1.*" \ - "extra continue to func1" - } - -re ".*$gdb_prompt $" { fail "continue to func1" } - default { fail "continue to func1" } - } - - setup_xfail "*-*-irix*" - send_gdb "signal SIGUSR1\n" - gdb_expect { - -re "Breakpoint.*handler.*$gdb_prompt $" { pass "signal SIGUSR1" } - -re "Program received signal SIGUSR1.*$gdb_prompt $" { - # This is what irix4 and irix5 do. - # It would appear to be a kernel bug. - fail "signal SIGUSR1" - gdb_test "continue" "Breakpoint.*handler.*" "pass it SIGUSR1" - } - -re ".*$gdb_prompt $" { fail "signal SIGUSR1" } - default { fail "signal SIGUSR1" } - } - - # Will tend to wrongly require an extra continue. - - # The problem here is that the breakpoint at func1 will be - # inserted, and when the system finishes with the signal - # handler it will try to execute there. For GDB to try to - # remember that it was going to step over a breakpoint when a - # signal happened, distinguish this case from the case where - # func1 is called from the signal handler, etc., seems - # exceedingly difficult. So don't expect this to get fixed - # anytime soon. - - setup_xfail "*-*-*" - send_gdb "continue\n" - gdb_expect { - -re "Breakpoint.*func2.*$gdb_prompt $" { pass "continue to func2" } - -re "Breakpoint.*func1.*$gdb_prompt $" { - fail "continue to func2" - gdb_test "continue" "Breakpoint.*func2.*" \ - "extra continue to func2" - } - -re ".*$gdb_prompt $" { fail "continue to func2" } - default { fail "continue to func2" } - } - - sleep 2 - - # GDB yanks out the breakpoints to step over the breakpoint it - # stopped at, which means the breakpoint at handler is yanked. - # But if SOFTWARE_SINGLE_STEP_P, we won't get another chance to - # reinsert them (at least not with procfs, where we tell the kernel - # not to tell gdb about `pass' signals). So the fix would appear to - # be to just yank that one breakpoint when we step over it. - - setup_xfail "sparc*-*-*" - setup_xfail "rs6000-*-*" - setup_xfail "powerpc-*-*" - - # A faulty bash will not step the inferior into sigtramp on sun3. - if {$bash_bug} then { - setup_xfail "m68*-*-sunos4*" - } - - setup_xfail "i*86-pc-linux-gnu*" - setup_xfail "i*86-*-solaris2*" - gdb_test "continue" "Breakpoint.*handler.*" "continue to handler" - - # If the SOFTWARE_SINGLE_STEP_P failure happened, we have already - # exited. - # If we succeeded a continue will return from the handler to func2. - # GDB now has `forgotten' that it intended to step over the - # breakpoint at func2 and will stop at func2. - setup_xfail "*-*-*" - # The sun3 with a faulty bash will also be `forgetful' but it - # already got the spurious stop at func2 and this continue will work. - if {$bash_bug} then { - clear_xfail "m68*-*-sunos4*" - } - gdb_test "continue" "Program exited with code 010\\." \ - "continue to exit in signals_tests_1 " - } -} - -# On a few losing systems, ptrace (PT_CONTINUE) or ptrace (PT_STEP) -# causes pending signals to be cleared, which causes these tests to -# get nowhere fast. This is totally losing behavior (perhaps there -# are cases in which is it useful but the user needs more control, -# which they mostly have in GDB), but some people apparently think it -# is a feature. It is documented in the ptrace manpage on Motorola -# Delta Series sysV68 R3V7.1 and on HPUX 9.0. Even the non-HPUX PA -# OSes (BSD and OSF/1) seem to have figured they had to copy this -# braindamage. - -if {[ istarget "m68*-motorola-*" ] || [ istarget "hppa*-*-bsd*" ] || - [ istarget "hppa*-*-osf*" ]} then { - setup_xfail "*-*-*" - fail "ptrace loses on signals on this target" - return 0 -} - -# lynx2.2.2 doesn't lose signals, instead it screws up the stack pointer -# in some of these tests leading to massive problems. I've -# reported this to lynx, hopefully it'll be fixed in lynx2.3. -# Severe braindamage. -if [ istarget "*-*-*lynx*" ] then { - setup_xfail "*-*-*" - fail "kernel scroggs stack pointer in signal tests on this target" - return 0 -} - gdb_exit gdb_start # This will need to be updated as the exact list of signals changes, # but I want to test that TARGET_SIGNAL_0, TARGET_SIGNAL_DEFAULT, and # TARGET_SIGNAL_UNKNOWN are skipped. + proc test_handle_all_print {} { global timeout # Increase timeout and expect input buffer for large output from gdb. @@ -359,282 +75,202 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load $binfile -signal_tests_1 - -# Force a resync, so we're looking at the right prompt. On SCO we -# were getting out of sync (I don't understand why). -send_gdb "p 1+1\n" -gdb_expect { - -re "= 2.*$gdb_prompt $" {} - -re ".*$gdb_prompt $" { perror "sync trouble in signals.exp" } - default { perror "sync trouble in signals.exp" } -} if [runto_main] then { - # Since count is a static variable outside main, runto_main - # is no guarantee that count will be 0 at this point. + + # Since count is a static variable outside main, runto_main is no + # guarantee that count will be 0 at this point. + gdb_test "set variable count = 0" "" + + # Test an inferior function call that takes a signal that hits a + # breakpoint (with a false condition). When GDB tries to run the + # stack dummy, it will hit the breakpoint at handler. Provided it + # doesn't lose its cool, this is not a problem, it just has to + # note that the breakpoint condition is false and keep going. + + # ...setup an always false conditional breakpoint + gdb_test "break handler if 0" "Breakpoint \[0-9\]+ .*" gdb_test "set \$handler_breakpoint_number = \$bpnum" "" - # Get to the point where a signal is waiting to be delivered - gdb_test "next" "signal \\(SIGUSR1.*" "next to signal in signals.exp" - gdb_test "next" "alarm \\(.*" "next to alarm #1 in signals.exp" + # ...setup the signal + + gdb_test "next" "signal \\(SIGUSR1.*" "next to signal" + gdb_test "next" "alarm \\(.*" "next to alarm #1" gdb_test "next" "\\+\\+count; /\\* first \\*/" \ - "next to ++count #1 in signals.exp" - # Give the signal time to get delivered + "next to ++count #1" sleep 2 - # Now call a function. When GDB tries to run the stack dummy, - # it will hit the breakpoint at handler. Provided it doesn't - # lose its cool, this is not a problem, it just has to note - # that the breakpoint condition is false and keep going. + # ...call the function gdb_test "p func1 ()" "^p func1 \\(\\)\r\n.\[0-9\]* = $void" \ - "p func1 () #1 in signals.exp" + "p func1 () #1" + + # ...veryfiy that the cout was updated - # Make sure the count got incremented. + gdb_test "p count" "= 2" "p count #1" - # Haven't investigated this xfail - setup_xfail "rs6000-*-*" - setup_xfail "powerpc-*-*" - gdb_test "p count" "= 2" "p count #1 in signals.exp" - if { [istarget "rs6000-*-*"] || [istarget "powerpc-*-*"] } { return 0 } + # Now run the same test but with a breakpoint that does stop. + + # ...set up the breakpoint and signal gdb_test "condition \$handler_breakpoint_number" "now unconditional\\." - gdb_test "next" "alarm \\(.*" "next to alarm #2 in signals.exp" + gdb_test "next" "alarm \\(.*" "next to alarm #2" gdb_test "next" "\\+\\+count; /\\* second \\*/" \ - "next to ++count #2 in signals.exp" + "next to ++count #2" sleep 2 - # This time we stop when GDB tries to run the stack dummy. - # So it is OK that we do not print the return value from the function. + # ...call the function, which is immediatly interrupted + gdb_test "p func1 ()" \ "Breakpoint \[0-9\]*, handler.* The program being debugged stopped while in a function called from GDB.*" \ - "p func1 () #2 in signals.exp" - # But we should be able to backtrace... - # On alpha-*-osf2.0 this test works when run manually but sometime fails when - # run under dejagnu, making it very hard to debug the problem. Weird... - gdb_test "bt 10" "#0.*handler.*#1.*signal handler.*#2.* main .*" "bt in signals.exp" - # ...and continue... - gdb_test "continue" "Continuing\\." "continue in signals.exp" + "p func1 () #2" + + # ...verify the backtrace + + gdb_test "backtrace" \ + "#0 handler.*#1 .signal handler called.*#2 func1.*#3 .function called from gdb.*#4.*main.*" \ + "backtrace from handler when calling func1" + + # ...and continue (silently returning) + + gdb_test "continue" "Continuing\\." + # ...and then count should have been incremented - gdb_test "p count" "= 5" "p count #2 in signals.exp" - - -# Verify that "info signals" produces reasonable output. -# - send_gdb "info signals\n" - gdb_expect { - -re "SIGHUP.*SIGINT.*SIGQUIT.*SIGILL.*SIGTRAP.*SIGABRT.*SIGEMT.*SIGFPE.*SIGKILL.*SIGBUS.*SIGSEGV.*SIGSYS.*SIGPIPE.*SIGALRM.*SIGTERM.*SIGURG.*SIGSTOP.*SIGTSTP.*SIGCONT.*SIGCHLD.*SIGTTIN.*SIGTTOU.*SIGIO.*SIGXCPU.*SIGXFSZ.*SIGVTALRM.*SIGPROF.*SIGWINCH.*SIGLOST.*SIGUSR1.*SIGUSR2.*SIGPWR.*SIGPOLL.*SIGWIND.*SIGPHONE.*SIGWAITING.*SIGLWP.*SIGDANGER.*SIGGRANT.*SIGRETRACT.*SIGMSG.*SIGSOUND.*SIGSAK.*SIGPRIO.*SIG33.*SIG34.*SIG35.*SIG36.*SIG37.*SIG38.*SIG39.*SIG40.*SIG41.*SIG42.*SIG43.*SIG44.*SIG45.*SIG46.*SIG47.*SIG48.*SIG49.*SIG50.*SIG51.*SIG52.*SIG53.*SIG54.*SIG55.*SIG56.*SIG57.*SIG58.*SIG59.*SIG60.*SIG61.*SIG62.*SIG63.*Use the \"handle\" command to change these tables.*$gdb_prompt $"\ - {pass "info signals"} - -re "$gdb_prompt $"\ - {fail "info signals"} - timeout {fail "(timeout) info signals"} - } -# Verify that "info signal" correctly handles an argument, be it a -# symbolic signal name, or an integer ID. -# - send_gdb "info signal SIGTRAP\n" - gdb_expect { - -re ".*SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*$gdb_prompt $"\ - {pass "info signal SIGTRAP"} - -re "$gdb_prompt $"\ - {fail "info signal SIGTRAP"} - timeout {fail "(timeout) info signal SIGTRAP"} - } + gdb_test "p count" "= 5" "p count #2" - send_gdb "info signal 5\n" - gdb_expect { - -re ".*SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*$gdb_prompt $"\ - {pass "info signal 5"} - -re "$gdb_prompt $"\ - {fail "info signal 5"} - timeout {fail "(timeout) info signal 5"} - } -# Verify that "handle" with illegal arguments is gracefully, um, handled. -# - send_gdb "handle\n" - gdb_expect { - -re "Argument required .signal to handle.*$gdb_prompt $"\ - {pass "handle without arguments"} - -re "$gdb_prompt $"\ - {fail "handle without arguments"} - timeout {fail "(timeout) handle without arguments"} - } + # Verify that "info signals" produces reasonable output. - send_gdb "handle SIGFOO\n" - gdb_expect { - -re "Unrecognized or ambiguous flag word: \"SIGFOO\".*$gdb_prompt $"\ - {pass "handle with bogus SIG"} - -re "$gdb_prompt $"\ - {fail "handle with bogus SIG"} - timeout {fail "(timeout) handle with bogus SIG"} - } + gdb_test "info signals" "SIGHUP.*SIGINT.*SIGQUIT.*SIGILL.*SIGTRAP.*SIGABRT.*SIGEMT.*SIGFPE.*SIGKILL.*SIGBUS.*SIGSEGV.*SIGSYS.*SIGPIPE.*SIGALRM.*SIGTERM.*SIGURG.*SIGSTOP.*SIGTSTP.*SIGCONT.*SIGCHLD.*SIGTTIN.*SIGTTOU.*SIGIO.*SIGXCPU.*SIGXFSZ.*SIGVTALRM.*SIGPROF.*SIGWINCH.*SIGLOST.*SIGUSR1.*SIGUSR2.*SIGPWR.*SIGPOLL.*SIGWIND.*SIGPHONE.*SIGWAITING.*SIGLWP.*SIGDANGER.*SIGGRANT.*SIGRETRACT.*SIGMSG.*SIGSOUND.*SIGSAK.*SIGPRIO.*SIG33.*SIG34.*SIG35.*SIG36.*SIG37.*SIG38.*SIG39.*SIG40.*SIG41.*SIG42.*SIG43.*SIG44.*SIG45.*SIG46.*SIG47.*SIG48.*SIG49.*SIG50.*SIG51.*SIG52.*SIG53.*SIG54.*SIG55.*SIG56.*SIG57.*SIG58.*SIG59.*SIG60.*SIG61.*SIG62.*SIG63.*Use the \"handle\" command to change these tables.*" \ + "info signals" - send_gdb "handle SIGHUP frump\n" - gdb_expect { - -re "Unrecognized or ambiguous flag word: \"frump\".*$gdb_prompt $"\ - {pass "handle SIG with bogus action"} - -re "$gdb_prompt $"\ - {fail "handle SIG with bogus action"} - timeout {fail "(timeout) handle SIG with bogus action"} - } + # Verify that "info signal" correctly handles an argument, be it a + # symbolic signal name, or an integer ID. -# Verify that "handle" can take multiple actions per SIG, and that in -# the case of conflicting actions, that the rightmost action "wins". -# - send_gdb "handle SIGHUP print noprint\n" - gdb_expect { - -re ".*SIGHUP\[ \t\]*No\[ \t\]*No\[ \t\]*Yes\[ \t\]*Hangup.*$gdb_prompt $"\ - {pass "handle SIG with multiple conflicting actions"} - -re "$gdb_prompt $"\ - {fail "handle SIG with multiple conflicting actions"} - timeout {fail "(timeout) handle SIG with multiple conflicting actions"} - } + gdb_test "info signal SIGTRAP" \ + "SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*" \ + "info signal SIGTRAP" -# Exercise all the various actions. (We don't care what the outcome -# is, this is just to ensure that they all can be parsed.) -# - send_gdb "handle SIGHUP print noprint stop nostop ignore noignore pass nopass\n" - gdb_expect { - -re ".*Signal.*$gdb_prompt $"\ - {pass "handle SIG parses all legal actions"} - -re "$gdb_prompt $"\ - {fail "handle SIG parses all legal actions"} - timeout {fail "(timeout) handle SIG parses all legal actions"} - } + gdb_test "info signal 5" \ + "SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*" \ + "info signal 5" -# Verify that we can "handle" multiple signals at once, interspersed -# with actions. -# - send_gdb "handle SIG63 print SIGILL\n" - gdb_expect { - -re ".*SIGILL\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Illegal instruction.*SIG63\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Real-time event 63.*$gdb_prompt $"\ - {pass "handle multiple SIGs"} - -re "$gdb_prompt $"\ - {fail "handle multiple SIGs"} - timeout {fail "(timeout) handle multiple SIGs"} - } + # Verify that "handle" with illegal arguments is gracefully, um, + # handled. -# Verify that "handle" can take a numeric argument for the signal ID, -# rather than a symbolic name. (This may not be portable; works for -# HP-UX.) -# -# Also note that this testpoint overrides SIGTRAP, which on HP-UX at -# least, is used to implement single-steps and breakpoints. Don't -# expect to run the inferior after this! -# - send_gdb "handle 5 nopass\n" - gdb_expect { - -re ".*SIGTRAP is used by the debugger.*Are you sure you want to change it.*y or n.*"\ - {send_gdb "y\n" - gdb_expect { - -re ".*SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*$gdb_prompt $"\ - {pass "override SIGTRAP (#5)"} - -re "$gdb_prompt $"\ - {fail "override SIGTRAP (#5)"} - timeout {fail "(timeout) override SIGTRAP (#5)"} - } - } - -re "$gdb_prompt $"\ - {fail "override SIGTRAP (#5)"} - timeout {fail "(timeout) override SIGTRAP (#5)"} - } + gdb_test "handle" \ + "Argument required .signal to handle.*" \ + "handle without arguments" -# GDB doesn't seem to allow numeric signal IDs larger than 15. Verify -# that restriction. ??rehrauer: Not sure if this is a feature or a -# bug, actually. Why is the range 1-15? -# - send_gdb "handle 58\n" - gdb_expect { - -re "Only signals 1-15 are valid as numeric signals.*Use \"info signals\" for a list of symbolic signals.*$gdb_prompt $"\ - {pass "invalid signal number rejected"} - -re "$gdb_prompt $"\ - {fail "invalid signal number rejected"} - timeout {fail "(timeout) invalid signal number rejected"} - } + gdb_test "handle SIGFOO" \ + "Unrecognized or ambiguous flag word: \"SIGFOO\".*" \ + "handle with bogus SIG" -# Verify that we can accept a signal ID range (number-number). -# ??rehrauer: This feature isn't documented on the quick-reference -# card. -# - send_gdb "handle 13-15\n" - gdb_expect { - -re ".*SIGPIPE.*SIGALRM.*SIGTERM.*$gdb_prompt $"\ - {pass "handle multiple SIGs via integer range"} - -re "$gdb_prompt $"\ - {fail "handle multiple SIGs via integer range"} - timeout {fail "(timeout) handle multiple SIGs via integer range"} + gdb_test "handle SIGHUP frump" \ + "Unrecognized or ambiguous flag word: \"frump\".*" \ + "handle SIG with bogus action" - } + # Verify that "handle" can take multiple actions per SIG, and that + # in the case of conflicting actions, that the rightmost action + # "wins". -# Bizarrely enough, GDB also allows you to reverse the range -# stat, stop IDs. E.g., "3-1" and "1-3" mean the same thing. -# Probably this isn't documented, but the code anticipates it, -# so we'd best test it... -# - send_gdb "handle 15-13\n" - gdb_expect { - -re ".*SIGPIPE.*SIGALRM.*SIGTERM.*$gdb_prompt $"\ - {pass "handle multiple SIGs via integer range"} - -re "$gdb_prompt $"\ - {fail "handle multiple SIGs via integer range"} - timeout {fail "(timeout) handle multiple SIGs via integer range"} + gdb_test "handle SIGHUP print noprint" \ + "SIGHUP\[ \t\]*No\[ \t\]*No\[ \t\]*Yes\[ \t\]*Hangup.*" \ + "handle SIG with multiple conflicting actions" - } + # Exercise all the various actions. (We don't care what the + # outcome is, this is just to ensure that they all can be parsed.) -# SIGINT is used by the debugger as well. Verify that we can change -# our minds about changing it. -# - send_gdb "handle SIGINT nopass\n" - gdb_expect { - -re ".*SIGINT is used by the debugger.*Are you sure you want to change it.*y or n.*"\ - {send_gdb "n\n" -# ??rehrauer: When you answer "n", the header for the signal info is -# printed, but not the actual handler settings. Probably a bug. -# - gdb_expect { - -re "Not confirmed, unchanged.*Signal.*$gdb_prompt $"\ - {pass "override SIGINT"} - -re "$gdb_prompt $"\ - {fail "override SIGINT"} - timeout {fail "(timeout) override SIGINT"} - } - } - -re "$gdb_prompt $"\ - {fail "override SIGINT"} - timeout {fail "(timeout) override SIGINT"} - } + gdb_test "handle SIGHUP print noprint stop nostop ignore noignore pass nopass" \ + "Signal.*" \ + "handle SIG parses all legal actions" + + # Verify that we can "handle" multiple signals at once, + # interspersed with actions. + + gdb_test "handle SIG63 print SIGILL" \ + "SIGILL\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Illegal instruction.*SIG63\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Real-time event 63.*" \ + "handle multiple SIGs" + + # Verify that "handle" can take a numeric argument for the signal + # ID, rather than a symbolic name. (This may not be portable; + # works for HP-UX.) -# Verify that GDB responds gracefully to the "signal" command with -# a missing argument. -# - send_gdb "signal\n" - gdb_expect { - -re "Argument required .signal number..*$gdb_prompt $"\ - {pass "signal without arguments disallowed"} - -re "$gdb_prompt $"\ - {fail "signal without arguments disallowed"} - timeout {fail "(timeout) signal without arguments disallowed"} + # Also note that this testpoint overrides SIGTRAP, which on HP-UX + # at least, is used to implement single-steps and breakpoints. + # Don't expect to run the inferior after this! + + set test "override SIGTRAP" + gdb_test_multiple "handle 5 nopass" "$test" { + -re "SIGTRAP is used by the debugger.*Are you sure you want to change it.*y or n.*" { + gdb_test "y" \ + "SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*" \ + "$test" + } } -# Verify that we can successfully send a signal other than 0 to -# the inferior. (This probably causes the inferior to run away. -# Be prepared to rerun to main for further testing.) -# - send_gdb "signal 5\n" - gdb_expect { - -re "Continuing with signal SIGTRAP.*$gdb_prompt $"\ - {pass "sent signal 5"} - -re "$gdb_prompt $"\ - {fail "sent signal 5"} - timeout {fail "(timeout) sent signal 5"} + # GDB doesn't seem to allow numeric signal IDs larger than 15. Verify + # that restriction. ??rehrauer: Not sure if this is a feature or a + # bug, actually. Why is the range 1-15? + + gdb_test "handle 58" \ + "Only signals 1-15 are valid as numeric signals.*Use \"info signals\" for a list of symbolic signals.*" \ + "invalid signal number rejected" + + # Verify that we can accept a signal ID range (number-number). + # ??rehrauer: This feature isn't documented on the quick-reference + # card. + + gdb_test "handle 13-15" \ + "SIGPIPE.*SIGALRM.*SIGTERM.*" \ + "handle multiple SIGs via integer range" + + # Bizarrely enough, GDB also allows you to reverse the range stat, + # stop IDs. E.g., "3-1" and "1-3" mean the same thing. Probably + # this isn't documented, but the code anticipates it, so we'd best + # test it... + + gdb_test "handle 15-13" \ + "SIGPIPE.*SIGALRM.*SIGTERM.*" \ + "handle multiple SIGs via reverse integer range" + + # SIGINT is used by the debugger as well. Verify that we can + # change our minds about changing it. + + set test "override SIGINT" + gdb_test_multiple "handle SIGINT nopass" "$test" { + -re "SIGINT is used by the debugger.*Are you sure you want to change it.*y or n.*" { + gdb_test_multiple "n" "$test" { + -re "Not confirmed, unchanged.*Signal.*$gdb_prompt $" { + # "Signal ..." should not be in the output. + kfail gdb/1707 "$test" + } + -re "Not confirmed, unchanged.*$gdb_prompt $" { + pass "$test" + } + } + } } + # Verify that GDB responds gracefully to the "signal" command with + # a missing argument. + + gdb_test "signal" \ + "Argument required .signal number..*" \ + "signal without arguments disallowed" + + # Verify that we can successfully send a signal other than 0 to + # the inferior. (This probably causes the inferior to run away. + # Be prepared to rerun to main for further testing.) + + gdb_test "signal SIGUSR1" "Breakpoint.*handler.*" + gdb_test "bt" \ + "#0 handler .*#1 .signal handler called.*\#2 .*main.*" \ + "backtrace for SIGUSR1" } return 0 diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/watchpoint.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/watchpoint.exp index 58b3527ede2..a69271b0aff 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/watchpoint.exp @@ -374,31 +374,8 @@ proc test_stepping {} { gdb_test "break func2 if 0" "Breakpoint.*at.*" gdb_test "p \$func2_breakpoint_number = \$bpnum" " = .*" - # The problem is that GDB confuses stepping through the call - # dummy with hitting the breakpoint at the end of the call dummy. - # Will be fixed once all architectures define - # DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. - setup_xfail "*-*-*" - # This doesn't occur if the call dummy starts with a call, - # because we are out of the dummy by the first time the inferior - # stops. - clear_xfail "arm*-*-*" - clear_xfail "xscale*-*-*" - clear_xfail "d10v*-*-*" - clear_xfail "m68*-*-*" - clear_xfail "i*86*-*-*" - clear_xfail "vax-*-*" - # The following architectures define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. - clear_xfail "alpha-*-*" - clear_xfail "mips*-*-*" - clear_xfail "sparc-*-*" - clear_xfail "hppa*-*-*bsd*" - # It works with the generic inferior function calling code too. - clear_xfail "mn10300*-*-*" - # The following architectures define CALL_DUMMY_HAS_COMPLETED. - clear_xfail "hppa*-*-*hpux*" gdb_test "p func1 ()" "= 73" \ - "calling function with watchpoint enabled" + "calling function with watchpoint enabled" # # "finish" brings us back to main. diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.c b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.c index 63d5d3dae09..7d4a647781f 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.c +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.c @@ -1,3 +1,23 @@ +/* This test program is part of GDB, the GNU debugger. + + Copyright 1992, 1993, 1994, 1997, 1999, 2004 + Free Software Foundation, Inc. + + 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. + */ + /* * Test file with lots of different types, for testing the * "whatis" command. @@ -7,10 +27,6 @@ * First the basic C types. */ -#if !(defined (__STDC__) || defined (_AIX)) -#define signed /**/ -#endif - char v_char; signed char v_signed_char; unsigned char v_unsigned_char; diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.exp index 98af77a3417..9b41d6a2ff4 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.base/whatis.exp @@ -1,5 +1,5 @@ -# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2002, +# 2003, 2004 Free Software Foundation, Inc. # 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 @@ -15,9 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - # This file was written by Rob Savoye. (rob@cygnus.com) if $tracelevel { @@ -75,19 +72,9 @@ gdb_test "whatis v_char" \ "type = (unsigned char|char)" \ "whatis char" -# If we did not use the signed keyword when compiling the file, don't -# expect GDB to know that char is signed. -if { $hp_cc_compiler || $hp_aCC_compiler } { - set signed_keyword_not_used 1 -} -if $signed_keyword_not_used then { - set signed_char "char" -} else { - set signed_char "signed char" -} if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" } gdb_test "whatis v_signed_char" \ - "type = $signed_char" \ + "type = (signed char|char)" \ "whatis signed char" gdb_test "whatis v_unsigned_char" \ diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.cp/pr-1553.cc b/gnu/usr.bin/binutils/gdb/testsuite/gdb.cp/pr-1553.cc deleted file mode 100644 index 58441fdb80f..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.cp/pr-1553.cc +++ /dev/null @@ -1,53 +0,0 @@ -class A { -public: - class B; - class C; -}; - -class A::B { - int a_b; - -public: - C* get_c(int i); -}; - -class A::C -{ - int a_c; -}; - -class E { -public: - class F; -}; - -class E::F { -public: - int e_f; - - F& operator=(const F &other); -}; - -void refer_to (E::F *f) { - // Do nothing. -} - -void refer_to (A::C **ref) { - // Do nothing. But, while we're at it, force out debug info for - // A::B and E::F. - - A::B b; - E::F f; - - refer_to (&f); -} - -int main () { - A::C* c_var; - A::B* b_var; - E *e_var; - - // Keep around a reference so that GCC 3.4 doesn't optimize the variable - // away. - refer_to (&c_var); -} diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.cp/pr-1553.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.cp/pr-1553.exp deleted file mode 100644 index fe9e2a26171..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.cp/pr-1553.exp +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright 2004 Free Software Foundation, Inc. - -# 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. - -# Test for PR gdb/1553. - -# This file is part of the gdb testsuite. - -set ws "\[\r\n\t \]+" - -if $tracelevel then { - strace $tracelevel -} - -if { [skip_cplus_tests] } { continue } - -# -# test running programs -# -set prms_id 0 -set bug_id 0 - -set testfile "pr-1553" -set srcfile ${testfile}.cc -set binfile ${objdir}/${subdir}/${testfile} - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} - -if [get_compiler_info ${binfile} "c++"] { - return -1 -} - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - -if ![runto_main] then { - perror "couldn't run to breakpoint" - continue -} - -gdb_test "ptype c_var" "type = class A::C \{${ws}private:${ws}int a_c;${ws}\} \\*" - -gdb_test "ptype E::F" "type = class E::F \{${ws}public:${ws}int e_f;${ws}E::F & operator=\\(E::F const ?&\\);${ws}\}" - -gdb_exit -return 0 diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.java/jmisc2.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.java/jmisc2.exp deleted file mode 100644 index 2eeb99df7ad..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.java/jmisc2.exp +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 2002 Free Software Foundation, Inc. - -# 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. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - -# This file was written by Anthony Green. (green@redhat.com) -# - -if $tracelevel then { - strace $tracelevel -} - -load_lib "java.exp" - -set testfile "jmisc" -set srcfile ${srcdir}/$subdir/${testfile}.java -set binfile ${objdir}/${subdir}/${testfile} -if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } { - untested "Couldn't compile ${srcfile}" - return -1 -} - -# Set the current language to java. This counts as a test. If it -# fails, then we skip the other tests. - -proc set_lang_java {} { - global gdb_prompt - global binfile objdir subdir - - verbose "loading file '$binfile'" - gdb_load $binfile - - send_gdb "set language java\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language java (timeout)" ; return 0 } - } - - return [gdb_test "show language" ".* source language is \"java\".*" \ - "set language to \"java\""] -} - -set prms_id 0 -set bug_id 0 - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -gdb_test "set print sevenbit-strings" ".*" - -if ![set_lang_java] then { - send_gdb "ptype jmisc\n" - gdb_expect { - -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { pass "ptype jmisc" } - -re ".*$gdb_prompt $" { fail "ptype jmisc" } - timeout { fail "ptype jmisc (timeout)" ; return } - } - - runto ${testfile}.main(java.lang.String\[\]) - - send_gdb "p args\n" - gdb_expect { - -re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $" { pass "p args" } - -re ".*$gdb_prompt $" { fail "p args" } - timeout { fail "p args (timeout)" ; return } - } - - send_gdb "p *args\n" - gdb_expect { - -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { pass "p *args" } - -re ".*$gdb_prompt $" { fail "p *args" } - timeout { fail "p *args (timeout)" ; return } - } -} diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.stabs/weird.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.stabs/weird.exp index 324f67b1f0b..7f67ccb132b 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.stabs/weird.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.stabs/weird.exp @@ -317,7 +317,7 @@ gdb_expect 60 { send_gdb "y\n" exp_continue } - -re "^Reading symbols from $binfile\\.\\.\\.done\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" { + -re "^Reading symbols from .*$binfile\\.\\.\\.done\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" { pass "weirdx.o read without error" } -re ".*$gdb_prompt $" { diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.c b/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.c index d82d550ffb4..abedb248b3e 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.c +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.c @@ -1,5 +1,5 @@ /* Pthreads test program. - Copyright 1996, 2002, 2003 + Copyright 1996, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Fred Fish of Cygnus Support @@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */ #include <stdio.h> +#include <stdlib.h> #include <pthread.h> /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.exp b/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.exp index 5dbe1a8348f..a60a3d372fe 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.threads/pthreads.exp @@ -1,4 +1,5 @@ -# Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. # 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 @@ -230,9 +231,9 @@ proc check_control_c {} { fail "Continue with all threads running (timeout)" } } - sleep 1 + after 2000 + send_gdb "\003" set description "Stopped with a ^C" - after 1000 [send_gdb "\003"] gdb_expect { -re "Program received signal SIGINT.*$gdb_prompt $" { pass $description diff --git a/gnu/usr.bin/binutils/gdb/testsuite/gdb.trace/gdb_c_test.c b/gnu/usr.bin/binutils/gdb/testsuite/gdb.trace/gdb_c_test.c index 77a6a093d9a..313508f6f77 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/gdb.trace/gdb_c_test.c +++ b/gnu/usr.bin/binutils/gdb/testsuite/gdb.trace/gdb_c_test.c @@ -3,7 +3,7 @@ ****************************************************************************** * * COPYRIGHT (C) by EMC Corporation, 1997 All rights reserved. - * $Id: gdb_c_test.c,v 1.2 2004/05/21 20:23:43 kettenis Exp $ + * $Id: gdb_c_test.c,v 1.3 2004/12/27 14:01:00 kettenis Exp $ * DESCRIPTION: This module has been provided for the purpose of testing GDB. * * NOTES: @@ -513,7 +513,7 @@ ULONG gdb_c_test( ULONG *parm ) end_of_stack = (unsigned long) &stack_ptr + sizeof(stack_ptr) + sizeof(end_of_stack) - 1; - printp ("\n$Id: gdb_c_test.c,v 1.2 2004/05/21 20:23:43 kettenis Exp $\n"); + printp ("\n$Id: gdb_c_test.c,v 1.3 2004/12/27 14:01:00 kettenis Exp $\n"); printp( "%s: arguments = %X, %X, %X, %X, %X, %X\n", p, parm[ 1 ], parm[ 2 ], parm[ 3 ], parm[ 4 ], parm[ 5 ], parm[ 6 ] ); diff --git a/gnu/usr.bin/binutils/gdb/testsuite/lib/gdb.exp b/gnu/usr.bin/binutils/gdb/testsuite/lib/gdb.exp index f49cbbf9855..91001185623 100644 --- a/gnu/usr.bin/binutils/gdb/testsuite/lib/gdb.exp +++ b/gnu/usr.bin/binutils/gdb/testsuite/lib/gdb.exp @@ -16,9 +16,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu - # This file was written by Fred Fish. (fnf@cygnus.com) # Generic gdb subroutines that should work for any target. If these @@ -183,7 +180,7 @@ proc gdb_run_cmd {args} { if [target_info exists gdb,do_reload_on_run] { # Specifying no file, defaults to the executable # currently being debugged. - if { [gdb_load ""] < 0 } { + if { [gdb_load ""] != 0 } { return; } send_gdb "continue\n"; @@ -228,7 +225,7 @@ proc gdb_run_cmd {args} { send_gdb "y\n" } -re "The program is not being run.*$gdb_prompt $" { - if { [gdb_load ""] < 0 } { + if { [gdb_load ""] != 0 } { return; } send_gdb "jump *$start\n"; @@ -250,7 +247,7 @@ proc gdb_run_cmd {args} { } if [target_info exists gdb,do_reload_on_run] { - if { [gdb_load ""] < 0 } { + if { [gdb_load ""] != 0 } { return; } } @@ -661,7 +658,7 @@ proc gdb_test_multiple { command message user_code } { fail "$errmsg" set result -1 } - -re ".*$gdb_prompt $" { + -re "\r\n$gdb_prompt $" { if ![string match "" $message] then { fail "$message" } @@ -700,7 +697,17 @@ proc gdb_test_multiple { command message user_code } { } set result 0 - gdb_expect $tmt $code + set code [catch {gdb_expect $tmt $code} string] + if {$code == 1} { + global errorInfo errorCode; + return -code error -errorinfo $errorInfo -errorcode $errorCode $string + } elseif {$code == 2} { + return -code return $string + } elseif {$code == 3} { + return + } elseif {$code > 4} { + return -code $code $string + } return $result } @@ -946,39 +953,56 @@ proc default_gdb_exit {} { unset gdb_spawn_id } +# Load a file into the debugger. +# The return value is 0 for success, -1 for failure. # -# load a file into the debugger. -# return a -1 if anything goes wrong. +# This procedure also set the global variable GDB_FILE_CMD_DEBUG_INFO +# to one of these values: # +# debug file was loaded successfully and has debug information +# nodebug file was loaded successfully and has no debug information +# fail file was not loaded +# +# I tried returning this information as part of the return value, +# but ran into a mess because of the many re-implementations of +# gdb_load in config/*.exp. +# +# TODO: gdb.base/sepdebug.exp and gdb.stabs/weird.exp might be able to use +# this if they can get more information set. + proc gdb_file_cmd { arg } { + global gdb_prompt global verbose - global loadpath - global loadfile global GDB - global gdb_prompt - upvar timeout timeout + + # Set whether debug info was found. + # Default to "fail". + global gdb_file_cmd_debug_info + set gdb_file_cmd_debug_info "fail" if [is_remote host] { - set arg [remote_download host $arg]; + set arg [remote_download host $arg] if { $arg == "" } { - error "download failed" - return -1; + perror "download failed" + return -1 } } send_gdb "file $arg\n" gdb_expect 120 { + -re "Reading symbols from.*no debugging symbols found.*done.*$gdb_prompt $" { + verbose "\t\tLoaded $arg into the $GDB with no debugging symbols" + set gdb_file_cmd_debug_info "nodebug" + return 0 + } -re "Reading symbols from.*done.*$gdb_prompt $" { verbose "\t\tLoaded $arg into the $GDB" - return 0 - } - -re "has no symbol-table.*$gdb_prompt $" { - perror "$arg wasn't compiled with \"-g\"" - return -1 + set gdb_file_cmd_debug_info "debug" + return 0 } -re "A program is being debugged already.*Kill it.*y or n. $" { send_gdb "y\n" - verbose "\t\tKilling previous program being debugged" + verbose "\t\tKilling previous program being debugged" exp_continue } -re "Load new symbol table from \".*\".*y or n. $" { @@ -986,32 +1010,33 @@ proc gdb_file_cmd { arg } { gdb_expect 120 { -re "Reading symbols from.*done.*$gdb_prompt $" { verbose "\t\tLoaded $arg with new symbol table into $GDB" - return 0 + set gdb_file_cmd_debug_info "debug" + return 0 } timeout { perror "(timeout) Couldn't load $arg, other program already loaded." - return -1 + return -1 } } } -re "No such file or directory.*$gdb_prompt $" { - perror "($arg) No such file or directory\n" - return -1 + perror "($arg) No such file or directory" + return -1 } -re "$gdb_prompt $" { perror "couldn't load $arg into $GDB." - return -1 + return -1 } timeout { perror "couldn't load $arg into $GDB (timed out)." - return -1 + return -1 } eof { # This is an attempt to detect a core dump, but seems not to # work. Perhaps we need to match .* followed by eof, in which # gdb_expect does not seem to have a way to do that. perror "couldn't load $arg into $GDB (end of file)." - return -1 + return -1 } } } @@ -1111,6 +1136,12 @@ proc skip_cplus_tests {} { return 0 } +# Return a 1 if I don't even want to try to test FORTRAN. + +proc skip_fortran_tests {} { + return 0 +} + # Skip all the tests in the file if you are not on an hppa running # hpux target. @@ -1124,7 +1155,6 @@ set compiler_info "unknown" set gcc_compiled 0 set hp_cc_compiler 0 set hp_aCC_compiler 0 -set signed_keyword_not_used 0 # Figure out what compiler I am using. # @@ -1190,10 +1220,11 @@ proc get_compiler_info {binfile args} { # These come from compiler.c or compiler.cc global compiler_info + + # Legacy global data symbols. global gcc_compiled global hp_cc_compiler global hp_aCC_compiler - global signed_keyword_not_used # Choose which file to preprocess. set ifile "${srcdir}/lib/compiler.c" @@ -1207,15 +1238,42 @@ proc get_compiler_info {binfile args} { set cppout [ gdb_compile "${ifile}" "" preprocess [list "$args" quiet] ] log_file -a "$outdir/$tool.log" - # Source the output. + # Eval the output. + set unknown 0 foreach cppline [ split "$cppout" "\n" ] { - if { ! [ regexp "^#" "$cppline" ] } { - if { ! [ regexp "^\[\n\r\t \]*$" "$cppline" ] } { - verbose "get_compiler_info: $cppline" 2 - eval "$cppline" - } + if { [ regexp "^#" "$cppline" ] } { + # line marker + } elseif { [ regexp "^\[\n\r\t \]*$" "$cppline" ] } { + # blank line + } elseif { [ regexp "^\[\n\r\t \]*set\[\n\r\t \]" "$cppline" ] } { + # eval this line + verbose "get_compiler_info: $cppline" 2 + eval "$cppline" + } else { + # unknown line + verbose -log "get_compiler_info: $cppline" + set unknown 1 } } + + # Reset to unknown compiler if any diagnostics happened. + if { $unknown } { + set compiler_info "unknown" + } + + # Set the legacy symbols. + set gcc_compiled 0 + set hp_cc_compiler 0 + set hp_aCC_compiler 0 + if { [regexp "^gcc-1-" "$compiler_info" ] } { set gcc_compiled 1 } + if { [regexp "^gcc-2-" "$compiler_info" ] } { set gcc_compiled 2 } + if { [regexp "^gcc-3-" "$compiler_info" ] } { set gcc_compiled 3 } + if { [regexp "^gcc-4-" "$compiler_info" ] } { set gcc_compiled 4 } + if { [regexp "^gcc-5-" "$compiler_info" ] } { set gcc_compiled 5 } + if { [regexp "^hpcc-" "$compiler_info" ] } { set hp_cc_compiler 1 } + if { [regexp "^hpacc-" "$compiler_info" ] } { set hp_aCC_compiler 1 } + + # Log what happened. verbose -log "get_compiler_info: $compiler_info" # Most compilers will evaluate comparisons and other boolean @@ -1593,7 +1651,7 @@ proc gdb_exit { } { # # gdb_load -- load a file into the debugger. -# return a -1 if anything goes wrong. +# Many files in config/*.exp override this procedure. # proc gdb_load { arg } { return [gdb_file_cmd $arg] @@ -1763,66 +1821,107 @@ proc gdb_step_for_stub { } { } } -### gdb_get_line_number TEXT [FILE] -### -### Search the source file FILE, and return the line number of a line -### containing TEXT. Use this function instead of hard-coding line -### numbers into your test script. -### -### Specifically, this function uses GDB's "search" command to search -### FILE for the first line containing TEXT, and returns its line -### number. Thus, FILE must be a source file, compiled into the -### executable you are running. If omitted, FILE defaults to the -### value of the global variable `srcfile'; most test scripts set -### `srcfile' appropriately at the top anyway. -### -### Use this function to keep your test scripts independent of the -### exact line numbering of the source file. Don't write: -### -### send_gdb "break 20" -### -### This means that if anyone ever edits your test's source file, -### your test could break. Instead, put a comment like this on the -### source file line you want to break at: -### -### /* breakpoint spot: frotz.exp: test name */ -### -### and then write, in your test script (which we assume is named -### frotz.exp): -### -### send_gdb "break [gdb_get_line_number "frotz.exp: test name"]\n" -### -### (Yes, Tcl knows how to handle the nested quotes and brackets. -### Try this: -### $ tclsh -### % puts "foo [lindex "bar baz" 1]" -### foo baz -### % -### Tcl is quite clever, for a little stringy language.) - -proc gdb_get_line_number {text {file /omitted/}} { - global gdb_prompt; - global srcfile; +# gdb_get_line_number TEXT [FILE] +# +# Search the source file FILE, and return the line number of the +# first line containing TEXT. If no match is found, return -1. +# +# TEXT is a string literal, not a regular expression. +# +# The default value of FILE is "$srcdir/$subdir/$srcfile". If FILE is +# specified, and does not start with "/", then it is assumed to be in +# "$srcdir/$subdir". This is awkward, and can be fixed in the future, +# by changing the callers and the interface at the same time. +# In particular: gdb.base/break.exp, gdb.base/condbreak.exp, +# gdb.base/ena-dis-br.exp. +# +# Use this function to keep your test scripts independent of the +# exact line numbering of the source file. Don't write: +# +# send_gdb "break 20" +# +# This means that if anyone ever edits your test's source file, +# your test could break. Instead, put a comment like this on the +# source file line you want to break at: +# +# /* breakpoint spot: frotz.exp: test name */ +# +# and then write, in your test script (which we assume is named +# frotz.exp): +# +# send_gdb "break [gdb_get_line_number "frotz.exp: test name"]\n" +# +# (Yes, Tcl knows how to handle the nested quotes and brackets. +# Try this: +# $ tclsh +# % puts "foo [lindex "bar baz" 1]" +# foo baz +# % +# Tcl is quite clever, for a little stringy language.) +# +# === +# +# The previous implementation of this procedure used the gdb search command. +# This version is different: +# +# . It works with MI, and it also works when gdb is not running. +# +# . It operates on the build machine, not the host machine. +# +# . For now, this implementation fakes a current directory of +# $srcdir/$subdir to be compatible with the old implementation. +# This will go away eventually and some callers will need to +# be changed. +# +# . The TEXT argument is literal text and matches literally, +# not a regular expression as it was before. +# +# . State changes in gdb, such as changing the current file +# and setting $_, no longer happen. +# +# After a bit of time we can forget about the differences from the +# old implementation. +# +# --chastain 2004-08-05 - if {! [string compare $file /omitted/]} { - set file $srcfile +proc gdb_get_line_number { text { file "" } } { + global srcdir + global subdir + global srcfile + + if { "$file" == "" } then { + set file "$srcfile" + } + if { ! [regexp "^/" "$file"] } then { + set file "$srcdir/$subdir/$file" } - set result -1; - gdb_test "list ${file}:1,1" ".*" "" - send_gdb "search ${text}\n" - gdb_expect { - -re "\[\r\n\]+(\[0-9\]+)\[ \t\].*${text}.*$gdb_prompt $" { - set result $expect_out(1,string) - } - -re ".*$gdb_prompt $" { - fail "find line number containing \"${text}\"" - } - timeout { - fail "find line number containing \"${text}\" (timeout)" - } + if { [ catch { set fd [open "$file"] } message ] } then { + perror "$message" + return -1 } - return $result; + + set found -1 + for { set line 1 } { 1 } { incr line } { + if { [ catch { set nchar [gets "$fd" body] } message ] } then { + perror "$message" + return -1 + } + if { $nchar < 0 } then { + break + } + if { [string first "$text" "$body"] >= 0 } then { + set found $line + break + } + } + + if { [ catch { close "$fd" } message ] } then { + perror "$message" + return -1 + } + + return $found } # gdb_continue_to_end: diff --git a/gnu/usr.bin/binutils/gdb/testsuite/lib/insight-support.exp b/gnu/usr.bin/binutils/gdb/testsuite/lib/insight-support.exp deleted file mode 100644 index cbdf163c85f..00000000000 --- a/gnu/usr.bin/binutils/gdb/testsuite/lib/insight-support.exp +++ /dev/null @@ -1,318 +0,0 @@ -# GDB Testsuite Support for Insight. -# -# Copyright 2001 Red Hat, Inc. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License (GPL) 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. - -# Initializes the display for gdbtk testing. -# Returns 1 if tests should run, 0 otherwise. -proc gdbtk_initialize_display {} { - global _using_windows - - # This is hacky, but, we don't have much choice. When running - # expect under Windows, tcl_platform(platform) is "unix". - if {![info exists _using_windows]} { - set _using_windows [expr {![catch {exec cygpath --help}]}] - } - - if {![_gdbtk_xvfb_init]} { - if {$_using_windows} { - untested "No GDB_DISPLAY -- skipping tests" - } else { - untested "No GDB_DISPLAY or Xvfb -- skipping tests" - } - - return 0 - } - - return 1 -} - -# From dejagnu: -# srcdir = testsuite src dir (e.g., devo/gdb/testsuite) -# objdir = testsuite obj dir (e.g., gdb/testsuite) -# subdir = subdir of testsuite (e.g., gdb.gdbtk) -# -# To gdbtk: -# env(DEFS)=the "defs" files (e.g., devo/gdb/testsuite/gdb.gdbtk/defs) -# env(SRCDIR)=directory containing the test code (e.g., *.test) -# env(OBJDIR)=directory which contains any executables -# (e.g., gdb/testsuite/gdb.gdbtk) -proc gdbtk_start {test} { - global verbose - global GDB - global GDBFLAGS - global env srcdir subdir objdir - - gdb_stop_suppressing_tests; - - # Need to convert ::GDB to use (-)?insight... - if {[regsub {gdb$} $GDB insight newGDB]} { - set INSIGHT $newGDB - } else { - perror "Cannot find Insight executable" - exit 1 - } - - verbose "Starting $INSIGHT -nx -q --tclcommand=$test" - - set real_test [which $test] - if {$real_test == 0} { - perror "$test is not found" - exit 1 - } - - if {![is_remote host]} { - if { [which $INSIGHT] == 0 } { - perror "$INSIGHT does not exist." - exit 1 - } - } - - set wd [pwd] - - # Find absolute path to test - set test [to_tcl_path -abs $test] - - # Set some environment variables - cd $srcdir - set abs_srcdir [pwd] - set env(DEFS) [to_tcl_path -abs [file join $abs_srcdir $subdir defs]] - - cd $wd - cd [file join $objdir $subdir] - set env(OBJDIR) [pwd] - cd $wd - - # Set info about target into env - _gdbtk_export_target_info - - set env(SRCDIR) $abs_srcdir - set env(GDBTK_VERBOSE) 1 - set env(GDBTK_LOGFILE) [to_tcl_path [file join $objdir gdb.log]] - - set err [catch {exec $INSIGHT -nx -q --tclcommand=$test} res] - if { $err } { - perror "Execing $INSIGHT failed: $res" - append res "\nERROR gdb-crash" - } - return $res -} - -# Start xvfb when using it. -# The precedence is: -# 1. If GDB_DISPLAY is set (and not ""), use it -# 2. If Xvfb exists, use it (not on cygwin) -# 3. Skip tests -proc _gdbtk_xvfb_init {} { - global env spawn_id _xvfb_spawn_id _using_windows - - if {[info exists env(GDB_DISPLAY)]} { - if {$env(GDB_DISPLAY) != ""} { - set env(DISPLAY) $env(GDB_DISPLAY) - } else { - # Suppress tests - return 0 - } - } elseif {!$_using_windows && [which Xvfb] != 0} { - set screen ":[getpid]" - set pid [spawn Xvfb $screen -ac] - set _xvfb_spawn_id $spawn_id - set env(DISPLAY) localhost$screen - } else { - # No Xvfb found -- skip test - return 0 - } - - return 1 -} - -# Kill xvfb -proc _gdbtk_xvfb_exit {} { - global objdir subdir env _xvfb_spawn_id - - if {[info exists _xvfb_spawn_id]} { - exec kill [exp_pid -i $_xvfb_spawn_id] - wait -i $_xvfb_spawn_id - } -} - -# help proc for setting tcl-style paths from unix-style paths -# pass "-abs" to make it an absolute path -proc to_tcl_path {unix_path {arg {}}} { - global _using_windows - - if {[string compare $unix_path "-abs"] == 0} { - set unix_path $arg - set wd [pwd] - cd [file dirname $unix_path] - set dirname [pwd] - set unix_name [file join $dirname [file tail $unix_path]] - cd $wd - } - - if {$_using_windows} { - set unix_path [exec cygpath -aw $unix_path] - set unix_path [join [split $unix_path \\] /] - } - - return $unix_path -} - -# Set information about the target into the environment -# variable TARGET_INFO. This array will contain a list -# of commands that are necessary to run a target. -# -# This is mostly devined from how dejagnu works, what -# procs are defined, and analyzing unix.exp, monitor.exp, -# and sim.exp. -# -# Array elements exported: -# Index Meaning -# ----- ------- -# init list of target/board initialization commands -# target target command for target/board -# load load command for target/board -# run run command for target_board -proc _gdbtk_export_target_info {} { - global env - - # Figure out what "target class" the testsuite is using, - # i.e., sim, monitor, native - if {[string compare [info proc gdb_target_monitor] gdb_target_monitor] == 0} { - # Using a monitor/remote target - set target monitor - } elseif {[string compare [info proc gdb_target_sim] gdb_target_sim] == 0} { - # Using a simulator target - set target simulator - } elseif {[string compare [info proc gdb_target_sid] gdb_target_sid] == 0} { - # Using sid - set target sid - } else { - # Assume native - set target native - } - - # Now setup the array to be exported. - set info(init) {} - set info(target) {} - set info(load) {} - set info(run) {} - - switch $target { - simulator { - set opts "[target_info gdb,target_sim_options]" - set info(target) "target sim $opts" - set info(load) "load" - set info(run) "run" - } - - monitor { - # Setup options for the connection - if {[target_info exists baud]} { - lappend info(init) "set remotebaud [target_info baud]" - } - if {[target_info exists binarydownload]} { - lappend info(init) "set remotebinarydownload [target_info binarydownload]" - } - if {[target_info exists disable_x_packet]} { - lappend info(init) "set remote X-packet disable" - } - if {[target_info exists disable_z_packet]} { - lappend info(init) "set remote Z-packet disable" - } - - # Get target name and connection info - if {[target_info exists gdb_protocol]} { - set targetname "[target_info gdb_protocol]" - } else { - set targetname "not_specified" - } - if {[target_info exists gdb_serial]} { - set serialport "[target_info gdb_serial]" - } elseif {[target_info exists netport]} { - set serialport "[target_info netport]" - } else { - set serialport "[target_info serial]" - } - - set info(target) "target $targetname $serialport" - set info(load) "load" - set info(run) "continue" - } - - sid { - # We must start sid first, since Insight won't have a clue - # about how to do this. - sid_start - set info(target) "target [target_info gdb_protocol] [target_info netport]" - set info(load) "load" - set info(run) "continue" - } - - native { - set info(run) "run" - } - } - - # Export the array to the environment - set env(TARGET_INFO) [array get info] -} - -# gdbtk tests call this function to print out the results of the -# tests. The argument is a proper list of lists of the form: -# {status name description msg}. All of these things typically -# come from the testsuite harness. -proc gdbtk_analyze_results {results} { - foreach test $results { - set status [lindex $test 0] - set name [lindex $test 1] - set description [lindex $test 2] - set msg [lindex $test 3] - - switch $status { - PASS { - pass "$description ($name)" - } - - FAIL { - fail "$description ($name)" - } - - ERROR { - perror "$name" - } - - XFAIL { - xfail "$description ($name)" - } - - XPASS { - xpass "$description ($name)" - } - } - } -} - -proc gdbtk_done {{results {}}} { - global _xvfb_spawn_id - gdbtk_analyze_results $results - - # Kill off xvfb if using it - if {[info exists _xvfb_spawn_id]} { - _gdbtk_xvfb_exit - } - - # Yich. If we're using sid, we must kill it - if {[string compare [info proc gdb_target_sid] gdb_target_sid] == 0} { - sid_exit - } -} diff --git a/gnu/usr.bin/binutils/gdb/thread.c b/gnu/usr.bin/binutils/gdb/thread.c index f8cc18d72a2..a52395bd144 100644 --- a/gnu/usr.bin/binutils/gdb/thread.c +++ b/gnu/usr.bin/binutils/gdb/thread.c @@ -1,7 +1,7 @@ /* Multi-process/thread control for GDB, the GNU debugger. Copyright 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. @@ -294,7 +294,6 @@ load_infrun_state (ptid_t ptid, CORE_ADDR *prev_pc, int *trap_expected, struct breakpoint **step_resume_breakpoint, - struct breakpoint **through_sigtramp_breakpoint, CORE_ADDR *step_range_start, CORE_ADDR *step_range_end, struct frame_id *step_frame_id, @@ -302,9 +301,8 @@ load_infrun_state (ptid_t ptid, int *another_trap, int *stepping_through_solib_after_catch, bpstat *stepping_through_solib_catchpoints, - int *stepping_through_sigtramp, int *current_line, - struct symtab **current_symtab, CORE_ADDR *step_sp) + struct symtab **current_symtab) { struct thread_info *tp; @@ -317,7 +315,6 @@ load_infrun_state (ptid_t ptid, *prev_pc = tp->prev_pc; *trap_expected = tp->trap_expected; *step_resume_breakpoint = tp->step_resume_breakpoint; - *through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint; *step_range_start = tp->step_range_start; *step_range_end = tp->step_range_end; *step_frame_id = tp->step_frame_id; @@ -327,10 +324,8 @@ load_infrun_state (ptid_t ptid, tp->stepping_through_solib_after_catch; *stepping_through_solib_catchpoints = tp->stepping_through_solib_catchpoints; - *stepping_through_sigtramp = tp->stepping_through_sigtramp; *current_line = tp->current_line; *current_symtab = tp->current_symtab; - *step_sp = tp->step_sp; } /* Save infrun state for the thread PID. */ @@ -340,7 +335,6 @@ save_infrun_state (ptid_t ptid, CORE_ADDR prev_pc, int trap_expected, struct breakpoint *step_resume_breakpoint, - struct breakpoint *through_sigtramp_breakpoint, CORE_ADDR step_range_start, CORE_ADDR step_range_end, const struct frame_id *step_frame_id, @@ -348,9 +342,8 @@ save_infrun_state (ptid_t ptid, int another_trap, int stepping_through_solib_after_catch, bpstat stepping_through_solib_catchpoints, - int stepping_through_sigtramp, int current_line, - struct symtab *current_symtab, CORE_ADDR step_sp) + struct symtab *current_symtab) { struct thread_info *tp; @@ -363,7 +356,6 @@ save_infrun_state (ptid_t ptid, tp->prev_pc = prev_pc; tp->trap_expected = trap_expected; tp->step_resume_breakpoint = step_resume_breakpoint; - tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint; tp->step_range_start = step_range_start; tp->step_range_end = step_range_end; tp->step_frame_id = (*step_frame_id); @@ -371,10 +363,8 @@ save_infrun_state (ptid_t ptid, tp->another_trap = another_trap; tp->stepping_through_solib_after_catch = stepping_through_solib_after_catch; tp->stepping_through_solib_catchpoints = stepping_through_solib_catchpoints; - tp->stepping_through_sigtramp = stepping_through_sigtramp; tp->current_line = current_line; tp->current_symtab = current_symtab; - tp->step_sp = step_sp; } /* Return true if TP is an active thread. */ @@ -417,15 +407,9 @@ info_threads_command (char *arg, int from_tty) struct thread_info *tp; ptid_t current_ptid; struct frame_info *cur_frame; - int saved_frame_level = frame_relative_level (get_selected_frame ()); - int counter; + struct frame_id saved_frame_id = get_frame_id (get_selected_frame ()); char *extra_info; - /* Check that there really is a frame. This happens when a simulator - is connected but not loaded or running, for instance. */ - if (legacy_frame_p (current_gdbarch) && saved_frame_level < 0) - error ("No frame."); - prune_threads (); target_find_new_threads (); current_ptid = inferior_ptid; @@ -436,11 +420,7 @@ info_threads_command (char *arg, int from_tty) else printf_filtered (" "); -#ifdef HPUXHPPA printf_filtered ("%d %s", tp->num, target_tid_to_str (tp->ptid)); -#else - printf_filtered ("%d %s", tp->num, target_pid_to_str (tp->ptid)); -#endif extra_info = target_extra_thread_info (tp); if (extra_info) @@ -448,32 +428,28 @@ info_threads_command (char *arg, int from_tty) puts_filtered (" "); switch_to_thread (tp->ptid); - print_stack_frame (get_selected_frame (), -1, 0); + print_stack_frame (get_selected_frame (), 0, LOCATION); } switch_to_thread (current_ptid); - /* Code below copied from "up_silently_base" in "stack.c". - * It restores the frame set by the user before the "info threads" - * command. We have finished the info-threads display by switching - * back to the current thread. That switch has put us at the top - * of the stack (leaf frame). - */ - counter = saved_frame_level; - cur_frame = find_relative_frame (get_selected_frame (), &counter); - if (counter != 0) + /* Restores the frame set by the user before the "info threads" + command. We have finished the info-threads display by switching + back to the current thread. That switch has put us at the top of + the stack (leaf frame). */ + cur_frame = frame_find_by_id (saved_frame_id); + if (cur_frame == NULL) { - /* Ooops, can't restore, tell user where we are. */ + /* Ooops, can't restore, tell user where we are. */ warning ("Couldn't restore frame in current thread, at frame 0"); - print_stack_frame (get_selected_frame (), -1, 0); + print_stack_frame (get_selected_frame (), 0, LOCATION); } else { select_frame (cur_frame); + /* re-show current frame. */ + show_stack_frame (cur_frame); } - - /* re-show current frame. */ - show_stack_frame (cur_frame); } /* Switch from one thread to another. */ @@ -497,7 +473,7 @@ restore_current_thread (ptid_t ptid) if (!ptid_equal (ptid, inferior_ptid)) { switch_to_thread (ptid); - print_stack_frame (get_current_frame (), 0, -1); + print_stack_frame (get_current_frame (), 1, SRC_LINE); } } @@ -557,13 +533,8 @@ thread_apply_all_command (char *cmd, int from_tty) if (thread_alive (tp)) { switch_to_thread (tp->ptid); -#ifdef HPUXHPPA printf_filtered ("\nThread %d (%s):\n", tp->num, target_tid_to_str (inferior_ptid)); -#else - printf_filtered ("\nThread %d (%s):\n", tp->num, - target_pid_to_str (inferior_ptid)); -#endif execute_command (cmd, from_tty); strcpy (cmd, saved_cmd); /* Restore exact command used previously */ } @@ -633,13 +604,8 @@ thread_apply_command (char *tidlist, int from_tty) else { switch_to_thread (tp->ptid); -#ifdef HPUXHPPA printf_filtered ("\nThread %d (%s):\n", tp->num, target_tid_to_str (inferior_ptid)); -#else - printf_filtered ("\nThread %d (%s):\n", tp->num, - target_pid_to_str (inferior_ptid)); -#endif execute_command (cmd, from_tty); strcpy (cmd, saved_cmd); /* Restore exact command used previously */ } @@ -662,12 +628,7 @@ thread_command (char *tidstr, int from_tty) if (target_has_stack) printf_filtered ("[Current thread is %d (%s)]\n", pid_to_thread_id (inferior_ptid), -#if defined(HPUXHPPA) - target_tid_to_str (inferior_ptid) -#else - target_pid_to_str (inferior_ptid) -#endif - ); + target_tid_to_str (inferior_ptid)); else error ("No stack."); return; @@ -697,15 +658,10 @@ do_captured_thread_select (struct ui_out *uiout, void *tidstr) ui_out_text (uiout, "[Switching to thread "); ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_ptid)); ui_out_text (uiout, " ("); -#if defined(HPUXHPPA) ui_out_text (uiout, target_tid_to_str (inferior_ptid)); -#else - ui_out_text (uiout, target_pid_to_str (inferior_ptid)); -#endif ui_out_text (uiout, ")]"); - print_stack_frame (deprecated_selected_frame, - frame_relative_level (deprecated_selected_frame), 1); + print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); return GDB_RC_OK; } diff --git a/gnu/usr.bin/binutils/gdb/top.c b/gnu/usr.bin/binutils/gdb/top.c index d6bdfd09284..618dc86ecb2 100644 --- a/gnu/usr.bin/binutils/gdb/top.c +++ b/gnu/usr.bin/binutils/gdb/top.c @@ -193,103 +193,104 @@ static void stop_sig (int); If the UI fails to initialize and it wants GDB to continue using the default UI, then it should clear this hook before returning. */ -void (*init_ui_hook) (char *argv0); +void (*deprecated_init_ui_hook) (char *argv0); /* This hook is called from within gdb's many mini-event loops which could steal control from a real user interface's event loop. It returns non-zero if the user is requesting a detach, zero otherwise. */ -int (*ui_loop_hook) (int); +int (*deprecated_ui_loop_hook) (int); /* Called instead of command_loop at top level. Can be invoked via throw_exception(). */ -void (*command_loop_hook) (void); +void (*deprecated_command_loop_hook) (void); /* Called from print_frame_info to list the line we stopped in. */ -void (*print_frame_info_listing_hook) (struct symtab * s, int line, - int stopline, int noerror); +void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, int line, + int stopline, int noerror); /* Replaces most of query. */ -int (*query_hook) (const char *, va_list); +int (*deprecated_query_hook) (const char *, va_list); /* Replaces most of warning. */ -void (*warning_hook) (const char *, va_list); +void (*deprecated_warning_hook) (const char *, va_list); -/* These three functions support getting lines of text from the user. They - are used in sequence. First readline_begin_hook is called with a text - string that might be (for example) a message for the user to type in a - sequence of commands to be executed at a breakpoint. If this function - calls back to a GUI, it might take this opportunity to pop up a text - interaction window with this message. Next, readline_hook is called - with a prompt that is emitted prior to collecting the user input. - It can be called multiple times. Finally, readline_end_hook is called - to notify the GUI that we are done with the interaction window and it - can close it. */ +/* These three functions support getting lines of text from the user. + They are used in sequence. First deprecated_readline_begin_hook is + called with a text string that might be (for example) a message for + the user to type in a sequence of commands to be executed at a + breakpoint. If this function calls back to a GUI, it might take + this opportunity to pop up a text interaction window with this + message. Next, deprecated_readline_hook is called with a prompt + that is emitted prior to collecting the user input. It can be + called multiple times. Finally, deprecated_readline_end_hook is + called to notify the GUI that we are done with the interaction + window and it can close it. */ -void (*readline_begin_hook) (char *, ...); -char *(*readline_hook) (char *); -void (*readline_end_hook) (void); +void (*deprecated_readline_begin_hook) (char *, ...); +char *(*deprecated_readline_hook) (char *); +void (*deprecated_readline_end_hook) (void); /* Called as appropriate to notify the interface of the specified breakpoint conditions. */ -void (*create_breakpoint_hook) (struct breakpoint * bpt); -void (*delete_breakpoint_hook) (struct breakpoint * bpt); -void (*modify_breakpoint_hook) (struct breakpoint * bpt); +void (*deprecated_create_breakpoint_hook) (struct breakpoint * bpt); +void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt); +void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt); /* Called as appropriate to notify the interface that we have attached to or detached from an already running process. */ -void (*attach_hook) (void); -void (*detach_hook) (void); +void (*deprecated_attach_hook) (void); +void (*deprecated_detach_hook) (void); /* Called during long calculations to allow GUI to repair window damage, and to check for stop buttons, etc... */ -void (*interactive_hook) (void); +void (*deprecated_interactive_hook) (void); /* Called when the registers have changed, as a hint to a GUI to minimize window update. */ -void (*registers_changed_hook) (void); +void (*deprecated_registers_changed_hook) (void); /* Tell the GUI someone changed the register REGNO. -1 means that the caller does not know which register changed or that several registers have changed (see value_assign). */ -void (*register_changed_hook) (int regno); +void (*deprecated_register_changed_hook) (int regno); /* Tell the GUI someone changed LEN bytes of memory at ADDR */ -void (*memory_changed_hook) (CORE_ADDR addr, int len); +void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len); /* Called when going to wait for the target. Usually allows the GUI to run while waiting for target events. */ -ptid_t (*target_wait_hook) (ptid_t ptid, - struct target_waitstatus * status); +ptid_t (*deprecated_target_wait_hook) (ptid_t ptid, + struct target_waitstatus * status); /* Used by UI as a wrapper around command execution. May do various things like enabling/disabling buttons, etc... */ -void (*call_command_hook) (struct cmd_list_element * c, char *cmd, - int from_tty); +void (*deprecated_call_command_hook) (struct cmd_list_element * c, char *cmd, + int from_tty); /* Called after a `set' command has finished. Is only run if the `set' command succeeded. */ -void (*set_hook) (struct cmd_list_element * c); +void (*deprecated_set_hook) (struct cmd_list_element * c); /* Called when the current thread changes. Argument is thread id. */ -void (*context_hook) (int id); +void (*deprecated_context_hook) (int id); /* Takes control from error (). Typically used to prevent longjmps out of the middle of the GUI. Usually used in conjunction with a catch routine. */ -NORETURN void (*error_hook) (void) ATTR_NORETURN; +void (*deprecated_error_hook) (void); /* One should use catch_errors rather than manipulating these @@ -321,9 +322,9 @@ throw_exception (enum return_reason reason) disable_current_display (); do_cleanups (ALL_CLEANUPS); - if (event_loop_p && target_can_async_p () && !target_executing) + if (target_can_async_p () && !target_executing) do_exec_cleanups (ALL_CLEANUPS); - if (event_loop_p && sync_execution) + if (sync_execution) do_exec_error_cleanups (ALL_CLEANUPS); if (annotation_level > 1) @@ -577,8 +578,6 @@ catch_command_errors (catch_command_errors_ftype * command, /* Handler for SIGHUP. */ #ifdef SIGHUP -/* Just a little helper function for disconnect(). */ - /* NOTE 1999-04-29: This function will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ @@ -590,15 +589,6 @@ quit_cover (void *s) quit_command ((char *) 0, 0); return 0; } - -static void -disconnect (int signo) -{ - catch_errors (quit_cover, NULL, - "Could not kill the program being debugged", RETURN_MASK_ALL); - signal (SIGHUP, SIG_DFL); - kill (getpid (), SIGHUP); -} #endif /* defined SIGHUP */ /* Line number we are currently in in a file which is being sourced. */ @@ -695,7 +685,7 @@ execute_command (char *p, int from_tty) /* If the target is running, we allow only a limited set of commands. */ - if (event_loop_p && target_can_async_p () && target_executing) + if (target_can_async_p () && target_executing) if (strcmp (c->name, "help") != 0 && strcmp (c->name, "pwd") != 0 && strcmp (c->name, "show") != 0 @@ -737,8 +727,8 @@ execute_command (char *p, int from_tty) do_setshow_command (arg, from_tty & caution, c); else if (!cmd_func_p (c)) error ("That is not a command, just a help topic."); - else if (call_command_hook) - call_command_hook (c, arg, from_tty & caution); + else if (deprecated_call_command_hook) + deprecated_call_command_hook (c, arg, from_tty & caution); else cmd_func (c, arg, from_tty & caution); @@ -942,15 +932,11 @@ gdb_readline (char *prompt_arg) } if (c == '\n') -#ifndef CRLF_SOURCE_FILES - break; -#else { if (input_index > 0 && result[input_index - 1] == '\r') input_index--; break; } -#endif result[input_index++] = c; while (input_index >= result_size) @@ -990,7 +976,7 @@ char * gdb_readline_wrapper (char *prompt) { /* Set the hook that works in this case. */ - if (event_loop_p && after_char_processing_hook) + if (after_char_processing_hook) { rl_pre_input_hook = (Function *) after_char_processing_hook; after_char_processing_hook = NULL; @@ -1051,37 +1037,6 @@ do_nothing (int signo) signal (signo, do_nothing); } -static void -init_signals (void) -{ - signal (SIGINT, request_quit); - - /* If SIGTRAP was set to SIG_IGN, then the SIG_IGN will get passed - to the inferior and breakpoints will be ignored. */ -#ifdef SIGTRAP - signal (SIGTRAP, SIG_DFL); -#endif - - /* If we initialize SIGQUIT to SIG_IGN, then the SIG_IGN will get - passed to the inferior, which we don't want. It would be - possible to do a "signal (SIGQUIT, SIG_DFL)" after we fork, but - on BSD4.3 systems using vfork, that can affect the - GDB process as well as the inferior (the signal handling tables - might be in memory, shared between the two). Since we establish - a handler for SIGQUIT, when we call exec it will set the signal - to SIG_DFL for us. */ - signal (SIGQUIT, do_nothing); -#ifdef SIGHUP - if (signal (SIGHUP, do_nothing) != SIG_IGN) - signal (SIGHUP, disconnect); -#endif - signal (SIGFPE, float_handler); - -#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER) - signal (SIGWINCH, SIGWINCH_HANDLER); -#endif -} - /* The current saved history number from operate-and-get-next. This is -1 if not valid. */ static int operate_saved_history = -1; @@ -1113,17 +1068,8 @@ gdb_rl_operate_and_get_next (int count, int key) { int where; - if (event_loop_p) - { - /* Use the async hook. */ - after_char_processing_hook = gdb_rl_operate_and_get_next_completion; - } - else - { - /* This hook only works correctly when we are using the - synchronous readline. */ - rl_pre_input_hook = (Function *) gdb_rl_operate_and_get_next_completion; - } + /* Use the async hook. */ + after_char_processing_hook = gdb_rl_operate_and_get_next_completion; /* Find the current line, and find the next line to use. */ where = where_history(); @@ -1199,12 +1145,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix) immediate_quit++; #ifdef STOP_SIGNAL if (job_control) - { - if (event_loop_p) - signal (STOP_SIGNAL, handle_stop_sig); - else - signal (STOP_SIGNAL, stop_sig); - } + signal (STOP_SIGNAL, handle_stop_sig); #endif while (1) @@ -1234,9 +1175,9 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix) } /* Don't use fancy stuff if not talking to stdin. */ - if (readline_hook && instream == NULL) + if (deprecated_readline_hook && instream == NULL) { - rl = (*readline_hook) (local_prompt); + rl = (*deprecated_readline_hook) (local_prompt); } else if (command_editing_p && instream == stdin && ISATTY (instream)) { @@ -1418,10 +1359,7 @@ There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n" char * get_prompt (void) { - if (event_loop_p) - return PROMPT (0); - else - return gdb_prompt_string; + return PROMPT (0); } void @@ -1432,10 +1370,7 @@ set_prompt (char *s) if (prompt != NULL) xfree (prompt); */ - if (event_loop_p) - PROMPT (0) = savestring (s, strlen (s)); - else - gdb_prompt_string = savestring (s, strlen (s)); + PROMPT (0) = savestring (s, strlen (s)); } @@ -1452,7 +1387,7 @@ quit_confirm (void) /* This is something of a hack. But there's no reliable way to see if a GUI is running. The `use_windows' variable doesn't cut it. */ - if (init_ui_hook) + if (deprecated_init_ui_hook) s = "A debugging session is active.\nDo you still want to close the debugger?"; else if (attach_flag) s = "The program is running. Quit anyway (and detach it)? "; @@ -1712,32 +1647,23 @@ init_main (void) { struct cmd_list_element *c; - /* If we are running the asynchronous version, - we initialize the prompts differently. */ - if (!event_loop_p) - { - gdb_prompt_string = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); - } - else - { - /* initialize the prompt stack to a simple "(gdb) " prompt or to - whatever the DEFAULT_PROMPT is. */ - the_prompts.top = 0; - PREFIX (0) = ""; - PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); - SUFFIX (0) = ""; - /* Set things up for annotation_level > 1, if the user ever decides - to use it. */ - async_annotation_suffix = "prompt"; - /* Set the variable associated with the setshow prompt command. */ - new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0))); - - /* If gdb was started with --annotate=2, this is equivalent to - the user entering the command 'set annotate 2' at the gdb - prompt, so we need to do extra processing. */ - if (annotation_level > 1) - set_async_annotation_level (NULL, 0, NULL); - } + /* initialize the prompt stack to a simple "(gdb) " prompt or to + whatever the DEFAULT_PROMPT is. */ + the_prompts.top = 0; + PREFIX (0) = ""; + PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); + SUFFIX (0) = ""; + /* Set things up for annotation_level > 1, if the user ever decides + to use it. */ + async_annotation_suffix = "prompt"; + /* Set the variable associated with the setshow prompt command. */ + new_async_prompt = savestring (PROMPT (0), strlen (PROMPT (0))); + + /* If gdb was started with --annotate=2, this is equivalent to the + user entering the command 'set annotate 2' at the gdb prompt, so + we need to do extra processing. */ + if (annotation_level > 1) + set_async_annotation_level (NULL, 0, NULL); /* Set the important stuff up for command editing. */ command_editing_p = 1; @@ -1755,57 +1681,26 @@ init_main (void) 15 is Control-o, the same binding this function has in Bash. */ rl_add_defun ("operate-and-get-next", gdb_rl_operate_and_get_next, 15); - /* The set prompt command is different depending whether or not the - async version is run. NOTE: this difference is going to - disappear as we make the event loop be the default engine of - gdb. */ - if (!event_loop_p) - { - add_show_from_set - (add_set_cmd ("prompt", class_support, var_string, - (char *) &gdb_prompt_string, "Set gdb's prompt", - &setlist), - &showlist); - } - else - { - c = add_set_cmd ("prompt", class_support, var_string, - (char *) &new_async_prompt, "Set gdb's prompt", - &setlist); - add_show_from_set (c, &showlist); - set_cmd_sfunc (c, set_async_prompt); - } + c = add_set_cmd ("prompt", class_support, var_string, + (char *) &new_async_prompt, "Set gdb's prompt", + &setlist); + deprecated_add_show_from_set (c, &showlist); + set_cmd_sfunc (c, set_async_prompt); add_com ("dont-repeat", class_support, dont_repeat_command, "Don't repeat this command.\n\ Primarily used inside of user-defined commands that should not be repeated when\n\ hitting return."); - /* The set editing command is different depending whether or not the - async version is run. NOTE: this difference is going to disappear - as we make the event loop be the default engine of gdb. */ - if (!event_loop_p) - { - add_show_from_set - (add_set_cmd ("editing", class_support, var_boolean, (char *) &command_editing_p, - "Set editing of command lines as they are typed.\n\ -Use \"on\" to enable the editing, and \"off\" to disable it.\n\ -Without an argument, command line editing is enabled. To edit, use\n\ -EMACS-like or VI-like commands like control-P or ESC.", &setlist), - &showlist); - } - else - { - c = add_set_cmd ("editing", class_support, var_boolean, (char *) &async_command_editing_p, - "Set editing of command lines as they are typed.\n\ + c = add_set_cmd ("editing", class_support, var_boolean, (char *) &async_command_editing_p, + "Set editing of command lines as they are typed.\n\ Use \"on\" to enable the editing, and \"off\" to disable it.\n\ Without an argument, command line editing is enabled. To edit, use\n\ EMACS-like or VI-like commands like control-P or ESC.", &setlist); - add_show_from_set (c, &showlist); - set_cmd_sfunc (c, set_async_editing_command); - } + deprecated_add_show_from_set (c, &showlist); + set_cmd_sfunc (c, set_async_editing_command); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("save", no_class, var_boolean, (char *) &write_history_p, "Set saving of the history record on exit.\n\ Use \"on\" to enable the saving, and \"off\" to disable it.\n\ @@ -1815,7 +1710,7 @@ Without an argument, saving is enabled.", &sethistlist), c = add_set_cmd ("size", no_class, var_integer, (char *) &history_size, "Set the size of the command history,\n\ ie. the number of previous commands to keep a record of.", &sethistlist); - add_show_from_set (c, &showhistlist); + deprecated_add_show_from_set (c, &showhistlist); set_cmd_sfunc (c, set_history_size_command); c = add_set_cmd ("filename", no_class, var_filename, @@ -1823,46 +1718,28 @@ ie. the number of previous commands to keep a record of.", &sethistlist); "Set the filename in which to record the command history\n\ (the list of previous commands of which a record is kept).", &sethistlist); set_cmd_completer (c, filename_completer); - add_show_from_set (c, &showhistlist); + deprecated_add_show_from_set (c, &showhistlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("confirm", class_support, var_boolean, (char *) &caution, "Set whether to confirm potentially dangerous operations.", &setlist), &showlist); - /* The set annotate command is different depending whether or not - the async version is run. NOTE: this difference is going to - disappear as we make the event loop be the default engine of - gdb. */ - if (!event_loop_p) - { - c = add_set_cmd ("annotate", class_obscure, var_zinteger, - (char *) &annotation_level, "Set annotation_level.\n\ + c = add_set_cmd ("annotate", class_obscure, var_zinteger, + (char *) &annotation_level, "Set annotation_level.\n\ 0 == normal; 1 == fullname (for use when running under emacs)\n\ 2 == output annotated suitably for use by programs that control GDB.", - &setlist); - c = add_show_from_set (c, &showlist); - } - else - { - c = add_set_cmd ("annotate", class_obscure, var_zinteger, - (char *) &annotation_level, "Set annotation_level.\n\ -0 == normal; 1 == fullname (for use when running under emacs)\n\ -2 == output annotated suitably for use by programs that control GDB.", - &setlist); - add_show_from_set (c, &showlist); - set_cmd_sfunc (c, set_async_annotation_level); - } - if (event_loop_p) - { - add_show_from_set - (add_set_cmd ("exec-done-display", class_support, var_boolean, (char *) &exec_done_display_p, - "Set notification of completion for asynchronous execution commands.\n\ + &setlist); + deprecated_add_show_from_set (c, &showlist); + set_cmd_sfunc (c, set_async_annotation_level); + + deprecated_add_show_from_set + (add_set_cmd ("exec-done-display", class_support, var_boolean, (char *) &exec_done_display_p, + "Set notification of completion for asynchronous execution commands.\n\ Use \"on\" to enable the notification, and \"off\" to disable it.", &setlist), - &showlist); - } + &showlist); } void @@ -1890,14 +1767,7 @@ gdb_init (char *argv0) init_cli_cmds(); init_main (); /* But that omits this file! Do it now */ - /* The signal handling mechanism is different depending whether or - not the async version is run. NOTE: in the future we plan to make - the event loop be the default engine of gdb, and this difference - will disappear. */ - if (event_loop_p) - async_init_signals (); - else - init_signals (); + async_init_signals (); /* We need a default language for parsing expressions, so simple things like "set width 0" won't fail if no language is explicitly set in a config file @@ -1905,8 +1775,9 @@ gdb_init (char *argv0) set_language (language_c); expected_language = current_language; /* don't warn about the change. */ - /* Allow another UI to initialize. If the UI fails to initialize, and - it wants GDB to revert to the CLI, it should clear init_ui_hook. */ - if (init_ui_hook) - init_ui_hook (argv0); + /* Allow another UI to initialize. If the UI fails to initialize, + and it wants GDB to revert to the CLI, it should clear + deprecated_init_ui_hook. */ + if (deprecated_init_ui_hook) + deprecated_init_ui_hook (argv0); } diff --git a/gnu/usr.bin/binutils/gdb/utils.c b/gnu/usr.bin/binutils/gdb/utils.c index 3bc5fed2a30..e30808c38b4 100644 --- a/gnu/usr.bin/binutils/gdb/utils.c +++ b/gnu/usr.bin/binutils/gdb/utils.c @@ -51,6 +51,7 @@ #include "charset.h" #include "annotate.h" #include "filenames.h" +#include "symfile.h" #include "inferior.h" /* for signed_pointer_to_address */ @@ -83,7 +84,7 @@ extern char *canonicalize_file_name (const char *); /* readline defines this. */ #undef savestring -void (*error_begin_hook) (void); +void (*deprecated_error_begin_hook) (void); /* Holds the last error message issued by gdb */ @@ -260,6 +261,19 @@ make_cleanup_ui_file_delete (struct ui_file *arg) return make_my_cleanup (&cleanup_chain, do_ui_file_delete, arg); } +static void +do_free_section_addr_info (void *arg) +{ + free_section_addr_info (arg); +} + +struct cleanup * +make_cleanup_free_section_addr_info (struct section_addr_info *addrs) +{ + return make_my_cleanup (&cleanup_chain, do_free_section_addr_info, addrs); +} + + struct cleanup * make_my_cleanup (struct cleanup **pmy_chain, make_cleanup_ftype *function, void *arg) @@ -566,8 +580,8 @@ discard_all_intermediate_continuations (void) void vwarning (const char *string, va_list args) { - if (warning_hook) - (*warning_hook) (string, args); + if (deprecated_warning_hook) + (*deprecated_warning_hook) (string, args); else { target_terminal_ours (); @@ -659,8 +673,8 @@ error_output_message (char *pre_print, char *msg) NORETURN void error_stream (struct ui_file *stream) { - if (error_begin_hook) - error_begin_hook (); + if (deprecated_error_begin_hook) + deprecated_error_begin_hook (); /* Copy the stream into the GDB_LASTERR buffer. */ ui_file_rewind (gdb_lasterr); @@ -752,8 +766,8 @@ internal_vproblem (struct internal_problem *problem, so that the user knows that they are living on the edge. */ { char *msg; - xvasprintf (&msg, fmt, ap); - xasprintf (&reason, "\ + msg = xstrvprintf (fmt, ap); + reason = xstrprintf ("\ %s:%d: %s: %s\n\ A problem internal to GDB has been detected,\n\ further debugging may prove unreliable.", file, line, problem->name, msg); @@ -838,7 +852,7 @@ internal_error (const char *file, int line, const char *string, ...) } static struct internal_problem internal_warning_problem = { - "internal-error", AUTO_BOOLEAN_AUTO, AUTO_BOOLEAN_AUTO + "internal-warning", AUTO_BOOLEAN_AUTO, AUTO_BOOLEAN_AUTO }; void @@ -974,51 +988,14 @@ void request_quit (int signo) { quit_flag = 1; - /* Restore the signal handler. Harmless with BSD-style signals, needed - for System V-style signals. So just always do it, rather than worrying - about USG defines and stuff like that. */ + /* Restore the signal handler. Harmless with BSD-style signals, + needed for System V-style signals. */ signal (signo, request_quit); if (immediate_quit) quit (); } -/* Memory management stuff (malloc friends). */ - -static void * -mmalloc (void *md, size_t size) -{ - return malloc (size); /* NOTE: GDB's only call to malloc() */ -} - -static void * -mrealloc (void *md, void *ptr, size_t size) -{ - if (ptr == 0) /* Guard against old realloc's */ - return mmalloc (md, size); - else - return realloc (ptr, size); /* NOTE: GDB's only call to ralloc() */ -} - -static void * -mcalloc (void *md, size_t number, size_t size) -{ - return calloc (number, size); /* NOTE: GDB's only call to calloc() */ -} - -static void -mfree (void *md, void *ptr) -{ - free (ptr); /* NOTE: GDB's only call to free() */ -} - -/* This used to do something interesting with USE_MMALLOC. - * It can be retired any time. -- chastain 2004-01-19. */ -void -init_malloc (void *md) -{ -} - /* Called when a memory allocation fails, with the number of bytes of memory requested in SIZE. */ @@ -1037,18 +1014,17 @@ nomem (long size) } } -/* The xmmalloc() family of memory management routines. +/* The xmalloc() (libiberty.h) family of memory management routines. - These are are like the mmalloc() family except that they implement + These are like the ISO-C malloc() family except that they implement consistent semantics and guard against typical memory management - problems: if a malloc fails, an internal error is thrown; if - free(NULL) is called, it is ignored; if *alloc(0) is called, NULL - is returned. + problems. */ - All these routines are implemented using the mmalloc() family. */ +/* NOTE: These are declared using PTR to ensure consistency with + "libiberty.h". xfree() is GDB local. */ -void * -xmmalloc (void *md, size_t size) +PTR /* OK: PTR */ +xmalloc (size_t size) { void *val; @@ -1057,15 +1033,15 @@ xmmalloc (void *md, size_t size) if (size == 0) size = 1; - val = mmalloc (md, size); + val = malloc (size); /* OK: malloc */ if (val == NULL) nomem (size); return (val); } -void * -xmrealloc (void *md, void *ptr, size_t size) +PTR /* OK: PTR */ +xrealloc (PTR ptr, size_t size) /* OK: PTR */ { void *val; @@ -1075,17 +1051,17 @@ xmrealloc (void *md, void *ptr, size_t size) size = 1; if (ptr != NULL) - val = mrealloc (md, ptr, size); + val = realloc (ptr, size); /* OK: realloc */ else - val = mmalloc (md, size); + val = malloc (size); /* OK: malloc */ if (val == NULL) nomem (size); return (val); } -void * -xmcalloc (void *md, size_t number, size_t size) +PTR /* OK: PTR */ +xcalloc (size_t number, size_t size) { void *mem; @@ -1097,7 +1073,7 @@ xmcalloc (void *md, size_t number, size_t size) size = 1; } - mem = mcalloc (md, number, size); + mem = calloc (number, size); /* OK: xcalloc */ if (mem == NULL) nomem (number * size); @@ -1105,45 +1081,10 @@ xmcalloc (void *md, size_t number, size_t size) } void -xmfree (void *md, void *ptr) -{ - if (ptr != NULL) - mfree (md, ptr); -} - -/* The xmalloc() (libiberty.h) family of memory management routines. - - These are like the ISO-C malloc() family except that they implement - consistent semantics and guard against typical memory management - problems. See xmmalloc() above for further information. - - All these routines are wrappers to the xmmalloc() family. */ - -/* NOTE: These are declared using PTR to ensure consistency with - "libiberty.h". xfree() is GDB local. */ - -PTR /* OK: PTR */ -xmalloc (size_t size) -{ - return xmmalloc (NULL, size); -} - -PTR /* OK: PTR */ -xrealloc (PTR ptr, size_t size) /* OK: PTR */ -{ - return xmrealloc (NULL, ptr, size); -} - -PTR /* OK: PTR */ -xcalloc (size_t number, size_t size) -{ - return xmcalloc (NULL, number, size); -} - -void xfree (void *ptr) { - xmfree (NULL, ptr); + if (ptr != NULL) + free (ptr); /* OK: free */ } @@ -1156,7 +1097,7 @@ xstrprintf (const char *format, ...) char *ret; va_list args; va_start (args, format); - xvasprintf (&ret, format, args); + ret = xstrvprintf (format, args); va_end (args); return ret; } @@ -1166,27 +1107,32 @@ xasprintf (char **ret, const char *format, ...) { va_list args; va_start (args, format); - xvasprintf (ret, format, args); + (*ret) = xstrvprintf (format, args); va_end (args); } void xvasprintf (char **ret, const char *format, va_list ap) { - int status = vasprintf (ret, format, ap); - /* NULL could be returned due to a memory allocation problem; a - badly format string; or something else. */ - if ((*ret) == NULL) - internal_error (__FILE__, __LINE__, - "vasprintf returned NULL buffer (errno %d)", errno); - /* A negative status with a non-NULL buffer shouldn't never - happen. But to be sure. */ + (*ret) = xstrvprintf (format, ap); +} + +char * +xstrvprintf (const char *format, va_list ap) +{ + char *ret = NULL; + int status = vasprintf (&ret, format, ap); + /* NULL is returned when there was a memory allocation problem. */ + if (ret == NULL) + nomem (0); + /* A negative status (the printed length) with a non-NULL buffer + should never happen, but just to be sure. */ if (status < 0) internal_error (__FILE__, __LINE__, "vasprintf call failed (errno %d)", errno); + return ret; } - /* My replacement for the read system call. Used like `read' but keeps going if `read' returns too soon. */ @@ -1222,21 +1168,6 @@ savestring (const char *ptr, size_t size) return p; } -char * -msavestring (void *md, const char *ptr, size_t size) -{ - char *p = (char *) xmmalloc (md, size + 1); - memcpy (p, ptr, size); - p[size] = 0; - return p; -} - -char * -mstrsave (void *md, const char *ptr) -{ - return (msavestring (md, ptr, strlen (ptr))); -} - void print_spaces (int n, struct ui_file *file) { @@ -1270,11 +1201,10 @@ query (const char *ctlstr, ...) int ans2; int retval; - va_start (args, ctlstr); - - if (query_hook) + if (deprecated_query_hook) { - return query_hook (ctlstr, args); + va_start (args, ctlstr); + return deprecated_query_hook (ctlstr, args); } /* Automatically answer "yes" if input is not from a terminal. */ @@ -1289,7 +1219,9 @@ query (const char *ctlstr, ...) if (annotation_level > 1) printf_filtered ("\n\032\032pre-query\n"); + va_start (args, ctlstr); vfprintf_filtered (gdb_stdout, ctlstr, args); + va_end (args); printf_filtered ("(y or n) "); if (annotation_level > 1) @@ -1372,9 +1304,9 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) n_string = "[n]"; } - if (query_hook) + if (deprecated_query_hook) { - return query_hook (ctlstr, args); + return deprecated_query_hook (ctlstr, args); } /* Automatically answer default value if input is not from a terminal. */ @@ -1387,13 +1319,13 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) gdb_flush (gdb_stdout); if (annotation_level > 1) - printf_filtered ("\n\032\032pre-%cquery\n", defchar); + printf_filtered ("\n\032\032pre-query\n"); vfprintf_filtered (gdb_stdout, ctlstr, args); printf_filtered ("(%s or %s) ", y_string, n_string); if (annotation_level > 1) - printf_filtered ("\n\032\032%cquery\n", defchar); + printf_filtered ("\n\032\032query\n"); wrap_here (""); gdb_flush (gdb_stdout); @@ -1437,7 +1369,7 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) } if (annotation_level > 1) - printf_filtered ("\n\032\032post-%cquery\n", defchar); + printf_filtered ("\n\032\032post-query\n"); return retval; } @@ -1855,12 +1787,7 @@ prompt_for_continue (void) while (*p == ' ' || *p == '\t') ++p; if (p[0] == 'q') - { - if (!event_loop_p) - request_quit (SIGINT); - else - async_request_quit (0); - } + async_request_quit (0); xfree (ignore); } immediate_quit--; @@ -2259,7 +2186,7 @@ vfprintf_maybe_filtered (struct ui_file *stream, const char *format, char *linebuffer; struct cleanup *old_cleanups; - xvasprintf (&linebuffer, format, args); + linebuffer = xstrvprintf (format, args); old_cleanups = make_cleanup (xfree, linebuffer); fputs_maybe_filtered (linebuffer, stream, filter); do_cleanups (old_cleanups); @@ -2278,7 +2205,7 @@ vfprintf_unfiltered (struct ui_file *stream, const char *format, va_list args) char *linebuffer; struct cleanup *old_cleanups; - xvasprintf (&linebuffer, format, args); + linebuffer = xstrvprintf (format, args); old_cleanups = make_cleanup (xfree, linebuffer); fputs_unfiltered (linebuffer, stream); do_cleanups (old_cleanups); @@ -2609,23 +2536,23 @@ initialize_utils (void) c = add_set_cmd ("width", class_support, var_uinteger, &chars_per_line, "Set number of characters gdb thinks are in a line.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); set_cmd_sfunc (c, set_width_command); c = add_set_cmd ("height", class_support, var_uinteger, &lines_per_page, "Set number of lines gdb thinks are in a page.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); set_cmd_sfunc (c, set_height_command); init_page_info (); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("demangle", class_support, var_boolean, (char *) &demangle, "Set demangling of encoded C++/ObjC names when displaying symbols.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("pagination", class_support, var_boolean, (char *) &pagination_enabled, "Set state of pagination.", &setlist), &showlist); @@ -2638,13 +2565,13 @@ initialize_utils (void) "Disable pagination"); } - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("sevenbit-strings", class_support, var_boolean, (char *) &sevenbit_strings, "Set printing of 8-bit characters in strings as \\nnn.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("asm-demangle", class_support, var_boolean, (char *) &asm_demangle, "Set demangling of C++/ObjC names in disassembly listings.", @@ -2659,7 +2586,7 @@ SIGWINCH_HANDLER_BODY /* print routines to handle variable size regs, etc. */ /* temporary storage using circular buffer */ #define NUMCELLS 16 -#define CELLSIZE 32 +#define CELLSIZE 50 static char * get_cell (void) { @@ -2689,7 +2616,7 @@ paddr_nz (CORE_ADDR addr) } static void -decimal2str (char *paddr_str, char *sign, ULONGEST addr) +decimal2str (char *paddr_str, char *sign, ULONGEST addr, int width) { /* steal code from valprint.c:print_decimal(). Should this worry about the real size of addr as the above does? */ @@ -2700,18 +2627,60 @@ decimal2str (char *paddr_str, char *sign, ULONGEST addr) temp[i] = addr % (1000 * 1000 * 1000); addr /= (1000 * 1000 * 1000); i++; + width -= 9; + } + while (addr != 0 && i < (sizeof (temp) / sizeof (temp[0]))); + width += 9; + if (width < 0) + width = 0; + switch (i) + { + case 1: + sprintf (paddr_str, "%s%0*lu", sign, width, temp[0]); + break; + case 2: + sprintf (paddr_str, "%s%0*lu%09lu", sign, width, temp[1], temp[0]); + break; + case 3: + sprintf (paddr_str, "%s%0*lu%09lu%09lu", sign, width, + temp[2], temp[1], temp[0]); + break; + default: + internal_error (__FILE__, __LINE__, + "failed internal consistency check"); + } +} + +static void +octal2str (char *paddr_str, ULONGEST addr, int width) +{ + unsigned long temp[3]; + int i = 0; + do + { + temp[i] = addr % (0100000 * 0100000); + addr /= (0100000 * 0100000); + i++; + width -= 10; } while (addr != 0 && i < (sizeof (temp) / sizeof (temp[0]))); + width += 10; + if (width < 0) + width = 0; switch (i) { case 1: - sprintf (paddr_str, "%s%lu", sign, temp[0]); + if (temp[0] == 0) + sprintf (paddr_str, "%*o", width, 0); + else + sprintf (paddr_str, "0%0*lo", width, temp[0]); break; case 2: - sprintf (paddr_str, "%s%lu%09lu", sign, temp[1], temp[0]); + sprintf (paddr_str, "0%0*lo%010lo", width, temp[1], temp[0]); break; case 3: - sprintf (paddr_str, "%s%lu%09lu%09lu", sign, temp[2], temp[1], temp[0]); + sprintf (paddr_str, "0%0*lo%010lo%010lo", width, + temp[2], temp[1], temp[0]); break; default: internal_error (__FILE__, __LINE__, @@ -2723,7 +2692,7 @@ char * paddr_u (CORE_ADDR addr) { char *paddr_str = get_cell (); - decimal2str (paddr_str, "", addr); + decimal2str (paddr_str, "", addr, 0); return paddr_str; } @@ -2732,9 +2701,9 @@ paddr_d (LONGEST addr) { char *paddr_str = get_cell (); if (addr < 0) - decimal2str (paddr_str, "-", -addr); + decimal2str (paddr_str, "-", -addr, 0); else - decimal2str (paddr_str, "", addr); + decimal2str (paddr_str, "", addr, 0); return paddr_str; } @@ -2799,6 +2768,87 @@ phex_nz (ULONGEST l, int sizeof_l) return str; } +/* Converts a LONGEST to a C-format hexadecimal literal and stores it + in a static string. Returns a pointer to this string. */ +char * +hex_string (LONGEST num) +{ + char *result = get_cell (); + snprintf (result, CELLSIZE, "0x%s", phex_nz (num, sizeof (num))); + return result; +} + +/* Converts a LONGEST number to a C-format hexadecimal literal and + stores it in a static string. Returns a pointer to this string + that is valid until the next call. The number is padded on the + left with 0s to at least WIDTH characters. */ +char * +hex_string_custom (LONGEST num, int width) +{ + char *result = get_cell (); + char *result_end = result + CELLSIZE - 1; + const char *hex = phex_nz (num, sizeof (num)); + int hex_len = strlen (hex); + + if (hex_len > width) + width = hex_len; + if (width + 2 >= CELLSIZE) + internal_error (__FILE__, __LINE__, + "hex_string_custom: insufficient space to store result"); + + strcpy (result_end - width - 2, "0x"); + memset (result_end - width, '0', width); + strcpy (result_end - hex_len, hex); + return result_end - width - 2; +} + +/* Convert VAL to a numeral in the given radix. For + * radix 10, IS_SIGNED may be true, indicating a signed quantity; + * otherwise VAL is interpreted as unsigned. If WIDTH is supplied, + * it is the minimum width (0-padded if needed). USE_C_FORMAT means + * to use C format in all cases. If it is false, then 'x' + * and 'o' formats do not include a prefix (0x or leading 0). */ + +char * +int_string (LONGEST val, int radix, int is_signed, int width, + int use_c_format) +{ + switch (radix) + { + case 16: + { + char *result; + if (width == 0) + result = hex_string (val); + else + result = hex_string_custom (val, width); + if (! use_c_format) + result += 2; + return result; + } + case 10: + { + char *result = get_cell (); + if (is_signed && val < 0) + decimal2str (result, "-", -val, width); + else + decimal2str (result, "", val, width); + return result; + } + case 8: + { + char *result = get_cell (); + octal2str (result, val, width); + if (use_c_format || val == 0) + return result; + else + return result + 1; + } + default: + internal_error (__FILE__, __LINE__, + "failed internal consistency check"); + } +} /* Convert a CORE_ADDR into a string. */ const char * diff --git a/gnu/usr.bin/binutils/gdb/valarith.c b/gnu/usr.bin/binutils/gdb/valarith.c index 03282eade74..f88701faee8 100644 --- a/gnu/usr.bin/binutils/gdb/valarith.c +++ b/gnu/usr.bin/binutils/gdb/valarith.c @@ -1,7 +1,7 @@ /* Perform arithmetic and other operations on values, for GDB. Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, - 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GDB. @@ -91,16 +91,15 @@ value_add (struct value *arg1, struct value *arg2) LONGEST sz; struct type *type1, *type2, *valptrtype; - COERCE_NUMBER (arg1); - COERCE_NUMBER (arg2); + COERCE_ARRAY (arg1); + COERCE_ARRAY (arg2); type1 = check_typedef (VALUE_TYPE (arg1)); type2 = check_typedef (VALUE_TYPE (arg2)); if ((TYPE_CODE (type1) == TYPE_CODE_PTR || TYPE_CODE (type2) == TYPE_CODE_PTR) && - (TYPE_CODE (type1) == TYPE_CODE_INT - || TYPE_CODE (type2) == TYPE_CODE_INT)) + (is_integral_type (type1) || is_integral_type (type2))) /* Exactly one argument is a pointer, and one is an integer. */ { struct value *retval; @@ -134,14 +133,14 @@ struct value * value_sub (struct value *arg1, struct value *arg2) { struct type *type1, *type2; - COERCE_NUMBER (arg1); - COERCE_NUMBER (arg2); + COERCE_ARRAY (arg1); + COERCE_ARRAY (arg2); type1 = check_typedef (VALUE_TYPE (arg1)); type2 = check_typedef (VALUE_TYPE (arg2)); if (TYPE_CODE (type1) == TYPE_CODE_PTR) { - if (TYPE_CODE (type2) == TYPE_CODE_INT) + if (is_integral_type (type2)) { /* pointer - integer. */ LONGEST sz = find_size_for_pointer_math (type1); @@ -203,7 +202,10 @@ value_subscript (struct value *array, struct value *idx) LONGEST index = value_as_long (idx); if (index >= lowerbound && index <= upperbound) return value_subscripted_rvalue (array, idx, lowerbound); - warning ("array or string index out of range"); + /* Emit warning unless we have an array of unknown size. + An array of unknown size has lowerbound 0 and upperbound -1. */ + if (upperbound > -1) + warning ("array or string index out of range"); /* fall doing C stuff */ c_style = 1; } @@ -752,22 +754,12 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) COERCE_REF (arg1); COERCE_REF (arg2); - COERCE_ENUM (arg1); - COERCE_ENUM (arg2); type1 = check_typedef (VALUE_TYPE (arg1)); type2 = check_typedef (VALUE_TYPE (arg2)); - if ((TYPE_CODE (type1) != TYPE_CODE_FLT - && TYPE_CODE (type1) != TYPE_CODE_CHAR - && TYPE_CODE (type1) != TYPE_CODE_INT - && TYPE_CODE (type1) != TYPE_CODE_BOOL - && TYPE_CODE (type1) != TYPE_CODE_RANGE) + if ((TYPE_CODE (type1) != TYPE_CODE_FLT && !is_integral_type (type1)) || - (TYPE_CODE (type2) != TYPE_CODE_FLT - && TYPE_CODE (type2) != TYPE_CODE_CHAR - && TYPE_CODE (type2) != TYPE_CODE_INT - && TYPE_CODE (type2) != TYPE_CODE_BOOL - && TYPE_CODE (type2) != TYPE_CODE_RANGE)) + (TYPE_CODE (type2) != TYPE_CODE_FLT && !is_integral_type (type2))) error ("Argument to arithmetic operation not a number or boolean."); if (TYPE_CODE (type1) == TYPE_CODE_FLT @@ -1051,7 +1043,10 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) break; case BINOP_DIV: - v = v1 / v2; + if (v2 != 0) + v = v1 / v2; + else + error ("Division by zero"); break; case BINOP_EXP: @@ -1061,7 +1056,10 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) break; case BINOP_REM: - v = v1 % v2; + if (v2 != 0) + v = v1 % v2; + else + error ("Division by zero"); break; case BINOP_MOD: @@ -1221,28 +1219,30 @@ value_equal (struct value *arg1, struct value *arg2) struct type *type1, *type2; enum type_code code1; enum type_code code2; + int is_int1, is_int2; - COERCE_NUMBER (arg1); - COERCE_NUMBER (arg2); + COERCE_ARRAY (arg1); + COERCE_ARRAY (arg2); type1 = check_typedef (VALUE_TYPE (arg1)); type2 = check_typedef (VALUE_TYPE (arg2)); code1 = TYPE_CODE (type1); code2 = TYPE_CODE (type2); + is_int1 = is_integral_type (type1); + is_int2 = is_integral_type (type2); - if ((code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL) && - (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL)) + if (is_int1 && is_int2) return longest_to_int (value_as_long (value_binop (arg1, arg2, BINOP_EQUAL))); - else if ((code1 == TYPE_CODE_FLT || code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL) - && (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL)) + else if ((code1 == TYPE_CODE_FLT || is_int1) + && (code2 == TYPE_CODE_FLT || is_int2)) return value_as_double (arg1) == value_as_double (arg2); /* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever is bigger. */ - else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL)) + else if (code1 == TYPE_CODE_PTR && is_int2) return value_as_address (arg1) == (CORE_ADDR) value_as_long (arg2); - else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL)) + else if (code2 == TYPE_CODE_PTR && is_int1) return (CORE_ADDR) value_as_long (arg1) == value_as_address (arg2); else if (code1 == code2 @@ -1278,30 +1278,32 @@ value_less (struct value *arg1, struct value *arg2) enum type_code code1; enum type_code code2; struct type *type1, *type2; + int is_int1, is_int2; - COERCE_NUMBER (arg1); - COERCE_NUMBER (arg2); + COERCE_ARRAY (arg1); + COERCE_ARRAY (arg2); type1 = check_typedef (VALUE_TYPE (arg1)); type2 = check_typedef (VALUE_TYPE (arg2)); code1 = TYPE_CODE (type1); code2 = TYPE_CODE (type2); + is_int1 = is_integral_type (type1); + is_int2 = is_integral_type (type2); - if ((code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL) && - (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL)) + if (is_int1 && is_int2) return longest_to_int (value_as_long (value_binop (arg1, arg2, BINOP_LESS))); - else if ((code1 == TYPE_CODE_FLT || code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL) - && (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL)) + else if ((code1 == TYPE_CODE_FLT || is_int1) + && (code2 == TYPE_CODE_FLT || is_int2)) return value_as_double (arg1) < value_as_double (arg2); else if (code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_PTR) return value_as_address (arg1) < value_as_address (arg2); /* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever is bigger. */ - else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL)) + else if (code1 == TYPE_CODE_PTR && is_int2) return value_as_address (arg1) < (CORE_ADDR) value_as_long (arg2); - else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL)) + else if (code2 == TYPE_CODE_PTR && is_int1) return (CORE_ADDR) value_as_long (arg1) < value_as_address (arg2); else if (code1 == TYPE_CODE_STRING && code2 == TYPE_CODE_STRING) return value_strcmp (arg1, arg2) < 0; @@ -1321,13 +1323,12 @@ value_neg (struct value *arg1) struct type *result_type = VALUE_TYPE (arg1); COERCE_REF (arg1); - COERCE_ENUM (arg1); type = check_typedef (VALUE_TYPE (arg1)); if (TYPE_CODE (type) == TYPE_CODE_FLT) return value_from_double (result_type, -value_as_double (arg1)); - else if (TYPE_CODE (type) == TYPE_CODE_INT || TYPE_CODE (type) == TYPE_CODE_BOOL) + else if (is_integral_type (type)) { /* Perform integral promotion for ANSI C/C++. FIXME: What about FORTRAN and (the deleted) chill ? */ @@ -1348,15 +1349,12 @@ value_complement (struct value *arg1) { struct type *type; struct type *result_type = VALUE_TYPE (arg1); - int typecode; COERCE_REF (arg1); - COERCE_ENUM (arg1); type = check_typedef (VALUE_TYPE (arg1)); - typecode = TYPE_CODE (type); - if ((typecode != TYPE_CODE_INT) && (typecode != TYPE_CODE_BOOL)) + if (!is_integral_type (type)) error ("Argument to complement operation not an integer or boolean."); /* Perform integral promotion for ANSI C/C++. diff --git a/gnu/usr.bin/binutils/gdb/valops.c b/gnu/usr.bin/binutils/gdb/valops.c index 60422779a14..575c9a335ea 100644 --- a/gnu/usr.bin/binutils/gdb/valops.c +++ b/gnu/usr.bin/binutils/gdb/valops.c @@ -42,10 +42,7 @@ #include "gdb_string.h" #include "gdb_assert.h" #include "cp-support.h" - -/* Flag indicating HP compilers were used; needed to correctly handle some - value operations with HP aCC code/runtime. */ -extern int hp_som_som_object_present; +#include "observer.h" extern int overload_debug; /* Local functions. */ @@ -53,8 +50,6 @@ extern int overload_debug; static int typecmp (int staticp, int varargs, int nargs, struct field t1[], struct value *t2[]); -static CORE_ADDR value_push (CORE_ADDR, struct value *); - static struct value *search_struct_field (char *, struct value *, int, struct type *, int); @@ -299,8 +294,8 @@ value_cast (struct type *type, struct value *arg2) { LONGEST longest; - if (hp_som_som_object_present && /* if target compiled by HP aCC */ - (code2 == TYPE_CODE_PTR)) + if (deprecated_hp_som_som_object_present /* if target compiled by HP aCC */ + && (code2 == TYPE_CODE_PTR)) { unsigned int *ptr; struct value *retvalp; @@ -530,8 +525,6 @@ value_assign (struct value *toval, struct value *fromval) { struct type *type; struct value *val; - char raw_buffer[MAX_REGISTER_SIZE]; - int use_buffer = 0; struct frame_id old_frame; if (!toval->modifiable) @@ -574,10 +567,10 @@ value_assign (struct value *toval, struct value *fromval) char *dest_buffer; CORE_ADDR changed_addr; int changed_len; + char buffer[sizeof (LONGEST)]; if (VALUE_BITSIZE (toval)) { - char buffer[sizeof (LONGEST)]; /* We assume that the argument to read_memory is in units of host chars. FIXME: Is that correct? */ changed_len = (VALUE_BITPOS (toval) @@ -596,12 +589,6 @@ value_assign (struct value *toval, struct value *fromval) changed_addr = VALUE_ADDRESS (toval) + VALUE_OFFSET (toval); dest_buffer = buffer; } - else if (use_buffer) - { - changed_addr = VALUE_ADDRESS (toval) + VALUE_OFFSET (toval); - changed_len = use_buffer; - dest_buffer = raw_buffer; - } else { changed_addr = VALUE_ADDRESS (toval) + VALUE_OFFSET (toval); @@ -610,9 +597,8 @@ value_assign (struct value *toval, struct value *fromval) } write_memory (changed_addr, dest_buffer, changed_len); - if (memory_changed_hook) - memory_changed_hook (changed_addr, changed_len); - target_changed_event (); + if (deprecated_memory_changed_hook) + deprecated_memory_changed_hook (changed_addr, changed_len); } break; @@ -663,7 +649,7 @@ value_assign (struct value *toval, struct value *fromval) { int offset; for (reg_offset = value_reg, offset = 0; - offset + DEPRECATED_REGISTER_RAW_SIZE (reg_offset) <= VALUE_OFFSET (toval); + offset + register_size (current_gdbarch, reg_offset) <= VALUE_OFFSET (toval); reg_offset++); byte_offset = VALUE_OFFSET (toval) - offset; } @@ -681,7 +667,7 @@ value_assign (struct value *toval, struct value *fromval) /* Copy it in. */ for (regno = reg_offset, amount_copied = 0; amount_copied < amount_to_copy; - amount_copied += DEPRECATED_REGISTER_RAW_SIZE (regno), regno++) + amount_copied += register_size (current_gdbarch, regno), regno++) frame_register_read (frame, regno, buffer + amount_copied); /* Modify what needs to be modified. */ @@ -689,8 +675,6 @@ value_assign (struct value *toval, struct value *fromval) modify_field (buffer + byte_offset, value_as_long (fromval), VALUE_BITPOS (toval), VALUE_BITSIZE (toval)); - else if (use_buffer) - memcpy (buffer + VALUE_OFFSET (toval), raw_buffer, use_buffer); else memcpy (buffer + byte_offset, VALUE_CONTENTS (fromval), TYPE_LENGTH (type)); @@ -698,13 +682,13 @@ value_assign (struct value *toval, struct value *fromval) /* Copy it out. */ for (regno = reg_offset, amount_copied = 0; amount_copied < amount_to_copy; - amount_copied += DEPRECATED_REGISTER_RAW_SIZE (regno), regno++) + amount_copied += register_size (current_gdbarch, regno), regno++) put_frame_register (frame, regno, buffer + amount_copied); } - if (register_changed_hook) - register_changed_hook (-1); - target_changed_event (); + if (deprecated_register_changed_hook) + deprecated_register_changed_hook (-1); + observer_notify_target_changed (¤t_target); break; } @@ -1009,58 +993,6 @@ push_bytes (CORE_ADDR sp, char *buffer, int len) return sp; } -#ifndef PARM_BOUNDARY -#define PARM_BOUNDARY (0) -#endif - -/* Push onto the stack the specified value VALUE. Pad it correctly for - it to be an argument to a function. */ - -static CORE_ADDR -value_push (CORE_ADDR sp, struct value *arg) -{ - int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg)); - int container_len = len; - int offset; - - /* How big is the container we're going to put this value in? */ - if (PARM_BOUNDARY) - container_len = ((len + PARM_BOUNDARY / TARGET_CHAR_BIT - 1) - & ~(PARM_BOUNDARY / TARGET_CHAR_BIT - 1)); - - /* Are we going to put it at the high or low end of the container? */ - if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - offset = container_len - len; - else - offset = 0; - - if (INNER_THAN (1, 2)) - { - /* stack grows downward */ - sp -= container_len; - write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len); - } - else - { - /* stack grows upward */ - write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len); - sp += container_len; - } - - return sp; -} - -CORE_ADDR -legacy_push_arguments (int nargs, struct value **args, CORE_ADDR sp, - int struct_return, CORE_ADDR struct_addr) -{ - /* ASSERT ( !struct_return); */ - int i; - for (i = nargs - 1; i >= 0; i--) - sp = value_push (sp, args[i]); - return sp; -} - /* Create a value for an array by allocating space in the inferior, copying the data into that space, and then setting up an array value. @@ -2918,14 +2850,14 @@ void _initialize_valops (void) { #if 0 - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("abandon", class_support, var_boolean, (char *) &auto_abandon, "Set automatic abandonment of expressions upon failure.", &setlist), &showlist); #endif - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("overload-resolution", class_support, var_boolean, (char *) &overload_resolution, "Set overload resolution in evaluating C++ functions.", &setlist), diff --git a/gnu/usr.bin/binutils/gdb/valprint.c b/gnu/usr.bin/binutils/gdb/valprint.c index 294e09f58ab..fd92750b8c6 100644 --- a/gnu/usr.bin/binutils/gdb/valprint.c +++ b/gnu/usr.bin/binutils/gdb/valprint.c @@ -209,202 +209,52 @@ val_print_type_code_int (struct type *type, char *valaddr, /* Print a number according to FORMAT which is one of d,u,x,o,b,h,w,g. The raison d'etre of this function is to consolidate printing of - LONG_LONG's into this one function. Some platforms have long longs but - don't have a printf() that supports "ll" in the format string. We handle - these by seeing if the number is representable as either a signed or - unsigned long, depending upon what format is desired, and if not we just - bail out and print the number in hex. - - The format chars b,h,w,g are from print_scalar_formatted(). If USE_LOCAL, - format it according to the current language (this should be used for most - integers which GDB prints, the exception is things like protocols where - the format of the integer is a protocol thing, not a user-visible thing). - */ - -#if defined (CC_HAS_LONG_LONG) && !defined (PRINTF_HAS_LONG_LONG) -static void print_decimal (struct ui_file * stream, char *sign, - int use_local, ULONGEST val_ulong); -static void -print_decimal (struct ui_file *stream, char *sign, int use_local, - ULONGEST val_ulong) -{ - unsigned long temp[3]; - int i = 0; - do - { - temp[i] = val_ulong % (1000 * 1000 * 1000); - val_ulong /= (1000 * 1000 * 1000); - i++; - } - while (val_ulong != 0 && i < (sizeof (temp) / sizeof (temp[0]))); - switch (i) - { - case 1: - fprintf_filtered (stream, "%s%lu", - sign, temp[0]); - break; - case 2: - fprintf_filtered (stream, "%s%lu%09lu", - sign, temp[1], temp[0]); - break; - case 3: - fprintf_filtered (stream, "%s%lu%09lu%09lu", - sign, temp[2], temp[1], temp[0]); - break; - default: - internal_error (__FILE__, __LINE__, "failed internal consistency check"); - } - return; -} -#endif + LONG_LONG's into this one function. The format chars b,h,w,g are + from print_scalar_formatted(). Numbers are printed using C + format. + + USE_C_FORMAT means to use C format in all cases. Without it, + 'o' and 'x' format do not include the standard C radix prefix + (leading 0 or 0x). + + Hilfinger/2004-09-09: USE_C_FORMAT was originally called USE_LOCAL + and was intended to request formating according to the current + language and would be used for most integers that GDB prints. The + exceptional cases were things like protocols where the format of + the integer is a protocol thing, not a user-visible thing). The + parameter remains to preserve the information of what things might + be printed with language-specific format, should we ever resurrect + that capability. */ void -print_longest (struct ui_file *stream, int format, int use_local, +print_longest (struct ui_file *stream, int format, int use_c_format, LONGEST val_long) { -#if defined (CC_HAS_LONG_LONG) && !defined (PRINTF_HAS_LONG_LONG) - if (sizeof (long) < sizeof (LONGEST)) - { - switch (format) - { - case 'd': - { - /* Print a signed value, that doesn't fit in a long */ - if ((long) val_long != val_long) - { - if (val_long < 0) - print_decimal (stream, "-", use_local, -val_long); - else - print_decimal (stream, "", use_local, val_long); - return; - } - break; - } - case 'u': - { - /* Print an unsigned value, that doesn't fit in a long */ - if ((unsigned long) val_long != (ULONGEST) val_long) - { - print_decimal (stream, "", use_local, val_long); - return; - } - break; - } - case 'x': - case 'o': - case 'b': - case 'h': - case 'w': - case 'g': - /* Print as unsigned value, must fit completely in unsigned long */ - { - unsigned long temp = val_long; - if (temp != val_long) - { - /* Urk, can't represent value in long so print in hex. - Do shift in two operations so that if sizeof (long) - == sizeof (LONGEST) we can avoid warnings from - picky compilers about shifts >= the size of the - shiftee in bits */ - unsigned long vbot = (unsigned long) val_long; - LONGEST temp = (val_long >> (sizeof (long) * HOST_CHAR_BIT - 1)); - unsigned long vtop = temp >> 1; - fprintf_filtered (stream, "0x%lx%08lx", vtop, vbot); - return; - } - break; - } - } - } -#endif + const char *val; -#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG) switch (format) { case 'd': - fprintf_filtered (stream, - use_local ? local_decimal_format_custom ("ll") - : "%lld", - (long long) val_long); - break; + val = int_string (val_long, 10, 1, 0, 1); break; case 'u': - fprintf_filtered (stream, "%llu", (long long) val_long); - break; + val = int_string (val_long, 10, 0, 0, 1); break; case 'x': - fprintf_filtered (stream, - use_local ? local_hex_format_custom ("ll") - : "%llx", - (unsigned long long) val_long); - break; - case 'o': - fprintf_filtered (stream, - use_local ? local_octal_format_custom ("ll") - : "%llo", - (unsigned long long) val_long); - break; + val = int_string (val_long, 16, 0, 0, use_c_format); break; case 'b': - fprintf_filtered (stream, local_hex_format_custom ("02ll"), val_long); - break; + val = int_string (val_long, 16, 0, 2, 1); break; case 'h': - fprintf_filtered (stream, local_hex_format_custom ("04ll"), val_long); - break; + val = int_string (val_long, 16, 0, 4, 1); break; case 'w': - fprintf_filtered (stream, local_hex_format_custom ("08ll"), val_long); - break; + val = int_string (val_long, 16, 0, 8, 1); break; case 'g': - fprintf_filtered (stream, local_hex_format_custom ("016ll"), val_long); - break; - default: - internal_error (__FILE__, __LINE__, "failed internal consistency check"); - } -#else /* !CC_HAS_LONG_LONG || !PRINTF_HAS_LONG_LONG */ - /* In the following it is important to coerce (val_long) to a long. It does - nothing if !LONG_LONG, but it will chop off the top half (which we know - we can ignore) if the host supports long longs. */ - - switch (format) - { - case 'd': - fprintf_filtered (stream, - use_local ? local_decimal_format_custom ("l") - : "%ld", - (long) val_long); - break; - case 'u': - fprintf_filtered (stream, "%lu", (unsigned long) val_long); - break; - case 'x': - fprintf_filtered (stream, - use_local ? local_hex_format_custom ("l") - : "%lx", - (unsigned long) val_long); + val = int_string (val_long, 16, 0, 16, 1); break; break; case 'o': - fprintf_filtered (stream, - use_local ? local_octal_format_custom ("l") - : "%lo", - (unsigned long) val_long); - break; - case 'b': - fprintf_filtered (stream, local_hex_format_custom ("02l"), - (unsigned long) val_long); - break; - case 'h': - fprintf_filtered (stream, local_hex_format_custom ("04l"), - (unsigned long) val_long); - break; - case 'w': - fprintf_filtered (stream, local_hex_format_custom ("08l"), - (unsigned long) val_long); - break; - case 'g': - fprintf_filtered (stream, local_hex_format_custom ("016l"), - (unsigned long) val_long); - break; + val = int_string (val_long, 8, 0, 0, use_c_format); break; default: internal_error (__FILE__, __LINE__, "failed internal consistency check"); - } -#endif /* CC_HAS_LONG_LONG || PRINTF_HAS_LONG_LONG */ + } + fputs_filtered (val, stream); } /* This used to be a macro, but I don't think it is called often enough @@ -449,9 +299,8 @@ print_floating (char *valaddr, struct type *type, struct ui_file *stream) if (floatformat_is_negative (fmt, valaddr)) fprintf_filtered (stream, "-"); fprintf_filtered (stream, "nan("); - fputs_filtered (local_hex_format_prefix (), stream); + fputs_filtered ("0x", stream); fputs_filtered (floatformat_mantissa (fmt, valaddr), stream); - fputs_filtered (local_hex_format_suffix (), stream); fprintf_filtered (stream, ")"); return; } @@ -512,7 +361,6 @@ print_binary_chars (struct ui_file *stream, unsigned char *valaddr, /* FIXME: We should be not printing leading zeroes in most cases. */ - fputs_filtered (local_binary_format_prefix (), stream); if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { for (p = valaddr; @@ -550,7 +398,6 @@ print_binary_chars (struct ui_file *stream, unsigned char *valaddr, } } } - fputs_filtered (local_binary_format_suffix (), stream); } /* VALADDR points to an integer of LEN bytes. @@ -599,7 +446,7 @@ print_octal_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len) cycle = (len * BITS_IN_BYTES) % BITS_IN_OCTAL; carry = 0; - fputs_filtered (local_octal_format_prefix (), stream); + fputs_filtered ("0", stream); if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { for (p = valaddr; @@ -698,7 +545,6 @@ print_octal_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len) } } - fputs_filtered (local_octal_format_suffix (), stream); } /* VALADDR points to an integer of LEN bytes. @@ -741,8 +587,6 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr, digits[i] = 0; } - fputs_filtered (local_decimal_format_prefix (), stream); - /* Ok, we have an unknown number of bytes of data to be printed in * decimal. * @@ -837,8 +681,6 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr, fprintf_filtered (stream, "%1d", digits[i]); } xfree (digits); - - fputs_filtered (local_decimal_format_suffix (), stream); } /* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */ @@ -850,7 +692,7 @@ print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len) /* FIXME: We should be not printing leading zeroes in most cases. */ - fputs_filtered (local_hex_format_prefix (), stream); + fputs_filtered ("0x", stream); if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) { for (p = valaddr; @@ -869,7 +711,6 @@ print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len) fprintf_filtered (stream, "%02x", *p); } } - fputs_filtered (local_hex_format_suffix (), stream); } /* VALADDR points to a char integer of LEN bytes. Print it out in appropriate language form on stream. @@ -1359,21 +1200,21 @@ _initialize_valprint (void) add_alias_cmd ("p", "print", no_class, 1, &showlist); add_alias_cmd ("pr", "print", no_class, 1, &showlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("elements", no_class, var_uinteger, (char *) &print_max, "Set limit on string chars or array elements to print.\n\ \"set print elements 0\" causes there to be no limit.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("null-stop", no_class, var_boolean, (char *) &stop_print_at_null, "Set printing of char arrays to stop at first null char.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("repeats", no_class, var_uinteger, (char *) &repeat_count_threshold, "Set threshold for repeated print elements.\n\ @@ -1381,27 +1222,27 @@ _initialize_valprint (void) &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("pretty", class_support, var_boolean, (char *) &prettyprint_structs, "Set prettyprinting of structures.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("union", class_support, var_boolean, (char *) &unionprint, "Set printing of unions interior to structures.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("array", class_support, var_boolean, (char *) &prettyprint_arrays, "Set prettyprinting of arrays.", &setprintlist), &showprintlist); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("address", class_support, var_boolean, (char *) &addressprint, "Set printing of addresses.", &setprintlist), @@ -1411,21 +1252,21 @@ _initialize_valprint (void) (char *) &input_radix, "Set default input radix for entering numbers.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); set_cmd_sfunc (c, set_input_radix); c = add_set_cmd ("output-radix", class_support, var_uinteger, (char *) &output_radix, "Set default output radix for printing of values.", &setlist); - add_show_from_set (c, &showlist); + deprecated_add_show_from_set (c, &showlist); set_cmd_sfunc (c, set_output_radix); - /* The "set radix" and "show radix" commands are special in that they are - like normal set and show commands but allow two normally independent - variables to be either set or shown with a single command. So the - usual add_set_cmd() and add_show_from_set() commands aren't really - appropriate. */ + /* The "set radix" and "show radix" commands are special in that + they are like normal set and show commands but allow two normally + independent variables to be either set or shown with a single + command. So the usual deprecated_add_set_cmd() and + add_show_from_set() commands aren't really appropriate. */ add_cmd ("radix", class_support, set_radix, "Set default input and output number radices.\n\ Use 'set input-radix' or 'set output-radix' to independently set each.\n\ diff --git a/gnu/usr.bin/binutils/gdb/value.h b/gnu/usr.bin/binutils/gdb/value.h index 690edb96e89..c50c2cac2e6 100644 --- a/gnu/usr.bin/binutils/gdb/value.h +++ b/gnu/usr.bin/binutils/gdb/value.h @@ -560,10 +560,6 @@ extern struct value *find_function_in_inferior (const char *); extern struct value *value_allocate_space_in_inferior (int); -extern CORE_ADDR legacy_push_arguments (int nargs, struct value ** args, - CORE_ADDR sp, int struct_return, - CORE_ADDR struct_addr); - extern struct value *value_of_local (const char *name, int complain); #endif /* !defined (VALUE_H) */ diff --git a/gnu/usr.bin/binutils/gdb/values.c b/gnu/usr.bin/binutils/gdb/values.c index 87baf2144b9..eaf3765c31a 100644 --- a/gnu/usr.bin/binutils/gdb/values.c +++ b/gnu/usr.bin/binutils/gdb/values.c @@ -1170,15 +1170,18 @@ value_from_string (char *ptr) struct value *val; int len = strlen (ptr); int lowbound = current_language->string_lower_bound; - struct type *rangetype = - create_range_type ((struct type *) NULL, - builtin_type_int, - lowbound, len + lowbound - 1); - struct type *stringtype = - create_array_type ((struct type *) NULL, - *current_language->string_char_type, - rangetype); - + struct type *string_char_type; + struct type *rangetype; + struct type *stringtype; + + rangetype = create_range_type ((struct type *) NULL, + builtin_type_int, + lowbound, len + lowbound - 1); + string_char_type = language_string_char_type (current_language, + current_gdbarch); + stringtype = create_array_type ((struct type *) NULL, + string_char_type, + rangetype); val = allocate_value (stringtype); memcpy (VALUE_CONTENTS_RAW (val), ptr, len); return val; @@ -1202,50 +1205,6 @@ value_from_double (struct type *type, DOUBLEST num) return val; } -/* Deal with the return-value of a function that has "just returned". - - Extract the return-value (as a "struct value") that a function, - using register convention, has just returned to its caller. Assume - that the type of the function is VALTYPE, and that the "just - returned" register state is found in RETBUF. - - The function has "just returned" because GDB halts a returning - function by setting a breakpoint at the return address (in the - caller), and not the return instruction (in the callee). - - Because, in the case of a return from an inferior function call, - GDB needs to restore the inferiors registers, RETBUF is normally a - copy of the inferior's registers. */ - -struct value * -register_value_being_returned (struct type *valtype, struct regcache *retbuf) -{ - struct value *val = allocate_value (valtype); - - /* If the function returns void, don't bother fetching the return - value. See also "using_struct_return". */ - if (TYPE_CODE (valtype) == TYPE_CODE_VOID) - return val; - - if (!gdbarch_return_value_p (current_gdbarch)) - { - /* NOTE: cagney/2003-10-20: Unlike "gdbarch_return_value", the - EXTRACT_RETURN_VALUE and USE_STRUCT_CONVENTION methods do not - handle the edge case of a function returning a small - structure / union in registers. */ - CHECK_TYPEDEF (valtype); - EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val)); - return val; - } - - /* This function only handles "register convention". */ - gdb_assert (gdbarch_return_value (current_gdbarch, valtype, - NULL, NULL, NULL) - == RETURN_VALUE_REGISTER_CONVENTION); - gdbarch_return_value (current_gdbarch, valtype, retbuf, - VALUE_CONTENTS_RAW (val) /*read*/, NULL /*write*/); - return val; -} /* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE @@ -1261,15 +1220,16 @@ register_value_being_returned (struct type *valtype, struct regcache *retbuf) 2.0-2.3.3. This is somewhat unfortunate, but changing gcc2_compiled would cause more chaos than dealing with some struct returns being handled wrong. */ +/* NOTE: cagney/2004-06-13: Deleted check for "gcc_p". GCC 1.x is + dead. */ int generic_use_struct_convention (int gcc_p, struct type *value_type) { - return !((gcc_p == 1) - && (TYPE_LENGTH (value_type) == 1 - || TYPE_LENGTH (value_type) == 2 - || TYPE_LENGTH (value_type) == 4 - || TYPE_LENGTH (value_type) == 8)); + return !(TYPE_LENGTH (value_type) == 1 + || TYPE_LENGTH (value_type) == 2 + || TYPE_LENGTH (value_type) == 4 + || TYPE_LENGTH (value_type) == 8); } /* Return true if the function returning the specified type is using @@ -1287,28 +1247,13 @@ using_struct_return (struct type *value_type, int gcc_p) if (code == TYPE_CODE_VOID) /* A void return value is never in memory. See also corresponding - code in "register_value_being_returned". */ + code in "print_return_value". */ return 0; - if (!gdbarch_return_value_p (current_gdbarch)) - { - /* FIXME: cagney/2003-10-01: The below is dead. Instead an - architecture should implement "gdbarch_return_value". Using - that new function it is possible to exactly specify the ABIs - "struct return" vs "register return" conventions. */ - if (code == TYPE_CODE_STRUCT - || code == TYPE_CODE_UNION - || code == TYPE_CODE_ARRAY - || RETURN_VALUE_ON_STACK (value_type)) - return USE_STRUCT_CONVENTION (gcc_p, value_type); - else - return 0; - } - /* Probe the architecture for the return-value convention. */ return (gdbarch_return_value (current_gdbarch, value_type, NULL, NULL, NULL) - == RETURN_VALUE_STRUCT_CONVENTION); + != RETURN_VALUE_REGISTER_CONVENTION); } void diff --git a/gnu/usr.bin/binutils/gdb/vax-tdep.c b/gnu/usr.bin/binutils/gdb/vax-tdep.c index 7db432eef0e..21e71b96558 100644 --- a/gnu/usr.bin/binutils/gdb/vax-tdep.c +++ b/gnu/usr.bin/binutils/gdb/vax-tdep.c @@ -1,4 +1,4 @@ -/* Print VAX instructions for GDB, the GNU debugger. +/* Target-dependent code for the VAX. Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. @@ -21,20 +21,18 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" -#include "symtab.h" -#include "opcode/vax.h" -#include "gdbcore.h" -#include "inferior.h" -#include "regcache.h" +#include "arch-utils.h" +#include "dis-asm.h" #include "frame.h" #include "frame-base.h" #include "frame-unwind.h" -#include "trad-frame.h" -#include "value.h" -#include "arch-utils.h" +#include "gdbcore.h" +#include "gdbtypes.h" #include "osabi.h" -#include "dis-asm.h" +#include "regcache.h" #include "regset.h" +#include "trad-frame.h" +#include "value.h" #include "gdb_string.h" @@ -108,7 +106,7 @@ vax_regset_from_core_section (struct gdbarch *gdbarch, return NULL; } -/* The VAX Unix calling convention uses R1 to pass a structure return +/* The VAX UNIX calling convention uses R1 to pass a structure return value address instead of passing it as a first (hidden) argument as the VMS calling convention suggests. */ @@ -146,7 +144,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, } static CORE_ADDR -vax_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, +vax_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) @@ -214,7 +212,21 @@ vax_return_value (struct gdbarch *gdbarch, struct type *type, if (TYPE_CODE (type) == TYPE_CODE_STRUCT || TYPE_CODE (type) == TYPE_CODE_UNION || TYPE_CODE (type) == TYPE_CODE_ARRAY) - return RETURN_VALUE_STRUCT_CONVENTION; + { + /* The default on VAX is to return structures in static memory. + Consequently a function must return the address where we can + find the return value. */ + + if (readbuf) + { + ULONGEST addr; + + regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr); + read_memory (addr, readbuf, len); + } + + return RETURN_VALUE_ABI_RETURNS_ADDRESS; + } if (readbuf) { @@ -258,26 +270,28 @@ vax_breakpoint_from_pc (CORE_ADDR *pc, int *len) static CORE_ADDR vax_skip_prologue (CORE_ADDR pc) { - int op = (unsigned char) read_memory_integer (pc, 1); + unsigned char op = read_memory_unsigned_integer (pc, 1); + if (op == 0x11) pc += 2; /* skip brb */ if (op == 0x31) pc += 3; /* skip brw */ if (op == 0xC2 - && ((unsigned char) read_memory_integer (pc + 2, 1)) == 0x5E) + && (read_memory_unsigned_integer (pc + 2, 1)) == 0x5E) pc += 3; /* skip subl2 */ if (op == 0x9E - && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xAE - && ((unsigned char) read_memory_integer (pc + 3, 1)) == 0x5E) + && (read_memory_unsigned_integer (pc + 1, 1)) == 0xAE + && (read_memory_unsigned_integer (pc + 3, 1)) == 0x5E) pc += 4; /* skip movab */ if (op == 0x9E - && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xCE - && ((unsigned char) read_memory_integer (pc + 4, 1)) == 0x5E) + && (read_memory_unsigned_integer (pc + 1, 1)) == 0xCE + && (read_memory_unsigned_integer (pc + 4, 1)) == 0x5E) pc += 5; /* skip movab */ if (op == 0x9E - && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xEE - && ((unsigned char) read_memory_integer (pc + 6, 1)) == 0x5E) + && (read_memory_unsigned_integer (pc + 1, 1)) == 0xEE + && (read_memory_unsigned_integer (pc + 6, 1)) == 0x5E) pc += 7; /* skip movab */ + return pc; } @@ -380,8 +394,8 @@ vax_frame_prev_register (struct frame_info *next_frame, void **this_cache, { struct vax_frame_cache *cache = vax_frame_cache (next_frame, this_cache); - trad_frame_prev_register (next_frame, cache->saved_regs, regnum, - optimizedp, lvalp, addrp, realnump, valuep); + trad_frame_get_prev_register (next_frame, cache->saved_regs, regnum, + optimizedp, lvalp, addrp, realnump, valuep); } static const struct frame_unwind vax_frame_unwind = @@ -429,7 +443,7 @@ vax_frame_num_args (struct frame_info *frame) /* Assume that the argument pointer for the outermost frame is hosed, as is the case on NetBSD/vax ELF. */ - if (get_frame_base (frame) == 0) + if (get_frame_base_address (frame) == 0) return 0; args = get_frame_register_unsigned (frame, VAX_AP_REGNUM); @@ -476,7 +490,6 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frame and stack info */ set_gdbarch_skip_prologue (gdbarch, vax_skip_prologue); set_gdbarch_frame_num_args (gdbarch, vax_frame_num_args); - set_gdbarch_frame_args_skip (gdbarch, 4); /* Stack grows downward. */ @@ -493,9 +506,11 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc); /* Misc info */ - set_gdbarch_function_start_offset (gdbarch, 2); + set_gdbarch_deprecated_function_start_offset (gdbarch, 2); set_gdbarch_believe_pcc_promotion (gdbarch, 1); + set_gdbarch_print_insn (gdbarch, print_insn_vax); + set_gdbarch_unwind_pc (gdbarch, vax_unwind_pc); frame_base_set_default (gdbarch, &vax_frame_base); @@ -505,12 +520,11 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) frame_unwind_append_sniffer (gdbarch, vax_frame_sniffer); - set_gdbarch_print_insn (gdbarch, print_insn_vax); - return (gdbarch); } -extern initialize_file_ftype _initialize_vax_tdep; /* -Wmissing-prototypes */ +/* Provide a prototype to silence -Wmissing-prototypes. */ +void _initialize_vax_tdep (void); void _initialize_vax_tdep (void) diff --git a/gnu/usr.bin/binutils/gdb/vaxbsd-nat.c b/gnu/usr.bin/binutils/gdb/vaxbsd-nat.c index 0529f3eec7e..bd505be766e 100644 --- a/gnu/usr.bin/binutils/gdb/vaxbsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/vaxbsd-nat.c @@ -1,4 +1,4 @@ -/* Native-dependent code for VAX BSD's. +/* Native-dependent code for modern VAX BSD's. Copyright 2004 Free Software Foundation, Inc. @@ -22,12 +22,14 @@ #include "defs.h" #include "inferior.h" #include "regcache.h" +#include "target.h" #include <sys/types.h> #include <sys/ptrace.h> #include <machine/reg.h> #include "vax-tdep.h" +#include "inf-ptrace.h" /* Supply the general-purpose registers stored in GREGS to REGCACHE. */ @@ -62,13 +64,13 @@ vaxbsd_collect_gregset (const struct regcache *regcache, /* Fetch register REGNUM from the inferior. If REGNUM is -1, do this for all registers. */ -void -fetch_inferior_registers (int regnum) +static void +vaxbsd_fetch_inferior_registers (int regnum) { struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); vaxbsd_supply_gregset (current_regcache, ®s); @@ -77,19 +79,19 @@ fetch_inferior_registers (int regnum) /* Store register REGNUM back into the inferior. If REGNUM is -1, do this for all registers. */ -void -store_inferior_registers (int regnum) +static void +vaxbsd_store_inferior_registers (int regnum) { struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't get registers"); vaxbsd_collect_gregset (current_regcache, ®s, regnum); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name ("Couldn't write registers"); } @@ -133,6 +135,13 @@ void _initialize_vaxbsd_nat (void); void _initialize_vaxbsd_nat (void) { + struct target_ops *t; + + t = inf_ptrace_target (); + t->to_fetch_registers = vaxbsd_fetch_inferior_registers; + t->to_store_registers = vaxbsd_store_inferior_registers; + add_target (t); + /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (vaxbsd_supply_pcb); } diff --git a/gnu/usr.bin/binutils/gdb/vx-share/wait.h b/gnu/usr.bin/binutils/gdb/vx-share/wait.h index cb8d1b5bbaa..f4670c0d050 100644 --- a/gnu/usr.bin/binutils/gdb/vx-share/wait.h +++ b/gnu/usr.bin/binutils/gdb/vx-share/wait.h @@ -10,9 +10,9 @@ modification history 01a,05jun90,llk borrowed. */ -/* Define how to access the structure that the wait system call stores. - On many systems, there is a structure defined for this. - But on vanilla-ish USG systems there is not. */ +/* Define how to access the structure that the wait system call + stores. On many systems, there is a structure defined for + this. */ #ifndef HAVE_WAIT_STRUCT #define WAITTYPE int diff --git a/gnu/usr.bin/binutils/gdb/win32-nat.c b/gnu/usr.bin/binutils/gdb/win32-nat.c index 8b26916e2b7..9845d46192d 100644 --- a/gnu/usr.bin/binutils/gdb/win32-nat.c +++ b/gnu/usr.bin/binutils/gdb/win32-nat.c @@ -1,7 +1,7 @@ /* Target-vector operations for controlling win32 child processes, for GDB. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free - Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Contributed by Cygnus Solutions, A Red Hat Company. @@ -56,9 +56,6 @@ #include "i386-tdep.h" #include "i387-tdep.h" -/* The ui's event loop. */ -extern int (*ui_loop_hook) (int signo); - /* If we're not using the old Cygwin header file set, define the following which never should have been in the generic Win32 API headers in the first place since they were our own invention... */ @@ -89,9 +86,6 @@ static int debug_registers_used; #define DEBUG_MEM(x) if (debug_memory) printf_unfiltered x #define DEBUG_EXCEPT(x) if (debug_exceptions) printf_unfiltered x -/* Forward declaration */ -extern struct target_ops child_ops; - static void child_stop (void); static int win32_child_thread_alive (ptid_t); void child_kill_inferior (void); @@ -361,15 +355,15 @@ do_child_fetch_inferior_registers (int r) if (r == I387_FISEG_REGNUM) { l = *((long *) context_offset) & 0xffff; - supply_register (r, (char *) &l); + regcache_raw_supply (current_regcache, r, (char *) &l); } else if (r == I387_FOP_REGNUM) { l = (*((long *) context_offset) >> 16) & ((1 << 11) - 1); - supply_register (r, (char *) &l); + regcache_raw_supply (current_regcache, r, (char *) &l); } else if (r >= 0) - supply_register (r, context_offset); + regcache_raw_supply (current_regcache, r, context_offset); else { for (r = 0; r < NUM_REGS; r++) @@ -395,7 +389,8 @@ do_child_store_inferior_registers (int r) if (!current_thread) /* Windows sometimes uses a non-existent thread id in its events */; else if (r >= 0) - regcache_collect (r, ((char *) ¤t_thread->context) + mappings[r]); + regcache_raw_collect (current_regcache, r, + ((char *) ¤t_thread->context) + mappings[r]); else { for (r = 0; r < NUM_REGS; r++) @@ -1420,8 +1415,8 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) { int detach = 0; - if (ui_loop_hook != NULL) - detach = ui_loop_hook (0); + if (deprecated_ui_loop_hook != NULL) + detach = deprecated_ui_loop_hook (0); if (detach) child_kill_inferior (); @@ -1444,7 +1439,7 @@ do_initial_child_stuff (DWORD pid) dr[i] = 0; current_event.dwProcessId = pid; memset (¤t_event, 0, sizeof (current_event)); - push_target (&child_ops); + push_target (&deprecated_child_ops); child_init_thread_list (); disable_breakpoints_in_shlibs (1); child_clear_solibs (); @@ -1656,7 +1651,37 @@ child_detach (char *args, int from_tty) gdb_flush (gdb_stdout); } inferior_ptid = null_ptid; - unpush_target (&child_ops); + unpush_target (&deprecated_child_ops); +} + +char * +child_pid_to_exec_file (int pid) +{ + /* Try to find the process path using the Cygwin internal process list + pid isn't a valid pid, unfortunately. Use current_event.dwProcessId + instead. */ + /* TODO: Also find native Windows processes using CW_GETPINFO_FULL. */ + + static char path[MAX_PATH + 1]; + char *path_ptr = NULL; + int cpid; + struct external_pinfo *pinfo; + + cygwin_internal (CW_LOCK_PINFO, 1000); + for (cpid = 0; + (pinfo = (struct external_pinfo *) + cygwin_internal (CW_GETPINFO, cpid | CW_NEXTPID)); + cpid = pinfo->pid) + { + if (pinfo->dwProcessId == current_event.dwProcessId) /* Got it */ + { + cygwin_conv_to_full_posix_path (pinfo->progname, path); + path_ptr = path; + break; + } + } + cygwin_internal (CW_UNLOCK_PINFO); + return path_ptr; } /* Print status information about what we're accessing. */ @@ -1680,7 +1705,8 @@ child_open (char *arg, int from_tty) ENV is the environment vector to pass. Errors reported with error(). */ static void -child_create_inferior (char *exec_file, char *allargs, char **env) +child_create_inferior (char *exec_file, char *allargs, char **env, + int from_tty) { char *winenv; char *temp; @@ -1875,7 +1901,7 @@ child_mourn_inferior (void) { (void) child_continue (DBG_CONTINUE, -1); i386_cleanup_dregs(); - unpush_target (&child_ops); + unpush_target (&deprecated_child_ops); generic_mourn_inferior (); } @@ -2039,47 +2065,46 @@ child_close (int x) PIDGET (inferior_ptid))); } -struct target_ops child_ops; - static void init_child_ops (void) { - child_ops.to_shortname = "child"; - child_ops.to_longname = "Win32 child process"; - child_ops.to_doc = "Win32 child process (started by the \"run\" command)."; - child_ops.to_open = child_open; - child_ops.to_close = child_close; - child_ops.to_attach = child_attach; - child_ops.to_detach = child_detach; - child_ops.to_resume = child_resume; - child_ops.to_wait = child_wait; - child_ops.to_fetch_registers = child_fetch_inferior_registers; - child_ops.to_store_registers = child_store_inferior_registers; - child_ops.to_prepare_to_store = child_prepare_to_store; - child_ops.to_xfer_memory = child_xfer_memory; - child_ops.to_files_info = child_files_info; - child_ops.to_insert_breakpoint = memory_insert_breakpoint; - child_ops.to_remove_breakpoint = memory_remove_breakpoint; - child_ops.to_terminal_init = terminal_init_inferior; - child_ops.to_terminal_inferior = terminal_inferior; - child_ops.to_terminal_ours_for_output = terminal_ours_for_output; - child_ops.to_terminal_ours = terminal_ours; - child_ops.to_terminal_save_ours = terminal_save_ours; - child_ops.to_terminal_info = child_terminal_info; - child_ops.to_kill = child_kill_inferior; - child_ops.to_create_inferior = child_create_inferior; - child_ops.to_mourn_inferior = child_mourn_inferior; - child_ops.to_can_run = child_can_run; - child_ops.to_thread_alive = win32_child_thread_alive; - child_ops.to_pid_to_str = cygwin_pid_to_str; - child_ops.to_stop = child_stop; - child_ops.to_stratum = process_stratum; - child_ops.to_has_all_memory = 1; - child_ops.to_has_memory = 1; - child_ops.to_has_stack = 1; - child_ops.to_has_registers = 1; - child_ops.to_has_execution = 1; - child_ops.to_magic = OPS_MAGIC; + deprecated_child_ops.to_shortname = "child"; + deprecated_child_ops.to_longname = "Win32 child process"; + deprecated_child_ops.to_doc = "Win32 child process (started by the \"run\" command)."; + deprecated_child_ops.to_open = child_open; + deprecated_child_ops.to_close = child_close; + deprecated_child_ops.to_attach = child_attach; + deprecated_child_ops.to_detach = child_detach; + deprecated_child_ops.to_resume = child_resume; + deprecated_child_ops.to_wait = child_wait; + deprecated_child_ops.to_fetch_registers = child_fetch_inferior_registers; + deprecated_child_ops.to_store_registers = child_store_inferior_registers; + deprecated_child_ops.to_prepare_to_store = child_prepare_to_store; + deprecated_child_ops.deprecated_xfer_memory = child_xfer_memory; + deprecated_child_ops.to_files_info = child_files_info; + deprecated_child_ops.to_insert_breakpoint = memory_insert_breakpoint; + deprecated_child_ops.to_remove_breakpoint = memory_remove_breakpoint; + deprecated_child_ops.to_terminal_init = terminal_init_inferior; + deprecated_child_ops.to_terminal_inferior = terminal_inferior; + deprecated_child_ops.to_terminal_ours_for_output = terminal_ours_for_output; + deprecated_child_ops.to_terminal_ours = terminal_ours; + deprecated_child_ops.to_terminal_save_ours = terminal_save_ours; + deprecated_child_ops.to_terminal_info = child_terminal_info; + deprecated_child_ops.to_kill = child_kill_inferior; + deprecated_child_ops.to_create_inferior = child_create_inferior; + deprecated_child_ops.to_mourn_inferior = child_mourn_inferior; + deprecated_child_ops.to_can_run = child_can_run; + deprecated_child_ops.to_thread_alive = win32_child_thread_alive; + deprecated_child_ops.to_pid_to_str = cygwin_pid_to_str; + deprecated_child_ops.to_stop = child_stop; + deprecated_child_ops.to_stratum = process_stratum; + deprecated_child_ops.to_has_all_memory = 1; + deprecated_child_ops.to_has_memory = 1; + deprecated_child_ops.to_has_stack = 1; + deprecated_child_ops.to_has_registers = 1; + deprecated_child_ops.to_has_execution = 1; + deprecated_child_ops.to_magic = OPS_MAGIC; + deprecated_child_ops.to_pid_to_exec_file = child_pid_to_exec_file; } void @@ -2095,47 +2120,54 @@ _initialize_win32_nat (void) add_com_alias ("sharedlibrary", "dll-symbols", class_alias, 1); - add_show_from_set (add_set_cmd ("shell", class_support, var_boolean, - (char *) &useshell, - "Set use of shell to start subprocess.", - &setlist), - &showlist); - - add_show_from_set (add_set_cmd ("new-console", class_support, var_boolean, - (char *) &new_console, - "Set creation of new console when creating child process.", - &setlist), - &showlist); - - add_show_from_set (add_set_cmd ("new-group", class_support, var_boolean, - (char *) &new_group, - "Set creation of new group when creating child process.", - &setlist), - &showlist); - - add_show_from_set (add_set_cmd ("debugexec", class_support, var_boolean, - (char *) &debug_exec, - "Set whether to display execution in child process.", - &setlist), - &showlist); - - add_show_from_set (add_set_cmd ("debugevents", class_support, var_boolean, - (char *) &debug_events, - "Set whether to display kernel events in child process.", - &setlist), - &showlist); - - add_show_from_set (add_set_cmd ("debugmemory", class_support, var_boolean, - (char *) &debug_memory, - "Set whether to display memory accesses in child process.", - &setlist), - &showlist); - - add_show_from_set (add_set_cmd ("debugexceptions", class_support, var_boolean, - (char *) &debug_exceptions, - "Set whether to display kernel exceptions in child process.", - &setlist), - &showlist); + deprecated_add_show_from_set + (add_set_cmd ("shell", class_support, var_boolean, + (char *) &useshell, + "Set use of shell to start subprocess.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("new-console", class_support, var_boolean, + (char *) &new_console, + "Set creation of new console when creating child process.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("new-group", class_support, var_boolean, + (char *) &new_group, + "Set creation of new group when creating child process.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("debugexec", class_support, var_boolean, + (char *) &debug_exec, + "Set whether to display execution in child process.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("debugevents", class_support, var_boolean, + (char *) &debug_events, + "Set whether to display kernel events in child process.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("debugmemory", class_support, var_boolean, + (char *) &debug_memory, + "Set whether to display memory accesses in child process.", + &setlist), + &showlist); + + deprecated_add_show_from_set + (add_set_cmd ("debugexceptions", class_support, var_boolean, + (char *) &debug_exceptions, + "Set whether to display kernel exceptions in child process.", + &setlist), + &showlist); add_info ("dll", info_dll_command, "Status of loaded DLLs."); add_info_alias ("sharedlibrary", "dll", 1); @@ -2148,7 +2180,7 @@ _initialize_win32_nat (void) "Display selectors infos.", &info_w32_cmdlist); - add_target (&child_ops); + add_target (&deprecated_child_ops); } /* Hardware watchpoint support, adapted from go32-nat.c code. */ @@ -2238,65 +2270,65 @@ core_dll_symbols_add (char *dll_name, DWORD base_addr) } } - register_loaded_dll (dll_name, base_addr + 0x1000); - solib_symbols_add (dll_name, 0, (CORE_ADDR) base_addr + 0x1000); + register_loaded_dll (dll_name, base_addr + 0x1000); + solib_symbols_add (dll_name, 0, (CORE_ADDR) base_addr + 0x1000); - out: - return 1; - } + out: + return 1; +} - typedef struct - { - struct target_ops *target; - bfd_vma addr; - } map_code_section_args; +typedef struct +{ + struct target_ops *target; + bfd_vma addr; +} map_code_section_args; - static void - map_single_dll_code_section (bfd * abfd, asection * sect, void *obj) - { - int old; - int update_coreops; - struct section_table *new_target_sect_ptr; +static void +map_single_dll_code_section (bfd * abfd, asection * sect, void *obj) +{ + int old; + int update_coreops; + struct section_table *new_target_sect_ptr; - map_code_section_args *args = (map_code_section_args *) obj; - struct target_ops *target = args->target; - if (sect->flags & SEC_CODE) - { - update_coreops = core_ops.to_sections == target->to_sections; + map_code_section_args *args = (map_code_section_args *) obj; + struct target_ops *target = args->target; + if (sect->flags & SEC_CODE) + { + update_coreops = core_ops.to_sections == target->to_sections; - if (target->to_sections) - { - old = target->to_sections_end - target->to_sections; - target->to_sections = (struct section_table *) - xrealloc ((char *) target->to_sections, - (sizeof (struct section_table)) * (1 + old)); - } - else - { - old = 0; - target->to_sections = (struct section_table *) - xmalloc ((sizeof (struct section_table))); - } - target->to_sections_end = target->to_sections + (1 + old); + if (target->to_sections) + { + old = target->to_sections_end - target->to_sections; + target->to_sections = (struct section_table *) + xrealloc ((char *) target->to_sections, + (sizeof (struct section_table)) * (1 + old)); + } + else + { + old = 0; + target->to_sections = (struct section_table *) + xmalloc ((sizeof (struct section_table))); + } + target->to_sections_end = target->to_sections + (1 + old); - /* Update the to_sections field in the core_ops structure - if needed. */ - if (update_coreops) - { - core_ops.to_sections = target->to_sections; - core_ops.to_sections_end = target->to_sections_end; - } - new_target_sect_ptr = target->to_sections + old; - new_target_sect_ptr->addr = args->addr + bfd_section_vma (abfd, sect); - new_target_sect_ptr->endaddr = args->addr + bfd_section_vma (abfd, sect) + - bfd_section_size (abfd, sect);; - new_target_sect_ptr->the_bfd_section = sect; - new_target_sect_ptr->bfd = abfd; - } - } + /* Update the to_sections field in the core_ops structure + if needed. */ + if (update_coreops) + { + core_ops.to_sections = target->to_sections; + core_ops.to_sections_end = target->to_sections_end; + } + new_target_sect_ptr = target->to_sections + old; + new_target_sect_ptr->addr = args->addr + bfd_section_vma (abfd, sect); + new_target_sect_ptr->endaddr = args->addr + bfd_section_vma (abfd, sect) + + bfd_section_size (abfd, sect);; + new_target_sect_ptr->the_bfd_section = sect; + new_target_sect_ptr->bfd = abfd; + } +} - static int - dll_code_sections_add (const char *dll_name, int base_addr, struct target_ops *target) +static int +dll_code_sections_add (const char *dll_name, int base_addr, struct target_ops *target) { bfd *dll_bfd; map_code_section_args map_args; @@ -2339,20 +2371,20 @@ core_section_load_dll_symbols (bfd * abfd, asection * sect, void *obj) if (strncmp (sect->name, ".module", 7)) return; - buf = (char *) xmalloc (sect->_raw_size + 1); + buf = (char *) xmalloc (bfd_get_section_size (sect) + 1); if (!buf) { printf_unfiltered ("memory allocation failed for %s\n", sect->name); goto out; } - if (!bfd_get_section_contents (abfd, sect, buf, 0, sect->_raw_size)) + if (!bfd_get_section_contents (abfd, sect, buf, 0, bfd_get_section_size (sect))) goto out; pstatus = (struct win32_pstatus *) buf; memmove (&base_addr, &(pstatus->data.module_info.base_address), sizeof (base_addr)); dll_name_size = pstatus->data.module_info.module_name_size; - if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > sect->_raw_size) + if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > bfd_get_section_size (sect)) goto out; dll_name = (char *) xmalloc (dll_name_size + 1); @@ -2412,7 +2444,7 @@ fetch_elf_core_registers (char *core_reg_sect, return; } for (r = 0; r < NUM_REGS; r++) - supply_register (r, core_reg_sect + mappings[r]); + regcache_raw_supply (current_regcache, r, core_reg_sect + mappings[r]); } static struct core_fns win32_elf_core_fns = @@ -2427,7 +2459,7 @@ static struct core_fns win32_elf_core_fns = void _initialize_core_win32 (void) { - add_core_fns (&win32_elf_core_fns); + deprecated_add_core_fns (&win32_elf_core_fns); } void diff --git a/gnu/usr.bin/binutils/gdb/xcoffread.c b/gnu/usr.bin/binutils/gdb/xcoffread.c index 759dfcb1fb7..2f1bd23ae1c 100644 --- a/gnu/usr.bin/binutils/gdb/xcoffread.c +++ b/gnu/usr.bin/binutils/gdb/xcoffread.c @@ -31,7 +31,7 @@ #include "gdb_string.h" #include <sys/param.h> -#ifndef NO_SYS_FILE +#ifdef HAVE_SYS_FILE_H #include <sys/file.h> #endif #include "gdb_stat.h" @@ -1838,8 +1838,7 @@ static void xcoff_symfile_init (struct objfile *objfile) { /* Allocate struct to keep track of the symfile */ - objfile->sym_private = xmmalloc (objfile->md, - sizeof (struct coff_symfile_info)); + objfile->sym_private = xmalloc (sizeof (struct coff_symfile_info)); /* XCOFF objects may be reordered, so set OBJF_REORDERED. If we find this causes a significant slowdown in gdb then we could @@ -1859,7 +1858,7 @@ xcoff_symfile_finish (struct objfile *objfile) { if (objfile->sym_private != NULL) { - xmfree (objfile->md, objfile->sym_private); + xfree (objfile->sym_private); } /* Start with a fresh include table for the next objfile. */ diff --git a/gnu/usr.bin/binutils/gdb/xcoffsolib.c b/gnu/usr.bin/binutils/gdb/xcoffsolib.c index 99d2cc8e8f7..9dcc3c4f715 100644 --- a/gnu/usr.bin/binutils/gdb/xcoffsolib.c +++ b/gnu/usr.bin/binutils/gdb/xcoffsolib.c @@ -48,11 +48,11 @@ xcoff_solib_address (CORE_ADDR addr) if (vp->tstart <= addr && addr < vp->tend) { xfree (buffer); - xasprintf (&buffer, "%s%s%s%s", - vp->name, - *vp->member ? "(" : "", - vp->member, - *vp->member ? ")" : ""); + buffer = xstrprintf ("%s%s%s%s", + vp->name, + *vp->member ? "(" : "", + vp->member, + *vp->member ? ")" : ""); return buffer; } return NULL; @@ -183,7 +183,7 @@ _initialize_xcoffsolib (void) add_info ("sharedlibrary", solib_info, "Status of loaded shared object libraries"); - add_show_from_set + deprecated_add_show_from_set (add_set_cmd ("auto-solib-add", class_support, var_boolean, (char *) &auto_solib_add, "Set autoloading of shared library symbols.\n\ diff --git a/gnu/usr.bin/binutils/gdb/xmodem.c b/gnu/usr.bin/binutils/gdb/xmodem.c deleted file mode 100644 index 7b8d77d1055..00000000000 --- a/gnu/usr.bin/binutils/gdb/xmodem.c +++ /dev/null @@ -1,275 +0,0 @@ -/* XMODEM support for GDB, the GNU debugger. - Copyright 1995, 2000, 2001 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 "serial.h" -#include "target.h" -#include "xmodem.h" - -/* These definitions are for xmodem protocol. */ - -#define SOH 0x01 -#define STX 0x02 -#define ACK 0x06 -#define NAK 0x15 -#define EOT 0x04 -#define CANCEL 0x18 - -static int blknum; /* XMODEM block number */ -static int crcflag; /* Sez we are using CRC's instead of cksums */ - -static int -readchar (struct serial *desc, int timeout) -{ - int c; - - c = serial_readchar (desc, timeout); - - if (remote_debug > 0) - fputc_unfiltered (c, gdb_stdlog); - - if (c >= 0) - return c; - - if (c == SERIAL_TIMEOUT) - error ("Timeout reading from remote system."); - - perror_with_name ("xmodem.c:readchar()"); -} - -#define CRC16 0x1021 /* Generator polynomial (X^16 + X^12 + X^5 + 1) */ - -static unsigned short *crctab; - -/* Call this to init the fast CRC-16 calculation table. */ - -static void -crcinit (void) -{ - static int crctab_inited = 0; - int val; - - if (crctab_inited == 1) - return; - - crctab = xmalloc (256 * sizeof (short)); - - for (val = 0; val <= 255; val++) - { - int i; - unsigned int crc; - - crc = val << 8; - - for (i = 0; i < 8; ++i) - { - crc <<= 1; - - if (crc & 0x10000) - crc ^= CRC16; - } - - crctab[val] = crc; - } - - crctab_inited = 1; -} - -/* Calculate a CRC-16 for the LEN byte message pointed at by P. */ - -static unsigned short -docrc (unsigned char *p, int len) -{ - unsigned short crc = 0; - - while (len-- > 0) - crc = (crc << 8) ^ crctab[(crc >> 8) ^ *p++]; - - return crc; -} - -/* Start up the transmit process. Reset state variables. Wait for receiver to - send NAK or CRC request. */ - -int -xmodem_init_xfer (struct serial *desc) -{ - int c; - int i; - - blknum = 1; - crcflag = 0; - crcinit (); - - for (i = 1; i <= 10; i++) - { - c = readchar (desc, 6); - - switch (c) - { - case 'C': - crcflag = 1; - case NAK: - return 0; - default: - fprintf_unfiltered (gdb_stderr, "xmodem_init_xfer: Got unexpected character %c (0%o)\n", c, c); - continue; - case CANCEL: /* target aborted load */ - fprintf_unfiltered (gdb_stderr, "Got a CANCEL from the target.\n"); - continue; - } - } - error ("xmodem_init_xfer: Too many unexpected characters."); -} - -/* Take 128 bytes of data and make a packet out of it. - - * Each packet looks like this: - * +-----+-------+-------+------+-----+ - * | SOH | Seq1. | Seq2. | data | SUM | - * +-----+-------+-------+------+-----+ - * SOH = 0x01 - * Seq1 = The sequence number. - * Seq2 = The complement of the sequence number. - * Data = A 128 bytes of data. - * SUM = Add the contents of the 128 bytes and use the low-order - * 8 bits of the result. - * - * send_xmodem_packet fills in the XMODEM fields of PACKET and sends it to the - * remote system. PACKET must be XMODEM_PACKETSIZE bytes long. The data must - * start 3 bytes after the beginning of the packet to leave room for the - * XMODEM header. LEN is the length of the data portion of the packet (and - * must be <= 128 bytes). If it is < 128 bytes, ^Z padding will be added. - */ - -void -xmodem_send_packet (struct serial *desc, unsigned char *packet, int len, int hashmark) -{ - int i; - int retries; - int pktlen; - int datasize; - - /* build the packet header */ - - packet[1] = blknum; - packet[2] = ~blknum; - - blknum++; - - if (len <= XMODEM_DATASIZE) - { - packet[0] = SOH; - datasize = XMODEM_DATASIZE; - } - else if (len <= XMODEM_1KDATASIZE) - { - packet[0] = STX; - datasize = XMODEM_1KDATASIZE; - } - else - internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Packet way too large */ - - /* Add ^Z padding if packet < 128 (or 1024) bytes */ - - memset (packet + 3 + len, '\026', datasize - len); - - if (crcflag) - { - int crc; - - crc = docrc (packet + 3, datasize); - - packet[3 + datasize] = crc >> 8; - packet[3 + datasize + 1] = crc; - pktlen = datasize + 5; - } - else - { - int sum; - - sum = 0; - for (i = 3; i < datasize + 3; i++) - sum += packet[i]; - - packet[3 + datasize] = sum; /* add the checksum */ - pktlen = datasize + 4; - } - - for (retries = 3; retries >= 0; retries--) - { - int c; - - serial_write (desc, packet, pktlen); - - c = readchar (desc, 3); - switch (c) - { - case ACK: - return; - case NAK: - if (!hashmark) - continue; - putchar_unfiltered ('-'); - gdb_flush (gdb_stdout); - continue; - case CANCEL: - error ("xmodem_send_packet: Transfer aborted by receiver."); - default: - fprintf_unfiltered (gdb_stderr, "xmodem_send_packet: Got unexpected character %c (0%o)\n", c, c); - continue; - } - } - - serial_write (desc, "\004", 1); /* Send an EOT */ - - error ("xmodem_send_packet: Excessive retries."); -} - -/* Finish off the transfer. Send out the EOT, and wait for an ACK. */ - -void -xmodem_finish_xfer (struct serial *desc) -{ - int retries; - - for (retries = 10; retries >= 0; retries--) - { - int c; - - serial_write (desc, "\004", 1); /* Send an EOT */ - - c = readchar (desc, 3); - switch (c) - { - case ACK: - return; - case NAK: - continue; - case CANCEL: - error ("xmodem_finish_xfer: Transfer aborted by receiver."); - default: - fprintf_unfiltered (gdb_stderr, "xmodem_send_packet: Got unexpected character %c (0%o)\n", c, c); - continue; - } - } - - error ("xmodem_finish_xfer: Excessive retries."); -} diff --git a/gnu/usr.bin/binutils/gdb/xmodem.h b/gnu/usr.bin/binutils/gdb/xmodem.h deleted file mode 100644 index 83aa24f71ec..00000000000 --- a/gnu/usr.bin/binutils/gdb/xmodem.h +++ /dev/null @@ -1,32 +0,0 @@ -/* XMODEM support for GDB, the GNU debugger. - Copyright 1995, 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -struct serial; - -int xmodem_init_xfer (struct serial *desc); -void send_xmodem_packet (struct serial *desc, unsigned char *packet, int len, - int hashmark); -void xmodem_finish_xfer (struct serial *desc); - -#define XMODEM_DATASIZE 128 /* The data size is ALWAYS 128 */ -#define XMODEM_1KDATASIZE 1024 /* Unless it's 1024!!! */ -#define XMODEM_PACKETSIZE 133 /* data + packet headers and crc */ -#define XMODEM_1KPACKETSIZE 1024 + 5 /* data + packet headers and crc */ -#define XMODEM_DATAOFFSET 3 /* Offset to start of actual data */ |