2008-04-10 Jason Molenda (jmolenda@apple.com) * breakpoint.c (breakpoint_re_set_one): Handle catch/throw breakpoints like normal breakpoints. (tell_breakpoints_objfile_changed_internal): Handle catch/throw breakpoints like normal breakpoints. 2008-04-08 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_line_1): Correctly advance the character pointer in the case where we have multiple source files that matched but only one actually turned out to have lines. 2008-04-08 Jim Ingham * objc-lang.c (value_nsstring): Make the function type that creates the nsstring actually be "returns NSString *" rather than "returns void *". Our attempts to fix the value up after the fact didn't work. * breakpoint.c (breakpoint_re_set_one): Thread creation breakpoints need to be relocated. 2008-04-04 Greg Clayton * remote.c (remote_attach): Clear up error display. * config/tm-macosx.h (ATTACH_DETACH): Define this for any Mac OSX target (including cross builds). * config/tm-macosx.h (ATTACH_NO_WAIT): Ditto. * config/nm-macosx.h (ATTACH_DETACH): Moved to tm-macosx.h. * config/nm-macosx.h (ATTACH_NO_WAIT): Ditto. 2008-04-04 Jim Ingham * remote.c (complete_create_or_attach): New function. (remote_create_inferior): Factored out common bits into complete_create_or_attach. (remote_attach): New implementation. 2008-04-03 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_and_continue_supported): Not supported on arm. 2008-04-03 Jim Ingham * remote.c (remote_create_inferior): Query the success of the launch attempt before proceeding. 2008-04-01 Jason Molenda (jmolenda@apple.com) * remote.c (getpkt_sane): If the watchdog timer times out, there's a good chance someone unplugged the remote device we were talking to. Change the error message to mention this possibility explicitly. 2008-04-01 Jim Ingham * objc-lang.c (new_objc_runtime_find_impl): If the implementation is _objc_msgForward then the object doesn't respond to the selector. Return 0 in this case. 2008-03-27 Jim Ingham * objfiles.c (free_objfile_internal): Free the cached sections data structures. * symtab.c: Use INVALID_ADDRESS to indicate uninitialized values instead of 0. (symtab_clear_cached_lookup_values): Ditto. 2003-03-27 Caroline Tice * c-exp.y (square_bracket_seen): New global variable. (yylex): Make special cases for '[' and ']', to update square_bracket_seen; only call lookup_objc_class if square_bracket_seen is true; then set it to false. * objc-exp.y (square_bracket_seen): New global variable. (yylex): Make special cases for '[' and ']', to update square_bracket_seen; only call lookup_objc_class if square_bracket_seen is true; then set it to false. * varobj.c (path_expr_of_root): New function. (name_of_variable): Call path_expr_of_root to get the path expression for root variables, instead of just returning its name. 2003-03-26 Jim Ingham * symfile.c (add_kext_command): Use printable_name not arch_name for the warning. 2008-03-24 Jason Molenda (jmolenda@apple.com) Original patch by Gaius Mulley , edited down to just the DW_TAG_set_type support by Jonas Maebe. * dwarf2read.c (read_set_type): Record a DW_TAG_set_type die. (process_die): Call it. (new_symbol): Recognize the tag. (read_type_die): Call it. 2003-03-21 Jim Ingham * fork-child.c (fork_inferior): Switch to using posix_spawn/ execve for both the shell & non-shell case. That way we can ensure that even if the shell is Universal we'll run the same fork of the shell as of the executable. 2008-03-18 Jim Ingham * breakpoint.c (watch_command_1): If the value for the watch expression's type is TYPE_CODE_ERROR, discard the watchpoint. 2008-03-17 Jim Ingham * remote.c (remote_create_inferior): Use the QEnvironment packet to send down the environment to the target. Also, changed the remote args code to share a buffer & cleanup with the environment code. 2008-03-12 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_implementation_from_class): Compare the cstring names of the classes instead of the class pointers themselves. (new_objc_runtime_find_impl): Remove accidental duplicated code. 2008-03-12 Caroline Tice * symfile.c (append_psymbols_as_msymbols): Check the return value from lookup_minimal_symbol_by_pc_section_from_objfile to make sure it's really the same symbol before skipping over it. 2008-03-10 Caroline Tice * block.c (inferior.h): New include file. (blockvector_for_pc_sect): Check to see if parameters are the same as the last time this function was called; if so return cached values; otherwise find the appropriate values, and re-set the cached parameters and return values. (block_for_pc_sect): Likewise. * blockframe.c (find_pc_sect_function): Likewise. * corefile.c (reopen_exec_file): Add call to symtab_clear_cached_lookup_values. * objfiles.c (find_pc_sect_section): Check to see if parameters are the same as the last time this function was calle; if so return cached value; otherwise find the appropriate value, and re-set the cached parameters and return value. * symfile.s (replace_psymbols with correct_psymbols): Add call to symtab_clear_cached_lookup_values. (symbol_file_clear): Likewise. (reread_symbols): Likewise. (remove_symbol_file_command): Likewise. (find_pc_overlay): Check to see if parameters are the same as the last time this function was calle; if so return cached value; otherwise find the appropriate value, and re-set the cached parameters and return value. (find_pc_mapped_section): Likewise. * symtab.c (cached_mapped_section, cached_overlay_section, cached_sect_section, cached_symtab, cached_psymtab, cached_pc_line, cached_pc_function, cached_blockvector, cached_blockvector_index, cached_block, last_block_lookup_pc, last_blockvector_lookup_pc, last_function_lookup_pc, last_pc_line_lookup_pc, last_psymtab_lookup_pc, last_symtab_lookup_pc, last_sect_section_lookup_pc, last_mapped_section_lookup_pc, last_overlay_section_lookup_pc): New global variables. (find_pc_sect_psymtab): Check to see if parameters are the same as the last time this function was calle; if so return cached value; otherwise find the appropriate value, and re-set the cached parameters and return value. (find_pc_sect_symtab): Likewise. (find_pc_sect_line): Likewise. (copy_sal): New function. (symtab_clear_cached_lookup_values): New function. * symtab.h (cached_mapped_section, cached_overlay_section, cached_sect_section, cached_symtab, cached_psymtab, cached_pc_line, cached_pc_function, cached_blockvector, cached_blockvector_index, cached_block, last_block_lookup_pc, last_blockvector_lookup_pc, last_function_lookup_pc, last_pc_line_lookup_pc, last_psymtab_lookup_pc, last_symtab_lookup_pc, last_sect_section_lookup_pc, last_mapped_section_lookup_pc, last_overlay_section_lookup_pc): New extern global variable declarations. (symtab_clear_cached_lookup_values): New extern function declaration. 2008-03-06 Jim Ingham *infrun.c (handle_inferior_event): Catch possible errors unwinding to the caller frame. * printcmd.c (address_info): Don't crash if there's no currently selected block. 2008-03-05 Jason Molenda (jmolenda@apple.com) Patch from George Helffrich. * dwarf2read.c (read_common_block): Record the current die's linkage name while children die processing. (decode_locdesc): If parent die's linkage name was set, use it. 2008-03-05 Jason Molenda (jmolenda@apple.com) * remote.c (PROTOCOL_LOG_COUNT): Double to 400 packets. (add_pkt_to_protocol_log): Record empty replies from the remote stub. 2008-03-05 Jason Molenda (jmolenda@apple.com) * configure.ac: Look for DebugSymbols framework in $SDKROOT. * configure: Regenerated. 2008-03-04 Greg Clayton * thread.c (info_threads_command): Use ui_out functions when outputting text so things stay in sync when using MI. 2008-02-26 Jim Ingham * ui-out.c (ui_out_print_annotation_int): Remove errant conditionalization of the char* formatting of the int. 2008-02-25 Jim Ingham * arm-tdep.c (arm_macosx_in_switch_glue): New function to detect if we're in a gcc-generated function to handle a switch statement's jump table. * infrun.c (struct execution_control_state): State whether we're in a thumb switch statement gcc-generated function. (init_execution_control_state): Init it. (handle_inferior_event): If we're in a gcc-generated function to handle a switch table, stepi over the instructions until we're back in the body of the real function we were stepping in. * config/arm/tm-arm-macosx.h (IN_SWITCH_GLUE): Define to arm_macosx_in_switch_glue. 2008-02-21 Jim Ingham * ui-out.c (ui_out_set_annotation_printer): New function. (ui_out_print_annotation_string): New function. (ui_out_print_annotation_int): New function. * ui-out.h: Declare the above. * breakpoint.c (print_it_typical): Route some useful bits of stop information through the annotation printer. (watchpoint_check): Ditto. (print_exception_catchpoint): Ditto. * infrun.c (print_stop_reason): Ditto. (handle_inferior_event): Ditto. * infcmd.c (step_1): Call the stepping_command_hook in the synchronous target case. 2008-02-20 Jason Molenda (jmolenda@apple.com) * arm-tdep.c (arm_dwarf2_reg_to_regnum): New function to map DWARF register numbers to gdb internal register numbers. (arm_gdbarch_init): Add it to the gdbarch. * arm-tdep.h (enum gdb_regnum): Clarify what the different register names indicate. 2008-02-20 Jim Ingham * objc-lang.c (new_objc_runtime_get_classname): Don't goto out of a TRY_CATCH block... * cli/cli-interp.c (cli_quoted_interpreter_resume): Route the stdtarg through an mi-like output as well. 2008-02-19 Jim Ingham * objc-lang.c (new_objc_runtime_class_getClass): New function. (new_objc_runtime_find_impl): Use the above. (free_rb_tree): Make more generic by taking a "free_data" function. (objc_clear_caches): New function, clear both rb_tree caches. (new_objc_runtime_get_classname): New function. (lookup_classname_in_cache, add_classname_to_cache): Ditto. (objc_target_type_from_object): Change to look in cache, and to call new_objc_runtime_get_classname for Objc 2.0. (new_objc_runtime_find_impl): Run gdbarch_addr_bits_remove on the address we get back from the runtime. * objc-lang.h: Declare objc_clear_caches * target.c (generic_mourn_inferior): Call objc_clear_caches. * breakpoint.c (bpstat_stop_status): Don't call remove_breakpoints if we aren't going to stop. That's an anachronism. * config/arm/tm-arm-macosx.h: Declare arm_throw_catch_find_typeinfo and the THROW_CATCH_FIND_TYPEINFO macro. 2008-02-15 Jim Ingham * breakpoint.c (breakpoint_re_set_one): Don't raise the load level if we are evaluating catch or throw breakpoints, since raising the load level will delete the breakpoint we're evaluating. * remote.c (init_remote_ops): add the MacOSX exception handling if we're on MacOS X. * memattr.c (mem_{enable,disable}_caching): New functions. Also use -1 for cache to mean "temporarily disabled". (mem_info_command): Change for new meaning of chache. * memattr.h: Declare the above. * dcache.c (dcache_write_line, dcache_read_line): Test for == 1, not non-zero to mean cache on. * target.c (mem_xfer_partial): Ditto. (target_read): Don't return 0 if you've been able to read some, but not all, the requested bytes. Return the number you've read. * dbxread.c (fill_symbuf): Temporarily disable caching while filling the symbuf. (stabsect_build_psymtabs): Ditto. 2008-02-14 Jim Ingham * objc-lang.c (lookup_implementation_in_cache, add_implementation_to_cache, objc_clear_selector_to_implementation_cache, free_rb_tree_data): New functions. (new_objc_runtime_find_impl): Add then new implementation to cache. (find_implementation_from_class): Look in cache first. And add a new one if found. (find_implementation): Ditto. (resolve_newruntime_objc_msgsendsuper): Ditto. * objc-lang.h: Declare objc_clear_selector_to_implementation_cache. * target.c (generic_mourn_inferior): Clear the cache. * symfile.c (append_psymbols_as_msymbols): Don't add a minsym if it already exists in the original objfile. 2008-02-09 Jim Ingham * objc-lang.c (new_objc_runtime_find_impl): Check for and call the new gdb_class_getClass. 2008-02-08 Jim Ingham * objc-lang.c (new_objc_runtime_find_impl): Set unwind_on_signal off while calling the function in the runtime. (find_implementation_from_class): Do more work to validate the input class before looking for the method. 2008-02-06 Jim Ingham * valops.c (check_safe_call): Set stack_depth in the args. 2008-02-05 Jim Ingham * objfiles.h: Add OBJF_SYM_DONT_CHANGE and the masks OBJF_SYM_LEVELS_MASK and OBJF_SYM_FLAGS_MASK. * dbxread.c (dbx_symfile_read): mutatis mutandi for above. * fix-and-continue.c (raise_objfile_load_level): Ditto. * infrun.c (handle_inferior_event): Ditto. * symfile.c (syms_from_objfile, reread_symbols): Ditto. * objfiles.c (objfile_set_load_state): Enforce OBJF_SYM_DONT_CHANGE> 2008-02-01 Jim Ingham * target.h: Declare set_trust_readonly. * mem-break.c: Remove extern of set_trust_readonly. 2008-01-24 Jim Ingham * memattr.h: MEM_NONE - new def'n. * memattr.c (mem_command): Translate "none" to "MEM_NONE". (mem_info): Print MEM_NONE as "none". (_initialize_mem): Fix doc string to add "none" mode. * target.c (memory_xfer_partial): Return an error if we are in a MEM_NONE memory region. 2008-01-23 Greg Clayton * arm-tdep.c (get_non_inlined_frame): New function. (arm_macosx_scan_prologue): Make the FP the default framereg when the current frame index isn't frame zero, or when our previous frame is not a sigtramp. 2008-01-21 Jim Ingham Pulling remote mobile onto the deep branch. * serial.c (serial_open): Recognize the filedesc serial type. * config/powerpc/macosx.mt: Add remote-mobile.o. * config/i386/macosx.mt: Add remote-mobile.o. * config/arm/macosx.mt: Ditto. 2008-01-18 Greg Clayton * arm-tdep.c (arm_macosx_sigtramp_frame_cache): Pulled some enum definitions out for use elsewhere in this source file. (arm_macosx_fast_show_stack): Added fast stack support. * remote.c (DEFAULT_MAX_REMOTE_PACKET_SIZE): Default to max remote packet size to 2000. (set_max_remote_packet_size): Allow max remote packet size to be reduced below the initial max value. * config/arm/tm-arm-macosx.h (arm_macosx_fast_show_stack): New prototype for fast stack support. (FAST_COUNT_STACK_DEPTH): New macro for fast stack support. 2008-01-16 Jim Ingham * fork-child.c: Move breakup_args from here to: * utils.c: here. * defs.h: declare breakup_args. * remote.c: Remove extern declaration for breakup_args. 2008-01-14 Jim Ingham * fork-child.c (breakup_args): Make non-static. Also return number of args. * remote.c (remote_start_remote): Handle case where the remote doesn't have a target when we connect. (remote_open_1) Ditto. (remote_create_inferior): New function. (remote_attach): New function. (remote_xfer_partial): If the remote side doesn't have a target yet, don't try to read its memory. (_initialize_remote): Add remote executable-directory set command. 2008-01-10 Jason Molenda (jmolenda@apple.com) * configure.ac: Use Bourne shell syntax for expanding SDKROOT. * configure: Regenerated. 2008-01-09 Greg Clayton * cli/cli-dump.c (g_max_binary_file_chunk): New global variable. (restore_binary_file): Segment binary downloads into chunks of size G_MAX_BINARY_FILE_CHUNK. (set_binary_buffer_size): New function. (show_binary_buffer_size): New function. (set_restore_cmd): New function. (show_restore_cmd): New function. (_initialize_cli_dump): Add "restore" as a new prefix for set and show lists that call set_restore_cmd () and show_restore_cmd (). Added "binary-buffer-size" as a child of the new "set/show restore" command. * remote.c (MIN_MAX_REMOTE_PACKET_SIZE): New define. (g_max_remote_packet_size): New global variable. (init_remote_state): Init remote_packet_size with current value of new G_MAX_REMOTE_PACKET_SIZE variable. (set_max_remote_packet_size): New function. (show_max_remote_packet_size): New function. (show_remote_cmd): Added a call to show_max_remote_packet_size () (_initialize_remote): Added a new "set/show remote max-packet-size" command. 2007-11-27 Greg Clayton * gdbarch.sh (skip_prologue_addr_ctx): New gdb arch callback function with predicate. * gdbarch.c: Regerated. * gdbarch.h: Regerated. * linespec.c (decode_line_2): Use new SKIP_PROLOGUE_ADDR_CTX when supported by the current arch. (decode_objc): Ditto. (minsyms_found): Ditto. (minsym_found): Ditto. * fork-child.c (fork_inferior): Added ARM arch support and init CPU to zero. * main.c (captured_main): Added ARM support arch support for the --arch option. * symtab.h (struct address_context): New address baton structure for more accurately looking up address related items. (init_address_context): New function prototype. * symtab.c (init_address_context): New function. (find_function_start_sal): Use address context when looking up symtab_and_line entries if gdbarch supports it. * arm-tdep.c (arm_macosx_skip_prologue_addr_ctx): New function. (arm_macosx_skip_prologue): Calls new function named arm_macosx_skip_prologue_addr_ctx. (arm_gdbarch_init): Register new arch function arm_macosx_skip_prologue_addr_ctx. 2007-11-06 Greg Clayton * dummy-frame.c (dummy_frame_push): Fixed a memory leak left over from an old merge. * arm-tdep.c (get_arm_prologue_cache): New function. (arm_macosx_scan_prologue): Use get_arm_prologue_cache to safely get an OSX prologue cache, or NULL for other frames. (arm_unwind_pc): Ditto. 2007-10-25 Greg Clayton * arm-tdep.h (__ARM_FP_REG): Use r7 as frame pointer when TM_NEXTSTEP is defined, not TM_NEXT_STEP. 2007-10-10 Greg Clayton * aclocal.m4: Set hardcode_direct=yes for all darwin host os targets to avoid libtool from expanding SDK -l options incorrectly. * configure: Regenerated. 2007-07-10 Greg Clayton * config.in, configure: Regenerated. 2007-07-05 Greg Clayton * Makefile.in (COREFOUNDATION_LDFLAGS): New flags to allow linking to CoreFoundation in when we don't link to Carbon. (CLIBS): Add new COREFOUNDATION_LDFLAGS to the option mix. * arch-utils.c (default_dbx_make_msymbol_special): New function. * arch-utils.h (default_dbx_make_msymbol_special): Added prototype. * arm-tdep.c (fp_model_strings): Add "none" as a valid FP model string. (arm_register_name_strings): Added support for VFP registers. (arm_register_offsets): New static array. (builtin_type_arm_psr): New global variable. (builtin_type_arm_fpscr): New global variable. (show_opcode_bytes): New static variable. (arm_set_show_opcode_bytes): New function. (arm_prologue_cache): Added prologue_start and prev_pc_is_thumb for stack crawling through code with no symbols. (arm_prologue_state): New structure type. (arm_scan_prolog_ftype): New function callback type. (arm_opcode_info_tag): New structure type. (data_proc_immediate): New function. (arm_scan_prolog_insn_stmfd_sp): New callback function for macosx prologue scan and skip code. (arm_scan_prolog_insn_data_proc_imm): Ditto. (arm_scan_prolog_insn_mov_ip_sp): Ditto. (arm_scan_prolog_insn_str_rd_sp): Ditto. (arm_scan_prolog_insn_stmfd_sp): Ditto. (arm_scan_prolog_insn_stfe_fn_sp_minus_12): Ditto. (arm_scan_prolog_insn_sfmfd_fn_4_sp): Ditto. (arm_scan_prolog_insn_fstmdb): Ditto. (thumb_scan_prolog_insn_push): Ditto. (thumb_scan_prolog_insn_sub4_sp_imm): Ditto. (thumb_scan_prolog_insn_add6_r7_sp): Ditto. (thumb_scan_prolog_insn_add_sp_rm): Ditto. (thumb_scan_prolog_insn_ldr_rd_pc_rel): Ditto. (thumb_scan_prolog_insn_mov_r7_sp): Ditto. (thumb_scan_prolog_insn_mov_rlo_rhi): Ditto. (arm_opcode_info): New array for macosx prologue scan and skip code. (thumb_opcode_info): Ditto. (IS_THUMB_ADDR): Look at bit 1 along with bit 0 to see if an address is thumb. (read_thumb_instruction): New function. (thumb_macosx_skip_prologue): New function. (thumb_macosx_scan_prologue): New function. (arm_macosx_skip_prologue): New function. (arm_macosx_scan_prologue): New function. (arm_skip_prologue): Take care of more variety of register stores to the stack. (thumb_scan_prologue): Use new arm_prologue_cache_t typedef and add logging code. (arm_prologue_prev_register): Use new arm_prologue_cache_t typedef. (arm_prologue_unwind_sniffer): Ditto. (arm_stub_this_id): Ditto. (arm_prologue_prev_register): Ditto. (arm_normal_frame_base): Ditto. (arm_make_sigtramp_cache): Ditto. (arm_sigtramp_this_id): Ditto. (arm_sigtramp_prev_register): Ditto. (arm_scan_prologue): Add logging code and use unsigned int variable when parsing opcodes, init the prologue_start, prologue_end and current_pc to zero. (arm_make_prologue_cache): Use arm_macosx_scan_prologue for darwin ARM builds. (arm_prologue_this_id): Improved stack backtracing through code without symbols. (arm_macosx_sigtramp_frame_cache): New function. (arm_macosx_sigtramp_frame_this_id): Ditto. (arm_macosx_sigtramp_frame_prev_register): Ditto. (arm_macosx_sigtramp_unwind_sniffer): New darwin sigtramp frame sniffer definition. (arm_unwind_pc_using_fp): New function to improve stack backtraces through code with no symbols. (arm_unwind_pc): Use the frame pointer to find previous PC and note if the previous function is Thumb in the prologue cache by inspecting the return address. (arm_push_dummy_call): Add log levels. (arm_print_float_info): Add more verbose information for VFP. (build_builtin_type_arm_psr_mode_enum): New function. (build_builtin_type_arm_psr): New function. (build_builtin_type_arm_fpscr): New function. (arm_register_type): Use new register formatters for CPSR and FPSCR registers. (arm_register_byte): Use new arm_register_offsets array. (convert_to_extended): Change args to uint32_t types. (bitcount): Change args to uint32_t types. (data_proc_immediate): New function. (shifted_reg_val): New function. (thumb_get_next_pc): Add logging and take care of "mov pc, " instructions. (arm_get_next_pc): Use uint32_t types where applicable instead of unsigned longs and added logging and use new data_proc_immediate function when needed to avoid duplicated code. (arm_software_single_step): Lock the scheduler when software single stepping. (THUMB_LE_BREAKPOINT): Use 0xDEFE as our breakpoint instruction for Darwin. (arm_extract_return_value): Add support for return values being VFP floats on the stack. (arm_store_return_value): Add support for changing return values being VFP floats on the stack. (arm_return_value): New function. (arm_set_show_opcode_bytes): Add the ability to show opcode bytes in disassembly. (set_disassembly_style): Add fpscr support. (arm_write_pc): Removed unused eflags local variable. (arm_register_reggroup_p): Add VFP support. (arm_gdbarch_init): Default float support to none when auto detecting float support, set wordsize to 4 early, and use arm_macosx_skip_prologue and arm_macosx_sigtramp_unwind_sniffer on darwin. (arm_dump_tdep): Use %s and paddr to dump tdep->lowest_pc. (_initialize_arm_tdep): Build builtin types for PSR and FPSCR and default default disassembly type to "gcc", add "set arm show-opcode-bytes " command, and add VFP float support, change set arm debug logging to be an integer instead of a bool for varying levels of logging. * arm-tdep.h (gdb_regnum): Add the ability to use a different register for the ARM frame pointer and added VFP support. (enum arm_float_model): Added a floating point support value for None. (gdbarch_tdep): Added wordsize for DYLD support. * config.in, configure: Regenerated. * configure.ac: Don't try and link against the Carbon.framework or DebugSymbols.framework for ARM builds. Check for CoreFoundation and use it if it is present. * configure.host: Add ARM Darwin support. * dbxread.c (record_minimal_symbol): Add the description field so we can make the msymbol special if needed. (read_dbx_dynamic_symtab): Pass zero to record_minimal_symbol for new description arg since we don't have one. (read_dbx_symtab): Pass the n_desc field to record_minimal_symbol in case it helps us mark the symbol as special. * defs.h (enum gdb_osabi): Add new GDB_OSABI_DARWINV6. * fix-and-continue.c (fix_command): No support for ARM. * gdbarch.c (struct gdbarch): Added make symbol special callback. (gdbarch_alloc): Use default make symbol special callback. (verify_gdbarch): Don't verify dbx_make_msymbol_special. (gdbarch_dump): Dump dbx_make_msymbol_special. (gdbarch_dbx_make_msymbol_special): New function. (set_gdbarch_dbx_make_msymbol_special): New function. * gdbarch.h (gdbarch_dbx_make_msymbol_special_ftype): New type. (gdbarch_dbx_make_msymbol_special): Added prototype. (set_gdbarch_dbx_make_msymbol_special): Added prototype. (DBX_MAKE_MSYMBOL_SPECIAL): New macro. * gdbarch.sh (dbx_make_msymbol_special): Added new arch callback. * gdbtypes.c (build_builtin_enum): New fucnction. (build_builtin_bitfield): New function. * gdbtypes.h (struct gdbtypes_enum_info): New type for build_builtin_enum. (gdbtypes_bitfield_info): New type for build_builtin_bitfield (maintenance_print_type): (build_builtin_enum): Added prototype. (build_builtin_bitfield): Added prototype. * main.c (captured_main): Added the ability to set the OSABI from the command line. * osabi.c (gdb_osabi_name): Added "DarwinV6" as a valid darwin OS ABI. (gdbarch_init_osabi): For ARM targets, check it ARMV6 is supported. (set_osabi): New function. (set_osabi_option): New function. * remote.c (init_remote_state): Increase the max packet size for ARM VFP support. * symfile.c (open_bfd_matching_arch): For ARM, if we support ARMV6, use and ARMV6 slices that are available, else fall back to ARMV4. * config/powerpc/macosx.mt: Re-format whitespace. 2007-11-08 Greg Clayton * dwarf2read.h (struct oso_final_addr_tuple): Changed PST_FILENAME to a partial_symtab struct pointer named PST. * dwarf2read.c (compare_map_entries_final_addr_index): Added secondary sort based on oso_low_addr for final addrs that aren't in the final image. (convert_oso_map_to_final_map): Initialize final_addr in all tuples, and store partial_symtab with translation map. (create_kext_addr_map): Ditto. (translate_debug_map_address): Make sure next FINAL_ADDR is valid when we use it, and make sure *ADDR doesn't exceed the high text address of the corrseponding partial_symtab. (translate_common_symbol_debug_map_address): Access partial symtab filename using new PST member. (dwarf_decode_lines): Don't translate line table addresses until they are about to be added so we can properly determine if we are translating addresses as HIGHPC addresses. 2008-02-26 Caroline Tice * breakpoint.c (breakpoint_re_set_one): Add two local variables, found and j; if more than one sal is returned for the breakpoint, loop through them trying to figure out which one is correct for the pc in the current breakpoint. Use the last sal if we can't figure it out (fall back on original behavior). 2008-02-26 Caroline Tice * dwarf2read.c (read_inlined_subroutine_scope): Make sure the caller and callee functions both have names before calling dwarf2_add_to_list_of_inlined_calls. * inlining.c (complaints.h): New include statement. (inlined_function_add_function_names): If caller or callee have NULL function names, complain and assign "unknown function" to them. 2008-02-20 Jason Molenda (jmolenda@apple.com) * remote.c (send_remote_max_packet_size): Rename to send_remote_max_payload_size. Send the QSetMaxPayloadSize packet instead of the QSetMaxPacketSize to avoid any ambiguity in its meaning. 2008-02-18 Jason Molenda (jmolenda@apple.com) * remote.c (send_remote_max_packet_size): Tell the remote stub the maximum packet size gdb is prepared to handle. (remote_start_remote): Call it. 2008-02-12 Jason Molenda (jmolenda@apple.com) * remote.c (init_all_packet_configs): Re-enable the software-breakpoint packet (Z0/z0) by default again. 2008-02-12 Jim Ingham * remote.c (remote_create_inferior): Make sure the sprintf doesn't overflow the buffer. 2008-02-09 Jason Molenda (jmolenda@apple.com) * remote.c (init_all_packet_configs): Disable the software-breakpoint packet (Z0/z0) by default for now. 2008-02-08 Jim Ingham * objc-lang.c (new_objc_runtime_find_impl): Set unwind_on_signal off while calling the function in the runtime. (find_implementation_from_class): Do more work to validate the input class before looking for the method. 2008-02-08 Jason Molenda (jmolenda@apple.com) * remote.c (dump_protocol_log): Quote nonprintable characters, omit the mi command sequence seperator char if there is no mi command sequence number. 2008-02-06 Jim Ingham * valops.c (check_safe_call): Set stack_depth in the args. 2008-02-05 Jason Molenda (jmolenda@apple.com) * remote.c (send_remote_debug_filename): Removed. (set_remote_debug_filename_command): Same. (show_remote_debug_filename_command): Same. (_initialize_remote): Remove set remote logging-filename command. 2008-02-01 Jason Molenda (jmolenda@apple.com) * remote.c (add_packet_config_cmd): Shorten set/show description to fit within 80 chars better. (send_remote_debug_filename): New function to send a logging filename to debugserver to save its logging messages. (set_remote_debug_filename_command): Verify that the user-specified filename doesn't contain characters that cause the remote protocol to have problems; send it to the remote stub. (show_remote_debug_filename_command): Show the current setting. (remote_start_remote): Send the logging filename to the remote stub if it was specified pre-connection. (_initialize_remote): Add the 'set remote logging-filename' command. 2008-01-30 Jason Molenda (jmolenda@apple.com) * remote.c (remote_backtrace_self): Print a backtrace of gdb so we can understand what gdb was doing when it hit an error where printing contextual information is hard. (initalize_protocol_log, add_incoming_pkt_to_protocol_log, add_outgoing_pkt_to_protocol_log, dump_protocol_log, dump_packets_command): Maintain a ring buffer of all remote protocol packets so they can be displayed by hand or when an unrecoverable error occurs. (fromhex): On error, show gdb backtrace and remote packet logs. (remote_stop, putpkt_binary, getpkt_sane, remote_start_remote): Add packets to packet log ring buffer. (putpkt_binary): Remove extraneous 'break' which would prevent acks from being sent to remote stub. (_initialize_remote): Register "maintenance dump-packets" command. * remote.h (struct remote_stats): Add mi_token field to record the current mi token, if there is one. 2008-01-29 Jason Molenda (jmolenda@apple.com) * remote.c (send_remote_debugflags_pkt): New function to send debug flags to the remote stub via the QSetLogging packet. (set_remote_debugflags_command): Check that the debug flags look reasonable; send it to the remote stub if connected. (_initialize_remote): Add the set/show debug remoteflags cmds. Fixed lots of minor signed vs unsigned warnings to make the file mostly warning free. 2008-01-25 Caroline Tice * varobj.c (varobj_update): Don't set varp->root->in_scope to 0 if the type comes back unchanged; use new retval, -4, to indicate when a varobj has come back into scope. (value_of_root): If tmp_var indicates the varobj has come back into scope (from being out of scope), set type_changed to be VAROBJ_SCOPE_CHANGED. * varobj.h (enum varobj_type_change): Add new enum value, VAROBJ_SCOPE_CHANGED. 2008-01-24 Jim Ingham * memattr.h: MEM_NONE - new def'n. * memattr.c (mem_command): Translate "none" to "MEM_NONE". (mem_info): Print MEM_NONE as "none". (_initialize_mem): Fix doc string to add "none" mode. * target.c (memory_xfer_partial): Return an error if we are in a MEM_NONE memory region. 2008-01-23 Jason Molenda (jmolenda@apple.com) * remote.c (set_max_remote_packet_size): Don't show the newly set max packet size; set commands shouldn't print anything unless there's an error. 2008-01-23 Jason Molenda (jmolenda@apple.com) * remote.c: Add no-ack mode to the remote protocol -- optionally stop ACKing packets and responses when we have a reliable communication medium. (no_ack_mode): New global. (start_no_ack_mode): Ask the remote stub to start no-ack mode. (set_no_ack_mode_cmd, show_no_ack_mode_cmd): User interface. (remote_start_remote): Try starting no-ack mode if requested. (putpkt_binary): Change ifdef NO_ACKS to use global var instead. (getpkt_sane): Same. (_initialize_remote): Add set remote noack-mode set/show. * dcache.c (LINE_SIZE_POWER): Default to 6 for 64-byte bufferings. 2008-01-23 Jim Ingham * remote.c (remote_create_inferior): Missing "*" operator. 2008-01-18 Greg Clayton * remote.c (DEFAULT_MAX_REMOTE_PACKET_SIZE): Default to max remote packet size to 2000. (set_max_remote_packet_size): Allow max remote packet size to be reduced below the initial max value. 2008-01-18 Jason Molenda (jmolenda@apple.com) * remote.c (putpkt_binary): Account for packets in noack mode. 2008-01-18 Jim Ingham Import Daniel's fix for PR remote/1966 (trust-readonly-sections doesn't work.) 2006-08-15 Daniel Jacobowitz PR remote/1966 * dcache.c (dcache_write_line): Use target_write. (dcache_read_line): Use target_read. * mi/mi-main.c (mi_cmd_data_read_memory): Use target_read. * symfile.c (struct load_section_data): Add new per-section members. (load_progress): New function. (load_section_callback): Pass load_progress to the new target_write_with_progress. * target.c (current_xfer_partial, memory_xfer_partial): New. (target_xfer_partial): New prototype. (target_xfer_memory, target_xfer_partial_p, xfer_using_stratum) (do_xfer_memory, target_xfer_memory_partial) (target_read_memory_partial, target_write_memory_partial): Delete. (trust_readonly): Move higher in the file. (update_current_target): Use current_xer_partial. (target_xfer_partial): Use memory_xfer_partial. Handle TARGET_OBJECT_RAW_MEMORY specially. (target_read_memory): Use target_read. (target_write_memory): Use target_write. (default_xfer_partial): Call to_xfer_partial directly. (target_write_with_progress): New function, based on target_write. (target_write): Call it. * target.h (enum target_object): Add TARGET_OBJECT_RAW_MEMORY. (target_write_with_progress): New prototype. (do_xfer_memory, target_read_memory_partial) (target_write_memory_partial): Delete prototypes. 2006-08-15 Daniel Jacobowitz * remote.c (remote_write_bytes): Take a const buffer argument. Do the checks from remote_xfer_memory. (remote_read_bytes): Do the checks from remote_xfer_memory. (remote_xfer_memory): Remove checks pushed into lower level functions. (remote_xfer_partial): Call remote_write_bytes and remote_read_bytes directly. * remote.h (remote_write_bytes): Update prototype. Also: * mem-break.c (default_{insert,remove}_memory_breakpoint): Override trust-readonly-sections for these calls. * target.c (memory_xfer_partial): Use find_pc_in_ordered_sections to get the bfd_section containing the pc. It is much faster than the unordered search through the target.to_sections. 2008-01-17 Jason Molenda (jmolenda@apple.com) * remote.c (putpkt_binary): Don't send ack/nack packets if NO_ACKS is defined. (getpkt_sane): Same. (read_frame): Same. Don't verify the checksum value. 2008-01-17 Jason Molenda (jmolenda@apple.com) * remote.c (remote_create_inferior): Fix printf specs for printing hex chars. 2008-01-16 Greg Clayton * cli/cli-dump.c (g_max_binary_file_chunk): New global variable. (restore_binary_file): Segment binary downloads into chunks of size G_MAX_BINARY_FILE_CHUNK. (set_binary_buffer_size): New function. (show_binary_buffer_size): New function. (set_restore_cmd): New function. (show_restore_cmd): New function. (_initialize_cli_dump): Add "restore" as a new prefix for set and show lists that call set_restore_cmd () and show_restore_cmd (). Added "binary-buffer-size" as a child of the new "set/show restore" command. * remote.c (MIN_MAX_REMOTE_PACKET_SIZE): New define. (g_max_remote_packet_size): New global variable. (init_remote_state): Init remote_packet_size with current value of new G_MAX_REMOTE_PACKET_SIZE variable. (set_max_remote_packet_size): New function. (show_max_remote_packet_size): New function. (show_remote_cmd): Added a call to show_max_remote_packet_size () (_initialize_remote): Added a new "set/show remote max-packet-size" command. 2008-01-16 Jason Molenda (jmolenda@apple.com) * objfiles.c (sanity_check_symtab_obsoleted_flag, sanity_check_psymtab_obsoleted_flag): Remove. (symtab_get_first, symtab_get_next): Don't call them. (psymtab_get_first, psymtab_get_next): Don't call them. * objfiles.h (ALL_PSYMTABS_INCL_OBSOLETED): Remove. 2008-01-16 Jim Ingham * fork-child.c: Move breakup_args from here to: * utils.c: here. * defs.h: declare breakup_args. * remote.c: Remove extern declaration for breakup_args. 2008-01-14 Jim Ingham * fork-child.c (breakup_args): Make non-static. Also return number of args. * remote.c (remote_start_remote): Handle case where the remote doesn't have a target when we connect. (remote_open_1) Ditto. (remote_create_inferior): New function. (remote_attach): New function. (remote_xfer_partial): If the remote side doesn't have a target yet, don't try to read its memory. (_initialize_remote): Add remote executable-directory set command. 2008-01-14 Jason Molenda (jmolenda@apple.com) * remote.c (total_packets_sent, total_packets_received): Track the total number of packets sent/received. (putpkt_binary, getpkt_sane): Update them. * remote.h: externs. 2008-01-11 Jason Molenda (jmolenda@apple.com) * remote.c (start_remote_timer, end_remote_timer): Functions to track how much time is spent waiting for the remote target to reply to pkts. (remote_start_remote): Track bytes sent/received. (remote_stop): Ditto. (readchar): Ditto. (putpkt_binary): Ditto. (getpkt_sane): Ditto. * remote.h: Definition of struct remote_stats. 2008-01-09 Jason Molenda (jmolenda@apple.com) * objfiles.c (find_objfile_by_name): Take a flag to indicate whether this is an exact-filename match or just matching the end of the filename. (make_cleanup_restrict_to_objfile_by_name): Call updated. * objfiles.h: Add prototype for find_objfile_by_name. * fix-and-continue.c (find_objfile_by_name): Remove in favor of the objfiles.c one. (fix_command_1): If the shlib filename looks doesn't look like an absolute file path, try doing a partial name match against the objfiles we have loaded. (fix_command_1, mark_previous_fixes_obsolete, get_fixed_file, do_final_fix_fixups, find_new_static_symbols, find_orig_static_symbols, find_and_parse_nonlazy_ptr_sect, build_list_of_objfiles_to_update, find_original_object_file, raise_objfile_load_level): Update call to find_objfile_by_name. 2008-01-08 Jim Ingham * valops.c (value_cast_1): Handle the case where you are casting up or down the class hierarchy with a reference type. 2007-12-14 Jim Ingham * serial.c (serial_open): Recognize the filedesc serial type. * config/powerpc/macosx.mt: Add remote-mobile.o. * config/i386/macosx.mt: Add remote-mobile.o. 2007-12-12 Caroline Tice * dwarf2expr.c (exceptions.h): New include statement. (execute_stack_op): Throw an error if the variable is uninitialized in the current location. * dwarf2loc.c (locexpr_describe_location): Add some local variables and initialize them, to enable a call to print_single_dwarf_location, to print location better; remove message that variable is too complex or has multiple locations. (print_single_dwarf_location): Annotate location with "[uninitialized]" if var is uninitialized in that location. 2007-12-10 Caroline Tice * fork-child.c (startup_inferior): Don't attempt to resume the inferior if it has exited, say with an error. 2007-12-05 Jim Ingham * config/{i386,powerpc}/macosx.mh: Remove -Wno-long-double from CFLAGS, it is no longer supported by gcc-4.2. 2007-12-05 Caroline Tice * dwarf2read.c (struct inlined_call_record): Remove definition; move it to inlining.h and rename it dwarf_inlined_call_record; remove 'next' field. (inlined_call_sites): Remove global variable. (dwarf2_add_to_list_of_inlined_calls): Add objfile parameter; change inlined_call_record to dwarf_inlined_call_record; remove inltialization of 'next' field; insert new record into objfile list rather than global var. (read_inlined_subroutine_scope): Pass objfile to dwarf2_add_to_list_of_inlined_calls. (check_cu_functions): Change inlined_call_record to dwarf_inlined_call_record; search for call site info only in current objfile. * inlining.c (inlined_subroutine_free_objfile_call_sites): New function. * inlining.h (struct dwarf_inlined_call_record): New definition, moved and renamed from dwarf2read.c. (inlined_subroutine_free_objfile_call_sites): New extern declaration. * objfiles.c (free_objfile_internal): Call inlined_subroutine_free_objfile_call_sites, if appropriate. * objfiles.h (struct objfile): Add new field, inlined_call_sites. 2007-12-04 Greg Clayton * dwarf2read.c (translate_debug_map_address_with_tuple): New function. (compare_translation_tuples_inclusive): New function. (translate_debug_map_address): Call new function translate_debug_map_address_with_tuple. (dwarf2_record_line): New function that correctly links DWARF line tables when using debug maps. (dwarf_decode_lines): Call new dwarf2_record_line function to recording line table entries. 2007-11-30 Caroline Tice * parse.c (parse_exp_in_context): Initialize innermost_block before call to parser. 2007-11-29 Jim Ingham * varobj.c (free_variable): Free the varobj's value. * i386-tdep.c (i386_frame_cache): Raise the load level of the frame's pc before finding the current frame's function start. 2007-11-28 Caroline Tice * dwarf2read.c (dwarf_decode_lines): Don't add in baseaddr until after calls to translate_debug_map_address. 2007-11-15 Jason Molenda (jmolenda@apple.com) * linespec.c (symbols_found): Add a sanity check to get an error instead of a crash with a F&C symbol problem. 2007-11-15 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_analyze_frame_setup): Reduce instruction limit to 50 insns. Enforce it for the register saves as well as the initial frame pointer setup. (i386_analyze_prologue): Omit calls to prologue-checker functions that never match anything on our platform. 2007-11-15 Caroline Tice * infrun.c (step_info_function): Check to see if inside a trampoline before updating ecs->stop_func_start. 2007-11-15 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (translate_debug_map_address): Add comment about this issue. 2007-11-15 Caroline Tice * dwarf2read.c (translate_debug_map_address) Comment out the code that caps the translation with pst->texthigh; it's not quite right, and it causes lots of regression tests to fail. 2007-11-08 Greg Clayton * dwarf2read.h (struct oso_final_addr_tuple): Changed PST_FILENAME to a partial_symtab struct pointer named PST. * dwarf2read.c (compare_map_entries_final_addr_index): Added secondary sort based on oso_low_addr for final addrs that aren't in the final image. (convert_oso_map_to_final_map): Initialize final_addr in all tuples, and store partial_symtab with translation map. (create_kext_addr_map): Ditto. (translate_debug_map_address): Make sure next FINAL_ADDR is valid when we use it, and make sure *ADDR doesn't exceed the high text address of the corrseponding partial_symtab. (translate_common_symbol_debug_map_address): Access partial symtab filename using new PST member. (dwarf_decode_lines): Don't translate line table addresses until they are about to be added so we can properly determine if we are translating addresses as HIGHPC addresses. 2007-11-07 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_analyze_frame_setup): Uninit var usage fix. 2007-11-07 Jason Molenda (jmolenda@apple.com) * symtab.c (search_symbols): Don't match dyld_stub names for functions. 2007-11-06 Greg Clayton * dummy-frame.c (dummy_frame_push): Fixed a memory leak left over from an old merge. 2007-10-19 Jim Ingham * objfiles.c (objfile_relocate): Don't use the bfd section index to index into the offsets. 2007-10-19 Caroline Tice * linespec.c (remove_duplicate_symbols): New function. (add_matching_methods): Change type of sym_arr to symbol***, so results of re-alloc'ing get passed back to caller; call remove_duplicate_symbols; blank out new array entries after calling xrealloc. (add_constructors): Likewise. (find_method): Pass address of sym_arr to collect_methods. (collect_methods): Change type of sym_arr to symbol***, so results of re-alloc'ing get passed back to caller; call remove_duplicate_symbols; blank out new array entries after calling xrealloc; pass address of sym_arr_size to find_methods. 2007-10-18 Caroline Tice * linespec.c (find_methods): Add two new parameters, sym_arr_size and sym_arr_pos; pass them to calls to add_matching_methods and add_constructors; also pass entire sym_arr to those two function. Pass the new parameters and the entire sym_arr to recursive call. (add_matching_methods): Add two new parameters, sym_arr_size and sym_arr_pos; replace calls to lookup_symbol with calls to lookup_symbol_all; add all the found symbols to sym_arr, resizing it if necessary. (add_constructors): Likewise. (decode_compound): Replace calls to lookup_symbol and symbol_found with lookup_symbol_all and symbols_found. (find_method): Add local var sym_arr_size to track size of sym_arr; use xcalloc instead of alloca, so that sym_arr can be resized if necessary. Pass sym_arr_size to collect_methods. Assign result of decode_line_2 to values rather than returning it directly; xfree sym_arr. (collect_methods): Add new parameter sym_arr_size; replace calls to lookup_symbol with lookup_symbol_all; add all the found symbols to sym_arr, resizing it if necessary. Pass sym_arr_size and sym_pos to call to find_methods. * symtab.c (lookup_symbol_all): Remove duplicate symbols from sym_list before returning it. 2007-10-09 Caroline Tice * inlining.c (temp_frame_stack): New data structure. (copy_temp_frame_stack_record): New function. (add_item_to_temp_frame_stack): New function. (update_tmp_frame_stack): New function. (tmp_frame_record_ranges_contains_pc): New function. (current_tmp_frame_stack_position): New function. (tmp_frame_in_inlined_function_call_p): New function. (inlined_function_initialize_call_stack): Add code to initialize the temp_frame_stack. (reset_temp_frame_stack): New function. (get_inlined_call_stack_record_pc): Remove function. (current_inlined_subroutine_stack_symtab): Modify to check the temp_frame_stack if the global_inlined_call_stack is blank. (current_inlined_subroutine_call_stack_start_pc): Likewise. (current_inlined_subroutine_call_stack_eof_pc): Likewise. (current_inlined_subroutine_call_stack_end_pc): Likewise. (current_inlined_subroutine_function_name): Likewise. (current_inlined_subroutine_calling_function_name): Likewise. (current_inlined_subroutine_call_site_line): Likewise. (inlined_frame_sniffer_helper): New function. (inlined_frame_sniffer): Add code to get the PC from the next frame and to call inlined_frame_sniffer_helper if appropriate. (inlined_frame_this_id): Fix it up to get info from the temp_frame_stack is the global_inlined_call_stack is blank. (print_inlined_frame): Modify to get info from the temp_frame_stack if the global_inlined_call_stack is blank. (flush_inlined_subroutine_frames): Blank out both the stack_frame_created and the stack_frame_printed fields in both the global_inlined_call_stack and the temp_frame_stack. (current_inlined_bottom_call_site_line): Get data from the temp_frame_stack if the global_inlined_call_stack is blank. (inlined_function_reset_frame_stack): New function. * inlining.h (inlined_function_reset_frame_stack): Add extern declaration. (get_inlined_call_stack_record_pc): Remove extern declaration. * stack.c (print_frame): Add call to current_inlined_bottom_call_site_line if the current frame is normal and the function it calls, next_frame, is inlined. (backtrace_command_1): Remove all the special code for inlined subroutines. Add calls to inlined_function_reset_frame_stack before and after printing out the whole back trace. 2007-10-05 Jim Ingham * symfile.c (reread_symbols): Try to avoid the abort in bfd_lookup_cache_worker when somebody's deleted an objfile out from under us. 2007-10-04 Caroline Tice * linespec.c (decode_all_variables): Remove unused local variables. (symbols_found): Manually determine and set the strings in the string array, canonical, instead of relying on call to build_canonical_line_spec. * symtab.h (lookup_minimal_symbol_all): Add extern declaration. 2007-10-03 Caroline Tice * stack.c (print_frame): Also set inside_inlined if the current frame is for an inlined subroutine (add test case to if-clause). 2007-10-03 Caroline Tice * inlining.c (add_item_to_inlined_subroutine): Move code that updates max_array_size fields to right after the re-sizing code. * stack.c (print_frame): Only set inside_inlined if the fi parameter matches the current frame. 2007-10-03 Jim Ingham * varobj.c (varobj_pc_in_valid_block_p): If we are up on the stack, test pc -1 to catch the case where the return pc is out of the call pc's block. Also use block_contains_pc so we work with blocks that have ranges. 2007-09-28 Jason Molenda (jmolenda@apple.com) * symfile.h: Add prototype for symbol_file_add_with_addrs_or_offsets_using_objfile. 2007-09-28 Caroline Tice (ctice@apple.com) * inlining.c (add_item_to_inlined_subroutine_stack): Fix off-by-one error when deciding whether or not to re-alloc the records array. 2007-09-26 Caroline Tice (ctice@apple.com) * infcmd.c (step_once): Move call to step_into_current_inlined_subroutine, to prior to finding the sal. * inlining.c (print_inlined_frame): Look for filename in inlined call stack record before resorting the the sal. (inlined_function_find_first_line): Add check to compare entry pc values. * symtab.c (find_pc_sect_line): When setting final_val.line, set the appropriate symtab too. 2007-09-24 Caroline Tice (ctice@apple.com) * gdbthread.h (inlining.h): New include statement. (struct thread_info): Add new field, thread_inlined_call_stack. *infrun.c (restore_inferior_status): Add call to flush_inlined_subroutine_frames. * inlining.c (gdbthread.h): New include statement. (at_inlined_call_site_p): Remove unused variable, cur_pos; (save_thread_inlined_call_stack): New function. (restore_thread_inlined_call_stack): New function. * thread.c (load_infrun_state): Add call to restore_thread_inlined_call_stack. (save_infrun_state): Add call to save_thread_inlined_call_stack. (switch_to_thread): Add calls to save_thread_inlined_call_stack and restore_thread_inlined_call_stack. 2007-09-19 Caroline Tice (ctice@apple.com) * infcmd.c (step_once): Remove func_sy, & func_name lookup code; call inlined_function_find_first_line to find first line of real code in function. * inlining.c (inlined_function_find_first_line): New function. * inlining.h (inlined_function_find_first_line): New extern decl. 2007-09-17 Caroline Tice (ctice@apple.com) * inlining.c (struct rb_tree_node_list): New struct. (rb_tree_find_all_matching_nodes): New function. (find_function_names_add_address_ranges): Call rb_tree_find_all_matching_nodes to traverse rb tree once, returning all potential matches, then search through list of potential matches for correct record. Replace calls to rb_tree_find_node_all_keys and rb_tree_find_next_node. (inlined_function_add_function_names): Likewise. 2007-09-14 Caroline Tice (ctice@apple.com) * inlining.c (add_item_to_inlined_subroutine_stack): Check to see if new item belongs at very bottom of stack & put it there if so. 2007-09-14 Greg Clayton (gclayton@apple.com) * configure.ac: Added configure features --disable-carbon-framework, --disable-debug-symbols-framework, and --disable-arch-for-exec. * configure: Regenerated. * config.in: Regenerated. * Makefile.in: Always link to CoreFoundation as it is needed by plist code. 2007-09-12 Jim Ingham (jingham@apple.com) * varobj.c (get_join_type): Follow possibly typedef'ed type to actual type before processing it. 2007-09-12 Jason Molenda (jmolenda@apple.com) * symfile.c (add_symbol_file_command): If the symbol file is a dSYM bundle, redirect to add-dsym. 2007-09-12 Caroline Tice * inlining.c (at_inlined_call_site_p): Remove code that attempted to detect when the first line the inferior stopped at, in an inlined subroutine, is beyond the official start of the inlined subroutine. 2007-09-08 Caroline Tice * inlining.c (inlined_function_add_function_names): Instead of sharing the ranges pointer, malloc new ranges records for the rb tree and copy the ranges contents into the new records. 2007-09-05 Caroline Tice * inlining.c (update_inlined_data_addresses): Change type for offset from 'int' to 'CORE_ADDR'. (inlined_subroutine_objfile_relocate): Likewise. * inlining.h (struct rb_tree_node): Change type for key and third_key fields from 'long long' to 'CORE_ADDR'. 2007-09-04 Caroline Tice * buildsym.c (record_line): Change 'fprintf's to 'fprintf_unfiltered's. * dwarf2read.c (ctype.h): Add new include statement. (read_inlined_subroutine_scope): Remove unused variable ('c'); (check_inlined_function_calls): Change 'fprintf' to 'fprintf_unfiltered'. (rb_print_note): Change print format from '%d' to '%Ld', to match print arguments. 2007-08-31 Caroline Tice * buildsym.c (inlining.h): New include statement. (record_line): Dump information about inlined line table entries, if dwarf2_debug_inlined_stepping is turned on. * dwarf2read.c (check_inlined_function_calls): Dump info about what was inlined into what, just before calling record_line, if dwarf2_debug_inlined_stepping is turned on. * symtab.c (find_pc_sect_line): Free temp_list and re-initialize inlined_entries_found if temp_list->pc does not match best->pc or prev->pc; only allow 'prev' to be a non-NORMAL entry if prev->pc exactly matches the search pc, otherwise assign prev to the first NORMAL entry preceding it in the line table; initialize final_val to zeros & warn if does not get updated later. 2007-08-31 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_skip_prologue): Refine the prologue insn limit to 512 bytes instead of 4096 -- prologues aren't going to be more than 512 bytes into the function and disassembling 4k of insns takes a long time. 2007-08-29 Caroline Tice * infcmd.c (step_once): Add code to see if current line has any more code beyond the end of the inlined subroutine, and make sure 'next' steps over all of it. 2007-08-24 Jason Molenda (jmolenda@apple.com) * disasm.c (find_pc_offset): Avoid disassembling large regions of memory to find the 64 instructions surrounding the PC that the GUI is requesting. 2007-08-24 Jason Molenda (jmolenda@apple.com) * symtab.c (find_pc_sect_line): Minor rearrangement of code to be a little more readable. free entries in the temp_list that we eliminate. 2007-08-24 Jim Ingham * infcmd.c (finish_command): If there is no selected frame, finish out of the current frame. * symtab.c (lookup_block_symbol_all): The struct symbol_search's block field was getting set to a "struct block *" which is not what that field is supposed to hold. * symtab.h: Remove obsolete SYMBOL_OBJFILE macro. 2007-08-24 Caroline Tice * symtab.c (find_pc_sect_line): Remove check that forced prev to be a NORMAL_LT_ENTRY before assigning to 'best'; allow change '>' to '>=' when comparing prev->pc to best->pc, when finding the NORMAL entry to assign to best from a list of entries with identical pc's. 2007-08-23 Caroline Tice * dwarf2read.c (read_inlined_subroutine_scope): Remove code that used DWARF lexical blocks to find address ranges of inlined subroutines. 2007-08-21 Jason Molenda (jmolenda@apple.com) * defs.h: Update prototype for fix_command_1. * fix-and-continue.c (struct fixinfo): Remove object_filename. (fix_command): Ignore the object filename if was provided. (fix_command_1): Remove object filename handling. (enum ZLObjectFileResult, tell_zerolink, inferior_is_zerolinked_p): Removed. (free_half_finished_fixinfo): object_filename no longer used. 2007-08-21 Caroline Tice * inlining.c (inlined_subroutine_objfile_relocate): Use ALL_OBJFFILE_OSECTIONS instead of ALL_OBJSECTIONS. 2007-08-21 Caroline Tice * infcmd.c (step_once): Only output "stepping over/into/to-beginning-of inlined subroutine" messages if dwarf2_debug_inlined_stepping is true. 2007-08-21 Caroline Tice * inlining.c (inlined_function_address_ranges_properly_contained): Remove declaration of unused variable, "all_fit". (inlined_subroutine_objfile_relocate): Loop through all sections, looking for section containing correct address range, rather than just assume its always the text section. 2007-08-20 Jason Molenda (jmolenda@apple.com) * prntcmd.c (address_info): Pass a function block into lookup_symbol, not whatever block we happen to be stopped in. 2007-08-20 Caroline Tice * dwarf2read.c (check_inlined_function_calls) Determine current objfile and pass it to calls to inlined_function_add_function_names. * infcmd.c (step_once) Make sure current_inlined_subroutine_function_name () is not null before attempting to do a lookup_symbol on it. * inlining.c (function_name_records): Remove global variable. (inlined_function_address_ranges_properly_contained): Remove all_fit from for-condition; change < to <= when comparing start addresses. (find_function_names_and_address_ranges): Add new parameter, objfile; use objfile->inlined_subroutine_data to lookup up function name records. (add_item_to_inlined_subroutine_stack): Make sure there is a symbol table, get the objfile from the symbol table, and pass the objfile to find_function_names_and_address_ranges. (update_function_names_and_address_ranges): Delete function. (tree_fix_up_inlined_function_line_table_entries): Delete function. (fix_up_inlined_function_line_table_entries): Delete function. (inlined_function_add_function_names): Add new parameter, objfile; look up for existing records in objfile->inlined_subroutine_data; add new records to objfile->inlined_subroutine_data. (check_for_additional_inlined_breakpoint_locations): Now that each objfile has its own inlined data, search through all the inlined data of all the objfiles for name matches, for setting breakpoints. (inlined_subroutine_free_objfile_data): New function. (update_inlined_data_addresses): New function. (inlined_subroutine_objfile_relocate): New function. * inlining.h (inlined_function_add_function_names): Add objfile parameter to extern declaration. (inlined_subroutine_free_objfile_data): New extern declaration. (inlined_subroutine_objfile_relocate): New extern declaration. * objfiles.c (free_objfile_internal): Add call to inlined_subroutine_free_objfile_data. (objfile_relocate): Add call to inlined_subroutine_objfile_relocate. * objfiles.h (inlining.h) New include statement. (struct objfile): Add new field, inlined_subroutine_data. 2007-08-14 Jason Molenda (jmolenda@apple.com) * dwarf2loc.c (loclist_describe_location): Don't leak DWARF expression contexts. 2007-08-14 Jason Molenda (jmolenda@apple.com) * breakpoint.c (_initialize_breakpoint): Fix typeo in watch/awatch/rwatch description texts. 2007-08-14 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_skip_prologue): Limit the prologue search to one page of memory if we can't find the bounds of the function. 2007-08-14 Caroline Tice * dwarf2read.c (add_equiv_psym): Fix some off-by-one array errors. 2007-08-14 Caroline Tice * dictionary.c (iter_name_first_hashed): Add check to see if there is a psym equivalence name that matches. (iter_name_next_hashed): Likewise. (iter_name_next_linear): Likewise. * dwarf2read.c (psym_equivalences): New global variable. (struct partial_die_info): New field, equiv_name. (dwarf2_create_include_psymtab): Initialize new field. (dwarf2_build_psymtabs_hard): Pass equiv_psyms argument to scan_partial_symbols, and assign result to new field in partial symbol table. (add_equiv_psym): New function. (scan_partial_symbols): New parameter, equiv_psyms; call add_equiv_psym if a subprogram partial die contains an equivalence name. (add_partial_namespace): Pass equiv_psyms to scan_partial_symbols. (read_partial_die): Check linkage name of subprogram die to see if it's a psym equivalence name; if so record it in equiv_name field in partial die and set global variable (psym_equivalences). * symtab.c (lookup_symbol_all): Look up symbol in psymtabs if psym_equivalences is 1. (psym_name_match): New function. (lookup_equiv_partial_symbol): New function. (lookup_symbol_aux_psymtabs): When looking for partial symbol, also check for psym equivalence matches. (lookup_block_symbol_all): Add check to see if linkage name of symbol is a psym equivalence name. (lookup_block_symbol): Likewise. * symtab.h (struct equiv_psym_list): New struct. (struct partial_symtab): Add new field, equiv_psyms. (psym_equivalences): Extern declaration for new global variable. (psym_name_match): Extern declaration for new function. 2007-08-07 Jason Molenda (jmolenda@apple.com) * inlining.c (in_inlined_function_call_p): Don't examine call stack records that we haven't stepped into, instead of recording them and then trying to elide them after the fact. 2007-08-07 Jim Ingham * objc-lang.c (find_implementation_from_class): Abort the method lookup after objc_class_method_limit lookups. (_initialize_objc_language): Add set command for objc_class_method_limit. 2007-08-03 Jason Molenda (jmolenda@apple.com) * dwarf2expr.c (execute_stack_op): Detect and work around bogus expression emitted by gcc-4.0. 2007-08-01 Jason Molenda (jmolenda@apple.com) * rs6000-tdep.c (rs6000_stab_reg_to_regnum): Recognize and map gcc 4.0's incorrect register numbering for AltiVec regs when unambiguous. 2007-08-01 Jim Ingham * objfiles.c (objfile_relocate): Relocate the new "end_pc" field in the linetable_items. 2007-07-30 Greg Clayton * dbxread.c (dbx_symfile_read): Handle in memory shared cache symbol table reading. * objfiles.c (objfile_section_offset): Handle in memory shared cache section offsets correctly. 2007-07-31 Jim Ingham * varobj.c (varobj_create): Suppress the warning when trying to make a varobj from a type. * linespec.c (minsyms_found): Use the correct index when adding equivalence elements to the "canonical" array. * breakpoint.c (do_enable_breakpoint): Change the bp_set_state when the breakpoint gets enabled. 2007-07-27 Jim Ingham (jingham@apple.com) * breakpoint.c (remove_breakpoints): If we can't remove a breakpoint, issue a warning and continue to remove the other breakpoints. (tell_breakpoints_objfile_changed): Renamed to tell_breakpoints_objfile_changed_internal, generalized to allow removed breakpoints to be marked as pending. (tell_breakpoints_objfile_changed): Old behavior. (tell_breakpoints_objfile_removed): New behavior - mark removed breakpoints as pending. * breakpoint.h (tell_breakpoints_objfile_removed): Prototype. 2007-07-27 Caroline Tice * infcmd.c (step_once): Add some tests to make sure stepping ranges is only set if stop_pc is actually in an inlined function; remove an assert that I discovered is not necessarily going to be true. 2007-07-25 Jim Ingham (jingham@apple.com) * varobj.c (enum varobj_join_type): New enumeration to track how to build varobj paths between parents/children. (struct varobj): Add join_in_expr, elide_in_expr fields. (get_join_type): New func; logic from c_path_expr_of_child. (varobj_create): Initialize the join_in_expr field. (create_child): Set up the join_in_expr/elide_in_expr fields. (new_variable): Initialize new fields. (path_expr_of_variable): Use new fields. (c_path_expr_of_child): Ditto. (cplus_path_expr_of_child): Ditto. 2007-07-25 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_frame_this_id): If saved PC value for the frame we're creating an id for is 0x0 and it's not the 0th frame, we're past the end of the stack. * amd64-tdep.c (amd64_frame_this_id): Ditto. 2007-07-17 Jason Molenda (jmolenda@apple.com), Jim Ingham (jingham@apple.com) * dwarf2read.c (read_structure_type): In C++/ObjC++ translation units, try to determine if a class is an ObjC class or a C++ class and mark the results. * gdbtypes.h (enum runtime_type): New. (struct cplus_struct_type): New runtime_type field. * objc-exp.y: If in a C++/ObjC++ file and class is marked as being a C++ class, pus OP_THIS instead of OP_OBJC_SELF so we get the correct "this" vs. "self" name when we evaluate the expression. 2007-07-17 Caroline Tice * dwarf2loc.c (print_single_dwarf_location): Make sure results of SLEB 128 tranlations are written out as signed ints. 2007-07-10 Jim Ingham * buildsym.c (finish_block): Expand the global block if one of the pending functions is outside its range rather than the other way round. 2007-07-10 Caroline Tice * inlining.c (inlined_function_add_function_names): Fix function comments. Also allow for nested inlined functions with completely overlapping addresses (i.e. same start & end pc, but different call sites). 2007-07-10 Caroline Tice * inlining.c (inlined_function_add_function_names): Fix function comments. 2007-07-09 Caroline Tice * dwarf2read.c (enum rb_tree_colors): Remove definition; move it to inlining.h (struct rb_tree_node): Remove definition; move it to inlining.h (rb_tree_find_node): Remove static declaration; remove 'static' from function definition. (rb_tree_insert): Likewise. (rb_tree_find_node_all_keys): New function. * inlining.c (struct record_list): Make 'record' field a pointer. (function_name_records): Change type of global data structure from linked list of record_list structs to red-black tree. (rb_tree_find_next_node): New function. (add_to_list): New function. (search_tree_for_name): New function. (find_function_names_and_address_ranges): Modify to use red-black tree functions to find correct records. (update_function_names_and_address_ranges): Likewise. (tree_fix_up_inlined_function_line_table_entries): New function. (fix_up_inlined_function_line_table_entries): Call new recursive function, tree_fix_up_inlined_function_line_table_entries, to traverse the red-black tree fixing up each record. (inlined_function_add_function_names): Store and look up data in red-black tree rather than linked list. (check_for_additional_inlined_breakpoint_locations): Use tree functions to look up function names in red-black tree instead of in linked list. * inlining.h (enum rb_tree_colors): Definition moved here from dwarf2read.c (struct rb_tree_node): Definition moved here from dwarf2read.c (rb_tree_find_node): Add extern function declaration. (rb_tree_find_node_all_keys): Add extern function declaration. (rb_tree_insert): Add extern function declaration. 2007-07-06 Caroline Tice * dwarf2read.c (dwarf2_debug_inlined_stepping): New global variable. (_initialize_dwarf2_read): Add new set-show variable, debug_inlined_stepping, which controls the new global variable dwarf2_debug_inlined_stepping. (rb_tree_remove_node): Condition the calls to verify_rb_tree, inside gdb_assert statements, on dwarf2_debug_inlined_stepping. * inlining.h (dwarf2_debug_inlined_stepping): Add extern declaration for new global variable. 2007-07-02 Jim Ingham * linespec.c (decode_objc): Don't throw away section info when you do find_pc_function. 2007-06-29 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_register_type): Initialize amd64_sse_type here if it hasn't been already. Use the build_builtin_type_vec128i_big function from i386-tdep.c. (swapped_regcache_raw_write_part, swapped_regcache_raw_read_part): New functions to switch the registers from the user's view of the bytes to the machine byte order for ABI purposes. (amd64_return_value): Use the new byte swapping calls when accessing the XMM regs. (amd64_push_arguments): Ditto. * i386-tdep.c (init_vector_type, build_builtin_type_vec128i_big): Move from here... * i386-amd64-shared-tdep.c (init_vector_type, build_builtin_type_vec128i_big): To here. * i386-amd64-shared-tdep.h (build_builtin_type_vec128i_big): Prototype. 2007-06-28 Jason Molenda (jmolenda@apple.com) * symfile.c (check_bfd_for_matching_uuid): Fix "exec_bfd" vs "exec_bfd" confusion. 2007-06-26 Jim Ingham * infcall.c (hand_function_call): Report the type of the function call's return value as the type the function is defined to have. 2007-06-25 Caroline Tice * inlining.c (print_inlined_frame): Make sure sal has a symtab before attempting to print the symtab->filename; otherwise get it from the inlined call stack record. 2007-06-25 Caroline Tice * breakpoint.c (set_raw_breakpoint): Initialize new field, bp_objfile_name. (delete_breakpoint): Free new field, bp_objfile_name. (breakpoint_re_set_one): If bp_objfile_name is set, use that to narrow the search as to where to re-set the breakpoint. (tell_breakpoint_objfile_changed): Set bp_objfile_name before setting bp_objfile to NULL. * breakpoint.h (struct breakpoint): Add new field, bp_objfile_name. * minsyms.c (lookup_minimal_symbol_all): Don't stop looping as soon as a symbol is found; loop through all objfiles no matter what. * objfiles.c (find_objfile_by_name): New function. (make_cleanup_restrict_to_objfile_by_name): New function. * objfiles.h (make_cleanup_restrict_to_objfile_by_name): Externally visible declaration of new function. 2007-06-22 Jason Molenda (jmolenda@apple.com) * dwarf2loc.c (find_location_expression): Add in the base_offset (the slide of the dylib, if any) correctly. (loclist_describe_location): Ditto. 2007-06-22 Greg Clayton * dwarf2read.c (dwarf_decode_lines): Deal with missing end sequence without crashing. 2007-06-22 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (set_cu_language): Recognize DW_LANG_Pascal83. Patch from Jonas Maebe. 2007-06-22 Jason Molenda (jmolenda@apple.com) * dwarf2loc.c (loclist_describe_location): Reorder the printing a bit so the address ranges are primary and the locations are secondary. 2007-06-22 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (struct comp_unit_head): Rename 'base_address' to 'base_address_untranslated' to make its value clear. (free_address_map): Remove. (process_full_comp_unit): Don't translate the compile unit start addr. (dwarf2_get_pc_bounds): Return the lowest & highest addresses seen when parsing a DW_AT_ranges list instead of returning the low/high value of the first element in the range list. Update to use an untranslated compile_unit base address. (dwarf2_symbol_mark_computed): Update the base_address variable names. * dwarf2loc.h (struct dwarf2_loclist_baton): Rename 'base_address' to 'base_address_untranslated' to make its value clear. * dwarf2loc.c (find_location_expression): Change the address computations to take into account the compile_unit's base address value being an untranslated address for non-dSYM uses. (print_single_dwarf_location): Ditto. Clean up printings to not leak memory and work correctly for 64-bit values. (dwarf_expr_read_reg): Remove unused variables. (loclist_describe_location): Mirror updates to find_location_expression to keep these two routines in sync. 2007-06-22 Jim Ingham * infcall.c (get_hand_call_ptid, do_reset_hand_call_ptid): New functions. (hand_function_call): Set the hand_call_ptid. * infrun.c (struct inferior_status): Add a field for the stored inferior_ptid. (save_inferior_status): Save off same. (restore_inferior_status): Restore same. 2007-06-21 Greg Clayton * configure.ac: Link test for HAVE_64_BIT_STACK_LOGGING and HAVE_32_BIT_STACK_LOGGING. * config.in, configure: Regenerated. 2007-06-19 Greg Clayton * dbxread.c (dbx_psymtab_to_symtab_1): Emit warning instead of error when we can't open OSO. * symtab.c (find_pc_sect_symtab): Only warn about pc being in psymtab yet not in symtab when we do not have an OSO. 2007-06-18 Jim Ingham * (symfile.c) find_separate_debug_file: Add an override so we can slip the objfile adding code a dSYM file behind our own backs. (add_dsym_command): New function. (_initialize_symfile): Register add-dsym command. 2007-06-18 Jason Molenda (jmolenda@apple.com) * dbxread.c (record_minimal_symbol): Don't assume that static symbol names are at least eight chars long. 2007-06-07 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (create_kext_addr_map): Initialize new address map structure's values. (dwarf2_kext_psymtab_to_symtab): Don't free address map. We'll use it to translate location expression addresses on-demand later on. 2006-06-07 Caroline Tice * gdbthread.h (struct thread_info): New field, stepping_ranges. (save_infrun_state): New parameter, stepping_ranges. (load_infrun_state): New parameter, stepping_ranges. * infcmd.c (finishing_inlined_subroutine): New global variable. (stepping_ranges): New global variable. (step_once): Remove some unused variables; initialize stepping_ranges when stepping over an inlined subroutine. (finish_inlined_subroutine_command_continuation): New function. (finish_inlined_subroutine_command): New function. (finish_command): Remove the old code that was added for finishing out of inlined subroutines; make it call finish_inlined_subroutine_command instead. (registers_info): Comment out unsed variables, to eliminate warning. * infrun.c (follow_exec): Initialize finishing_inlined_subroutine and stepping_ranges; add comments. (clear_proceed_status): Likewise. (context_switch): Add stepping_ranges as an argument to save_infrun_state and load_infrun_state. (handle_inferior_event): When checking to see if stop_pc is between step_range_start & step_range end, also call is_within_stepping_ranges, to see if it falls within any of the valid stepping ranges; when checking to see if stop_pc is equal to step_range_end, also call is_at_stepping_ranges_end to see if it is equal to the end of any valid stepping range. (print_stop_reason): If stopped at end of stepping range, check to see if user was finishing out of inlined subroutine, and if so us EXEC_ASYNC_FUNCTION_FINISHED for reason, rather than EXEC_ASYNC_END_STEPPING_RANGE; also, if finishing out of inlined subroutine, make sure source_flag is SRC_AND_LOC. (struct inferior_status): New field, stepping_ranges. (save_inferior_status): Save stepping_ranges. (restore_inferior_status): Restore stepping_ranges. * inlining.c (is_within_stepping_ranges): New function. (is_at_stepping_ranges_end): New function. * inlining.h (stepping_ranges): Declaration for new global variable. (finishing_inlined_subroutine): Likewise. (is_within_stepping_ranges): Extern function declaration. (is_at_stepping_ranges_end): Likewise. * thread.c (load_infrun_state): New parameter, stepping_ranges; load saved value into new parameter. (save_infrun_state): New parameter, stepping_ranges; save the new parameter in the new field. 2007-06-07 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (translate_debug_map_address): Add a check that there are translation entries before we try to translate the address. (translate_common_symbol_debug_map_address): Ditto. 2007-06-07 Jason Molenda (jmolenda@apple.com) * symfile.c (add_kext_command): Warn user if .sym file architecture doesn't match gdb's architecture. 2007-06-06 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (free_address_map): Set freed tuples/final_addr_index to NULL after they have been xfreed. (compare_translation_final_addr): Check the array index passed in to verify that it is within the bounds of the array. Should always be true. (translate_debug_map_address): Check the returned array index to verify that it is within the bounds of the array. Should always be true. 2007-06-06 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (compare_map_entries_final_addr_index): Use CORE_ADDRs to store addresses instead of ints. 2007-06-05 Jim Ingham * linespec.c (decode_line_1): Handle the case where a filename has a parenthesis in it. 2007-06-04 Jim Ingham * symtab.c (lookup_symtab_all): Remove unnecessary check for readin. * symfile.c (check_for_matching_uuid): Delete in favor of: (check_bfd_for_matching_uuid): New function. (symbol_file_add_with_addrs_or_offsets_using_objfile): Check the bfd's for the matching UUID BEFORE making the objfile. (reread_separate_symbols): Ditto. * inf-loop.c (inferior_event_handler): Switch to TRY_CATCH. Print an error message if the fetch_inferior_event didn't work. 2007-06-01 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_implementation_from_class): Reapply changes. 2007-06-01 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_implementation_from_class): Revert previous change to isolate Caroline's dwarf2read change for a minute. 2007-05-31 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_implementation_from_class): Print the class name we're looking up if 'verbose' is enabled. 2007-05-31 Caroline Tice * dwarf2read.c (new_symbol): Do not mark a variable as optimized away (LOC_OPTIMIZED_OUT) even if it does not have a location attribute, if it has DW_AT_declaration. 2007-05-23 Caroline Tice * ax-gdb.c (agent_command): Initialize innermost_block before calling parse_expression. * eval.c (parse_and_eval_address): Move assignments to expr and old_chain out of declarations; initialize innermost_block before calling parse_expression. (parse_and_eval_address_1): Likewise. (parse_ande_eval_long): Likewise. (parse_and_eval): Likewise. (parse_to_comma_and_eval): Move assignments to expr and old_chain out of declarations. Initialize innermost_block before calling parse_exp_1. (parse_and_eval_type): Initialize innermost_block before calling parse_expression. * objc-lang.c (print_object_command): Move assignments to expr and old_chain out of declarations; initialize innermost_block before calling parse_expression. * printcmd.c (print_command_1): Initialize innermost_block before calling parse_expression. (output_command): Likewise. (set_command): Move assignments to expr and old_chain out of declarations; initialize innermost_block before calling parse_expression. (x_command): Initialize innermost_block before calling parse_expression. * typeprint.c (whatis_exp): Likewise. (ptype_command): Likewise. (maintenance_print_type): Likewise. 2007-05-23 Jason Molenda (jmolenda@apple.com) * dwarf2read.c: Rename final_addr_indexes to final_addr_index. Use 'int' as the type of the index values instead of uint32_t. (create_kext_addr_map): Create a final_addr_index array. Initialize the pst_filename member as well. * dwarf2read.h: Rename final_addr_indexes to final_addr_index. It is now an array of int instead of uint32_t's. * dbxread.c (clear_containing_archive_cache): Comment touchup. * inlining.h: Include frame.h to pick up enum print_what defn. 2007-05-23 Greg Clayton * buildsym.c (finish_block): If we have block ranges, fix the start and end address to be the min and max of the ranges. * objfiles.c (objfile_relocate): Always relocate the block start and end even if we have ranges so they don't get out of date when something is slid. 2007-05-23 Jim Ingham * objfiles.h: Added a comment. 2007-05-23 Caroline Tice * inlining.c (print_inlined_frame): Add check for null function names, to prevent gdb crashing. 2007-05-21 Jim Ingham * varobj.c (cplus_value_of_variable): References to scalars should fall through to c_value_of_variable. 2007-05-16 Jim Ingham * objc-exp.y (yylex): Initialize the "first char" variable. 2007-05-15 Derek Kumar * config/i386/macosx.mh: Add darwin-kernel.o * config/powerpc/macosx.mh: Add darwin-kernel.o 2007-05-14 Jim Ingham * config/i386/nm-i386-macosx.h: undef the watchpoint functions that were defined in nm-i386.h. We'll put them in the target vector where they belong later. 2007-05-14 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (get_dlerror_message): New function. (get_fixed_file): Call get_dlerror_message to get the error string. (load_fixed_objfile): Switch over to using dlopen to load the bundle. 2007-05-14 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (get_fixed_file): Correct dlerror() usage. (encode_lo16, encode_hi16, decode_lohi16, updatedatum): ifdef out on non-PPC systems to suppress unused func warnings. 2007-05-11 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (get_fixed_file): Correct symbol name for dlerror. Check that the dlerror string is 7-bit clean before printing it; it may just contain uninitialized data. (do_final_fix_fixups_static_syms): Make sure the symbol has a type defined before dereferencing it. 2007-05-11 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (redirect_statics): Use the minimal symbol's address; we may pick up a sym that has been optimized away. 2007-05-11 Jim Ingham * Makefile.in: Add codesign-gdb rule. 2007-05-10 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (get_fixed_file): Try to print out dyld's dlerror string when there is an error loading a bundle. (redirect_statics): Check that both the original and new symbol have an address not equal to zero before redirecting from/to them. (find_and_parse_nonlazy_ptr_sect): Don't assume addresses will map to a section - if we get a bogus address it may map to nothing. 2007-05-10 Jason Molenda (jmolenda@apple.com) * Info.plist: Add the SecTaskAccess key. 2007-05-10 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restriction_cxx_zerolink): Remove. (do_pre_load_checks): Don't call check_restriction_cxx_zerolink. 2007-05-09 Jim Ingham * gdbthread.h: Changed a comment on gdb_suspend_count. 2007-05-07 Caroline Tice * infrun.c (handle_inferior_event): Add clause to handle 'next'ing over an inlined subroutine, where the step_end_range instruction is hopped over (inferior doesn't stop there), and the stop_pc is actually on the beginning of ANOTHER inlined subroutine. * inlining.c (inlined_function_address_ranges_properly_contained): Fix bad assumption about how inlined subroutine address ranges must fit into calling routine's ranges. * inlining.h (print_inlined_frame): Add extern function declaration. * stack.c (print_frame_info): Add code to fix sal passed to identify_source_line when user is at an inlined subroutine call site and the annotation level is greater than 0. (frame_info): Change type of 'optimized' from int to enum opt_state. (print_frame_label_vars): Fix typo for type of containing_block; add cast to call to 'contained_in', to eliminate warning. 2007-05-07 Jim Ingham * defs.h: Declare the hand_call_function_hook. * top.c: Define the hand_call_function_hook. * infcall.c (hand_function_call): Call the new hook. 2007-05-03 Jim Ingham * infcall.c (hand_function_call): Add symbol name to "Unable to call..." output, and use paddr_nz for the address. 2007-05-01 Caroline Tice * infcmd.c (step_once): Get inlined stack pos from at_inlined_call_site_pc; use start_pc of current inlined subroutine to get sal for setting step range when stepping over inlined subroutines. * inlining.h (struct inlined_function_data): Add new field, last_inlined_pc, to global_inlined_call_stack, to keep track of the last stop_pc that was inside an inlined subroutine. * inlining.c (inlined_function_initialize_call_stack): Initialize new field, last_inlined_pc. (reset_saved_call_stack): Likewise. (inlined_function_reinitialize_call_stack): Likewise. (inlined_function_update_call_stack): Add code to update last_pc and last_inlined_pc fields appropriately; if stop_pc is the first pc within the current inlined subroutine, set stepped_into for the subroutine to false. (at_inlined_call_site_p): Modify to return stack position for inlined call site record; also deal with situation where first instruction in the inlined subroutine that the inferior stops at is beyond the first instruction of inlining. (inlined_subroutine_restore_after_dummy_call): Copy new field, last_inlined_pc, appropriately. (inlined_subroutine_save_before_dummy_call): Likewise. * stack.c (print_frame_info): If printing the call site of an inlined subroutine, make sure we use the correct symtab. 2007-04-30 Jim Ingham * dbxread.c (add_to_containing_archive_cache): Don't use a fixed size cache, since we can't do the right thing with the ones we drop off the end. Use a growable cache instead. * valops.c (do_check_is_thread_unsafe): Moved here from macosx-nat-inferior.c. (safe_check_is_thread_unsafe): Ditto. (check_safe_call): Ditto. * value.h: Declare check_safe_call. 2007-04-26 Jim Ingham * c-exp.y (parse_number): Don't return an error if we scanned both the number & the modifier character. * objc-exp.y (parse_number): Sync up with the c-exp.y version, there were inessential differences. (yylex): Replace the number handling portion with the c-exp.y version. 2007-04-25 Greg Clayton * dwarf2read.c (compare_map_entries_final_addr_indexes): New function. (convert_oso_map_to_final_map): Initialize and sort final_addr_indexes member of the oso_to_final_addr_map structure. (create_kext_addr_map): Use safer objfile_text_section_offset function in place of ANOFFSET macro. (free_address_map): Free memory for final_addr_indexes member of struct oso_to_final_addr_map. (compare_translation_final_addr): New function for binary searches by final address. (final_addr_key): New structure for compare_translation_final_addr. (translate_debug_map_address): When we are fixing a HIGHPC address, check to see if we need to trim the end address. * dwarf2read.h (struct oso_to_final_addr_map): New member final_addr_indexes with lots of comments. 2007-04-25 Jim Ingham * dwarf2read.c (read_func_scope): ObjC++ should be handled the same as C++ here. (read_structure_type): Ditto. (read_subroutine_type): Ditto. (new_sybol): Ditto. (determine_prefix): Ditto. 2007-04-24 Greg Clayton * objfiles.c (objfile_add_to_ordered_sections): Use segment_mark member in 'struct bfd_section' instead of counting dots in section name. * symtab.c (fixup_section): Compute SECTION_OFFSETS index for statics correctly and use safer objfile_section_offset function in place of ANOFFSET macro that doesn't check bounds. 2007-04-24 Jim Ingham * breakpoint.c (set_raw_breakpoint): Add pending_p argument, and don't try to get the bp_objfile is the breakpoint is pending. (create_internal_breakpoint): Pass 0 for pending_p. (solib_load_unload_1): Ditto (create_fork_vfork_event_catchpoint): Ditto (create_exec_event_catchpoint): Ditto (set_momentary_breakpoint): Ditto (watch_command_1): Ditto (create_exception_catchpoint): Ditto (set_breakpoint_sal): Ditto (create_breakpoints): Pass appropriate pending_p value. 2007-04-19 Caroline Tice * value.h (enum opt_state): Move this declaration to be before the include statement for frame.h. 2007-04-19 Jim Ingham * dbxread.c (open_bfd_from_oso): Fix thinko from rearranging the read fat archive section. 2007-04-18 Greg Clayton (gclayton@apple.com) * coff-pe-read.c (read_pe_exported_syms): Use new objfile section offset functions. * coffread.c (coff_symtab_read): Ditto. (enter_linenos): Ditto. (process_coff_symbol): Ditto. * dbxread.c (read_dbx_dynamic_symtab): Ditto. (read_dbx_symtab): Ditto. (read_ofile_symtab_from_oso): Ditto. * dwarf2-frame.c (dwarf2_frame_find_fde): Ditto. * dwarf2loc.c (find_location_expression): Ditto. (loclist_describe_location): Ditto. * dwarf2read.c (dwarf2_build_psymtabs_hard): Ditto. (add_partial_symbol): Ditto. (convert_oso_map_to_final_map): Ditto. (convert_oso_map_to_final_map): Ditto. (process_full_comp_unit): Ditto. (read_file_scope): Ditto. (read_inlined_subroutine_scope): Ditto. (read_func_scope): Ditto. (read_lexical_block_scope): Ditto. (dwarf_decode_line_header): Ditto. (dwarf_decode_lines): Ditto. (var_decode_location): Ditto. (new_symbol): Ditto. * elfread.c (elf_symtab_read): Ditto. * hppa-tdep.c (read_unwind_info): Ditto. * hppabsd-tdep.c (hppabsd_find_global_pointer): Ditto. * hpread.c (scan_procs): Ditto. (hpread_build_psymtabs): Ditto. (hpread_start_psymtab): Ditto. * ia64-tdep.c (ia64_find_unwind_table): Ditto. * mips-mdebug-tdep.c (non_heuristic_proc_desc): Ditto. (non_heuristic_proc_desc): Ditto. * nlmread.c (nlm_symfile_read): Ditto. * objfiles.c (executable_objfile): New function. (separate_debug_objfile): New function. (objfile_section_offset): New function. (objfile_text_section_offset): New function. (objfile_data_section_offset): New function. (objfile_rodata_section_offset): New function. (objfile_bss_section_offset): New function. * objfiles.h (SECT_OFF_DATA): Always use executable objfile when tracking down section indexes. (SECT_OFF_RODATA): Ditto. (SECT_OFF_TEXT): Ditto. (SECT_OFF_BSS): Ditto. (objfile_section_offset): Added prototype. (objfile_text_section_offset): Added prototype. (objfile_data_section_offset): Added prototype. (objfile_rodata_section_offset): Added prototype. (objfile_bss_section_offset): Added prototype. * symfile.c (syms_from_objfile): Use new objfile section offset functions. * symtab.c (fixup_section): Always use the executable when finding section information, not the dSYM. * symtab.h (objfile_section_offset): Added prototype. 2007-04-18 Jim Ingham * fork-child.c (fork_inferior): Remove debug printf. 2007-04-17 Jim Ingham * Makefile.in: Do HAVE_64_BIT_MACH_EXCEPTIONS through config.h. * config.in: Add HAVE_64_BIT_MACH_EXCEPTIONS, USE_ARCH_FOR_EXEC and USE_POSIX_SPAWN * configure.ac: Test for USE_ARCH_FOR_EXEC and USE_POSIX_SPAWN. * config/powerpc/macosx.mh: Fix call to mig so it doesn't need @HAVE_64_BIT_MACH_EXCEPTIONS@. * config/i386/macosx.mh: Ditto. * fork-child.c (fork_inferior): Use "arch" instead of just exec, and use "posix_spawn" instead of execvp so we can set which side of a Universal file runs. (startup_inferior): Remove Apple Local patch that nixed the value passed in ntraps. * main.c (captured_main): Add an option for --arch. * osabi.c (gdbarch_lookup_osabi_from_bfd): New function, does NOT return the current_gdbarch if user selected. (gdbarch_lookup_osabi): Use gdbarch_lookup_osabi_from_bfd. (set_osabi_from_string): New function. * osabi.h: Declare set_osabi_from_string and gdbarch_lookup_osabi_from_bfd. * symfile.c (open_bfd_matching_arch): Use gdbarch_lookup_osabi_from_bfd. * arch-utils.c (set_architecture_from_string): New function. (gdbarch_from_bfd): Remove unused variables. (set_gdbarch_from_file): Error if the file doesn't match the current gdbarch - but only if the user selected an architecture. (gdbarch_info_fill): If the info passed in has a bfd, use that instead of the default gdbarch to get the arch_info. * arch-utils.h: Declare set_architecture_from_string. * buildsym.h: Forward declare enum line_table_entry_type. * linespec.c (decode_line_1): Zero out the final_result.sals before setting the fields we know about. 2007-04-12 Caroline Tice * alpha-mdebug-tdep.c (alpha_mdebug_frame_prev_register): Change type of "optmizedp" from int to enum opt_state; assign it "opt_okay" instead of 0. * alpha-tdep.c (alpha_sigtramp_frame_prev_register): Likewise. (alpha_heuristic_frame_prev_register): Likewise. * amd64-tdep.c (amd64_frame_prev_register): Likewise. (amd64_sigtramp_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * avr-tdep.c (avr_frame_prev_register): Change type of "optimizedp" from int to enum opt_state; assign it "opt_okay" instead of 0. * cris-tdep.c (cris_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * dwarf2-frame.c (dwarf2_frame_prev_register): Change type of "optimizedp" from int to enum opt_state; assign it appropriate new state values. * dwarf2expr.c (execute_stack_op): Add default case to switch statement to eliminate warning. * dwarf2loc.c (dwarf2_evaluate_loc_desc): Use 'opt_away' instead of '1' for variables that are missing a location description. (loclist_read_variable): Use 'opt_evicted' instead of '1' for variables whose location lists don't have an entry for the current stop_pc. * dwarf2read.c (new_symbol): Add else clause to add symbols that are missing locations to the symbol lists. * findvar.c (value_of_register): Change type of "optim" from int to enum opt_state. (read_var_value): For cases LOC_OPTIMIZED_OUT, pass 'opt_away' to set_value_optimized_out (instead of '1'). * frame.c (frame_register_unwind): Change type of "optimizedp" from int to enum opt_state. (frame_unwind_register): Change type of "optimized" from int to enum opt_state. * frame.h (value.h): New include statement. (frame_register_unwind): Change type of "optimizedp" from int to enum opt_state. (frame_register): Likewise. * frv-linux-tdep.c (frv_linux_sigtramp_frame_prev_register): Likewise * h8300-tdep.c (h8300_frame_pref_register): Likewise; also assign 'opt_okay' rather than '0'. * hppa-hpux-tdep.c (hppa-hpux_sigtramp_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_prev_register): Likewise * hppa-tdep.c (value.h): New include statement. (hppa_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. (hppa_fallback_frame_prev_register): Likewise. (hppa_stub_frame_prev_register): Likewise. (hppa_frame_prev_register_helper): Likewise; also assign "opt_other" rather than '0'. * hppa-tdep.h (hppa_frame_prev_register_helper): Change type of "optimizedp" from int to enum opt_state. * i386-tdep.c (i386_frame_prev_register): Likewise; also assign opt_okay instead of 0. (i386_sigtramp_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * ia64-tdep.c (ia64_frame_prev_register): Likewise; also assign opt_okay instead of 0. (ia64_sigtramp_frame_prev_register): Likewise. (ia64_libunwind_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. (ia64_libunwind_sigtramp_frame_prev_register): Likewise. * iq2000-tdep.c (iq2000_frame_prev_register): Likewise; also assign opt_okay instead of 0. * libunwind-frame.c (libunwind_frame_prev_register): Change type of "optimizedp" from int to enum opt_state; assign appropriate new state values. * libunwind-frame.h (libunwind_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * m32r-linux-tdep.c (m32r_linux_sigtramp_frame_prev_register): Likewise * m32r-tdep.c (m32r_frame_prev_register): Likewise. * m68hc11-tdep.c (m68hc11_frame_prev_register): Likewise. * m68k-tdep.c (m68k_frame_prev_register): Likewise; also assign opt_okay instead of 0. * m68klinux-tdep.c (m68k_linux_sigtramp_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * m88k-tdep.c (m88k_frame_prev_register): Likewise. * mips-mdebug-tdep.c (mips_mdebug_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * mips-tdep.c (mips_insn16_frame_prev_register): Likewise. (mips_insn32_frame_prev_register): Likewise. (mips_stub_frame_prev_register): Likewise. * mn10300-tdep.c (mn10300_frame_prev_register): Likewise. * rs6000-tdep.c (fs6000_frame_prev_resgister): Likewise. * s390-tdep.c (s390_frame_prev_register): Likewise. (s390_stub_frame_prev_register): Likewise. (s390_sigtramp_frame_prev_register): Likewise. * sh-tdep.c (sh_frame_prev_register): Likewise; also assign opt_okay instead of 0. * sh64-tdep.c (sh64_frame_prev_register): Likewise. * sparc_sol2-tdep.c (sparc32_sol2_sigtramp_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * sparc-tdep.c (sparc32_frame_prev_register): Likewise; also assign opt_okay instead of 0. * sparc64_sol2-tdep.c (sparc64_sol2_sigtramp_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * sparc64-tdep.c (sparc64_frame_prev_register): Likewise; also assign opt_okay instead of 0. * sparc64fbsd-tdep.c (sparc64fbsd_sigtramp_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * sparc64nbsd-tdep.c (sparc64nbsd_sigcontext_frame_prev_register): Likewise. * sparc64obsd-tdep.c (sparc64obsd_frame_prev_register): Likewise. * sparcnbsd-tdep.c (sparc32nbsd_sigcontext_frame_prev_register): Likewise. * sparcobsd-tdep.c (sparc32obsd_frame_prev_register): Likewise. * trad_frame.c (value.h): New include statement. (trad_frame_get_prev_register): Change type of "optimizedp" from int to enum opt_state; assign opt_okay instead of 0. (trad_frame_get_register): Change type of "optimizedp" from int to enum opt_state. * trad_frame.h (trad_frame_get_register): Likewise. (trad_frame_get_prev_register): Likewise. * tramp_frame.c (tramp_frame_prev_register): Likewise. * v850-tdep.c (v850_frame_prev_register): Likewise. * valprint (value_check_printable): Add switch statement to test value's opt state and possible print appropriate message. * value.c (struc value): Change type of "optimized_out" field from 'char' to 'enum opt_state'. (value_optimized_out): Change return type from int to enum opt_state. (set_value_optimized_out): Change type of 'val' parameter from int to enum opt_state. * value.h (enum opt_state): New enum type. (value_optimized_out): Change return type to enum opt_state. (set_value_optimized_out): Change parameter type to enum opt_state. * vax-tdep.c (vax_frame_prev_register): Change type of "optimizedp" from int to enum opt_state. * xstormy16-tdep.c (xstormy16_frame_prev_regsiter): Likewise; assign opt_okay instead of 0. 2007-04-10 Jim Ingham * symmisc.c (equivalence_table_build): If the table already exists, delete and remake it. 2007-04-10 Jason Molenda (jmolenda@apple.com) * i386-amd64-shared-tdep.c (i386_picbase_setup_pattern_p): New function. * i386-amd64-shared-tdep.h: Prototype. * i386-tdep.c (i386_find_esp_adjustments): Use it. * inlining.c: A little comment reformatting. 2007-04-10 Jim Ingham * dwarf2read.c (process_die): Handle DW_TAG_typedef separately. We need to pass the typedef type into new_symbol so we don't dereference it in making the symbol for the type. (read_tag_pointer_type): Handle the odd-ball named pointer dies gcc emits for ObjC's "id" and "Class". * objc-lang.c (objc_target_type_from_object): return the class name if you can't find the full type information for the dynamic type. * objc-lang.h: Adjust declaration for change above. * varobj.c: Add "dynamic_type_name" field to the varobj. (varobj_fixup_value): Return the dynamic_type_name if we can't find the full type info for the dynamic type. (varobj_create, value_of_child, value_of_root): Add the dynamic_type_name if we get it back from varobj_fixup_value. (varobj_get_dynamic_type): Report the dynamic_type_name if we don't have the full dynamic_type. (new_variable): Initialize dynamic_type_name. (free_variable): Free dynamic_type_name. * wrapper.c (safe_value_objc_target_type): Adjust for changes to value_objc_target_type. * wrapper.h: Ditto. 2007-04-03 Jim Ingham * dbxread.c (read_dbx_symtab): clear archive cache. (close_containing_archive_and_cntents): New function. (find_in_containing_archive_cache): New function. (add_to_containing_archive_cache): New function. (clear_containing_archive_cache): New function. (open_bfd_from_oso): Manage the containing archives internally, and just return whether you cached the returned bfd or not. (oso_scan_partial_symtab): Mutatis mutandi for changes to open_bfd_from_oso. (dbx_psymtab_to_symtab_1): Ditto. * dwarf2read.c (dwarf2_scan_pubtype_for_psymbols): Ditto. (dwarf2_debug_map_psymtab_to_symtab): Ditto. Take advantage of the change to reuse the .a files we might need to open. * symfile.h: Declare changes to open_bfd_from_oso and declare clear_containing_archive_cache. 2007-04-02 Caroline Tice * inlining.c (copy_inlined_call_stack_record): New function. (add_item_to_inlined_subroutine_stack): Add code to shift array and allow inserting item into middle of stack if that's where it belongs. 2007-03-29 Greg Clayton * utils.c (query): Handle case where user hits ^C during query by resetting QUIT_FLAG to zero. 2007-03-29 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_find_picbase_setup): Correctly mask off the register number from a push instruction. 2007-03-29 Jason Molenda (jmolenda@apple.com) * Info.plist: New file. * Makefile.in: Add the Info.plist to the gdb binary in the __TEXT,__info_plist section. 2007-03-28 Jason Molenda (jmolenda@apple.com) * config/i386/nm-i386-macosx.h: Definitions needed to activate hardware watchpoint support from i386-nat.c. * config/i386/macosx.mh: Build i386-nat.c. * config/nm-macosx.h: Comment out the page-protection style watchpoints if real hardware watchpoints are available. * configure.ac: Check to see if the x86_debug_state32_t type is available on the build system. * config.in, configure: Regenerated. 2007-03-27 Jason Molenda (jmolenda@apple.com) * symfile.c (add_kext_command): Fix typeo in usage string. 2007-03-23 Jim Ingham * Makefile.in: Add HAVE_64_BIT_MACH_EXCEPTIONS & MACH_EXC_SERVER_PREFACE variables, and use them to select the 64 bit mig interfaces if available. * configure.ac: Test for the existance of /usr/include/mach/mach_exc.defs, and set the above flags so it will get used. * config/i386/macosx.mh: The name of the generated mig files is different between the 32 & 64 bit versions. Adjust for that. * config/powerpc/macosx.mh: Ditto. * symfile.c (syms_from_objfile): When applying the offset, remember that not all bfd_sections become objfile sections. (symbol_file_add_bfd_safe): num_offsets is not equal to the number of bfd sections, but to the number of bfd sections that end up in the objfile. 2007-03-23 Caroline Tice * dwarf2loc.c (print_single_dwarf_location): Comment out unnecessary some unnecessary code. * dwarf2read.c (read_inlined_subroutine_scope): Add push_context, pop_context, and finish_block to get scope for inlined parameters correct. (new_symbol): Look for DW_AT_location in abstract origin dies ofr formal parameters of inlined subroutines. 2007-03-22 Jason Molenda (jmolenda@apple.com) * symmisc.c (equivalence_table_build): Formatting typeo. * symfile.c (add_kext_command): Check for flat bundle formatted kext bundles in addition to traditional kext bundle layouts. 2007-03-21 Caroline Tice * c-valprint.c (c_value_print): Output "[uninitialized]" before a variable's value, if the variable is uninitialized. * dwarf2expr.c (add_piece): Make function not static. (unsigned_address_type): Likewise. (signed_address_type): Likewise. (execute_stack_op): Initialized var_status field of context struct; allow DW_OP_APPLE_uninit to follow at DW_OP_reg operation. * dwarf2expr.h (struct dwarf_expr_context): New field, var_status. (unsigned_address_type): Declare function to be extern. (signed_address_type): Likewise. (add_piece): Likewise. * dwarf2loc.c (dwarf2_evaluate_loc_desc): Set var_status field in return value to var_status field in context struct. (print_single_dwarf_location): New function. (loclist_describe_location): Modify to actually print out list of locations based on Dwarf location list. * dwarf2read.c (dwarf_stack_op_name): Add case for DW_OP_APPLE_uninit. (decode_locdesc): Likewise. * value.c (struct value): New field, var_status. (set_var_status): New function. (value_var_status): New function. (allocation_value): Initialize var_status field. * value.h (set_var_status, value_var_status): New extern declarations. 2007-03-19 Greg Clayton * dwarf2read.c (peek_die_abbrev): Return NULL and zero BYTES_READ if the DIE is past the end of the compilation unit. 2007-03-19 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (peek_die_abbrev): Revert last change; it is not sufficient either. 2007-03-19 Greg Clayton (gclayton@apple.com) * dwarf2read.c (peek_die_abbrev): Return NULL if the DIE is past the end of the compilation unit. 2007-03-19 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (load_partial_dies): Revert previous change. 2007-03-19 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (load_partial_dies): Stop parsing DIEs if we hit the end of a compile_unit's length even if the debug_info did not properly end. 2007-03-16 Jason Molenda (jmolenda@apple.com) * buildsym.c (finish_block): Properly cap a block whose scope is incorrect so that the block list addresses aren't incorrect. * block.c (blockvector_for_pc_sect): Don't search back into the static/global blocks. Don't stop searching if the current block's addresses are lower than the searching PC if this is a sub-block; an earlier block may be what we're looking for. 2007-03-16 Jim Ingham * breakpoint.c (detect_location_arg): Handle the no argument case. 2007-03-16 Jim Ingham * varobj.c (c_path_expr_of_child): If the child is anonymous, return the parent expression. (cplus_path_expr_of_child): Ditto. 2007-03-16 Caroline Tice * infcmd.c (step_once): Check for the existence of a function symbol before trying to call find_function_start_sal; use alternate method for finding first line if function symbol does not exist. 2007-03-15 Jim Ingham * breakpoint.c (watch_command_1): Added by_location argument, and if set, only watch the resolved location. (detect_location_arg): New function. (watch_command, rwatch_command, awatch_command): Parse out the location argument. (watch_command_wrapper, rwatch_command_wrapper, awatch_command_wrapper): Accept the by_location argument. (_initialize_breakpoint): Add "-location" to the doc strings. * breakpoint.h: Change declaration of the _wrapper functions above. 2007-03-15 Jason Molenda (jmolenda@apple.com) * inlining.c (address_range_ending_pc): Add comment about this function's performance impact. 2007-03-14 Jason Molenda (jmolenda@apple.com) * ada-lang.c (ada_lookup_symbol): Use BLOCK_HIGHEST_PC. * block.c (address_range_ending_pc): Moved to inlining.c (block_highest_pc): New function. Return the highest pc value of a block. (contained_in): Return early when possible. (block_starts_and_ends): Ditto. (blockvector_for_pc_sect): Fix second loop so we don't iterate back to the static block when looking for a match. * block.h: Define BLOCK_HIGHEST_PC. Prototype for block_highest_pc. * blockframe.c (addr_inside_main_func, find_pc_partial_function): Use BLOCK_HIGHEST_PC. * buildsym.c: Typeo. * inlining.c (address_range_ending_pc): Function moved here from block.c. 2007-03-14 Greg Clayton * dbxread.c (read_dbx_symtab): Use TM_NEXTSTEP instead of NM_NEXTSTEP. * elfread.c (elf_symtab_read): Ditto. * exec.c: Use new MACOSX_DYLD instead of NM_NEXTSTEP so we can enable and disable dyld support and use it for remote targets. (exec_file_attach): Look for app bundles when Mac OS X is the target instead of only for native builds, and only init dyld if MACOSX_DYLD is defined. * fix-and-continue.c (get_fixed_file): Use new MACOSX_DYLD instead of NM_NEXTSTEP. * minsyms.c (lookup_minimal_symbol_all): Use TM_NEXTSTEP instead of NM_NEXTSTEP. (lookup_minimal_symbol): Ditto. (prim_record_minimal_symbol_and_info): Ditto. * objfiles.c (objfile_get_next): Use new MACOSX_DYLD instead of NM_NEXTSTEP. (objfile_set_load_state): Ditto. * remote.c (remote_open_1): Keep dyld informed when creating a remote target. (remote_mourn_1): Keep dyld informed when our inferior dies. (init_remote_ops): Register dyld functions for remote ops. * source.c (pathname_substitutions): Changed global to static. (pathname_substitutions_argv): New static variable. (open_source_file_fullpath): Use new pathname_substitutions_argv static variable to avoid recomputing and leaking PSUBS every time. (set_pathname_substitution): Now caches the arg list for the open_source_file_fullpath function. (show_pathname_substitutions): New function to display the current pathname substitutions. (_initialize_source): Updated help text for the set/show "pathname-substitutions" command and supply the function callback show_pathname_substitutions. * symfile.c (syms_from_objfile): Use new MACOSX_DYLD instead of NM_NEXTSTEP (new_symfile_objfile): Ditto (symbol_file_add_with_addrs_or_offsets_us): Ditto (symbol_file_add_main_1): Ditto (symbol_file_clear): Ditto (add_symbol_file_command): Ditto (symfile_bfd_open): Use TM_NEXTSTEP instead of NM_NEXTSTEP. * symmisc.c (dump_msymbols): Use TM_NEXTSTEP instead of NM_NEXTSTEP. * symtab.h: Use TM_NEXTSTEP instead of NM_NEXTSTEP. * config/nm-macosx.h (macosx_solib_add): Removed. (SOLIB_ADD): Removed. (SOLIB_IN_DYNAMIC_LINKER): Removed. (SOLIB_UNLOADED_LIBRARY_PATHNAME): Removed. (SOLIB_LOADED_LIBRARY_PATHNAME): Removed. (SOLIB_CREATE_CATCH_LOAD_HOOK): Removed. (SOLIB_CREATE_CATCH_UNLOAD_HOOK): Removed. (macosx_add_shared_symbol_files): Removed. (ADD_SHARED_SYMBOL_FILES): Removed. (macosx_pc_solib): Removed. (PC_SOLIB): Removed. (macosx_filename_in_bundle): Removed. * config/tm-macosx.h (MACOSX_DYLD): New define that can be used to enable/disable Mac OS X dyld support. (SOLIB_ADD): Moved here from nm-macosx.h. (SOLIB_IN_DYNAMIC_LINKER): Ditto. (SOLIB_UNLOADED_LIBRARY_PATHNAME): Ditto. (SOLIB_LOADED_LIBRARY_PATHNAME): Ditto. (SOLIB_CREATE_CATCH_LOAD_HOOK): Ditto. (SOLIB_CREATE_CATCH_UNLOAD_HOOK): Ditto. (macosx_add_shared_symbol_files): Ditto. (ADD_SHARED_SYMBOL_FILES): Ditto. (macosx_pc_solib): Ditto. (PC_SOLIB): Ditto. * config/i386/macosx.mt: Add dyld object files to support dyld on cross targets. * config/powerpc/macosx.mt: Add dyld object files to support dyld on cross targets. 2007-03-13 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_analyze_frame_setup): Stop scanning for a prologue insn after 256 instructions. Stop scanning for a prologue insn if we hit a return insn. 2007-03-13 Jim Ingham * frame.h: Declare backtrace_past_main here, since we're going to use it in other modules. 2007-03-13 Caroline Tice * inlining.c (add_item_to_inlined_subroutine_stack): Initialize new call stack records after they get malloc'd or realloc'd. 2007-03-09 Jason Molenda (jmolenda@apple.com) * config/i386/macosx.mh: Don't build CFM support code. 2007-03-08 Jim Ingham * objc-lang.c (objc_target_type_from_object): New function, extracted from value_objc_target_type. (value_objc_target_type): Use objc_target_type_from_object. * objc-lang.h: Declare objc_target_type_from_object. 2007-03-07 Jason Molenda (jmolenda@apple.com) * cp-support.c (cp_lookup_rtti_type): Downgrade "RTTI symbol not found for class" from warning to complaint. 2007-03-07 Greg Clayton (gclayton@apple.com) * infrun.c (handle_inferior_event): HW watchpoints now work for targets that use software single stepping. 2007-03-06 Jason Molenda (jmolenda@apple.com) * infrun.c (metrowerks_stepping): Remove. (fetch_inferior_event): Remove CodeWarrior support. (macosx_print_extra_stop_info): Ditto. * linespec.c (metrowerks_ignore_breakpoint_errors_flag): Remove. (decode_variable): Remove CodeWarrior support. * symtab.c (metrowerks_ignore_breakpoint_errors_flag): Remove. (_initialize_symtab): Don't add metrowerks-ignore-breakpoint-errors setting. * config/i386/macosx.mh: Don't include macosx-metrowerks.o. * config/powerpc/macosx.mh: Don't include macosx-metrowerks.o. 2007-03-05 Jason Molenda (jmolenda@apple.com) * symfile.c (kext_symbol_file_path): New global. (add_kext_command): If the .sym file isn't found, and kext_symbol_file_path is set, look for the .sym file there as well. (_initialize_symfile): Register the 'set kext-symbol-file-path' command. 2007-03-02 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf2_debug_map_psymtab_to_symtab): Print the name of the source file when verbose is set. * linespec.c: Whitespace fixes. 2007-03-01 Jason Molenda (jmolenda@apple.com) * dwarf2read.h: New file. Definition of oso_to_final_addr_map from dwarf2read.c. * dwarf2read.c: Remove defn of oso_to_final_addr_map. (translate_debug_map_address): Make extern. Take the addr map as the first argument instead of the dwarf2_cu. Callers updated. (dwarf2_debug_map_psymtab_to_symtab): Don't free addr translation map. Should probably add to objfile's obstack. (dwarf2_symbol_mark_computed): Save pointer to address map in location list batons. * dwarf2loc.h: Include dwarf2read.h. Add addr_map field to dwarf2_locexpr_baton and dwarf2_loclist_baton. * dwarf2loc.c (find_location_expression): Use address translation map if one is available. 2007-03-01 Caroline Tice * infcmd.c (stepping_over_inlined_subroutine): New global variable. (step_once): Change code for stepping over inlined subroutines to NOT use breakpointes (which can cause continue-like behavior at times), and to use stepping_over_inlined_subroutine flag; Change code for stepping into inlined subroutine to display first line of function code rather than first line of function declaration. * infrun.c (follow_exec): Initialize stepping_over_inlined_subroutine to 0. (clear_proceed_status): Likewise. (handle_inferior_event): Check stepping_over_inlined_subroutine flag when determining whether or not to stop inside an apparently different subroutine. (insert_step_resume_breakpoint): Use step_frame_id for setting frame breakpoint if stepping_over_inlined_subroutine is on. * inlining.c (inlined_function_update_call_stack): In special situations, turn off stepping_over_inlined_subroutine. (rest_of_line_contains_inlined_subroutine): Do nothing if inlined_stepping flag is turned off; fix various small bugs. * inlining.h (stepping_over_inlined_subroutine): Declare new global variable. 2007-02-26 Jason Molenda (jmolenda@apple.com) * frame.c (backtrace_sanity_checks): Renamed the setting of the last checking. It's now 'sanity-checks' in the backtrace set list. (get_prev_frame_1): Ditto. (_initialize_frame): Ditto. 2007-02-26 Jason Molenda (jmolenda@apple.com) * frame.c (ignore_stack_sanity_checks): New parameter for tweaking by people who want a backtrace in spite of the sanity check heuristics. (get_prev_frame_1): Don't error out when ignore_stack_sanity_checks is set. (_initialize_frame): Add trust-me-keep-backtracing to the 'set backtrace' chain of settings. 2007-02-23 Caroline Tice * inlining.c (insert_pending_node): Fix typo comparing end_pc fields (was accidentally comparing end_pc to pc field). 2007-02-22 Jason Molenda (jmolenda@apple.com) * disasm.c (find_pc_offset): Return the earliest address of a function even if it is less than the offset limiter. 2007-02-22 Jim Ingham * objfiles.c (objfile_keeps_section): Extract this logic from build_objfile_section_table. * (build_objfile_section_table): Use objfile_keeps_section. * objfiles.h: Declare objfile_keeps_section. 2007-02-21 Jim Ingham * symfile.c (init_objfile_sect_indices): Copy paste error. Also add a break when we find the segment we're looking for. * (symbol_file_add_with_addrs_or_offsets_using_objfile): NM_NEXTSTEP-> TM_NEXTSTEP, and also handle the case where we don't have a "calculate_offsets_for_dsym" somehow. (reread_separate_symbols): Ditto. 2007-02-20 Jason Molenda (jmolenda@apple.com) * macosx-nat-cmds-load.c (load_plugin): Require that the plugin pathname be an absolute path. 2007-02-20 Jim Ingham This change is to better propagate "offsets" when we build the objfiles & separate_debug_files. * objfiles.{c,h}: changed some comments, added a FIXME. * symfiles.c (init_objfile_sect_indices): Can't use the bfd section indices, since we don't make sections for bfd_sections of 0 length, and thus the count may not be the same. Also arrange for the text, data & bss indices for separate debug objfiles to be 0 if we couldn't find them elsewhere. * (syms_from_objfile): Don't look at addrs if we get offsets! Also do the "delete & reinsert" in ordered sections here, and apply the offsets if they were provided. * (symbol_file_add_with_addrs_or_offsets_using_objfile): Don't try to make a separate_debug_file FOR a separate_debug_file. Also, check for the dSYM offset if appropriate. And pass through offsets appropriately. * (reread_symbols): Make sure we recreate the objfile & separate objfile in the same order we originally made them. There are some order dependencies that don't work otherwise. * (symbol_file_add_bfd_using_objfile): Let this take both addrs & offsets. * (symbol_file_add_bfd_safe): Ditto. * symfile.h: Changes to symbol_file_add_bfd_using_objfile and symbol_file_add_bfd_safe. * fix-and-continue.c (pre_load_and_check_file): Mutatis mutandi for symbol_file_add_bfd_safe. 2007-02-15 Jason Molenda (jmolenda@apple.com) * interps.c (interp_complete): Accept & pass along an optional limit for the number of matches to be returned. * interps.h (interp_complete_ftype): Prototype updated. * cli/cli-cmds.c (complete_command): Don't limit matches from the command line. (cli_interpreter_complete): Accept & honor a limit on the number of matches to be printed. * cli/cli-cmds.h (cli_interpreter_complete): Prototype updated. * mi/mi-interp.c (mi_cmd_interpreter_complete): Enforce a hard limit of 200 matches returned for completions in the MI for now. 2007-02-12 Jason Molenda (jmolenda@apple.com) * buildsym.c (finish_block): Add more information to the inner block not inside outer block complaint. 2007-02-09 Jason Molenda (jmolenda@apple.com) * symfile.c (add_kext_command): More verbose error messages. 2007-02-07 Jason Molenda (jmolenda@apple.com) * config/i386/macosx.mt: Build macosx-self-backtrace. * config/powerpc/macosx.mt: Build macosx-self-backtrace. * utils.c (internal_vproblem): Do a stack crawl of how we got to the internal error. 2007-02-06 Jason Molenda (jmolenda@apple.com) * block.c (blockvector_for_pc_sect): Only return a matched block if the pc is less than the block's end_pc. 2007-02-06 Jason Molenda (jmolenda@apple.com) * infrun.c (set_scheduler_locking_mode): Add cast to fix printf formatting warning. (macosx_print_extra_stop_info): Add comment to spot where we seem to have lots of problems. Fix unterminated comment mistake. 2007-02-05 Jason Molenda (jmolenda@apple.com) * objc-lang.c (resolve_newruntime_objc_msgsend): New unified function for determining the target of an ObjC dispatch in the new runtime. (resolve_msgsend_fixup, resolve_msgsend_fixedup, resolve_msgsend_stret_fixup, resolve_msgsend_stret_fixedup): Call it. (resolve_newruntime_objc_msgsendsuper): New unified function for determining the target of an ObjC super dispatch in the new runtime. (resolve_msgsendsuper2_fixup, resolve_msgsendsuper2_fixedup, resolve_msgsendsuper2_stret_fixup, resolve_msgsendsuper2_stret_fixedup): Call it. (methcalls): Updated to call the correct variations. 2007-02-02 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_fetch_pointer_argument): Return zero for an unsupported argument number. * objc-lang.h (find_implementation): Take a third argument. * eval.c (evaluate_subexp_standard): Update call to find_implementation. * objc-lang.c (lookup_objc_class): Whitespace cleanup. (methcalls): Add entries for new 64-bit Objective C runtime's entry functions. (find_objc_msgsend): Fix formatting. Use find_pc_partial_function to find the end address of functions instead of the incorrect method that was being used. (new_objc_runtime_internals): Detect the new Objective C runtime. (new_objc_runtime_find_impl): Find the implementation of a given class and selector in the new Objective C runtime. (find_implementation_from_class): Call new_objc_runtime_find_impl if the new runtime is being used. (find_implementation): Ditto. (resolve_msgsend_fixedup): New function to correctly interpret the arguments when we stepi into the new runtime's message dispatch function. (resolve_msgsend_stret_fixedup): Variant of the above func. (resolve_msgsendsuper2_fixedup): Call to an object's super class; not yet correctly resolving to a function address. (resolve_msgsendsuper2_stret_fixedup): Variant of above, also not yet correct. 2007-02-01 Caroline Tice * breakpoint.c (solib_load_unload_1): Add new argument to call to decode_line_1. The new argument indicates whether or not to look for all occurrences of a symbol rather than just the first one. (parse_breakpoint_sals): Likewise. (until_break_command): Likewise. (breakpoint_re_set_one): Likewise. (decode_line_spec_1): Likewise. * linespec.c (gdb_assert.h): New include statement. (decode_all_variables): New function. (symbols_found): New function. (minsyms_found): New function. (decode_line_1): Add new paramenter, find_all_occurrences; add call to decode_all_variables, predicated on find_all_occurrences. * linespec.h (decode_line_1): Add new paramenter to function declaration. * minsyms.c (lookup_minimal_symbol_all): New function. * symtab.c (lookup_symbol_aux_symtabs): Add new parameters, sym_list and find_all_occurrences; Modify to find all the matching symbols if find_all_occurrences is set. Do this via calling lookup_block_symbol_all. If returning multiple symbols, put them into new parameter sym_list. (lookup_symbol_aux_psymtabs): Likewise. (lookup_symbol_all): New function. (lookup_symbol_aux): Add new arguments to calls to lookup_symbol_aux_symtabs and lookup_symbol_aux_psymtabs. (lookup_symbol_global): Add new arguments to calls to lookup_symbol_aux_symtabs and lookup_symbols_aux_psymtabs. (lookup_block_symbol_all): New function. (decode_line_spec): Add new argument to call to decode_line_1. * symtab.h (lookup_block_symbol_all): New function decl. (lookup_symbol_all): New function decl. * tracepoint.c (trace_command): Add new argument to call to decode_line_1. (scope_info): Likewise. * cli/cli-cmds.c (edit_command): Likewise. (list_command): Likewise. 2007-01-31 Greg Clayton * configure.ac: Check for DebugSymbols.framework and export DEBUG_SYMBOLS_LIBS and define HAVE_DEBUG_SYMBOLS_FRAMEWORK. * Makefile.in (DEBUG_SYMBOLS_LDFLAGS): Added. * config.in: Regenerate. * configure: Regenerate. * aclocal.m4: Regenerate. * symfile.c (APPLE_DSYM_EXT_AND_SUBDIRECTORY): Removed. (find_separate_debug_file): Moved contents to macosx_locate_dsym in macosx/macosx-tdep.c. 2007-01-29 Jim Ingham * amd64-tdep.c (amd64_analyze_prologue): Remove errant +1's that came from converting the FSF code. 2007-01-29 Jim Ingham * symfile.c (check_for_matching_uuid): Add an async notification if we're running the MI. 2007-01-26 Jim Ingham * varobj.c (cplus_value_of_variable): For references, just return "{...}" like we do for structures, classes & unions. 2007-01-26 Caroline Tice * dwarf2read.c (rb_delete_fixup): Add tests to cope with children of 'w' being NULL; Add lots of comments. (rb_tree_remove_node): Add y_parent and x_child_pos vars; copy first iteration of loop from rb_delete_fixup to cope with a null 'x'. Add calls to rb_verify_tree. (num_nodes_in_tree): New function (for debuggging rb-trees). (tree_height): Likewise. (verify_tree_colors): Likewise. (verify_tree_heights): Likewise. (verify_rb_tree): Likewise. (rb_print_node): Likewise. (rb_print_tree): Likewise. * inlining.c (insert_pending_node): Modify to sort by start pc as well as by end pc. 2007-01-25 Caroline Tice * dwarf2read.c (_initialize_dwarf2_read): Modify text messages for setshow variable "inlined_stepping", to make them clearer and more grammatical. * infcmd.c (step_1): Modify to not perform inlined subroutine stuff if single_inst is true. (step_once): Likewise. * infrun.c (handle_inferior_event): Modified condition near line 3108 to not consider do something special for INLINED_FRAME types if step_range_end is one (i.e. if the user is doing instruction-level stepping). 2007-01-24 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_fetch_pointer_argument): Function to retrieve the first few function arguments out of the registers. (amd64_init_abi): Add it to the current gdbarch. 2007-01-24 Jason Molenda (jmolenda@apple.com) * Makefile.in (gdb): Remove an old dSYM for gdb binary if present. 2007-01-23 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_find_picbase_setup): Switch over to using new libopcodes-disassembler based instruction parsing. (i386_find_esp_adjustments): Ditto. * i386-amd64-shared-tdep.c (i386_frame_setup_skip_insns): Removed. (i386_frame_setup_insns): Removed. (i386_match_insn): Removed. * i386-amd64-shared-tdep.h (i386_match_insn): Removed. 2007-01-22 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_skip_prologue): Look up the end addr of the function that we're analyzing the prologue of and limit our instruction scanning to that addr. 2007-01-18 Jim Ingham * checkpoint.c (_initialize_checkpoint): Don't register the sigterm handler here, only do it when you use it. (collect_checkpoint): Don't reinitialize the checkpoint stuff every time you make one. Also register the SIGTERM handler here. (checkpoint_clear_inferior): New function. * checkpoint.h: Declare checkpoint_clear_inferior. * target.c (generic_mourn_inferior): Reset the checkpoint state. 2007-01-19 Caroline Tice * inlining.c (struct pending_node): New struct. (find_function_names_and_addresses): Modify to check to non-initialized lines. (add_item_to_inlined_subroutine_stack): Modify to cope with entirely overlapping address ranges for distinct inlining cases (distinguish by call site line). (insert_pending_node): New function. (inlined_function_update_call_stack): Modified to collect all records for a pc and sort them before calling add_item_to_inlined_subroutine_stack. (inlined_function_add_function_names): Add check for call site line. (print_inlined_frame): Modified to use sal symtab if call stack symtab is NULL. 2007-01-19 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (follow_die_ref): Account for initial Length of Compilation Unit field when determining if a ref is contained within this compilation unit or not. 2007-01-17 Jason Molenda (jmolenda@apple.com) * dbxread.c (oso_scan_partial_symtab): Whitespace fixes to stay under 80 columns. 2007-01-17 Caroline Tice * dwarf2read.c (plain_tree_insert): Change "else if" to "else" so everything gets inserted. 2007-01-17 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf2_kext_psymtab_to_symtab): Add sanity check when finding a particular compilation unit's dwarf in a dSYM. (process_full_comp_unit): For the non-dSYM case, trust the high/low addresses from the debug map (i.e. in the psymtab) over the DWARF's high/low pc values - those first/last functions may have been reordered during linking. 2007-01-17 Jim Ingham * objc-lang.c (value_objc_target_type): Get it to work for real inheritance. 2007-01-17 Caroline Tice * gdbthread.h: Declare prune threads here. * thread.c: Don't declare it here. 2007-01-10 Jason Molenda (jmolenda@apple.com) * symtab.c (lookup_symbol_aux_psymtabs): Print error message if the expansion of a psymtab to symtab results in a null symtab instead of dereferencing the null symtab pointer. 2007-01-08 Jason Molenda (jmolenda@apple.com) * c-exp.y (OP_OBJC_MSGCALL): Address of ObjC class data structure is a pointer value. * objc-exp.y (OP_OBJC_MSGCALL): Ditto. * eval.c (evaluate_subexp_standard): Don't mask off high 32-bits when inferior is a 64-bit program. Address of selector is a pointer value. * expression.h (enum exp_opcode): Fix formatting. * objc-lang.c (value_nsstring): Fix formatting. 2006-12-19 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_analyze_prologue): Add a next_frame parameter which may optionally be null. If this frame can't be frameless, set the sensible frame defaults. Use i386_ret_pattern_p() to detect the end of a function. (amd64_frame_cache): Pass the next_frame to amd64_analyze_prologue. (amd64_skip_prologue): Update call to amd64_analyze_prologue. * i386-amd64-shared-tdep.c (i386_ret_pattern_p): New function. * i386-amd64-shared-tdep.h (i386_ret_pattern_p): Prototype. 2006-12-19 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_analyze_prologue): Ah, don't have a frame_info pointer yet - temporarily back out the previous change. 2006-12-19 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_analyze_prologue): If this frame must have a frame on the stack, salt some sensible default values ahead of time in case we fail to parse the prologue correctly. 2006-12-19 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_analyze_prologue): Add a limit for how many non-prologue instructions to skip over when analyzing a prologue. Limit value picked at random. 2006-12-13 Caroline Tice file_index is within the bounds of lh. 2006-12-13 Jim Ingham * objfiles.c (free_objfile_internal): Don't null out the separate_debug_objfile of our backlink file here, it's only appropriate to do that when freeing the objfile. (free_objfile): So do it here instead. * symfile.c (symbol_file_add_with_addrs_or_offsets_using_objfile): Thinko in setting the separate_debug_objfile, sense of the using_orig_objfile test was reversed. 2006-12-12 Jason Molenda (jmolenda@apple.com) * i386-amd64-shared-tdep.c (i386_mov_esp_ebp_pattern_p): Recognize x86-64 version of mov %esp, %ebp. * amd64-tdep.c (amd64_analyze_prologue): Use libopcodes instruction length function to step through instructions in the prologue. 2006-12-12 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_match_insn): Move this function and the supporting instruction tables to i386-amd64-shared-tdep.c. (i386_analyze_frame_setup): Use i386_push_ebp_pattern_p, i386_length_of_this_instruction, and i386_mov_esp_ebp_pattern_p functions instead of hardcoding the opcode values. * i386-amd64-shared-tdep.c: New file with shared code to analyze prologues that will be used by both i386-tdep.c and amd64-tdep.c. Add support for using the libopcodes disassembler to step over instructions. * i386-amd64-shared-tdep.h: Ditto. * Makefile.in: Build the new file. 2006-12-12 Jim Ingham * disasm.c (dump_insns): Don't truncate assembly names here, this isn't used for the 'x' command. * printcmd.c (build_address_symbolic): Do it here. 2006-12-08 Greg Clayton * amd64-tdep.c (amd64_init_abi): Set the frame pointer register to be AMD64_RBP_REGNUM. * frame.c (frame_next_hack): Cleanup whitespace. (frame_cache_hack): Ditto. * i386-tdep.c (i386_gdbarch_init): Set the frame pointer register to be I386_EBP_REGNUM. * user-regs.c (replace_user_reg): New function. (user_reg_replace): New function. (value_of_user_reg): Fill in the frame ID member of the value for user registers. * user-regs.h (user_reg_replace): Added prototype. * valops.c (value_assign): Only find and refind the frame by ID if we have a frame that is not the first frame and protect refinding the frame by ID with try/catch block. * ppc-macosx-tdep.c (ppc_value_of_builtin_frame_fp_reg) New function. (ppc_frame_unwind_sp_for_dereferencing): Fix whitespace. (ppc_macosx_init_abi): Call new user_reg_replace with "fp" new ppc_value_of_builtin_frame_fp_reg function as new callback. (ppc_macosx_init_abi_64): Ditto. 2006-12-05 Jim Ingham * i386-tdep.c (i386_frame_this_id): Don't see if the 0th frame is the terminating frame. Just read it from the sentinel. 2006-12-04 Jason Molenda (jmolenda@apple.com) * frame.c (get_prev_frame_1): Replace the "corrupt stack?" error messages with phrase that puts the blame more on gdb. 2006-12-01 Jim Ingham * dbxread.c (stabsect_read_strtab_from_oso): Don't throw an error if there's no stabs or stabsstr, just return empty data. 2006-11-30 Jason Molenda (jmolenda@apple.com) * symfile.c (replace_psymbols_with_correct_psymbols): Don't strdup null psymtab oso name. 2006-11-30 Jason Molenda (jmolenda@apple.com) * symfile.c (replace_psymbols_with_correct_psymbols): Correctly handle objfiles with more than one psymtab. * dwarf2read.c (convert_oso_map_to_final_map): Remove kext support. (create_kext_addr_map): New function, mostly taken from convert_oso_map_to_final_map, to create address translation map for kext + dSYM objfiles. (dwarf2_kext_psymtab_to_symtab): Call create_kext_addr_map. 2006-11-28 Jason Molenda (jmolenda@apple.com) * configure.ac: Remove tests for libxml. * configure: Regenerated. * Makefile.in (LIBXML2_CFLAGS, LIBXML2_LDFLAGS): Removed. 2006-11-27 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Read the debug map out of a kext symbol (kextload-output) binary even though it has a dSYM file. (open_bfd_from_oso): Remove code to issue an informative error for "gcc -gdwarf-2 foo.c" uses because the compiler creates a dSYM now. * dwarf2read.c (convert_oso_map_to_final_map): Handle kext + dSYM case specially. (dwarf2_kext_psymtab_to_symtab): New psymtab expander, largely ripped off from dwarf2_debug_map_psymtab_to_symtab. (find_debug_info_for_pst): New function to iterate over the DWARF debug info compilaton units in a dSYM looking for a specific one that we're expanding from a psymtab to a symtab. * fix-and-continue.c (pre_load_and_check_file): Update call to symbol_file_add_bfd_safe. * objfiles.c (allocate_objfile_internal): Initialize new not_loaded_kext_filename field. * objfiles.h (struct objfile): New not_loaded_kext_filename field. * symfile.c (check_for_matching_uuid): Don't insist on a matching uuid for kext + dSYMs quite yet. (struct dbxread_symloc): Private data structure definition copied over from dbxread.c so I can copy these. Maybe this psymtab copying function would be better off in dbxread.c so I don't get burned by changes in the future... (replace_psymbols_with_correct_psymbols): Function to copy the psymtabs derived from the debug map of the kextload'ed symbol file into the dSYM file so the actual loaded addresses are used for psymtab expansion. (symbol_file_add_with_addrs_or_offsets_using_objfile): In the kext + dSYM case set the not_loaded_kext_filename field appropriately and copy the partial symbol table entries over to the dSYM. (symbol_file_add_with_addrs_or_offsets): Pass the kext bundle name down. (symbol_file_add_name_with_addrs_or_offsets): Ditto. (symbol_file_add_from_bfd): Update call to symbol_file_add_name_with_addrs_or_offsets. (symbol_file_add): Ditto. (symbol_file_add_using_objfile): Ditto. (symbol_file_add_main_1): Ditto. (add_symbol_file_command): Ditto. (symbol_file_add_bfd_helper): Ditto. (symbol_file_add_bfd_safe): Ditto. (find_separate_debug_file): Update to handle kext + dSYMs. (add_kext_command): New user command for loading a kext's symbols. (_initialize_symfile): Initialize new add-kext command. * symfile.h: Expose prototype for dwarf2_kext_psymtab_to_symtab. Update prototype for symbol_file_add_bfd_safe. 2006-11-15 Jim Ingham * symtab.c (basic_lookup_transparent_type): Replace error's about "found in psymtab not in symtab" with complaints. This failure can be caused by reading names from the pubtypes and not knowing whether they are structure names or typedef's. 2006-11-06 Jim Ingham Add the ability to "edit an objfile in place". This allows you to gang the deletion of objfiles and not make ALL_OBJFILES_SAFE unsafe. * objfiles.c (create_objfile_using_objfile): New function, factors out most of create_objfile except mallocing it. (create_objfile): Use create_objfile_using_objfile. (allocate_objfile_internal): Factor out common parts of allocate_objfile. (allocate_objfile): Rework to use allocate_objfile_internal. (allocate_objfile_using_objfile): The version that doesn't allocate or link in the objfile. (free_objfile_internal): Factor out bits common to free_objfile and clear_objfile. (free_objfile): Use free_objfile_internal, also deallocate & unlink. (clear_objfile): New function. * objfiles.h: declare new functions. * symfiles.c (symbol_file_add_with_addrs_or_offsets_using_objfile): New function. Reuse the passed in objfile. (symbol_file_add_name_with_addrs_or_offsets_using_objfile): Ditto. (symbol_file_add_using_objfile): Ditto * symfile.h: Declare new functions. 2006-11-02 Caroline Tice Add ability to deal with multiple non-contiguous address ranges. * ada-lang.c (ada_lookup_symbol): Replace BLOCK_START and BLOCK_END tests with code to deal with possible multiple address ranges. * alpha-mdebug-tdep.c (find_proc_desc): Replace BLOCK_START with BLOCK_LOWEST_PC. * ax-gdb.c (gen_var_ref): Likekwise. * block.c (address_range_ending_pc): New function. (contained_in): Modified to deal correctly with address ranges, if present. (block_starts_and_ends): New function. (block_contains_pc): New function. (blockvector_for_pc_sect): Replace BLOCK_START with BLOCK_LOWEST_PC; replace BLOCK_END test with appropriate code for dealing with possible address ranges. (allocate_block): Initialize new ranges field in block struct. * block.h (struct address_range): New struct. (struct address_range_list): New struct. (struct block): Add new field, ranges, to contain multiple address ranges. (BLOCK_RANGES): New macro. (BLOCK_RANGE_START): New macro. (BLOCK_RANGE_END): New macro. (BLOCK_LOWEST_PC): New macro. (block_contains_pc): New extern function declaration. (block_starts_and_ends): New extern function declaration. (address_range_ending_pc): New extern function declaration. * blockframe.c (addr_inside_main_func): Replace BLOCK_START and BLOCK_END tests with appropriate code for dealing with possibly multiple ranges of addresses. (find_pc_partial_function): Likewise. (block_innermost_frame): Replace block start & end tests with call to block_contains_pc. * buildsym.c (finish_block): Add new parameter, ranges; Add code to properly test for and deal with multiple address ranges. (make_blockvector): Replace BLOCK_START with BLOCK_LOWEST_PC. (end_symtab): Add ranges argument to calls to finish_block. * buildsym.h (finish_block): Add new parameter, ranges, to declaration. * coffread.c (coff_symtab_read): Add (null) ranges parameter to calls to finish block. * dbxread.c (process_one_symbol): Likewise. * dwarf2read.c (block.h): New include statement. (struct inlined_call_record): Add new field, ranges. (dwarf2_get_pc_bounds): Add new parameter to contain address ranges parsed from die info; Modify to store address ranges into new ranges parameter (for returning); to add the correct offset to the ranges addresses; to store the first range values in lowpc and highpc (dwarf2_add_to_list-of_inlined_calls): Add new parameter, ranges; use new parameter to initialize new field in inlined_call_record struct. (read_inlined_subroutine_scope): Add new ranges argument to call to dwarf2_get_pc_bounds; check children for lexical block; if found, parse IT for address ranges of inlined subroutine; add new argument, ranges, to call to dwarf2_add_to_list_of_inlined_calls. (read_func_scope): Add ranges argument to calls to dwarf2_get_pc_bounds and finish_block; fix up address ranges, if any. (read_lexical_block_scope): Likewise. (get_scope_pc_bounds): Add ranges argument to calls to dwarf2_get_pc_bounds. (check_inlined_function_calls): Add ranges arguemnt to call to inlined_function_add_function_names. * dwarfread.c (read_lexical_block_scope): Add (null) ranges parameter to call to finish_block. (read_func_scope): Likewise. * f-valprint.c (info_common_command): Replace BLOCK_START with BLOCK_LOWEST_PC. (there_is_a_visible_common_named): Likewise. * findvar.c (read_var_value): Likewise. * fix-and-continue.c (do_final_fixups_global_syms): Likewise. (redirect_old_function): Add error condition on detecting multiple address ranges. (update_picbase_register): Likewise. * hpread.c (hpread_process_one_debug_symbol): Add null ranges parameter to calls to finish_block. * infcmd.c (until_next_command): Replace BLOCK_START with BLOCK_LOWEST_PC. * inlining.c (find_function_names): Rename function to find_function_names_and_address_ranges. (record_end_pc): New function. (find_correct_current_position): Modify to deal with address ranges. (inlined_function_address_ranges_properly_contained): New function. (verify_stack): Modify to deal with address ranges. (find_function_names_and_address_ranges): Renamed from find_function_names; add code to find/record address ranges. (add_item_to_inlined_subroutine_stack): Change function call to use new name for find_function_names_and_address_ranges. (inlined_function_update_call_stack): Add code to check value of dwarf2_allow_inlined_stepping; add code to properly handle address ranges. (update_function_names_and_address_ranges): New function. (fix_up_inlined_function_line_table_entries): New function. (inlined_function_add_function_names): Update function comments; add code to set ranges field. (current_inlined_subroutine_call_stack_eof_pc): New function. (in_inlined_function_call_p): Add code to properly handle address ranges. (inlined_function_end_of_inlined_code_p): Change end_pc test into call to record_end_pc. (inlined_frame_this_id): Likewise. (inlined_subroutine_restore_after_dummy_call): Add code to restore ranges field. (inlined_subroutine_save_before_dummy_call): Add code to save ranges field. (rest_of_line_contains_inlined_subroutine): Change end_pc test into call to record_end_pc. * inlining.h (block.h): New include statement. (struct inlined_call_stack_record): Add new field, ranges. (inlined_function_add_function_names): Add new ranges parameter. (extern int dwarf2_allow_inlined_stepping): New global variable. * mdebugread.c (new_block): Initialize ranges field. * mips-mdebug-tdep.c (non_heuristic_proc_desc): Replace BLOCK_START with BLOCK_LOWEST_PC. * objc-lang.c (find_methods): Replace BLOCK_START and BLOCK_END with block_contains_pc. * objfiles.c (objfile_relocate): Add code to deal appropriately with multiple address ranges. * parse.c (parse_exp_in_context): Replace BLOCK_START with BLOCK_LOWESET_PC. * printcmd.c (build_address_symbolic): Likewise. (address_info): Likewise. * stack.c (print_frame): Likewise. (print_frame_label_vars): Modify code to deal appropriately with multiple address ranges. * symmisc.c (dump_symtab_1): Modify to deal appropriately with multiple address ranges. (print_symbol): Likewise. (maintenance_check_symtabs): Replace BLOCK_START and BLOCK_END tests with calls to block_contains_pc; Add code to deal appropriately with multiple address ranges. * symtab.c (lookup_symbol_aux_block): Replace BLOCK_START with BLOCK_LOWEST_PC. (block_size): New function. (find_pc_sect_symtab): Replace BLOCK_START and BLOCK end tests with call to block_contains_pc; Replace BLOCK_END minus BLOCK_START with call to block_size. (find_function_start_sal): Replace BLOCK_START with BLOCK_LOWEST_PC; replace BLOCK_START and BLOCK_END tests with call to block_contains_pc. (update_inlined_function_line_table_entry): New function. * symtab.h (update_inlined_function_line_table_entry): New declaration. * tracepoint.c (scope_info): Replace BLOCK_START with BLOCK_LOWEST_PC. * value.c (value_fn_field): Likewise. * xcoffread.c (read_xcoff_symtab): Add null ranges argument to calls to finish_block. * gdbtk/generic/gdbtk-stack.c (gdb_block_vars): Replace BLOCK_START BLOCK_END tests with call to block_starts_and_ends. (gdb_get_blocks): Add code to deal appropriately with multiple address ranges. (gdb_seleted_block): Return an error if dealing with multiple address ranges. (get_frame_name): Replace BLOCK_START with BLOCK_LOWEST_PC. * macosx/macosx-tdep.c (dyld_symbol_stub_function_address): Likewise. * macosx/symread.c (sym_symfile_read): Add code to properly handle multiple address ranges. 2006-11-01 Caroline Tice * symtab.c (find_pc_sect_line): Make sure outer_call_site has a value, even if symtabs don't match. 2006-10-30 Jim Ingham * interps.c (interp_set_ui_out): New function. * interps.h: Declare it. 2006-10-20 Jim Ingham * dbxread.c (parse_archive_name): New function. (read_dbx_symtab): Use parse_archive_name. (open_bfd_from_oso): Ditto. 2006-10-19 Jim Ingham * dbxread.c (read_dbx_symtab): handle the case where we have an OSO record, but the file it points to is missing. 2006-10-18 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_oso_nlists): Initialize processing_objfile instead of picking up whatever (possibly invalidated) value it might contain. 2006-10-16 Jim Ingham * objc-lang.c (lookup_objc_class): If you can't call functions in the target, return zero (instead of crashing). 2006-10-12 Jim Ingham * objc-lang.c (find_methods): Fix a thinko in the code added to support separate_debug_objfiles. 2006-10-12 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (process_die): Handle DW_TAG_const_type DIEs here. 2006-10-11 Greg Clayton * main.c (captured_main): Add missing break in switch statement for OPT_WAITFOR case. 2006-10-11 Jason Molenda (jmolenda@apple.com) * configure.ac: Report results of test for Carbon framework. * configure: Regenerated. * doc/configure: Regenerated with autoconf 2.60. * gdbserver/configure: Ditto. * testsuite/configure: Ditto. * testsuite/gdb.apple/configure: Ditto. * testsuite/gdb.stabs/configure: Ditto. 2006-10-11 Jason Molenda (jmolenda@apple.com) * configure.ac (MIG_CHECKING): New makefile variable to enable MIG type checking. * Makefile.in (MIG_CHECKING): Same. * configure: Regenerated. 2006-10-11 Jim Ingham * infrun.c (handle_inferior_event): Raise the load level of the stop_pc objfile so we have access to the relevant symbols & debug info before we try to do backtracing type tests. 2006-10-11 Jason Molenda (jmolenda@apple.com) * symtab.c (search_symbols): Add yet another pass over the objfiles to raise the load level of any objfiles with minimal symbols that match the regexp. 2006-10-11 Jim Ingham * disasm.c (dump_insns): Use disassembly_name_length to truncate the symbol name. * disasm.h: Define disassembly_name_length. * printcmd.c (_initialize_printcmd): Add the set-show for disassembly-name-length. * mem-break.c (default_memory_remove_breakpoint): If the instruction has changed since we wrote our trap, store the new instruction (probably self-modifying code) rather than restoring the old value. 2006-10-10 Jason Molenda (jmolenda@apple.com) * rs6000-tdep.c (rs6000_dwarf2_reg_to_regnum): Make linkage global. Warn when an invalid register number is received. * ppc-tdep.h: Prototype for rs6000_dwarf2_reg_to_regnum. 2006-10-09 Greg Clayton (gclayton@apple.com) * dwarf2read.c (new_symbol): Create a typedef symbol for objective C/C++ classes. 2006-10-05 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (decode_locdesc): Ditch the original patch for CVE-2006-4146 and handle the array bounds checking in a more natural form. 2006-10-04 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_implementation_from_class): Return immediately if the selector we're inspecting is the 0xfffeb010 bit pattern. 2006-10-03 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_implementation_from_class): Ignore selectors where the address of the name is 0xfffeb010 - it's a bit pattern with special meaning to the runtime on little-endian systems. 2006-09-29 Jim Ingham * dwarf2read.c (dwarf2_locate_sections): add support for pubtypes. (find_pubtypes): New function. (dwarf2_scan_pubtype_for_psymbols): New function. * symfile.h: define dwarf2_scan_pubtype_for_psymbols. * symtab.c (lookup_symbol_aux_psymtabs): Change found in psymtab but not in symtab from error->complaint. This will happen in Dwarf because we don't know whether the names in the pubtypes table are tag names or typedef names. * dbxread.c (read_dbx_symtab): Call dwarf2_scan_pubtype_for_psymbols on the OSO files. 2006-09-28 Jim Ingham * maint.c (maintenance_interval_display, init_timer, push_timer, pop_timer, stop_timer, report_timer_interval, maintenance_report_interval_command, stop_report_timer, make_cleanup_start_report_timer, find_timer, start_timer): New functions implementing "interval timers". (_initialize_maint_cmds): Add the "interval" and "report-interval" commands. * defs.h: Defines for start_timer & maint_use_timers. * dbxread.c (dbx_symfile_add): Add a timer. * objc-lang.c (lookup_objc_class): Add timer, also lock the scheduler when calling into the inferior to lookup the class. * symfile.c (psymtab_to_symtab): Add a timer. * value.c (value_fn_field): Check for NULL block. 2006-09-26 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_oso_nlists): Ignore symbols with a '.' in their name except for function static vars and, now, functions in a C++ anonymous namespace. 2006-09-20 Jason Molenda (jmolenda@apple.com) * cli/cli-cmds.c (edit_command): Don't cast addresses to 32-bits before printing. (list_command): Ditto. 2006-09-14 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Linewrapping whitespace fix. * dwarf2read.c (EH_FRAME_SECTION): Use the MachO segment/section name. (decode_locdesc): Update to final patch form of CVE-2006-4146. 2006-09-13 Jason Molenda (jmolenda@apple.com) * symfile.c (find_separate_debug_file): Fix conditional preprocessor usage as per Greg's intended change. 2006-09-05 Jim Ingham * valops.c (value_cast_1): New functions, wrap value_cast so I can fix up typedefs. (value_cast): Don't remove typedef from value_cast. 2006-09-01 Jim Ingham * dbxread.c (read_dbx_symtab): Demangle the vtable symbol name to get the classname. Otherwise we miss classes in namespaces. * valops.c: (check_field_in): If the baseclass type is a stub, call CHECK_TYPEDEF on it before searching in it. 2006-08-29 Caroline Tice * i386-tdep.c (i386_skip_prologue): Remove erroneous ';' at the end of a condition on an if statement. It was causing incorrect parsing of i386 prologues with gcc 1518. 2006-08-25 Stan Shebs * checkpoint.c (forking_checkpoint): New global. (collect_checkpoint): Reorg to use it. (_init_checkpoint): Add command to set it. (maybe_create_checkpoint): Catch an unusual situation. (print_checkpoint_info): Print memory statistics for in-GDB checkpoints. (clear_all_checkpoints): Clear collecting_checkpoint too. * checkpoint.h: Declare memcache_get. 2006-08-24 Caroline Tice * top.c (execute_command): Rename "line" to be "tmp_line", to avoid potential further confusion in the future. 2006-08-24 Caroline Tice * top.c (execute_command): Make "line" into a local variable again (local definition had been accidentally deleted); Re-undo change from 2006-08-04, restoring original pointer assignment of p into line (now the local variable version). 2006-08-22 Jason Molenda (jmolenda@apple.com) * top.c (execute_command): Reapply change from 2006-08-04; simple removal causes crashes in break.exp and commands.exp. 2006-08-22 Caroline Tice * infcmd.c (step_once): Fix code for finding sal for stepping into inlined subroutine; also don't adjust global_inlined_call_stack until correct sal has been found. (finish_command): When finishing from an inlined function, set step_frame_id, so gdb will stop in correct frame. * infrun.c (handle_inferior_event): Allow stepping to stop within a line if the line contains an inlined subroutine. * inlining.c (add_item_to_inlined_subroutine_stack): Don't take symtab from call_site; Use current symtab rather than original one when calling add_item_to_inlined_subroutine_stack. (at_inlined_call_site_p): Add valid case if there's only a single possible record (low == high). (print_inlined_frame): Take file name from sal rather than global_inlined_call_stack. (step_into_current_inlined_subroutine): Add loop to step into/through multiple levels of inlining, if necessary, to reach appropriate record. (rest_of_line_contains_inlined_subroutine): Modify to check entire line, from begining of line, not just from current position within line. * stack.c (print_frame_info): Use symtab from sal rather than from global_inlined_call_stack. (print_frame): Fix code for finding symtab, for printing filename, if inside inlined subroutine. (backtrace_command_1): Add code to demangle C++ names, when reporting inlined subroutines. * symtab.c (find_pc_sect_line): Remove erroneous code that attempted to adjust line number for first line of inlined subroutine. 2006-08-22 Caroline Tice * top.c (execute_command): Undo change from 2006-08-04: revert the strcpy back to a pointer assignment. 2006-08-21 Jason Molenda (jmolenda@apple.com) * dwarfread.c (locval): A stack of zero elements is legal. * dwarf2read.c (decode_locdesc): Ditto. 2006-08-21 Jason Molenda (jmolenda@apple.com) Patch from Will Drewry and Tavis Ormandy to address CVE-2006-4146. * dwarfread.c (locval): Don't walk off the location description stack. * dwarf2read.c (decode_locdesc): Don't walk off the location description stack. 2008-08-21 Caroline Tice * dwarf2read.c (read_inlined_subroutine_scope): Make sure the compiler generated the call site information before attempting to use it. 2006-08-04 Caroline Tice * infcmd.c (step_omce): Remove unnecessary call to inferior_event_handler. * thread.c (do_captured_thread_select): If inside and inlined function, make sure deprecated_selected_frame has a valid value. * top.c (execute_command): do strcpy of p into line rather than pointer assignment. 2006-08-03 Jason Molenda (jmolenda@apple.com) * infcall.c (_initialize_infcall): inferior_function_calls_disabled_p is only defined for native gdb's. 2006-08-03 Jason Molenda (jmolenda@apple.com) * infcall.c (_initialize_infcall): Add set/show for inferior_function_calls_disabled_p. Need to add function to note if the user set this or the target so the error message can be better than "no inf func calls for translated apps". 2006-08-02 Jim Ingham * source.c (convert_sal): Add explanatory comment. * symtab.c (find_pc_sect_line): Change a huh? comment to an explanatory one. 2006-08-02 Caroline Tice * inlining.c (rest_of_line_contains_inlined_subroutine): If the sal could not find a line number (i.e. line is 0), return a 0 immediately. 2006-08-01 Jim Ingham * (Makefile.in): Turn off the tui, since if you use it it crashes, and we don't intend to make it work. 2006-08-01 Caroline Tice * infcmd.c (annotate.h): New include statement. (mi-common.h, mi-cmds.h, mi-main.h): Remove include statements. (step_1): Don't call async_disable_stdin if we're stepping into an inlined function (i.e. not executing the inferior). (step_once): Move all the code for handling stepping into an inlined subroutine from execute_command into step_once. Also, remove code that calls mi routines and forces gdb_prompt, and add call to inferior_event_handler. * top.c (mi-common.h, mi-cmds.h, mi-main.h): Remove include statements. (execute_command): Remove code for handling stepping into inlined subroutine; move it to step_once. 2006-07-27 Caroline Tice * dwarf2read.c (struct inlined_call_record): Add two new fields, decl_file_index and decl_line, to record actual decl location of inlined subroutine (before it got inlined). (dwarf2_add_to_list_of_inlined_calls): Add two new parameters, decl_file and decl_line; use those to fill in new fields in inlined_call_records. (read_inlined_subroutine_scope): Get the decl location for inlined subroutine from its abstract_origin die, and pass the information to dwarf2_add_to_list_of_inlined_calls. (check_inlined_function_calls): Add two new parameters, cu and comp_dir; check to see if required subfile has not been created yet, and if not, create it. Also, if inlined subroutine is declared in one file but inlined in a different file, make sure the INLINED_SUBROUTINE_LT_ENTRY goes into the linetable for the declaration file, and the INLINED_CALL_SITE_LT_ENTRY goes into the linetable for the call site file. (dwarf_decode_lines): Add two new arguments, cu and comp_dir, to calls to check_inlined_function_calls. * infcmd.c (step_once): Look for INLINED_CALL_SITE sal entry, rather than INLINED_SUBROUTINE sal entry, when stepping into an inlined subroutine. * inlining.c (print_inlined_frame): Use line number from sal rather than trying to get line number from previous frame. (rest_of_line_contains_inlined_subroutine): Fix while loop to not skip last iteration; add check for INLINED_CALL_SITE_LT_ENTRY. * symtab.c (gdb_assert.h): Add new include statement. (find_pc_sect_line): Completely re-write the portion of this dealing with finding and returning line table entries for inlined subroutines, so it can properly deal with multiple entries across multiple line tables from different symbol tables (files). 2006-07-27 Stan Shebs * checkpoint.c (subsystem_checkpointing): New global. (collect_checkpoint, rollback_to_checkpoint): Use it. (_initialize_checkpoint): New settable variable subsystem-checkpointing. 2006-07-26 Stan Shebs Fixes from Jim Ingham: * checkpoint.c (load_helpers): Terminate string properly, warn about dlopen results. (sigterm_handler): New function, clears checkpoint forks. (_initialize_checkpoint): Install it. 2006-07-21 Stan Shebs * checkpoint.c (inferior_call_checkpoints): New global. (maybe_create_checkpoint): Test it. (begin_inferior_call_checkpoints, end_inferior_call_checkpoints): New functions. (rollback_to_checkpoint): Move rolling_back outside of external subsystem rollbacks. * infcall.c (hand_function_call): Call the begin and end functions above. 2006-21-2006 Jim Ingham * symfile.c (check_for_matching_uuid): Fix a warning message. 2006-07-18 Jason Molenda (jmolenda@apple.com) * amd64-tdep.c (amd64_analyze_prologue): Skip over fix-and-continue generated nop insns when looking for the prologue. 2006-07-18 Stan Shebs * checkpoint.c (max_checkpoints): New global. (prune_checkpoint_list): New function. (finish_checkpoint): Call it. (collect_checkpoint): Use correct checkpoint id in CG call. (delete_checkpoint): Update last_checkpoint correctly. (delete_checkpoint_command): Better looping for mass deletion. (set_max_checkpoints): New function. (_initialize_checkpoint): New command "set max-checkpoints". * checkpoint.h (struct checkpoint *): New field "keep". 2006-07-18 Jim Ingham * inferior.h: Declare make_cleanup_suppress_hook_stop. * infrun.c: (make_cleanup_suppress_hook_stop, do_cleanup_suppress_hook_stop): New functions. (hook_stop_stub): Check whether we are suppressing the stop hook. * parse.c (parse_exp_in_context): Disable the stop hook before starting to parse. 2006-07-17 Jason Molenda (jmolenda@apple.com) * top.c: Include "checkpoint.h" * infcmd.c (rx_cp, active_checkpoint): Declare these as their actual type. * checkpoint.c: Include necessary std header files. * checkpoint.h: Add prototypes for clear_all_checkpoints, checkpoint_compare. 2006-07-14 Stan Shebs * checkpoint.c (load_helpers): Change dylib name. 2006-07-13 Jason Molenda (jmolenda@apple.com) * infcmd.c (_initialize_infcmd): Update 'attach' documentation to note Apple local extensions. * main.c (captured_main): Recognize a new --waitfor command line argument. 2006-07-13 Jim Ingham * varobj.c (new_variable): Initialize path_expr to NULL. 2006-07-13 Stan Shebs * checkpoint.c (load_helpers): New function. (collect_checkpoint): Call it. 2006-07-12 Caroline Tice * Makefile.in (SFILES): Add inlining.c (inlining_h): New definition. (BASE_OBS): Add inlining.o (breakpoint.o): Add inlining_h (dwarf2read.o, frame.o, frame_unwind.o, infcmd.o, infrun.o): Likewise. (inlining.o): New definition. (linux-thread_db.o, ocd.o, remote-e7000.o, remote-mips.o): Add inlining_h. (remote-rdp.o, stack.o, thread.o, top.o, tracepoint.o): Likewise. (mi-cmd-stack.o, mi-main.o): Likewise. * breakpoint.c (inlining.h): New include statement. (print_it_typical): Add case for bp_inlined_breakpoint. (bpstat_stop_status): Modify condition comparing frames if an INLINED_FRAME is involved; call inlined_subroutine_adjust_position_for_breakpoint if the inferior hit a bp_inlined_breakpoint breakpoint. (bpstat_what): Add case for bp_inlined_breakpoint. (print_one_breakpoint): Add info for bp_inlined_breakpoint. Add case for bp_inlined_breakpoint. (user_settable_breakpoint): Add case for bp_inlined_breakpoint. (allocate_bp_location): Likewise. (disable_breakpoints_in_shlibs): Add bp_inlined_breakpoint to condition. (mention): Add case for bp_inlined_breakpoint. (create_breakpoints): Add call to check_for_additional_inlined_breakpoint_locations, and recursive call to create_breakpoints, if appropriate. (breakpoint_re_set_one): Add case for bp_inlined_breakpoint. (breakpoint_re_set_all): Likewise. (disable_command): Likewise. (enable_command): Likewise. (write_one_breakpoint): Likewise. (save_breakpoints_command): Add check for bp_inlined_breakpoint. * breakpoint.h (enum bptype): Add new type, bp_inlined_breakpoint. * buildsym.c (record_line): Add two new parameters to the function, END_PC and ENTRY_TYPE, corresponding to the two new fields in line table entries. Also use the new values passed in when creating the new line table entry. * buildsym.h (record_line): Change function declaration to match new parameters. * coffread.c (coff_symtab_read): Modify calls to record_line to pass in the two new arguments. (enter_linenos): Likewise. * corelow.c (inlining.h): New include statement. (core_open): Add call to clear_inlined_subroutine_print_frames after print_stack_frame. * dbxread.c (process_one_symbol): Modify calls to record_line to pass in the two new arguments. * dummy-frame.c (dummy_frame_push): Add call to inlined_subroutine_save_before_dummy_call. * dwarf2read.s (inlining.h): New include statement. (struct inlined_call_record): New struct. (inlined_call_sites): New global variable. (dwarf2_allow_inlined_stepping): New set/show global variable. (read_inlined_subroutine_scope): New function. (process_die): Add call to read_inlined_subroutine_scope for inlined_subroutine dies, if dwarf2_allow_inlined_stepping is set. (dwarf2_add_to_list_of_inlined_calls): New function. (check_inlined_function_calls): New function. (dwarf_decode_lines): Add call to check_inlined_function_calls after each call to record_line; and add the two new arguments to calls to record_line. (new_symbol): Add case for DW_TAG_inlined_subroutine. (_initialize_dwarf2_read): Add call to add_setshow_boolean_cmd, to set up dwarf2_allow_inlined_stepping to be a set/show gdb variable. * dwarfread.c (decode_line_numbers): Add two new arguments to call to record_line. * frame_unwind.c (inlining.h) New include statement. (frame_unwind_init): Add inlined_frame_unwind to the table immediately after the dummy_frame_unwind; Make the insertion point fort OSABI sniffers to come after the inlined_frame_unwind. * frame.c (inlining.h): New include statement. (fprint_frame_type): Add case for INLINED_FRAME. (frame_unwind_id): Add an extra level of unwinding if the frame type is iNLINED_FRAME. (flush_cached_frames): Add call to flush_inlined_subroutine_frames. (get_prev_frame_1): Modify conditions of various error checks to take INLINED_FRAMEs properly into account. (get_prev_frame): Likewise. (find_frame_sal): Modify to cope properly with the linked list of SALs that may be returned for a PC at an inlined subroutine call. (inlined_frame_prev_register): New function. * frame.h (INLINED_FRAME): New frame type. * hpread (hpread_record_lines): Modify calls to record_line to pass in the two new arguments. (hp_process_one_debug_symbol): Likewise. * infcall.c (hand_function_call): Add call to inlined_subroutine_restore_after_dummy_call. * infcmd.c (mi/mi-common.h) New include statement. (mi/mi-cmds.h) Likewise. (mi/mi-main.h) Likewise. (inlining.h) Likewise. (run_command_1): Add code to properly initialize global_inlined_call_stack. (step_once): Add code to cope with 'next' over an inlined function or the final 'step' into an inlined subroutine (the step into the innermost inlined subroutine). Also code to help deal with an inlined subroutine within a larger source line being 'next'ed over or 'step'ed into. (finish_command): Added code to correctly finish from inside an inlined subroutine. * inferior.h (insert_step_resume_breakpoint_at_sal): Add extern function declaration (the function used to be static, inside infrun.c). * infrun.c (inlining.h): New include statement. (prepare_to_proceed): Check to see if the stop_pc has changed since the last time global_inlined_call_stack was updated, and if so re-update global_inlined_call_stack. (handle_inferior_event): Likewise; also fix struct types for prev_frame declarations (make them frame_info instead of frame); (insert_step_resume_breakpoint_at_sal): Remove "static" qualifier on function; also check to see if the breakpoint is at the exit of an inlined subroutine, and if so, adjust the global_inlined_call_stack appropriately. (normal_stop): Add call to clear_inlined_subroutine_print_frames after print_stack_frame. Also, if a dummy call just ended, call inlined_subroutine_restore_after_dummy_call, then check to see if stop_pc has changed since last time global_inlined_call_stack was updated, and if so re-update it * inlining.c : New file. * inlining.h : New file. * linux-thread-db.c (inlining.h): New include statement. (check_event): Check to see if the stop_pc has changed since the last time global_inlined_call_stack was updated, and if so re-update global_inlined_call_stack. * mdebugread.c (psymtab_to_symtab_1): Modify call to record_line to pass in two new arguments. * ocd.c (inlining.h): New include statement. (ocd_start_remote): Check to see if the stop_pc has changed since the last time global_inlined_call_stack was updated, and if so re-update global_inlined_call_stack. Also, call clear_inlined_subroutine_print_frames after print_stack_frame. * remote-e7000.c (inlining.h): New include statement. (e7000_start_remote): Check to see if the stop_pc has changed since the last time global_inlined_call_stack was updated, and if so re-update global_inlined_call_stack; also call clear_inlined_subroutine_print_frames after print_stack_frame. * remote-mips.c (inlining.h): New include statement. (common_open): Check to see if the stop_pc has changed since the last time global_inlined_call_stack was updated, and if so re-update global_inlined_call_stack. Also call clear_inlined_subroutine_print_frames after print_stack_frame. * remote-rdp.c (inlining.h): New include statement. (remote_rdp_open): Check to see if the stop_pc has changed since the last time global_inlined_call_stack was updated, and if so re-update global_inlined_call_stack. Also call clear_inlined_subroutine_print_frames after print_stack_frame. * stack.c (inlining.h): New include statement. (print_frame_info): Add code to print out correct locations if inside an inlined subroutine. (print_frame): Check to see if user is inside an inlined subroutine and if the current frame is an INLINED_FRAME. Call print_inlined_frame if appropriate. Modify the source line printed if user is inside an inlined subroutine. For inlined function call sites, get the symtab from the current global_inlined_call_stack record. (backtrace_command_1): If the user is inside an inlined subroutine, print out information about what was inlined where before printing out normal information. (select_and_print_frame): Call clear_inlined_subroutine_print_frames after print_stack_frame. (frame_command): Likewise. (current_frame_command): Likewise. (up_command): Likewise. (down_command): Likewise. (return_command): Check to see if user is inside inlined subroutine; if so, tell the user what has been inlined into what (for current) position, before outputting return prompt question; Add call to inlined_subroutine_restore_after_dummy_call if returning from a dummy frame. * symtab.c (init_sal): Initialize new fields, entry_type and next. (find_pc_sect_line): Modify it to check for inlined subroutine line table entries and returned a linked list of sals if found; added/moved code so inlined function entries wouldn't be lost if multiple symbol tables/files are used. * symtab.h (enum line_table_entry_type): New type, for classifying line table entries. Current enums are: NORMAL_LT_ENTRY, INLINED_SUBROUTINE_LT_ENTRY, INLINED_CALL_SITE_LT_ENTRY. (struct linetable_entry): Add two new fields, end_pc and entry_type. (struct symtab_and_line): Add two new fields, entry_type and next. * thread.c (inlining.h): New include statement. (info_threads_command): Add calls to clear_inlined_subroutine_print_frames after print_stack_frame. (switch_to_thread): Check to see if the stop_pc has changed since the last time global_inlined_call_stack was updated, and if so re-update global_inlined_call_stack. (restore_current_thread): Add call to clear_inlined_subroutine_print_frames after print_stack_frame. (do_captured_thread_select): Likewise. * top.c (mi/mi-common.h): New include statement. (mi/mi-cmds.h): Likewise. (mi/mi-main.h): Likewise. (inlining.h): Likewise. (execute_command): Check to see if the user requested a 'step' and is at the call site of an inlined subroutine. If so, change the user's context without actually running the inferior. * tracepoint.c (inlining.h): New include statement. (finish_tfind_command): Add call to clear_inlined_subroutine_print_frames after print_stack_frame. * xcoffread.c (enter_line_range): Add two new arguments to call to record_line. 2006-07-08 Stan Shebs * checkpoint.c (CP_FORK_NAME): Macrofy fork function name. (collect_checkpoint): Use it, also add call for CG state save. (rollback_to_checkpoint): Add call for CG state restore, use rollback_stop(). (warned_cg): New global. (clear_all_checkpoints): Clear rolled_back. * infrun.c (rollback_stop): New function, modified normal_stop. (proceed): Disable resume-from-rollback warning for now. 2006-07-07 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_all_digits_exhaustive): Initialize sal with 0x0 addrs so a non-match is correctly detected, e.g. a breakpoint on a source line past the end of the file. 2006-07-05 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_line_1): Fix logic in cond expr that avoids objc method lookups for "main" and "exit". 2006-06-28 Greg Clayton * symfile.c (find_separate_debug_file): Use Apple-specific version of this function to find dSYM files when __APPLE__ is defined instead of using NM_NEXTSTEP. NM_NEXTSTEP isn't defined for cross-gdb's but we still need to look for dSYM files in those cases. 2006-06-23 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_line_1): Also don't look for ObjC methods named "error". 2006-06-23 Jason Molenda (jmolenda@apple.com) * configure.ac: Substitute UNIX03_UGH_CFLAGS in the Makefile. Set __DARWIN_UNIX03 to 0 to use pre-conformant headers/functions. * Makefile.in: Add UNIX03_UGH_CFLAGS to various CFLAGS. 2006-06-13 Jim Ingham * Makefile.in: Uncomment the LIBXML2 variables * config.in: Put the LIBXML2 defines back (lost in the merge.) 2006-06-12 Jim Ingham * charset.c: Add a utf-8 charset. (utf_8_print_literally): New function. (utf_8_to_control): New function. (utf_8_family_charset): New function. (register_charset): Register it. * configure.ac: Make UTF-8 the macosx native default. 2006-06-11 Stan Shebs * checkpoint.c (create_checkpoint_command): Add a check. (collect_checkpoint): Improve cpfork lookup, use direct_memcache_get. (delete_checkpoint): New. (map_checkpoint_numbers): New. (clear_all_checkpoints): Rename from clear_checkpoints. (_initialize_checkpoint): Add checkpoint deletion command. * infcmd.c (kill_if_already_running): Clear checkpoints. (attach_command): Ditto. * top.c (quit_target): Ditto. * infrun.c (proceed): Query about proceeding after rollback. 2006-06-05 Jim Ingham * valops.c (allocate_string_in_inferior): New function. (value_clear_inferior_string_pool): New function. (value_string): use allocate_string_in_inferior. * target.c (generic_mourn_inferior): Clear out string pool. * values.h: define value_clear_inferior_string_pool. 2006-06-01 Jim Ingham * source.c (set_pathname_substitution): New function. (_initialize_source): Add set_pathname_substution as the set function. 2006-06-01 Jason Molenda (jmolenda@apple.com) * Makefile.in (gdb): Remove MACOSX_DEPLOYMENT_TARGET setting; it was only needed while we were weak linking to Carbon. 2006-06-01 Jim Ingham (jingham@apple.com) * varobj.c (varobj_create): Check the return from gdb_value_fetch_lazy, and set error if it fails. (varobj_update): Call value_fetch_lazy on the new value if necessary, and handle the error if this doesn't work. 2006-05-30 Jason Molenda (jmolenda@apple.com) * configure.ac: Link to Carbon normally, not weak. * configure: Regenerated. 2006-05-30 Jim Ingham * varobj.c (varobj_get_type_index_from_fake_child): Skip static fields. (cplus_real_type_index_for_fake_child_ind): Ditto. 2006-05-25 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_oso_nlists): Do ingest file static variables which have had a ".[0-9]+" suffix added by the compiler. 2006-05-24 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Only skip the first character of the name if it is the bfd_prefix_char, i.e. don't skip the first char of ObjC method function names. (read_oso_nlists): Don't create OSO nlist records for artifical nlist entries that contain "." in the names. 2006-05-24 Jason Molenda (jmolenda@apple.com) * Makefile.in (gdb): Set MACOSX_DEPLOYMENT_TARGET when doing the final app link to avoid weak linking warnings from the static link editor. 2006-05-23 Jim Ingham * configure.ac: If the carbon framework exists, weak link to it. * Makefile.in: Add the carbon framework weakly to the gdb link. * infrun.c (normal_stop): Move the call to the stop_command to AFTER the point where the bottom frame is set. Otherwise the hook-stop commands will get the old version of the cursal, not the current one. 2006-05-23 Jason Molenda (jmolenda@apple.com) * objc-lang.c: Update for 64-bit objc runtime. (get_addrsize): New function. May prove to be too inefficient to fetch this every time; possibly cache the value and dirty the cache when exec_bfd is changed. (print_object_command): Whitespace fixes; treat address values as such. (read_objc_method): Updated for 64 bit objc runtime. (read_objc_method_list_nmethods): Ditto. Renamed from read_objc_methlist_nmethods to be consistent with the structure name in the objc runtime. (read_objc_method_list_method): Ditto. (read_objc_object): Updated for 64 bit objc runtime. (read_objc_super): Ditto. (read_objc_class): Ditto. (find_implementation_from_class): Ditto. (value_objc_target_type): Ditto. 2006-05-22 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_line_1): Don't do method lookup for "main". 2006-05-17 Jason Molenda (jmolenda@apple.com) * target.c (deprecated_debug_xfer_memory): Use paddr_nz to print addresses, not any of the printf builtin formatters. (debug_to_insert_breakpoint): Ditto. (debug_to_remove_breakpoint): Ditto. 2006-05-15 Jim Ingham * objfiles.c (objfile_set_load_state): Discriminate between real error and the user not requesting auto-loading. (objfile_name_set_load_state): Ditto. 2006-05-11 Jim Ingham * config/xm-macosx.h: Include signal.h. * fork-child.c (startup_inferior): Recognize a crash in the shell instead of in the inferior process and flag it as such. 2006-05-10 Greg Clayton (gclayton.com) * dbxread.c (read_dbx_symtab): Skip adding any debug map symbols when we have a dSYM file. * symfile.c (symbol_file_add_with_addrs_or_offsets): Moved the code that locates and parses the dSYM file for a given objfile to happen before syms_from_objfile() gets called. When we know if a dSYM file exists and is that the UUIDs match for a given executable before calling syms_from_objfile(), we will know wether to ignore the debug map entries we may find in the main executable. * elfread.c (elf_symtab_read): Change #ifdef condition that surrounds msym->filename code to only be enabled for when SOFUN_ADDRESS_MAYBE_MISSING is defined and NM_NEXTSTEP is NOT defined since we don't need the filename member for OS X development. The only place that sets this member is in elfread.c. * symmisc.c (dump_msymbols): Ditto. * symtab.h (struct minimal_symbo): Ditto. * minsyms.c (lookup_minimal_symbol): Ditto. (prim_record_minimal_symbol_and_info): Added initialization for the filename member of minimal_symbol since it was not getting initialized to NULL. 2006-05-09 Jason Molenda (jmolenda@apple.com) * procfs.c (proc_update_threads): Fix flipped bit in a comment from cosmic ray hitting cvs server or something. 2006-05-02 Jason Molenda (jmolenda@apple.com) * environ.c (smuggle_dyld_settings): dyld no longer truncates DYLD_FRAMEWORK_PATH etc to an empty string; it now excludes it entirely from the child's environment. Fix logic in this function to handle that correctly. 2006-05-02 Stan Shebs * checkpoint.h (enum cp_type): New, for types of checkpoints. (struct checkpoint): Add type and logical prev/next fields. * checkpoint.c: General redesign to use new fields, various cleanup. (_initialize_checkpoint): New commands "redo" and "now". * infrun.c (normal_stop): Move auto-checkpointing to end. 2006-03-28 Eric Albert (ejalbert@apple.com) * i386-tdep.h (struct gdbarch_tdep): Update the comment for wordsize to account for x86-64. 2006-03-23 Eric Albert (ejalbert@apple.com) * config/i386/macosx.mt (TDEPFILES): Add amd64-tdep.o. 2006-04-28 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (create_current_active_funcs_list): Don't xstrdup a NULL char* like we tend to have in DWARF programs. 2006-04-27 Jason Molenda (jmolenda@apple.com) * dbxread.c (record_minimal_symbol): Update DBX_TEXT_SECTION et al to use a struct obj_section instead of BFD asection. (dbx_symfile_init): Don't initialize DBX_TEXT_SECTION et al here. We don't use this code path so I'm not updating it to the new behavior. * gdb-stabs.h: (struct dbx_symfile_info): Update text_section et al to struct obj_sections. 2006-04-21 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Add function static data to the psymtab w/ its mangled name; put static data in the static psymtab table, not the global one. * dwarf2read.c (convert_oso_map_to_final_map): Look up names from the .o file nlist records in the psymtab instead of an unscoped global lookup via minimal_symbol_lookup to get the correct one. (read_file_scope): Prefer the psymtab's textlow/texthigh settings when a debug map was processed - it will have the correct range of addresses that functions are contained within. * symtab.h (lookup_minimal_symbol_by_pc_section_from_objfile): Add prototype. 2006-04-19 Jim Ingham * varobj.c (c_value_of_variable): Ensure the varobj's child count is initialized before printing. 2006-04-17 Jim Ingham * varobj.c (varobj_value_struct_elt_by_index): Do the work of value_struct_elt, but look up by index in the TYPE_FIELDS array instead of by name. (varobj_lookup_struct_elt_type_by_index): Ditto for lookup_struct_elt_type. (varobj_get_type_index_from_fake_child): New function. (cplus_make_name_of_child): Use varobj_get_type_index_from_fake_child. (create_child): Use the index to create the anonymous child names. This makes testsuites easier to write... (c_value_of_child); Don't use the element name to lookup the child, it's not unique for anonymous structures & unions. (c_type_of_child): Ditto. (cplus_value_of_child): Ditto. (cplus_type_of_child): Ditto. 2006-04-17 Jason Molenda (jmolenda@apple.com) * objfiles.c (objfile_relocate): Relocate the deprecated_sym_stab_info (aka DBX_SYMFILE_INFO) member of the struct objfile along with everything else. 2006-04- Greg Clayton (gclayton.com) * symfile.c (find_separate_debug_file): We now search for dSYM files at one extra location for bundles where we do not strip the executable bundle extension before appending the dSYM bundle path information. 2006-04-13 Jason Molenda (jmolenda@apple.com) * symtab.c (symbol_set_names): Demangle the symbol name even if a demangled version is found in the cache so that the symbol's language is correctly initialized. * dbxread.c (read_dbx_symtab): Add GSYMs to the psymtab. 2006-04-13 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (struct dwarf2_cu): Add comp_dir field. (read_file_scope): Set comp_dir. (dwarf_decode_lines): Pass cu->comp_dir. (dwarf2_start_subfile): If dirname is relative, prepend comp_dir. (build_dummy_cu): Copy over comp_dir setting. 2006-04-11 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (translate_debug_map_address): Note whether the highpc was set on the failing lookup. (dwarf2_get_pc_bounds): If no address attributes found, don't try to translate the 0's. 2006-04-11 Jason Molenda (jmolenda@apple.com) * dwarf2read.c: Add "set debug debugmap" switch to get information about how addresses are being translated by the DWARF debug map between the .o file and the executable. (show_debug_debugmap): New function. (translate_debug_map_address): Print translation results when 'set debug debugmap 1'. (translate_common_symbol_debug_map_address): Ditto. (dwarf_decode_lines): Indicate start & end of line program processing for easier reading of the output. 2006-04-11 Jason Molenda (jmolenda@apple.com) * objfiles.c (make_cleanup_restrict_to_shlib): Whitespace cleanup. * linespec.c (intersect_sals, decode_line_1): Ditto. 2006-04-05 Stan Shebs * dwarf2loc.c (dwarf2_evaluate_loc_desc): Handle DW_op_pieces better. 2006-03-31 Greg Clayton (gclayton@apple.com) * objc-lang.c (value_objc_target_type): Modified the function to be able to look into the class heiarchy generated by DWARF for objective C to find the "isa" member for dynamic typing. 2006-03-31 Jim Ingham * cli/cli-cmds.c (ambiguous_line_spec): Check first to make sure that the linespecs point to different file:lines. Return whether it was ambiguous or not. (edit_command): Use the return value from ambiguous_line_spec. (list_command): Ditto. * linespec.c (decode_line_1): Handle the case where a file:line match generated multiple hits, and some of the hits were on the file:line, but others were because the file was included, but it didn't get any code from the given line. 2006-03-31 Greg Clayton (gclayton@apple.com) * symfile.c (check_for_matching_uuid): removed unused variable named 'uuid_size'. (add_objfile_prefix): New function for append_psymbols_as_msymbols() that will correctly prefix minsym names. (find_section_for_addr): New function for append_psymbols_as_msymbols() that will find the best section in an objfile for a partial symbol address. (append_psymbols_as_msymbols): New function that appends minsyms to an objfile by translating it's dSYM partial symbols. Debugging fully stripped executables with a dSYM file now has better stepping abilities. (symbol_file_add_with_addrs_or_offsets): We now generate minsyms for objfiles that have dSYM files in case the executable has been stripped. * ppc-macosx-frameinfo.c (ppc_frame_function_properties): Check this_frame against NULL before calling get_frame_pc() since that can crash gdb. Both 'this_frame' and 'bounds' can be NULL when an executable has been stripped and when get_prev_frame() determines that we are inside the 'main' function. * dbxread.c (record_minimal_symbol): Fixed address range comparisons to be inclusive of the low address for the __text and __textcoal_nt sections. 2006-03-30 Jason Molenda (jmolenda@apple.com) * gdbtypes.c (make_cv_type): Fix conditional expression for returning builtin_type_error. 2006-03-30 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf2_get_pc_bounds): Fix double-translating of DW_AT_ranges addresses when processing a debug map. 2006-03-30 Jason Molenda (jmolenda@apple.com) * gdbtypes.c (make_cvs_type): Return builtin_type_error and try to continue instead of asserting and exiting the debugger when our target is an error/invalid type. Paper over invalid stabs definitions as best we can. 2006-03-28 Stan Shebs * defs.h (lval_type): Add new enum lval_register_literal. * eval.c (evaluate_subexp_standard): Use it when evaluating literal register references. * valops.c (value_assign): Test it when deciding whether to use CONVERT_REGISTER_P code. * frame.c (put_frame_register): Add lval_register_literal case. * breakpoint.c (can_use_hardware_watchpoint): Ditto. 2006-03-28 Jim Ingham (jingham@apple.com) * cp-abi.c (is_destructor_name): Check for the destructor name being unmangled. * linespec.c (collect_methods): Ditto. * symtab.c (skip_non_matching_bfd): fix up the logic and make it clearer. 2006-03-28 Jason Molenda (jmolenda@apple.com) * frame.h: Provide prototype for inside_main_func. * config/i386/tm-i386-macosx.h: Include tm-i386-macosx.h. 2006-03-28 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (set_cu_language): Recognize DW_LANG_ObjC and DW_LANG_ObjC_plus_plus. 2006-03-28 Stan Shebs (shebs@apple.com) * checkpoint.c (_initialize_checkpoint): Make rollback command "rollback" instead of "rb". 2006-03-28 Jim Ingham (jingham@apple.com) * configure.ac: Disable TUI by default. 2006-03-28 Eric Albert (ejalbert@apple.com) * i386-tdep.h (struct gdbarch_tdep): Update the comment for wordsize to account for x86-64. 2006-03-23 Eric Albert (ejalbert@apple.com) * config/i386/macosx.mt (TDEPFILES): Add amd64-tdep.o. 2006-03-21 Jason Molenda (jmolenda@apple.com) * objfiles.h (ALL_OBJFILES_SAFE): Update to use new objfile_get_first, objfile_get_next iterator functions. * breakpoint.c (parse_breakpoint_sals): Use ALL_OBJFILES_SAFE because the objfile struct can be freed out from under us when the symbol load level is raised. 2006-03-16 Jason Molenda (jmolenda@apple.com) * blockframe.c (addr_inside_main_func): Revive old function. * symtab.h: Declare it. * objfiles.h (struct entry_info): New fields for main() bounds. * objfiles.c (init_entry_point_info): Init them. 2006-03-15 Jason Molenda (jmolenda@apple.com) * dwarf2read.c, linespec.c, objc-lang.c, objfiles.c: Make last checkin conform. 2006-03-15 Greg Clayton (gclayton@apple.com) * breakpoint.c (breakpoint_re_set): don't add the separate debug objfile to the restrict list anymore. * dbxread.c (open_bfd_from_oso): replaced the first two arguments with 'struct partial_symtab *pst' to allow access to the 'pst->objfile' so we can check if a separate debug file (dSYM) exists and not call the error function if one exists for the pst->objfile. (oso_scan_partial_symtab): fix the call to open_bfd_from_oso to use the new prototype. (dbx_psymtab_to_symtab_1): ditto * dwarf2read.c (dwarf2_debug_map_psymtab_to_symtab): only call error when a .o file for a debug map OSO is missing if there is no dSYM file. (dwarf2_get_pc_bounds): fixup addresses for DW_AT_ranges attributes when using dwarf with debug map. (process_structure_scope): make sure that class constants get parsed * * linespec.c (apple_sals_pushback): added new function to append a number of symtab_and_line struct entries to a symtabs_and_lines collection. (apple_intersect_sals): new function that will only add non duplicate symtab_and_line struct entries from the 'src_sals' list of symtabs_and_lines struct to 'dst_sals'. (decode_line_1): Instead of just appending two symtabs_and_lines structs, we now make sure there are no duplicates. Duplicates can be found due if a dwarf with debug maps executable is used along with a dSYM file. A memory leak was also plugged from the 'this_result.sals' member. (decode_compound): removed unused variables 'values' and 'sym_arr' * objc-lang.c (find_methods): restrict the scope of the search when calling find_pc_sect_function() to the current objfile that we already have else we will get a recursive call that modifies the restrict list and will cause an infinite loop. * objfiles.c (objfile_add_to_restrict_list): stop separate debug objfiles from being able to be added to the restrict list. We will add the main objfile for a separate debug objfile if someone tries to add a separate debug objfile. (make_cleanup_restrict_to_shlib): no longer add the separate debug objfiles to the restrict list as it is no longer necessary. (objfile_get_first): modified this iterator initialization routine to always return the separate debug objfile first if one exists for the first item in the restrict list. (objfile_get_next): modified this iterator function to only increment the restrict list position pointer when we are getting the next objfile for an objfile that isn't a separate debug objfile (dSYM). If the current file is a separate debug objfile (dSYM), then we return the it's original objfile as the next item to search. This helps us to guarantee that separate debug objfiles always get searched first in the restrict list and so we don't get incosistent results when we have both a debug map executable that also has a dSYM file. * symfile.h : changed the prototype for open_bfd_from_oso to match it's new type. 2006-03-15 Jim Ingham * breakpoint.c (break_command_2): If the not_found_ptr is set, assume the caller meant to return NOT_FOUND_ERROR. * linespec.c (symtab_from_filename): NOT_FOUND_ERROR is the correct error to throw here. 2006-03-15 Jim Ingham * breakpoint.c (insert_breakpoints): Catch errors in value_fetch_lazy. Mark the breakpoint as not currently set. (watchpoint_check): Don't try to check the watchpoint if it hasn't been successfully inserted yet. 2006-03-15 Jim Ingham linespec.c (decode_line_1): Make sure start_here gets set. 2006-03-15 Jim Ingham * symtab.c (find_pc_sect_psymtab): Break the ALL_PSYMTABS loop into ALL_OBJFILES and ALL_OBJFILE_PSYMTABS so you can migrate the sections test into the outer loop. 2006-03-15 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (struct oso_final_addr_tuple): Add 'oso_high_addr' and 'present_in_final' fields so each record gives its complete address range and indicates whether it was coalesced/dead-code-stripped or not. (compare_map_entries_oso_addr): Update for new field names. (convert_oso_map_to_final_map): Update for new field names. Add a tuple for functions that were coalesced/DCS'ed instead of skipping them. Fill in 'oso_high_addr' fields once the array is sorted. (compare_translation_tuples_highpc): New function for bsearch(). (compare_translation_tuples_nothighpc): Ditto. (translate_debug_map_address): Update to new field names. Use bsearch() to find the matching tuple. 2006-03-13 Jim Ingham * dbxread.c (typename_concat): Don't pass NULL prefix/suffix to functions that will crash. 2006-03-08 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_line_1): Don't try to iterate over the line table if this psymtab doesn't have one. 2006-03-08 Jim Ingham (jingham@apple.com) * symfile.c (reread_symbols): Remove merge mistake of calling clear_symtab_users() all the time. 2006-03-06 Jason Molenda (jmolenda@apple.com) * dbxread.c (open_bfd_from_oso): More informative error message when the .o file containing debug info can't be found. 2006-03-06 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Create a psymtab record when we come across a vtable and creating a debug map so we know to expand this psymtab to find a definition of that class. 2006-03-02 Jason Molenda (jmolenda@apple.com) * dbxread.c (process_one_symbol): Ignore N_OSO stabs when creating a symtab. 2006-03-02 Jim Ingham * infrun.c (handle_inferior_event): Check for a null previous frame before passing it to insert_step_resume_breakpoint_at_frame. 2006-02-24 Greg Clayton (gclayton@apple.com) * breakpoint.c (set_bp_objfile): set the breakpoint objfile to the actual executable instead of the separate debug objfile to keep the UI and test cases happy, and it also makes more sense. (breakpoint_re_set): add the separate_debug_objfile to the restrict list when resetting breakpoints to make sure we can find our breakpoint again. * dwarf2read.c (dwarf_decode_lines): fixed an issue where an extra psymtab was being created for an already existing and valid source file due to a mismatch in relative and absolute paths. * fix-and-continue.c (file_exists_p): made file_exists_p global instead of static so it can be reused by find_separate_debug_file() in symfile.c. * defs.h (file_exists_p): Add prototype. * objfiles.c (objfile_remove_from_restrict): removed unused variables named 'cached_symfile_dir' and 'check_timestamp'. (objfile_delete_from_ordered_sections): return if we run into a separate debug objfile and do not delete since these will never get added in the first place and would cause unnecessary warnings. (objfile_add_to_ordered_sections): return if we run into a separate debug objfile and do not add sections since these are not needed by the program and can cause false matches to non-existent code. (free_objfile): correctly set the separate_debug_objfile member to NULL if the member gets freed to avoid a stale pointer from existing. (find_pc_sect_section): do not check any separate debug objfiles when looking for pc sections as they are not valid code. (push_front_restrict_list): added for make_cleanup_restrict_to_shlib to keep the code common since it is used more than once. (clear_restrict_list): added for make_cleanup_restrict_to_shlib to keep the code common since it is used more than once. (make_cleanup_restrict_to_shlib): always add an objfile and it's separate debug objfile (dSYM) when restricting things to a specific shared library so we can find symbols for things in our separate debug object files. (_initialize_objfiles): remove unused variable named 'c'. * objfiles.h : added a new objfile->flags bit called OBJF_SEPARATE_DEBUG_FILE so we can stop a separate debug objfile (dSYM) from being added to the ordered section list since it gets added while the separate debug objfile is being created and before the 'separate_debug_objfile_backlink' member can be correctly set. * symfile.c (copy_section_addr_info): fixed the copy function to copy all members including the apple local member addrs_are_offsets. (place_section): removed unused variable named 'cur_offset'. (check_for_matching_uuid): added function that can match the UUID of two files (the executable and the separate debub objfile (dSYM)) to make sure we are using the correct debug information for an executable and post a warning if we have a mismatch. (symbol_file_add_with_addrs_or_offsets): add the OBJF_SEPARATE_DEBUG_FILE to the symbol_file_add() function call to make sure we know we are creating a separate debub objfile (dSYM) and so that we don't try to add it's section list to the ordered section lists and check the UUID of the two files to make sure we have the correct files. (get_debug_link_info): remove unused variable named 'p'. (find_separate_debug_file): Created an Apple specific version that looks for a dSYM file. (find_sym_fns): removed an unused variable named 'our_target'. (generic_load): removed unused variables. (reread_separate_symbols): Fixed a stale pointer issue with objfile->separate_debug_objfile after it gets freed and add the OBJF_SEPARATE_DEBUG_FILE flag to the creation args for the new separate debug objfile (dSYM) to make sure it's sections don't get added to our ordered section list. We also check the UUID to ensure proper executable and debug object file matching. Fixed a memory leak with the "debug_file" string. * symtab.c (skip_non_matching_bfd): added a function to centralize some code that was being pasted about that got more complex after adding dSYM support. (find_pc_sect_psymtab): now use skip_non_matching_bfd() function to check for matching objfile or separate debug objfile. (find_pc_sect_symtab): ditto. 2006-02-24 Jim Ingham (jingham@apple.com) * linespec.c (symtab_from_filename): Set not_found_ptr before throwing an error. 2006-02-24 Jim Ingham (jingham@apple.com) * utils.c (internal_vproblem): Print the reason we're exiting when unexpectedly exiting in MI mode. (query): Indicate an auto-answered answer. 2006-02-24 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (translate_common_symbol_debug_map_addres): Correctly handle the case where there is no debug map. 2006-02-24 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (translate_debug_map_address): Return a status value as well as take a new flag indicating whether the address being translated is a DW_AT_high_pc or not. (process_full_comp_unit): Update call to translate_debug_map_address. Handle the case where the function at that address is not in the executable. (read_file_scope): Ditto. (dwarf2_get_pc_bounds): Ditto. (read_partial_die): Ditto. (var_decode_location): Ditto. (new_symbol): Ditto. (dwarf2_const_value): Ditto. (decode_locdesc): Ditto. (dwarf_decode_lines): Don't record lines if the last address seen did not make the final executable. Assumes we have a DW_LNE_set_address at least at the beginning of functions. 2006-02-22 Jason Molenda (jmolenda@apple.com) * linespec.c (add_matching_methods): If the method name isn't a mangled name prepend the containing class name and do a lookup_symbol on the qualified source function name. 2006-02-22 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf2_debug_map_psymtab_to_symtab): Mark psymtab as read in once we've read it in. * dbxread.c (read_dbx_symtab): Handle cases where the first function listed in a compilation unit's debug map is not the lowest address function. 2006-02-20 Stan Shebs * breakpoint.c (do_captured_breakpoint): Update comments, merge issues were resolved. 2006-02-13 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_follow_jump): Don't follow the jump if we're (unnecessarily, sigh) examining a dyld stub trampoline. * dwarf2read.c (convert_oso_map_to_final_map): Don't add the slide for a minsyms that's absolute. * objc-lang.c (find_objc_msgsend): Re-enable code which allows for a msgsend function to be the last one in an objfile and still get the range right. 2006-02-07 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (translate_debug_map_address): Correctly handle the case where a debug map is not being used. 2006-02-07 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_oso_nlists): Fix off by one error when resizing nlists/common symbols array. 2006-02-07 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_oso_nlists): Create both the nlists array as well as the common_symnames array of common symbol names that were discovered in the .o file. * symfile.h: Update prototype for read_oso_nlists. * dwarf2read.c (struct oso_to_final_addr_map): In addition to the {name, .o file addr, final addr} tuple array add an array of {name, final addr} pairs for common symbols which have no address in the .o file. (compare_map_entries_name): Callback function for qsort. (convert_oso_map_to_final_map): Create common symbol pairs array in addition to regular address tuple array. (free_address_map): Free the common symbol names as well. (translate_common_symbol_debug_map_address): New function to look up potential common symbols. (dwarf2_debug_map_psymtab_to_symtab): Create the common symbols array as well. (var_decode_location): If the address of something in the dwarf says it is at 0x0, see if the symbol is in the common symbols array before following the usual DEBUGMAP_XLATE procedure. 2006-02-07 Jason Molenda (jmolenda@apple.com) * dbxread.c: Include mach-o.h (read_dbx_symtab): Don't set up a PSYMTAB_OSO_STATICS list; I ended up not using that in the final implementation. (read_oso_nlists): Remove unused variables. Don't return anything. * symfile.h: Update read_oso_nlists prototype. 2006-02-06 Jason Molenda (jmolenda@apple.com) * defs.h: Include . 2006-02-06 Greg Clayton (gclayton@apple.com) * varobj.c (varobj_create): NULL out block_found before evaluating the variable expression to avoid a situation where member variables in objective C may not evaluate correctly when a block is specified due to the expression parser using a stale value from a previous expression. 2006-02-03 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (convert_oso_map_to_final_map): Factor off slide offset when adding address to translation table. 2006-02-01 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf2_debug_map_psymtab_to_symtab): Need to initialize the type_hash element or we'll jump into random memory later on. 2006-02-01 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf2_debug_map_psymtab_to_symtab): Call my own psymtab-to-symtab converter, not the regulard dwarf one. 2006-02-01 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf2_debug_map_psymtab_to_symtab): Process the dependencies of a pst before trying to process the pst. Don't try to read an OSO for a header file. 2006-02-01 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (translate_debug_map_address): Handle function as last symbol in file correctly. 2006-02-01 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (convert_oso_map_to_final_map): Don't leak memory. (translate_debug_map_address): Handle a compilation unit with one symbol correctly. (dwarf_decode_lines): Don't re-translate addresses who've had an offset added to them. 2006-01-31 Jason Molenda (jmolenda@apple.com) * dwarf2read.c: Final part of DWARF debug map support. (DEBUGMAP_XLATE): New macro. (struct oso_final_addr_tuple, oso_to_final_addr_map): New structs. (struct dwarf2_cu): New element, addr_map. (dwarf2_has_info): Move contents into.. (dwarf2_has_info_1): Here. (dwarf2_build_psymtabs): Move the section of this function that reads the dwarf sections into memory into.. (dwarf2_copy_dwarf_from_file): Here. (compare_map_entries): New. (convert_oso_map_to_final_map): New. (free_address_map): New. (translate_debug_map_address): New. (dwarf2_debug_map_psymtab_to_symtab): New. (load_full_comp_unit): Take an addr_map parameter. (process_full_comp_unit): Pass addresses through DEBUGMAP_XLATE. (dwarf2_get_pc_bounds): Ditto. (dwarf2_read_section): Take a bfd parameter. (read_partial_die): Pass addresses through DEBUGMAP_XLATE. (var_decode_location): Ditto. (new_symbol): Ditto. (dwarf2_const_value): Ditto. (decode_locdesc): Ditto. * symfile.h (struct nlist_rec): Unconst name to reduce casting. * dwarf2-frame.c: Update dwarf2_read_section prototype to note new bfd parameter. (dwarf2_build_frame_info): Updated. 2006-01-31 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_oso_nlists): New function to read the nlist records of a dwarf .o file (i.e. read the minsyms). (stabsect_read_strtab_from_oso): Comment cleanup. * symfile.h (struct nlist_rec): Structure used by read_oso_nlists. (open_bfd_from_oso, read_oso_nlists): Add prototypes. 2006-01-25 Stan Shebs * configure.ac: Move ac_cv_func_mmap_fixed_mapped setting up far enough to actually have an effect. * configure: Regenerate. * checkpoint.c (memcache_put): Ifdef a native-only call. 2006-01-23 Greg Clayton (gclayton@apple.com) * cp-support.c (cp_func_name): Added a test for full_name being NULL. 2006-01-19 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (INFO_SECTION, ABBREV_SECTION, etc): DWARF is now in segment "__DWARF", not "__DWARFA". (db_error): Whitespace tweak. 2006-01-19 Jason Molenda (jmolenda@apple.com) * dwarf2read.c (dwarf_info_vma, dwarf_abbrev_vma, dwarf_line_vma, dwarf_str_vma): Remove. (struct dwarf2_per_objfile): Ditto. (dwarf2_has_info): Don't initialize dwarf section vma's. (dwarf2_build_psymtabs_hard): Ditto. (dwarf2_locate_sections): Don't use dwarf section vma's. (read_comp_unit_head): Ditto. (psymtab_to_symtab_1): Ditto. (read_file_scope): Ditto. (read_indirect_string): Ditto. 2006-01-18 Jason Molenda (jmolenda@apple.com) * dbxread.c (struct oso_fun_static, struct oso_fun_list, struct oso_pst_list): Move these out of the symloc psymtab private struct into the generic partial_symtab struct in symtab.h. (LDSYM_OSO_NAME, LDSYM_OSO_MTIME, LDSYM_OSO_STATICS, LDSYM_OSO_PLIST): rename to PSYMTAB_OSO_* and move to symtab.h. (read_dbx_symtab): Add a new state variable, in_dwarf_debug_map, which notes when the current SO file is a DWARF debug map. In that case, handle N_FUN and STSYM specially; let the rest be processed as usual. (start_psymtab): Don't initialize the OSO structures in the symloc; the generic psymtab creator does it. (add_oso_pst_to_list): Macro names updated. (end_psymtab): Ditto. (oso_scan_partial_symtab): Ditto. (dbx_psymtab_to_symtab_1): Ditto. (read_ofile_symtab_from_oso): Ditto. * dwarf2read (dwarf2_debug_map_psymtab_to_symtab): A stub function to be defined. * symfile.c (allocate_psymtab): Initialize the OSO fields in the generic partial_symtab struct. * symfile.h: Prototype for dwarf2_debug_map_psymtab_to_symtab. * symtab.h: (struct partial_symtab): Add OSO fields. Add struct oso_fun_static, oso_fun_list, oso_pst_list from dbxread.c. Add PSYMTAB_OSO_NAME etc accessor macros from dbxread.c 2006-01-17 Stan Shebs * infrun.c (set_schedlock_func): Clear a merge confusion. 2006-01-16 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Recognize & ignore empty OSO stabs. 2006-01-12 Jim Ingham * symtab.c (find_function_start_sal): Catch the case where the block is NULL. Can happen sometimes when the stabs get mangled, for instance. * dbxread.c (read_ofile_symtab_from_oso): Add checks for NULL cur_file_name and oso_static->name to handle some error cases without crashing. 2006-01-12 Stan Shebs * ppc-sysv-tdep.c (ppc_push_argument): Use our vector reg count. (ppc_push_arguments): Pad the dummy stack with an extra 32 bytes, for luck. 2006-01-11 Jim Ingham * gdbtypes.c (create_array_type): If you are creating an array whose elements are another array, make sure the element array's length is > 0. It might not have gotten correctly calculated yet... 2006-01-11 Caroline Tice *dwarf2read.c (read_in_db_abbrev_table): Delete redundant forward declaration. (dwarf_attr_name): Add case for DW_AT_APPLE_repository_abstract_origin. 2006-01-10 Jim Ingham * stabsread.c (attach_fields_to_type): If a type is a typedef of an undefined type, add it to the undefined_types list. * Makefile.in: Restore the makefile goop that finds runtest so you can run make check from the gdb directory. 2006-01-10 Eric Albert (ejalbert@apple.com) * i386-tdep.c (i386_gdbarch_init): Long double is 128 bits on darwin. 2006-01-10 Eric Albert (ejalbert@apple.com) * valprint.c (print_ostype): Use unpack_long() to get the value instead of assuming it's a memory location. Take a type parameter. * valprint.h (print_ostype): Prototype updated. * printcmd.c (print_formatted, print_scalar_formatted): Update callers. 2006-01-09 Stan Shebs * ppc-sysv-tdep.c (ppc_push_argument): Fix a merge mess by using VALUE_REGNUM. 2006-01-06 Jason Molenda (jmolenda@apple.com) * dwarf2read.c: Minor cleanups on Caroline's type repository patch: Removing commented-out code, clarifying a few comments, removing some unintended whitespace changes that were made in the patch. 2006-01-06 Caroline Tice * Makefile.in (LIBSQLITE3): Add new link library option for sqlite3. (INSTALLED_LIBS): Add LIBSQLITE3 to the list. * db-access-functions.h: New file. * dwarf2read.c (db-access-functions.h): Add new #include. (struct dwarf2_cu): Add 2 new fields: repository and repository_name. (struct partial_die_info): Add 5 new fields: has_repo_specification, has_repository, has_repository_type, repo_spec_id and repo_name.. (struct die_info): Add 1 new field: repository_id. (zeroed_partial_die): Comment it out to eliminate warning. (read_comp_unit_head): Comment out signed_addr to eliminate warning. (open_dwarf_repository): New function. (dwarf2_read_repository_abbrevs): New function. (build_dummy_cu): New function. (build_dummy_objfile): New function. (read_in_db_abbrev_table): New function. (db_error): New function. (db_lookup_type): New function. (fill_in_die_info): New function. (get_uleb128): New function. (db_read_attribute_value): New function. (follow_db_ref): New function. (set_repository_cu_language): New function. (get_repository_name): New function. (finalize_stmts): New function. (find_open_repository): New function. (increment_use_count): New function. (decrement_use_count): New function. (enum db_status): New type. (struct objfile_list_node): New type. (struct database_info): New type. (byte_swap_p): New global variable. (dwarf2_build_psymtabs_hard): Initialize byte_swap_p; add code to call functions to read in the repository abbreviations table if appropriate, and initialize the repository language. Also fix the stuff to initialize the dwarf_*_vma files in the pst (update it to use dwarf2_per_objfile). (add_partial_symbol): For variables, add check of has_repository_type. (skip_one_die): Add case for DW_FORM_APPLE_db_str. (psymtab_to_symtab_1): Update the dwarf_*_vma things correctly from dwarf2_per_objfile. (read_partial_die): Initialize the new fields has_repository, has_repo_specification and has_repository_type; check possible string attributes for DW_FORM_APPLE_db_str and call get_repository_name if appropriate; add cases to check for DW_AT_APPLE_repository_type and DW_AT_APPLE_repository_specification. If the partial die uses a repository, call open_dwarf_repository to open the appropriate database. (read_full_die): Add and initialize repository_name and comp_dir variables, also update them if die attributes are appropriate; initialize die->repository_id; call open_dwarf_repository if approriate. (read_attribute_value): Add case for DW_FORM_APPLE_db_str. (dwarf2_attr): Add and initialize repository_spec variable; check attributes for a repository string or a repository reference and do the right thing if found. (die_type): Check type attribute to see if it's a repository type reference, and if so get the appropriate type from the repository data. (copy_die): Initialize repository_id field. (dwarf_attr_name): Add cases for the 6 new DW_AT_APPLE_repository_* attributes. (dwarf_form_name): Add case for DW_FORM_APPLE_db_str. (dump_die): Add case for DW_FORM_APPLE_db_str. (dwarf2_get_attr_constant_value): Add check for DW_FORM_APPLE_db_str. (enum rb_tree_colors): New type. (struct rb_tree_node): New type. (rb_tree-find_node): New function. (left_rotate): New function. (right_rotate): New function. (plain_tree_insert): New function. (rb_tree_insert): New function. (MAX_OPEN_DBS): New constant. (repositories): New global variable. (num_open_dbs): New global variable. (lookup_repository_type): New function. (initialize_repositories): New function. (close_dwarf_repositories): New function. (SELECT_DIE_STR): New constant. (FIND_STRING_STR): New constant. (db_stmt1): New global variable. (db_stmt2): New global variable. (struct attr_pair): New type. (db_read_1_byte): New function. (db_read_2_bytes): New function. (db_read_4_bytes): New function. (db_read_8_bytes): New function. (db_read_n_bytes): New function. (db_read_unsigned_leb128): New function. (db_read_signed_leb128): New function. (Various places): Add type casts or comment out dead declarations to eliminate compiler warnings. * objfiles.c (db-access-function.h): Add new include statement. (create_objfile): Initialize uses_sql_repository field. (free_objfile): If uses_sql_repository field is set call close_dwarf_repositories. (get_objfile_registry_num_registrations): New function. * objfiles.h (): New include statement. (struct objfile): Add new field uses_sql_repository. Add extern declaration for get_objfile_registry_num_registrations. * ../include/elf/dwarf2.h (DW_FORM_APPLE_db_str): Add new DWARF form. (DW_AT_APPLE_repository_file): Add new DWARF attribute. (DW_AT_APPLE_repository_type): Add new DWARF attribute. (DW_AT_APPLE_repository_name): Add new DWARF attribute. (DW_AT_APPLE_repository_specification): Add new DWARF attribute. (DW_AT_APPLE_repository_import): Add new DWARF attribute. (DW_AT_APPLE_repository_abstract_origin): Add new DWARF attribute. 2006-01-04 Greg Clayton (gclayton@apple.com) * symtab.c (lookup_symtab_all): Safeguarded against null return from symtab_to_fullname. (lookup_partial_symbol, completion_list_add_name): Removed unused variables and cleaned up a const warning. 2005-12-29 Stan Shebs Start of checkpoint and undo support. * checkpoint.c: New file, checkpoint support. * checkpoint.h: New file. * Makefile.in (BASE_OBS): Add checkpoint.o. (checkpoint.o): Add dependencies. * infcmd.c (run_command_1): Always clear checkpoints. (re_execute_command, re_exec_1, re_exec_once): New functions, used to create intermediate checkpoints on demand. * infrun.c (normal_stop): Maybe create a checkpoint. * regcache.c (regcache_compare): New function. 2005-12-20 Jason Molenda (jmolenda@apple.com) * varobj.c (varobj_create): Mark some more Apple Local code as such. Remove APPLE MERGE #if 0'ed code markers. (varobj_update): Remove some now-unused variables to reduce warnings. 2005-12-16 Jim Ingham * Makefile.in: Set the rc_version in version.c. * version.h: declare rc_version. 2005-12-15 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Keep marching on if we have bogus stabs debug info and we're looking for OSOs. 2005-12-15 Jim Ingham * valops.c (value_of_this): Don't error if complain is 0. 2005-12-13 Jason Molenda (jmolenda@apple.com) * utils.c (error_stream): Remove #if 0'ed APPLE LOCAL change that doesn't belong here any more after the merge. * exceptions.c (print_exception): Add the code here, to suppress console error printing when we're in MI mode. 2005-12-13 Jason Molenda (jmolenda@apple.com) * symtab.c (rbreak_command): Commit Jim's change to rbreak's bp setting to be safe for all ObjC method names. 2005-12-05 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_line_1): symtab_form_filename returns a file_symtab_arr, not a file_symtab. * symtab.c (lookup_symtab_all, add_partial_symtab_to_array): Note some APPLE LOCAL code. (lookup_symtab_all): Don't recompute file basename. * objc-lang.c (lookup_objc_class): Don't complain when we can't look up ObjC classes (which always happens in non-ObjC programs). 2005-11-28 Jason Molenda (jmolenda@apple.com) * disasm.c (gdb_disassemble_info_null): Use gdb_null instead of rolling it ourself. (fprintf_null): Removed. 2005-11-28 Jason Molenda (jmolenda@apple.com) * config/i386/tm-i386-macosx.h: Don't include tm-i386.h. * config/i386/xm-i386-macosx.h: Don't include xm-i386.h. * i386-tdep.c (i386_match_insn): Fix syntax error. (i386_push_dummy_call): VALUE_ENCLOSING_TYPE is a function now. 2005-11-17 Jason Molenda (jmolenda@apple.com) * infcall.c (inferior_function_calls_disabled_p): New global variable to control whether inferior function calls are allowed (should be a target vector entry). (hand_function_call): If inf func calls disabled, throw an error. * infcall.h (inferior_function_calls_disabled_p): Provide extern decl. * objc-lang.h (lookup_objc_class_p): Provide extern decl. 2005-11-17 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (redirect_statics): Also look in the new __IMPORT, __pointers section for non-lazy symbol pointers. 2005-11-09 Jason Molenda (jmolenda@apple.com) * config/powerpc/xm-ppc-macosx.h: Don't define the host fp formats here. * config/i386/xm-i386-macosx.h: Ditto. * configure.host: Add definitions for the PPC host fp formats. 2005-11-08 Jason Molenda (jmolenda@apple.com) * breakpoint.c (_initialize_breakpoint): Update add_set_cmd to add_setshow_string_cmd calls. * dbxread.c (read_dbx_symtab): Fix merge mistakes. * linespec.c: Update prototype. * objc-lang.c (print_object_command): Use value_type instead of VALUE_TYPE. * source.c (open_source_file_fullpath): Change to work with new style. (find_and_open_source): Update call of same. * symfile.h: Update prototype. * symtab.c (lookup_symtab_all): Change call to symtab_to_filename to call symtab_to_fullname instead. * valops.c (value_of_this): Fix call to get_selected_frame. 2005-10-31 Jim Ingham * i386-tdep.c (i386_follow_jump): Use 32 bit math to calculate the pc relative offset for the JMP instruction. 2005-10-26 Jim Ingham * dbxread.c (read_ofile_symtab_from_oso): Delete unnecessary warning. (open_bfd_from_oso): pass expected format to open_bfd_matching_arch. exec.c (exec_file_attach): Ditto. symfile.c (symfile_bfd_open): Ditto. (reread_symbols): Ditto. (open_bfd_matching_arch): Take in the expected type of the archive slice. symfile.h: Change def'n of open_bfd_matching_arch to accept format. 2005-10-07 Jim Ingham * linespec.c (decode_all_digits_exhaustive): New function, same as decode_all_digits, but returns all the matches in the linetable of the input symtab. (symtab_from_filename): Return an array of ALL the symtabs that match the given filename. (decode_line_1): Handle getting ALL the symtabs matching the file name, and all the symtab_and_lines matching the line. * symtab.c (add_symtab_to_array): New function. (lookup_symtab_all): New function. (lookup_partial_symtab): Return all the matches, not just the first match. (add_partial_symtab_to_array): New function. (lookup_partial_symtab_all): New function. * symtab.h: Def'ns of lookup_symtab_all and lookup_partial_symtab_all. 2005-11-04 Jason Molenda (jmolenda@apple.com) * configure.ac: Fix APPLE LOCAL block. * configure: Regenerated. 2005-10-24 Jim Ingham (jingham@apple.com) * dbxread.c (end_psymtab): A psymtab isn't empty if it has an OSO record. 2005-10-19 Jim Ingham (jingham@apple.com) * gdbtypes.c (make_cv_type): Return builtin_type_error if an undefined type is being cast. 2005-10-19 Jim Ingham (jingham@apple.com) * stabsread.c (read_type): When looking up a forward reference type, if the type is already defined, just return it. 2005-10-19 Jason Molenda (jmolenda@apple.com) * environ.c (smuggle_dyld_settings): New function to copy environment variables in GDB_DYLD_* to DYLD_*. * environ.h: Prototype. * infcmd.c (_initialize_infcmd): Call it. 2005-10-13 Klee Dienes * gdbthread.h (switch_to_thread): Add prototype. * thread.c (switch_to_thread): Make external. 2005-10-13 Klee Dienes * valops.c (allocate_space_in_inferior_malloc): Set unwind-on-signal to 1 while calling malloc. 2005-10-11 Klee Dienes * target.c (update_current_target): Add field for to_allocate_memory. Set default to allocate_space_in_inferior_malloc. * target.c (struct target): Add field for to_allocate_memory. (target_allocate_memory): New macro. * value.h (allocate_space_in_inferior_malloc): New function. * valops.c (allocate_space_in_inferior_malloc): New function. Same as value_allocate_space_in_inferior, but returns a CORE_ADDR instead of a value. Check to be sure it's safe to call malloc(). (value_allocate_space_in_inferior): Implement using target_allocate_memory. Fixes . 2005-10-11 Jim Ingham * eval.c (evaluate_subexp_standard): If EVAL_SKIP, bail out before you try to lookup methods in the target (which is set to 1 in this case). * linespec.c (decode_compound): Accept and set "not_found_ptr". (find_method): ditto. (decode_line_1) pass not_found_ptr to decode_compund. * varobj.c (cplus_value_of_child): Make a copy of the parent's value before calling value_cast. 2005-10-11 Klee Dienes * doublest.c (floatformat_byteorders_are_reversed): New function. (floatformats_same_except_for_byteorder): New function. (swap_bytes): New function. (floatformat_to_doublest): If the type is a type supported by the host, but simply byteswapped, just do the byteswapping instead of using the generic float code. Fixes . * i386-tdep.c (i386_push_dummy_call): Fix the dummy stack frame to look like a "normal" stack frame. In particular, make sure it has a correct $ebp chain. Fixes . 2005-10-03 Jim Ingham * source.c (open_source_file): Don't free fullname if we aren't going to use it. Happens when we found a file from the pathname-substitution path. 2005-10-03 Jason Molenda (jmolenda@apple.com) * breakpoint.c (print_it_typical): Use "times" as the field for hit-count, to be consistent with all the other breakpoint printers. 2005-09-30 Jim Ingham * stabsread.c (cleanup_undefined_types): Don't call replace_type if the types instance flag's aren't the same. * symmisc.c (equivalence_table_build): Only consider names of the form foo$[0-9A-Z] as equivalent to foo. 2005-09-30 Jason Molenda (jmolenda@apple.com) * Makefile: Try to make gdb binary setgid procmod. * fork-child.c (fork_inferior): Give up elevated group privs. * ser-pipe.c (pipe_open): Ditto. * cli/cli-cmds.c (shell_escape): Ditto. * breakpoint.c (print_it_typical): Print the current hit count of the breakpoint. 2005-09-27 Jim Ingham * dbxread.c (read_dbx_symtab): Relax the pattern checking for the Symbol Separation .o file. (read_ofile_symtab_from_oso) Add some more error checking when we go to match up the function list with the FUN stabs we are seeing in the .o file. * varobj.c (create_child): Cons up a fake name for anonymous struct fields. 2005-09-26 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_push_dummy_call): Pad the dummy stack frame so it is properly 16-byte aligned. 2005-09-15 Klee Dienes * breakpoint.c (print_exception_catchpoint): New function. (print_one_exception_catchpoint): New function. (print_mention_exception_catchpoint): New function. (print_catch_info): Now takes a breakpoint *, instead of a bpstat. (print_one_breakpoint): Use print_one_exception_catchpoint. (print_it_typical): Use print_exception_catchpoint. (mention): Use print_mention_exception_catchpoint. 2005-09-15 Klee Dienes * infrun.c (set_scheduler_locking_mode): Update error strings. (set_schedlock_helper): Ditto. 2005-09-14 Jim Ingham * defs.h (Debugger_state): Put back, MacsBug uses it (state_change_hook): ditto * top.c (state_change_hook): ditto. (quit_target): ditto. * infcmd.c (run_command, continue_command, signal_command): ditto. * inflow.c (kill_command): ditto. * infrun.c (handle_inferior_event): ditto. * main.c (main): ditto. * symfile.c (symbol_file_clear, symbol_file_command): ditto. 2005-09-13 Eric Albert (ejalbert@apple.com) * objc-lang.c (print_object_command): Try to call _CFPrintForDebugger() for print-object if _NSPrintForDebugger() is not present. 2005-09-13 Jim Ingham * stabsread.c (read_type): When processing forward reference stab def'ns, don't use a type you looked up by name unless it fill the type slot currently being defined. 2005-09-12 Jason Molenda (jmolenda@apple.com) * objc-lang.c (print_object_command): Revert last patch until I have a chance to look into why it caused regressions. 2005-09-12 Eric Albert (ejalbert@apple.com) * objc-lang.c (print_object_command): Add support for calling CFPrintForDebugger() if the dylib with NSPrintForDebugger() isn't loaded. 2005-09-12 Klee Dienes * disasm.h (find_pc_offset): Add new arguments, return type. * disasm.c (gdbarch_instruction_length): New function. (find_pc_offset): Update comment. Add new arguments. Convert to use gdbarch_instruction_length. Add support to control limiting the PC to the current function. Enhance error reporting. 2005-09-07 Jim Ingham * dbxread.c: These changes are to support reading debug info from a .o file that has multiple N_SO sections in it. (stabs_seek): When you were using the internal buffer, this was seeking backwards from the pointer, which is just wrong. (init_oso_pst_list, add_oso_pst_to_list, end_oso_pst_list): New functions. (read_dbx_symtab): Build up the list of N_SO sections sharing one N_OSO. (start_psymtab): Null out the LDSYM_OSO_PST_LIST pointer. (end_psymtab): Null the LDSYM_OSO_* fields for the PST's we make for BINCL/EINCL header includes. (oso_scan_partial_symtab): New function. (dbx_psymtab_to_symtab_1): Call oso_scan_partial_symtab to build up dependencies for the partial_symtabs that share this .o. (read_ofile_symtab_from_oso): Use the LDSYMOFF since we now set that in oso_scan_partial_symtab. And this supports timing checking between final linked executable and the .o file: (read_dbx_symtab): Record OSO_MTIME from the N_OSO stab. (open_bfd_from_oso): Check time stamp. * gdbtypes.c (smash_types)L Don't delete the chain when you smash types. You will need to fix up the other elements on it. (make_qualified_type): Handle the case where both TYPE & STORAGE may have qualified elements already. 2005-09-06 Klee Dienes * configure.in: Remove the code to hard-code long double support to "no" on all platforms. Add code to default long double support to "yes" on Mac OS X. 2005-09-06 Klee Dienes * config/i386/xm-i386-macosx.h (HOST_LONG_DOUBLE_FORMAT): Only set this if we are compiling with gcc-4.0 or above. 2005-09-06 Klee Dienes Restore patch by Jim Ingham from 2003-03-03 that was lost in a subsequent merge. Includes the following additional changes: * breakpoint.c (bpstat_stop_status): Properly resume the inferior and step over the catchpoint if we stop at a catchpoint for which the condition doesn't hold. (mention): MI-ify the catchpoint output. Added the OBJFILE parameter to all instances of target->to_find_exception_catchpoints. Original ChangeLog by Jim: This set of changes updates the "catch catch" and "catch throw". The output is mi-ified, the object type being thrown is added, you can set a regexp for which objects to stop on both for catches & throws. It adds one target-vector entry to the catchpoint support: to_find_exception_catchpoints. This just splits out the "enabling" and the "setting breakpoints on catchpoints" parts of the target catchpoint support. * breakpoint.c: Define enabled flags & regexp strings. (print_it_typical): MI-ify the catchpoint printing info. (print_catch_info): New function, for printing info. (bpstat_stop_status): Only process the "catch" breakpoint that matches the stop address. Check the catch regexp to see if we should stop here. MI-ify the catch stop message. (update_exception_catchpoints): New function, more convenient client function than target_enable_exception_callback/ create_exception_catchpoints. (current_exception_should_stop): New function. (catch_exception_command_1): use update_exception_catchpoints. (exception_catchpoints_enabled): New function, needed for the mi command. (disable_exception_catch): New function, so you don't have to remove all the catch breakpoints by hand. (_initialize_breakpoint): Add set commands for the exception type regexp's. * breakpoint.h: Add declarations for new functions. * inftarg.c (child_enable_exception_callback): No longer return the SALS, this is done by child_find_exception_catchpoints. (child_find_exception_catchpoints): stubbed out version of this. (init_child_ops): add child_find_exception_catchpoints. * stack.c (catch_info): Still does nothing, but in the new form. * symtab.h: Add exception_type to exception_event_record & accessor macro. * target.c: Add to_find_exception_catchpoints everywhere necessary. * target.h: ditto. * infcmd.c (_initialize_infcmd): String constants can't have un-backslashed newlines. gcc-3.3 actually makes this an error so we ought to fix it... 2005-09-06 Jim Ingham * stabsread.c (process_symbol_types_only): Missing break. (find_name_end): Add the "correct" algorithm for names that have "::" in them. But the correct version is #if 0'ed because it makes stabs reading ~6% slower without corresponding benefit. 2005-09-01 Klee Dienes * disasm.c (fprintf_null): New function. (gdb_disassemble_info_null): New function. Returns a struct disassemble_info that generates no output. (gdb_disassembly): Don't pass in file_string and line_num; they weren't used anyway. (find_pc_offset): New function. * disasm.h (gdb_disassembly): Update prototype. * cli/cli-cmds.c: Update call to gdb_disassembly. 2005-08-19 Jim Ingham * dbxread.c (open_bfd_from_oso): Handle the case where the file path of an OSO stab has a "()" in the name. 2005-08-15 Jim Ingham * buildsym.c (end_symtab): Call cleanup_undefined_arrays. * gdbtypes.c (add_undefined_arrays): New function. (cleanup_undefined_arrays): New function. (create_array_type): Call add_undefined_arrays. * gdbtypes.h: Declare cleanup_undefined_arrays. * stabsread.c (read_struct_type): Take out the code that adjusts the length of variants. This is now redundant, and is done in dbx_fixup_variants. 2005-08-14 Jim Ingham * buildsym.c (end_symtab): Call cleanup_undefined_fields. * stabsread.c (dbx_fixup_variants): New function. (read_type): Call dbx_fixup_variants on all the newly defined types. (add_undefined_field): New function. (cleanup_undefined_fields): New function. (adjust_field_bitsize): New function. (read_one_struc_field): Use adjust_field_bitsize. (attach_fields_to_type): If field type is undefined, add it to the undefined fields for fixup. * stabsread.h: declare cleanup_undefined_fields 2005-08-12 Jim Ingham * dbxread.c (read_ofile_symtab_from_oso): Thinko in how we rewind past the SO stabs when we seek for the right SO section. 2005-08-11 Jim Ingham * dbxread.c (read_ofile_symtab_from_oso): Handle the case where one OSO file might have more than one N_SO section in it. * stabsread.c (cleanup_undefined_types): Don't complain about the type being undefined unless it actually is still undefined. * (read_type): Set the "type" variable to the value of dbx_fixup_type, since it might be used later on in read_type. 2005-08-10 Jason Molenda (jmolenda@apple.com) * stabsread.c (cleanup_undefined_types): Remove extra "." at end of complaint. 2005-08-02 Jim Ingham * dbxread.c (dbx_psymtab_to_symtab_1): Remove a debugging printf. 2005-08-01 Jim Ingham * stabsread.c (dbx_fixup_type): New function. (read_type): Fix the type in the slot for a given typenumber, don't just replace it with the new type. Otherwise the references to it won't get fixed up. 2005-07-28 Jim Ingham * dbxread.c (read_dbx_symtab): We recognize the symbol separation file from the N_OSO name, not the N_SO name. (read_ofile_symtab_from_oso): Read over the stabs from coalesced functions and extract the types. * stabsread.c (process_symbol_types_only): New function, the parsing side of extracting types from a stab. 2005-07-27 Jim Ingham This set of changes implements keeping debug information in the .o file, and mapping the addresses from there using a minimal set of debug information in the final linked image. * dbxread.c: (read_ofile_symtab_from_oso, stabsect_read_strtab_from_oso, open_bfd_from_oso, cleanup_oso_data, lookup_psymbol_from_namestring, oso_statics_pop): New functions. (fill_symbuf): If using stabs_data, don't bother copying it into the symbuf, just use it out of stabs_data. (INTERNALIZE_SYMBOL, NEXT_SYMBOL, PEEK_SYMBOL): Return whether the N_SECT flag was set on the external nlist. (set_namestring_1): New function, read the namestring without using the objfile directly. (set_namestring): Change to use set_namestring_1. (read_dbx_symtab): Process the N_OSO stab. Also, if we saw an N_OSO, then build up a queue of static symbols so we can map them back when reading in the .o file. Don't read symbols from the SYMBOL_STUB section, they just confuse us. Add symbol separation files to the dependency list by hand. Don't duplicate the code for handling 'F' and 'f' FUN stabs. Read in the N_OPT symbols when reading the psymtab. ld64 doesn't give addresses to ANY N_SO stabs, and that confuses us if we don't know we are processing gcc compilations in the psymtab. (start_psymtab): Null out OSO name and OSO statics. Record the language in the psymtab, we will need it. (dbx_psymtab_to_symtab_1): Add support for reading out of the .o. (process_one_symbol): Remove compiler warning. * symtab.h: Add language to psymtab. * config/tm-macosx.h: change INTERNALIZE_SYMBOL to take sect_p. * event-top.c (async_request_quit): Check for immediate_quit. * symfile.c (open_bfd_matching_arch): Make a common idiom into a function. Also use it where needed. * symfile.h: declare open_bfd_matching_arch. * exec.c: use open_bfd_matching_arch. * stabsread.c (read_type): Obvious merge goof. Also check for ERROR and don't continue processing array type. * symtab.c (lookup_partial_symbol): Fix thinko in looking up with both demangled & mangled names. 2005-06-30 Jim Ingham * symtab.c (rbreak_command): Add -shlib to the case where we only found minsymbols as well, so we don't set all the rbreak breakpoints on the same symbol. 2005-06-23 Jim Ingham * valops.c (value_of_this): Use get_selected_frame rather than accessing the deprecated_selected_frame directly. 2005-06-20 Jim Ingham * c-exp.y (yylex): Look up symbol as ObjC class even if we don't have debug info for it. We don't need that to call a method on the object. * objc-lang.c (print_object_command): If the class has an unknown type, cast it to id before calling po. 2005-06-14 Jim Ingham * defs.h: Add a declaration of get_scheduler_lock_ptid. * infrun.c (get_scheduler_lock_ptid): New function. (set_schedlock_helper): Use scheduler_run_this_ptid instead of setting scheduler_lock_ptid by hand. (resume): Ditto. (init_wait_for_inferior): Ditto * objc-lang.c (print_object_command): Make the unsafe call a warning not an error. Otherwise you can't use po in a breakpoint command without aborting the command... * thread.c (switch_to_thread): Move the code to switch the locked thread if the scheduler locking is on from do_captured_thread_select to here, this is a more basic function. 2005-06-07 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_frame_setup_skip_insns): Add instructions found in prologues on a Red Hat FedoraCore2 system. 2005-09-12 Jason Molenda (jmolenda@apple.com) * objc-lang.c (print_object_command): Revert last patch until I have a chance to look into why it caused regressions. 2005-09-12 Eric Albert (ejalbert@apple.com) * objc-lang.c (print_object_command): Add support for calling CFPrintForDebugger() if the dylib with NSPrintForDebugger() isn't loaded. 2005-09-01 Klee Dienes * disasm.c (fprintf_null): New function. (gdb_disassemble_info_null): New function. Returns a struct disassemble_info that generates no output. (gdb_disassembly): Don't pass in file_string and line_num; they weren't used anyway. (find_pc_offset): New function. * disasm.h (gdb_disassembly): Update prototype. * cli/cli-cmds.c: Update call to gdb_disassembly. 2005-08-09 Klee Dienes * varobj.c (struct value_rtti_args): Remove. (wrapped_value_rtti_target_type): Remove. (safe_value_rtti_target_type): Fix exception-handling. 2005-08-09 Klee Dienes * objc-lang.c (struct selector_entry): VAL should be a CORE_ADDR, not an int (since it's used to store the address of the selector in memory). 2005-08-03 Klee Dienes * breakpoint.c (print_it_typical): Use async_reason_lookup. 2005-08-02 Klee Dienes * findvar.c (extract_unsigned_integer): Use extract_unsigned_integer_with_byte_order, not extract_signed_integer_with_byte_order. 2005-08-02 Klee Dienes * config/powerpc/macosx.mh (NATDEPFILES): Include gcore.o. 2005-07-26 Stan Shebs * breakpoint.c (_initialize_breakpoint): Restore a missing line in command help. * infrun.c: Bring back HP-era macros TARGET_DISABLE_HW_WATCHPOINTS and TARGET_ENABLE_HW_WATCHPOINTS. (handle_inferior_event): Use them. * ppc-sysv-tdep.c (ppc_darwin_abi_return_value): Use a ULONGEST to work around truncation problem in 32-bit mode. * config/nm-macosx.h (HAVE_NONSTEPPABLE_WATCHPOINT): Re-enable. 2005-07-11 Klee Dienes * ppc-sysv-tdep.c (do_ppc_sysv_return_value): Use ppc_copy_from_greg. 2005-07-11 Klee Dienes * breakpoint.c (break_command_2): Propagate the entire exception upward, instead of just the reason. * thread.c (gdb_thread_select): Pass the address of the entire args struct, not just the string. 2005-07-07 Klee Dienes * varobj.c: Clean up various merge messes. 2005-07-07 Klee Dienes * interps.c (current_interp): Restore; was omitted from interps.c. * event-loop.c (start_event_loop): Set the global uiout to the uiout for the current interpreter. This is necessary because the interpreter-switching code is now wrapped in a cleanup handler that resets the uiout. We should clearly come up with a better way of managing the global interpreter and uiout, in any event, but this appears to work for now. 2005-07-07 Stan Shebs * eval.c (evaluate_subexp_standard): Resolve a merge standard, fix some local markers. * infcall.c (hand_function_call): Set values_type from check_typedef call. * infcmd.c (default_print_registers_info): Fix a merge mess. * ppc-sysv-tdep.c (ppc_copy_into_greg): Use new API. (ppc_push_argument): Similarly. * printcmd.c (print_formatted): Tweak local markers. * procfs.c: Revert to FSF version. * valops.c (hp_som_som_object_present): Delete leftover decl. 2005-07-05 Stan Shebs * frame.c (frame_debug): Make globally visible. 2005-06-28 Stan Shebs * arch-utils.c: Remove our size/offset caching code, now handled in generic machinery. (reg_cache_hack__architecture_changed_hook): Delete. (generic_register_size): Revert to FSF version. (generic_register_byte): Likewise. * arch-utils.h (reg_cache_hack__architecture_changed_hook): Delete decl. * bcache.h: Add a local marker. * breakpoint.c: Likewise. * breakpoint.h: Likewise. * completer.c: Add local markers. * completer.h: Likewise. * frame.c (deprecated_frame_next_hack): Rename to frame_next_hack. (deprecated_frame_cache_hack): Similarly. (default_print_extra_frame_info): Remove, no longer used. * frame.h: Adjust decls to match. * rs6000-tdep.c: Reduce FSF discrepancies. (_initialize_rs6000_tdep): Make usable for non-Darwin configs. * solib.c (symbol_add_stub): Fix merge mess. * solib.h: Reduce FSF discrepancy. * somread.c: Revert to FSF version. * stack.c (frame_info): Revive extra frame info printing, using macro instead of gdbarch. * config/nm-macosx.h (CHILD_PREPARE_TO_STORE): Delete, no longer needed. 2005-06-23 Stan Shebs * breakpoint.c: Add some local markers. (break_at_finish_command, etc): Delete some old dead code. (condition_command): Clean up merge conflicts. (condition_command_1): Likewise. (do_captured_breakpoint): Likewise. (disable_exception_catch): Likewise. (catch_command_1): Fix FSF discrepancy. * breakpoint.h: Add local markers. * buildsym.c (record_line): Add local marker. * c-exp.y: Add local markers. * frame.c: Add local markers. * frame.h: Delete decls of deleted functions. * infcmd.c: Add local markers. (jump_command): Fix async patch. (print_return_value): Fix FSF discrepancies. (_initialize_infcmd): Fix attach's completer. * infrun.c (handle_inferior_event): Recover local patches in disappeared handle_step_into_function. * inftarg.c: Add local markers. * interps.h: Delete unused decl. * linespec.c: Add local markers. (symtab_from_filename): Fix merge mess. (decode_variable): Likewise. (minsym_found): Likewise. * linespec.h: Add local marker. * stack.c: Add local markers. * target.c: Add local markers, delete unused decls. 2005-06-21 Klee Dienes * breakpoint.c (do_captured_parse_breakpoint): Now returns void. (watchpoint_equal): Convert to use gdb_byte. (break_command_2): Convert to use the new exception handling mechanism. 2005-06-21 Klee Dienes * cli/cli-setshow.c (do_setshow_command): Re-merge the "always show the options for an enumerated value" patch originally done by Jim. Revert our removal of an extra declaration, to match the FSF sources. Add APPLE_LOCAL marker. 2005-06-21 Klee Dienes * minsyms.c (prim_record_minimal_symbol_and_info): Re-factor the mst_file_text check up one level. Don't modify the symbol name when checking it against __gcc_compiled. Update comments. (Restoring a patch originally done by Jim that somehow got lost in the merge.) 2005-06-21 Klee Dienes * infcall.c (hand_function_call): Complete the merge. Rename value_type to values_type, to avoid name conflict. Replace CHECK_TYPEDEF with check_typedef. Update comments. 2005-06-21 Klee Dienes * wrapper.c: Convert entire file to the new exception-handling code. Move Apple-specific #includes to end of the #include list. Remove all wrap_* prototypes and functions. (struct gdb_wrapper_arguments): Remove. (struct captured_value_struct_elt_args): Remove. (gdb_parse_exp_1): Convert to TRY_CATCH. (wrap_parse_exp_1): Remove. (gdb_evaluate_expression): Convert to TRY_CATCH. (wrap_evaluate_expression): Remove. (gdb_print_expression): Convert to TRY_CATCH. (wrap_print_expression): Remove. (gdb_evaluate_type): Convert to TRY_CATCH. (wrap_evaluate_type): Remove. (gdb_value_fetch_lazy): Convert to TRY_CATCH. (wrap_value_fetch_lazy): Remove. (wrap_value_equal): Remove. (wrap_value_subscript): Remove. (wrap_value_ind): Remove. (wrap_value_cast): Remove. (wrap_parse_and_eval_type): Remove. (gdb_value_struct_elt): Convert to TRY_CATCH. (do_captured_value_struct_elt): Remove. (gdb_varobj_get_value): Convert to TRY_CATCH. (wrap_varobj_get_value): Remove. (wrap_value_objc_target_type): Remove. (safe_value_objc_target_type): Convert to TRY_CATCH. 2005-06-20 Stan Shebs * config/powerpc/macosx.mt: Use DEPRECATED_TM_FILE instead of TM_FILE for the target header. * config/i386/macosx.mt: Likewise. 2005-06-17 Stan Shebs Reduce hair-tearing differences between Apple and FSF versions of symbol_file_add* functions. * symfile.c (symbol_file_add_with_addrs_or_offsets): Rename to symbol_file_add_name_with_addrs_or_offsets and fix callers. (symbol_file_add_bfd_with_addrs_or_offsets): Rename to symbol_file_add_with_addrs_or_offsets. (symbol_file_add_bfd): Remove, redundant with symbol_file_add_from_bfd. (symbol_file_add_from_bfd): Call symbol_file_add_with_addrs_or_offsets. (symbol_file_add): Call symbol_file_add_name_with_addrs_or_offsets. (symbol_file_add_main_1): Call symbol_file_add_name_with_addrs_or_offsets. * symfile.h (symbol_file_add_bfd): Remove decl. 2005-06-17 Klee Dienes symfile.c (reread_symbols): Fix up the Apple-local patches to the stat check --- the FSF folks added their own check, but it's not quite right. 2005-06-15 Klee Dienes * configure: Regenerate. * configure.ac: Add AC_PROG_LIBTOOL. 2005-06-07 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_frame_setup_skip_insns): Add instructions found in prologues on a Red Hat FedoraCore2 system. 2005-06-04 Jason Molenda (jmolenda@apple.com) * i386-tdep.c: A little merge cleanup. Haven't tried compiling yet, just eyeballing. 2005-05-30 Stan Shebs * block.c (blockvector_for_pc_sect): Note a mysterious change. * breakpoint.c (insert_bp_location): Mark local changes. (insert_breakpoints): Likewise. (software_breakpoint_inserted_here_p): Likewise, remove if 0 block. (print_it_typical): Mark local change. (watchpoint_equal): Note as Apple-only. (watchpoint_check): Mark local changes. (bpstat_stop_status, print_one_breakpoint, user_settable_breakpoint, resolve_pending_breakpoint, disable_breakpoints_in_shlibs, mention, delete_breakpoint, delete_command, breakpoint_re_set_one, save_breakpoints_command): Mark local changes. * breakpoint.h: Likewise. * buildsym.c (add_symbol_to_list, finish_block, make_blockvector, start_subfile): Likewise. (end_symtab): Remove if 0 block. * buildsym.h: Mark local change. * c-typeprint.c (cp_type_print_method_args): Likewise. (c_type_print_args): Likewise. * cli-out.c: Likewise. * completer.c: Tweak FSF discrepancy. * corelow.c (core_close): Mark local change. * cp-abi.c, cp-abi.h, cp-namespace.c: Likewise. * stabsread.c (read_member_functions): Remove long if 0 block. * symfile.c, symfile.h, symtab.h: Tweak cosmetic FSF discrepancies. * cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c, cli/cli-script.c: Likewise, and mark local changes. 2005-05-27 Klee Dienes * minsyms.c (prim_record_minimal_symbol_and_info): Don't build the equivalent symbol table here; these symbols are going to get freed and replaced by versions on the obstack. (install_minimal_symbols): Instead, build them here, by calling the new function equivalence_table_build(). * symmisc.c (equivalence_table_build): New function. Based on the original code from prim_record_minimal_symbol_and_info. * symtab.h (equivalence_table_build): Add prototype. (equivalence_table_add): If the table hasn't been allocated, something has gone very wrong --- issue an internal error, instead of just covering it up. 2005-05-27 Klee Dienes * linespec.c (decode_variable): Add new boolean argument EQUIVALENCIES, to determine if decode_variable should look up equivalent symbols. (minsym_found): Ditto. Also, when returning the canonical names, single-quote them so they won't be re-evaluated for equivalent symbols later. (decode_line_one): If we are parsing a single-quoted string, tell decode_variable not to look up equivalent symbols. (decode_dollar): Tell minsym_found not to look up equivalent symbols. (decode_variable): Propagate CANONCIAL through to minsym_found. 2005-05-27 Klee Dienes * breakpoint.c (bpstat_copy): Release the copy of the value in the bpstat, so it doesn't get freed out from underneath us. 2005-05-27 Klee Dienes * frame.c (get_prev_frame): Allow a single duplicate frame in the stack (generating a warning), but generate an error if there are two or more duplicates in a row. This allows us to recover from a minor prologue parsing error, but still prevents an infinite loop from spamming the user. 2005-05-26 Stan Shebs * arch-utils.c, arch-utils.h (generic_dynamic_trampoline_nextpc): Remove. (show_endian): Tweak local markers. * blockframe.c (deprecated_inside_entry_file): Likewise. (inside_main_func): Likewise. * breakpoint.c: Add some local markers. * breakpoint.h: Likewise. * c-valprint.c: Likewise. * corefile.c: Tweak local markers. * gdbarch.sh, gdbarch.c, gdbarch.h: Remove dynamic_trampoline_nextpc bits. * hpread.c (hpread_alloc_type): Revert local change. * utils.c: Whack a newline. * value.h: Tweak whitespace and local markers. * varobj.c: Add some local markers. * wrapper.c: Likewise. 2005-05-26 Jason Molenda (jmolenda@apple.com) * serial.c (serial_open): Comment fix. 2005-05-25 Stan Shebs * breakpoint.c, c-typeprint.c, cli/cli-out.c, eval.c, event-top.c, fork-child.c, frame.h, infcmd.c, inftarg.c, jv-exp.y, main.c, maint.c, minsym.c, objc-lang.c, ppc-tdep.h, remote.c, source.c, stabsread.h, stack.c, symfile.c, target.h, thread.c, top.c, ui-out.c, cli/cli-decode.h, cli/cli-script.c, mi/mi-cmd-break.c, mi/mi-cmd-file.c, mi/mi-cmd-var.c, mi/mi-main.c: Cosmetic changes to reduce discrepancy with FSF versions. * corefile.c (memory_error): Remove use of always-zero error_hook. * defs.h: Remove redundant include of ansidecl.h, remove junk cygwin and NeXT_PDO passes. * elfread.c (elf_symtab_read): Remove old PDO bit. * eval.c (evaluate_subexp_standard): Remove reference to undefined variable symbol_generation. * gdb_locale.h: Remove include of ansidecl.h and undef of _. * gdbarch.sh, gdbarch.c, gdbarch.h: Remove clear_gdbarch_swap, declarations of swapout_gdbarch_swap and swapin_gdbarch_swap, all unused. * macosx/macosx-nat-dyld.c: Likewise. * jv-lang.c: Remove unused static class_symtab_space. * m2-exp.y: Remove unused NOTUI. * minsym.c (lookup_minimal_symbol_text): Remove local #if 0 bit. (lookup_minimal_symbol_by_pc_section_from): Likewise. (lookup_minimal_symbol_by_pc): Remove #if O FSF bit, risky for bad patching in merges. * objfiles.c (objfile_purse_solibs): Remove local commented-out code. * rs6000-tdep.c: Add a local marker. * serial.h, serial.c, ser-pipe.c, ser-tcp.c, ser-unix.c, macosx/macosx-nat.c: Don't use altered names for open, close, and write fields of struct. * stabsread.c: Don't include limits.h. (os9k_stabs): Remove. * symtab.c (gdb_mangle_name): Remove local #if 0 code. * target.c (debug_to_core_file_to_sym_file): Likewise. * gdbtk-cmds.c, gdbtk-hooks.c: Add local markers. 2005-05-22 Stan Shebs * Makefile.in: whack old nindy bits left over from merge. * dbxread.c (unparse_stabtype): Remove, never used. * arch-utils.c, cp-namespace.c, symfile.c: Add a newline. * bcache.c: Lose a newline. 2005-05-19 Jim Ingham * varobj.c: Added "lookup_dynamic_type" variable to the value_of_child ftype. (value_of_child): Pass this in. (c_value_of_child): Set it properly. (java_value_of_child): Ditto (cplus_value_of_child): Ditto, plus make sure if we are a baseclass, we use TYPE_PTR if our parent was a pointer to the object. (cplus_type_of_child): Again, base-classes need to be pointers to base-class if their parents were as well. (cplus_path_expr_of_child): Need to use the dynamic child for the cast if it is available. 2005-05-19 Stan Shebs * coffread.c, event-loop.c, exec.c, fork-child.c, gdbarch.h, gdbarch.sh, gdbcore.h, hpux-thread.c, i386-tdep.c, infcall.c, infcmd.c, memattr.c, objfiles.c, objfiles.h, solib.c: Clear random small differences from FSF versions, cosmetic or unused code. * defs.h (Debugger_state): Remove, not needed. (state_change_hook): Likewise. * top.c (state_change_hook): Remove. (quit_target): Remove use of state_change_hook. * infcmd.c (run_command, continue_command, signal_command): Likewise. * inflow.c (kill_command): Likewise. * infrun.c (handle_inferior_event): Likewise. * main.c (main): Likewise. * symfile.c (symbol_file_clear, symbol_file_command): Likewise. 2005-05-19 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_frame_setup_skip_insns): Add xorps. 2005-05-18 Stan Shebs Remove cached symfile machinery. * Makefile.in: Remove reference to cached-symfile.o. * jv-lang.c (get_dynamics_objfile): Only use Apple version of allocate_objfile. * objfiles.c: Restore to layout more like to FSF code, remove FSF_OBJFILES stuff since diverged from FSF, merge cached symfile commands from removed files for compat (but they are no-ops). * objfiles.h (OBJF_MAPPED): Remove. (allocate_objfile): Remove excess decl. * symfile.c (MAPPED_SYMFILES): Remove. (symbol_file_add_bfd_with_addrs_or_offset): Only use Apple version of allocate_objfile, prune out mapped symfile code. (add_symbol_file_command): Remove -mapped option. (reread_separate_symbols): Remove use of OBJF_MAPPED. 2005-05-16 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (update_picbase_register): Add a debug printer. * i386-tdep.c (i386_find_picbase_setup): i386_frame_setup_skip_insns now skips over the picbase register call, so look for that in the matched insns. 2005-05-12 Jim Ingham * dwarf2read.c: Add the dwarf_*_vma values to the dwarf2_pinfo structure. Add accessor macros. (dwarf2_build_psymtabs_hard): Store our hacky dwarf_*_vma addresses in the pst. (psymtab_to_symtab_1): reset the dwarf_*_vma addresses out of the pst. 2005-05-10 Jim Ingham * breakpoint.c (breakpoint_create): Don't let the condition setting for a pending breakpoint "error", catch the error and issue a warning instead. * objc-exp.y: Use find_template_name_end to step over a template rather than doing it by hand. 2005-05-09 Klee Dienes * stabsread.c (define_symbol): Add support for CodeWarrior-style boolean constants. 2005-05-09 Klee Dienes * dbxread.c (end_fun_absolute_p): New variable. (process_one_symbol): Add support for absolute-address N_FUN stabs. (_initialize_dbxread): Add "function-end-absolute" GDB variable. 2005-05-09 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_analyze_frame_setup): Remove FIXME comment I'd added - I believe I was mistaken. 2005-05-03 Ronnie Misra (rgmisra@apple.com) Edited by Jason Molenda (jmolenda@apple.com) * remote.c (remote_ops): Make global so we can access it from macosx-nat.c. * serials.c (serial_open): Recognize "unix" style serial connections (socket connections). 2005-05-02 Jim Ingham * breakpoint.c (tell_breakpoints_objfile_changed): Always check the bp_objfile against the one passed in, regardless of whether the breakpoint is set or not. 2005-04-29 Klee Dienes * valarith.c (value_subscripted_rvalue): Fix comparison against upper bound. 2005-04-29 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_find_esp_adjustments): New function, necessary for finding our way in -momit-leaf-frame-pointer frames. (i386_frame_cache): Add new case to handle genuinely frameless functions. 2005-04-29 Klee Dienes * infrun.c: Include "ppc-macosx-regnums.h" when necessary. (handle_inferior_event): If we are doing a metrowerks-step, use ($pc == $lr) to determine if we have just returned from a function, since we won't have any other symbol information available. 2005-04-29 Klee Dienes * eval.c (evaluate_subexp_with_coercion): Don't coerce vectors to pointers, even though they are nominally arrays. * gdbtypes.c (use_stride): New variable. (create_range_type): Add new 'stride' field. (get_array_bounds): New function. (_initialize_gdbtypes): Add 'use-array-stride' GDB variable. * gdbtypes.h (TYPE_STRIDE): New accessor. (get_array_bounds): Add prototype. * stabsread.c (read_type): Add support for the @T= (stride) parameter. Set the stride to -1 if we notice the @V (vectory) parameter on an Intel target. * valarith.c (value_subscripted_rvalue): No longer pass the lower bound explicitly; we can calculate it from the range type. Add support for reverse array strides. (value_subscript): Use get_array_bounds and the new prototype for value_subscripted_rvalue. Pull in the change from FSF that doesn't print a "out of range" warning if the array is declared to be of unspecified size. Add support for reverse strides. * valprint.c (val_elt_addr): New function. (val_print_array_elements): Update to use val_elt_addr. 2005-04-29 Jim Ingham * valops.c (value_cast): Don't COERCE_REF a reference type, since that turns it into a struct and then when we go to cast it back to a reference, we cast the value not the address. 2005-04-26 Jim Ingham * breakpoint.c (resolve_pending_breakpoint): Pass a choices array with -1, so if there are multiple hits we will choose all the hits. (re_enable_breakpoints_in_shlibs): catch errors from resolve_pending_breakpoint. * stabsread.c (read_struct_type): If we see a redefined type, read the new stab in. Otherwise we may miss some in-line type definitions that we might need. (find_name_end): gcc emits some ObjC++ symbol names with the ObjC bit AFTER the _ZWhatever. find_name_end should skip over the ObjC part of these symbols. * valops.c (check_field): If "this" is not a aggregate, warn and return not a member of this, rather than error-ing. Otherwise you will halt searches whenever you are in a frame with bad stabs for "this". 2005-04-26 Jason Molenda (jmolenda@apple.com) * printcmd.c (decode_format): Recognize "T". (print_formatted): Call print_ostype for "T". (print_scalar_formatted): Ditto. (do_examine): Recognize "T". (_initialize_printcmd): Add "T" to "help x" documentation. * valprint.c (print_ostype): Print out an OSType variable's contents. * valprint.h (print_ostype): Add prototype. * varobj.c (varobj_format_string): Add "unsigned" and "OSType". (format_code): Matching update. (varobj_set_display_format): Handle FORMAT_OSTYPE. * varobj.h (enum varobj_display_formats): Add FORMAT_OSTYPE. 2005-04-25 Jason Molenda (jmolenda@apple.com) * target.c (debug_check_is_objfile_loaded): A "debug target" printer function. (setup_target_debug): Add it to the vector. 2005-04-21 Jim Ingham * breakpoint.c (resolve_pending_breakpoint): move the delete_breakpoint call into this function, it's much cleaner that way. (re_enable_breakpoints_in_shlibs): Take delete_breakpoint out of here. (do_enable_breakpoint): Ditto (create_breakpoints): Swap the resolved breakpoint for the pending breakpoint in the list (if there is only one resolved breakpoint.) 2005-04-20 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_match_insn): New parameter, to indicate that we should avoid matching a prologue instruction or not. (i386_frame_setup_skip_insns): Add all the instructions that were scheduled into prologues in any dylib/framework on a gcc 3.3 compiled system. (i386_analyze_frame_setup): Return the instruction following the last frame-setup instruction we saw. Update call of i386_match_insn. (i386_find_picbase_setup): Update calls to i386_match_insn. (maintenance_i386_prologue_parser): Look 48 bytes into the function before giving up, by default. Fix status printing statements a bit. 2005-04-18 Klee Dienes * minsyms.c (lookup_minimal_symbol): Don't crash if a minsym doesn't have filename set in the SOFUN_ADDRESS_MAYBE_MISSING code-path. 2005-04-18 Klee Dienes * arch-utils.c (show_endian): Add MI support. 2005-04-15 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (maintenance_i386_prologue_parser): Add a new maint command to run gdb's prologue analyzer on a selected address/function and report how far it got. 2005-04-14 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_analyze_frame_setup): Don't scan into the following function by accident. (i386_frame_cache): Detect frames that cannot possibly be frameless, so we can make assumptions about the stack setup, regardless of our ability to parse the function's prologue. 2005-04-14 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_analyze_frame_setup): Recognize the push $0x0 as an alternative to push %ebp in a prolgoue. 2005-04-14 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_frame_setup_skip_insns): Add instructions found in hand-written assembly in objc_msgForward. (i386_analyze_frame_setup): Allow for any of the non-prologue instructions to occur before push %ebp. 2005-04-09 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (redirect_old_function): Write an x86 Fix and Continue trampoline. (decode_fix_and_continue_trampoline): Recognize an x86 F&C trampoline. (update_picbase_register): CAll out to i386_find_picbase_setup() (new function) to find the picbase for a function, if any is used. (fix_and_continue_supported): F&C is now supported on x86. * i386-tdep.c (I386_MAX_INSN_LEN, struct i386_insn, i386_match_insn, i386_frame_setup_skip_insns, i386_analyze_frame_setup): Import FSF gdb TOT sources for these structs/variables/functions (2005-04-07). I ended up modifying all of these with minor Apple Local changes. (i386_frame_setup_insns): New array, a list of instructions that are expected in a function prologue. (i386_find_picbase_setup): New function; skip over instructions that are expected in a prologue, and instructions that sometimes get scheduled into a prologue, looking for the CALL insn that will set up the PIC base for this function. * i386-tdep.h: Prototype for i386_find_picbase_setup. 2005-04-06 Klee Dienes * findvar.c (extract_signed_integer_with_byte_order): Construct from extract_signed_integer. (extract_signed_integer): Update to use extract_signed_integer_with_byte_order. (extract_unsigned_integer_with_byte_order): Ditto. (extract_unsigned_integer): Ditto. (extract_long_unsigned_integer_with_byte_order): Ditto. (extract_long_unsigned_integer): Ditto. (store_signed_integer_with_byte_order): Ditto. (store_signed_integer): Ditto. * gdbtypes.h (struct main_type): Use the last two bits of the 'type' field, for the new field 'byte_order', to store the byte order of the given type. (TYPE_BYTE_ORDER): Add accessor for 'byte_order'. * gdbtypes.c (alloc_type): Initialize the byte order to BFD_ENDIAN_UNKNOWN. * i386-linux-nat.c (swap_fpxregs): New function. Byte-reverses the xmm register sections of a fxsave region. (fetch_fpxregs): Call swap_fpxregs on the xmm data. (store_fpxregs): Call swap_fpxregs on the xmm data. * i386-tdep.c (builtin_type_vec128i_big): New type, for big-endian 128-bit vectors (used by the XMM register store). (init_vector_type): Taken from gdbtypes.c. (build_builtin_type_vec128i_big): Create the big-endian XMM register type. (i386_register_type): Return builtin_type_vec128i_big for XMM registers. (_initialize_i386_tdep): Call build_builtin_type_vec128i_big. * i387-tdep.c (i387_swap_fxsave): New function. Byte-reverses the xmm register sections of a fxsave region. * i387-tdep.h (i387_swap_fxsave): Add prototype. * valprint.c (val_print_type_code_int): Update to use the _with_byte_order variants of the print/extract functions. (print_hex_chars_with_byte_order): Construct from print_hex_chars. (print_hex_chars): Update to use print_hex_chars_with_byte_order. (print_char_chars_with_byte_order): Ditto. (print_char_chars): Ditto. * valprint.h (print_hex_chars_with_byte_order): Add prototype. (print_char_chars_with_byte_order): Add prototype. * values.c (unpack_long): Update to use the _with_byte_order variants of the print/extract functions. 2005-03-31 Jim Ingham * i386-tdep.c (i386_analyze_frame_setup): Really look for mov $XXX, reg rather than just doing it when reg == %ecx * fork-child.c (_initialize_fork_child): Typo in the help string. 2005-03-30 Jim Ingham * fix-and-continue.c (decode_fix_and_continue_trampoline): Make this a no-op for anything other than PPC. * i386-tdep.c (i386_analyze_frame_setup): Add cmpl to the list of instructions we might find after the push %ebp, since the compiler sometimes puts it there. * config/i386/tm-i386-macosx.h: Remove definitions for the skip_trampoline functions - they are now generic macosx functions. 2005-03-24 Jason Molenda (jmolenda@apple.com) * configure.in: Force AC_FUNC_MMAP's result to 'yes' - it needs to run a test case to say 'yes' so cross-host builds end up with mmap support turned off. Replaced the configdirs variable with separate invocations of AC_CONFIG_SUBDIRS as the new autoconf wants to have done. (matches FSF TOT) * acloal.m4, configure, */configure: Regenerated. 2005-03-18 Jim Ingham * remote.c (init_remote_ops): Make sure that the asyn_mask_value is 0 for asynchronous remote target. * target.c (update_current_target): Inheriting data values doesn't work with the INHERIT method, since 0 means "doesn't provide a value". 2005-03-18 Jason Molenda (jmolenda@apple.com) * objfiles.c (_initialize_objfiles): Don't put the auto-raise-load-levels in a #if HAVE_MMAP section of code. 2005-03-11 Jason Molenda (jmolenda@apple.com) * i386-tdep.c (i386_frame_cache): Revert a bit of Klee's 2005-02-23 patch that was causing problems with source-level 'next'ing. 2005-03-11 Jason Molenda (jmolenda@apple.com) * symfile.c (symfile_bfd_open): Mark symbol files as cacheable so we don't fill the bfd cache. 2005-03-04 Jim Ingham * objfiles.c (objfile_name_set_load_state): New function. * objfiles.h: declare objfile_name_set_load_state. * breakpoint.c (breakpoint_re_set_one): If a shlib is specified for the breakpoint, raise it's load level here just to make sure that someone hasn't downgraded it between the time you first set the breakpoint and now. 2005-03-02 Jim Ingham * breakpoint.c (gnu_v3_update_exception_catchpoints): If the library in which we are setting the exception breakpoint hasn't been loaded yet, set the bp_waiting_load state. (breakpoint_re_set_one): Also reset exception breakpoints that are waiting load. (breakpoint_update): The check for breakpoint type is bogus, don't set the waiting state if you don't intend the breakpoint to be updated. 2005-02-24 Jim Ingham * objfiles.c (objfile_set_load_state): Add the force parameter and obey it. (pc_set_load_state): Ditto. (_initialize_objfiles): Add the "set auto-raise-load-levels" flag. * objfiles.h: Change the declarations of objfile_set_load_state and pc_set_load_state. * breakpoint.c (parse_breakpoint_sals): Pass force parameter. * fix-and-continue.c (raise_objfile_load_level): Ditto. * infrun.c (handle_step_into_function): Ditto * stack.c (print_frame_info): Ditto * frame.c (frame_id_equal): Turn off the code_addr = 0 means wildcard behavior altogether. * stack.c (symbol_file_add_main_1): Obey the load rules for the main executable. * thread.c (thread_apply_all_command): Don't report the thread switch back to the original thread, it is just confusing spam. 2005-02-23 Klee Dienes * i386-tdep.c (i386_frame_cache): Use 0(%ebp) as the default value for the previous %ebp when not on the top of the stack. Don't try to be too clever about deciding a function is frameless, or partially constructed, unless we were able to parse the prologue. (i386_frame_this_id): Truncate the backtrace when we reach a NULL %ebp for the previous frame. 2005-02-23 Klee Dienes * corefile.c (captured_read_memory_integer_arguments): Allow either a signed or unsigned result. Add 'signedp' to determine which field to use. (do_captured_read_memory_integer): Honor the value of 'signedp'. (safe_read_memory_integer): Update to set signedp, and retrieve the signed value. (safe_read_memory_unsigned_integer): New function. * gdbcore.h (safe_read_memory_unsigned_integer): Add prototype. 2005-02-21 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_and_continue_supported): New function to determine if F&C is supported for the given executable or not. * defs.h: Prototype for above. 2005-02-18 Klee Dienes * symfile.c (symbol_file_add_main_1): Check the load rules when loading symfile_objfile as well. 2005-02-17 Jim Ingham * breakpoint.c (insert_bp_location): Breakpoints that are pure address breakpoints, with no associated objfile should always be inserted. We assume the user knew what she was doing in this case. (breakpoint_re_set_one): Ditto. (breakpoint_update): Ditto. * linespec.c (decode_line_2): Obey funfirstline for symbols which are in objfiles with no debug info as well. (decode_objc): Ditto. 2005-02-10 Jim Ingham * breakpoint.h: Add the bp_set_state enum, use it for the bp_set_state element of struct breakpoint. * breakpoint.c: First, revert the changes of 2005-01-21, this is a better way to do it. Second, everywhere bp_set_p appears, convert to bp_set_state, and use the enum. (breakpoint_re_set_one): If we fail to set the breakpoint all the way because it's objfile isn't loaded yet, don't delete it, mark it as bp_state_waiting_load. (breakpoint_update): If there are any bp_state_waiting_load breakpoints, try to set them in the objfile they were found in. 2005-02-01 Jim Ingham * ppc-sysv-tdep.c (ppc_push_argument): Follow the Mac OS X ABI and don't 8-byte align long long's. * breakpoint.c (breakpoint_re_set_all): Continue after deleting longjmp breakpoint. 2005-02-01 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restriction_cxx_zerolink): Correct error message syntax. 2005-01-31 Jim Ingham * printcmd.c (address_info): Check for a NULL block before accessing it. 2005-01-28 Jim Ingham * objfiles.c (objfile_set_restrict_list): New function. (objfile_matches_name): Return different values for an exact match & a basename match. (make_cleanup_restrict_to_objfile_list): New function. (make_cleanup_restrict_to_shlib): If you have multiple basename only matches, then look in all those matches. * objfiles.h: def'n of objfile_matches_name_return enum. 2005-01-25 Jim Ingham * breakpoint.c (breakpoint_re_set_all): Delete the old longjmp breakpoints before making them again. FIXME: Probably should just flag whether we have done this once, and not do it again. 2005-01-21 Jim Ingham * breakpoint.c (set_bp_objfile): New function. (set_raw_breakpoint): use set_bp_objfile. (create_breakpoints): Ditto. (breakpoint_re_set_one): If we can't set the breakpoint because it's objfile isn't loaded yet return 1 to indicate this to our callers. Also use set_bp_objfile. (breakpoint_re_set_all): Pass up the return value from breakpoint_re_set_one. (breakpoint_update): If we couldn't reset the breakpoint because a library hadn't loaded yet, don't reset the symbol & breakpoint generations, so we will retry setting the breakpoint again next time around. 2005-01-13 Jason Molenda (jmolenda@apple.com) * symfile.h: Include symtab.h to pick up domain_enum decl. 2005-01-13 Jason Molenda (jmolenda@apple.com) * jv-lang.c (get_dynamics_objfile): Proper # of args to allocate_objfile(). * objfiles.h: Add prototype for cached symfile version of allocate_objfile() so all callers are using the right prototype. * symfile.c: Don't include macosx/cached-symfile for allocate_objfile prototype. (TEXT_SEGMENT_NAME): Provide default for non-macosx platforms. 2005-01-12 Jason Molenda (jmolenda@apple.com) * objfiles.h (struct objfile): New field, syms_only_objfile. * objfiles.c (allocate_objfile): Set SYMS_ONLY_OBJFILE field of struct objfile to 0 by default. * symfile.c (add_symbol_file_command): Mark objfile that we add via add-symbol-file as such so breakpoint insertion isn't confused. 2005-01-12 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command_1): Raise the load level of the original dylib AFTER we tell zerolink to page it in, not before. 2005-01-11 Jason Molenda (jmolenda@apple.com) * symfile.c (syms_from_objfile): Use the text segment name, not the text section name, to find the load address of the file. (add_symbol_file_command): Ditto. * config/tm-macosx.h (TEXT_SEGMENT_NAME): Define. 2005-01-04 Jason Molenda (jmolenda@apple.com) * breakpoint.c: Don't include macosx-nat-dyld-process.h here any more; we're going through the target vector as of 2004-12-22. 2005-01-04 Jason Molenda (jmolenda@apple.com) * breakpoint.c (insert_bp_location): Skip objfile-loaded check if we're evaluating a watchpoint. Those are considerably more complicated to handle correctly. (set_raw_breakpoint): Find the appropriate objfile for a breakpoint and stash that away for the is-objfile-loaded check in insert_bp_location. * objfiles.c (objfile_purge_solibs): Revert 2004-12-21 change and #if 0 out the code that clears the object_files chain when we mourn the inferior. 2004-12-22 Jim Ingham * target.h: Add to_check_is_objfile_loaded to target vector. * target.c: INHERIT & de_fault to_check_is_objfile_loaded. * breakpoint.c (insert_bp_location): Switch to using target_check_is_objfile_loaded. 2004-12-21 Jason Molenda (jmolenda@apple.com) * objfiles.c (objfile_purge_solibs): Remove Apple Local #if 0 around the purgy bits of this function. 2004-12-17 Jason Molenda (jmolenda@apple.com) * breakpoint.c: Conditionally include macosx-nat-dyld-process.h at the top of the file. * infcall.c: Ditto. * objfiles.c: Ditto. 2004-12-15 Jim Ingham * objfiles.c (free_objfile): Move the call to delete_objfile_from_ordered_sections to before we close the bfd. We use the bfd sections in that call... * minsyms.c (lookup_minimal_symbol_by_pc_section_from_objfile): If we don't find a minsym in the correct section, return NULL rather than the last minsym we looked at. 2004-12-14 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (do_final_fix_fixups_static_syms): This func does nothing if oldobj is null; skip out early. (check_restrictions_locals): Move expensive loop invariant out of the loop. 2004-12-13 Jim Ingham * config/i386/macosx.mh (MACOSX_FILES): Add macosx-nat.o to match a change from 2003-03-13. [3677049] 2004-11-30 Jason Molenda (jmolenda@apple.com) * i386-tdep.h (struct gdbarch_tdep): Add a 'wordsize' field so the macosx-nat-dyld.c code doesn't need ppc vs x86 ifdefs. * i386-tdep.c (i386_gdbarch_init): Set wordsize to 4. 2004-11-30 Jason Molenda (jmolenda@apple.com) * main.c (captured_main): Call source_file () instead of source_command () when we have a pathname for a file to source and we don't want that pathname going through the argv parser and messing things up. * top.h (source_file): Prototype. * cli/cli-cmds.c (source_command): Move the actual sourcing over to source_file (). This function now handles the argument parsing. (source_file): New function, which handles the sourcing. 2004-11-24 Jim Ingham * breakpoint.c (break_command_2): Make sure the index is in range before looking up the sal with it. (breakpoint_re_set_one): Don't use the osect if we failed to find it. * ppc-sysv-tdep.c (ppc_push_argument): If we are passed a 8 byte value that comes from a register (value->regno != -1) and we are running a 32 bit app, then artificially strip the upper 4 bytes. 2004-11-23 Jim Ingham * breakpoint.c (safe_breakpoint_sals_to_pc): New function. (wrap_breakpoint_sals_to_pc): New function. (break_command_2): Use safe_breakpoint_sals_to_pc. 2004-11-15 Jim Ingham * defs.h: Backport the def'n of return_value enum from the current gdb. * infcmd.c (print_return_value): Ditto. * values.c (using_struct_return): adjust test for the new return values. * ppc-sysv-tdep.c (ppc_darwin_abi_return_value): Fetch the struct return from r3 so we can display the value. 2004-11-12 Jim Ingham * ppc-sysv-tdep.c (ppc_copy_into_greg): New function. (ppc_copy_from_greg): New function. (ppc_push_argument): Use ppc_copy_into_greg. (ppc_push_arguments): ditto. (do_ppc_sysv_return_value): Use ppc_copy_from_greg. 2004-11-05 Jim Ingham * gdbtypes.c (init_type): If we are defining a long double type whose length is not the standard length, then make an explicit floatformat for it so we won't get confused. * ppc-sysv-tdep.c (ppc_push_argument): Don't assume floating point numbers are only 4 & 8 bytes. Also don't cast a 16 byte long double down to an 8 byte one. * (do_ppc_sysv_return_value): A 16 byte long double is passed back through $f1 & $f2. * stabsread.c (define_symbol): When we go to name a previously unnamed symbol, if is not the same length as the canonical long double, make a floatformat for it. 2004-11-04 Jim Ingham * objc-lang.c (find_implementation_from_class): Handle the mlist being NULL, and the CLS_NO_METHOD_ARRAY case, where the method list is an array of methods, rather than a pointer to the first chunk. 2004-11-02 Jason Molenda (jmolenda@apple.com) * arch-utils.c: Add two small caches of the size of registers and the offsets of registers, to speed up the (vastly common) computation of these. (reg_cache_hack__architecture_changed_hook): Reset the caches on arch change. (generic_register_size): Set cache if not initialized; use cache if initialized. (generic_register_byte): Ditto. * arch-utils.h: Prototype for reg_cache_hack__architecture_changed_hook. * gdbarch.c (deprecated_current_gdbarch_select_hack): Call reg cache hook. 2004-10-26 Jim Ingham * breakpoint.c (print_one_breakpoint): Print the shared library the breakpoint was set in if we are using the MI. * breakpoint.c (break_command_2): Add "indices" parameter, and if we are using the MI and have multiple hits, use this to determine which of the hits we should accept. * (resolve_pending_breakpoint): Pass indices parameter. * (re_enable_breakpoints_in_shlib): Ditto * (create_breakpoints): Ditto * (gdb_breakpoint): Ditto, also add an indices parameter so the MI can provide the indices. * gdb.h: Change declaration of gdb_breakpoints * infcmd.c (continue_command): If you aren't at a breakpoint, we weren't handling the ignore argument to continue properly because we didn't remember that bpstat_num returns -1 for no breakpoint... * linespec.c (minsym_found): Add "canonical" argument. * (decode_variable): Pass canonical to minsym_found. * (minsym_found): Look for an "equivalent symbol" if this objfile has them. Set the canonical name as well. * minsyms.c (prim_record_minimal_symbol_and_info): Build the table of "equivalent symbols". * objfiles.c (allocate_objfile): Hacky way to get us to check for equivalent symbols in libSystem only. FIXME: find some target way to do this. * (free_objfile): Delete the equivalence table if needed. * objfile.h: Add equivalence table pointer to the objfile. * symfile.c (reread_symbols): Clear out the equivalence table. * symmisc.c (equivalence_table_initialize): New function. * (equivalence_table_delete): New function. * (equivalence_table_add): New function. * (find_equivalent_msymbol): New function. * symtab.h: Declare the public functions above. 2004-10-26 Jason Molenda (jmolenda@apple.com) * eval.c (evaluate_subexp_standard): Look in the objc runtime to see if a method is defined for an object directly, instead of making a couple calls into the inferior to ask the objc runtime the same thing. Stub out the FSF code in a vain attempt to avoid extraneous conflicts. * objc-lang.c (find_implementation): Make extern, for above. * objc-lang.h (find_implementation): Add prototype. * objc-exp.y: I don't believe this code to look up a symbol as a class is ever correct, so prefix it with a symbol name lookup first. This means that a class name w/o debug info (that previously was looked up by this code) will be skipped, but I am doubtful this is used for anything, and the symbol lookup is cheap. (and the objc runtime call we were previously making all over the place was expensive.) 2004-10-13 Jim Ingham * thread.c (thread_apply_all_command): Use "safe_execute_command" rather than execute command so we will traverse ALL the threads even if there is an error in one thread. 2004-10-12 Jim Ingham * config/tm-macosx.h: Define SOFUN_ADDRESS_MAYBE_MISSING since gcc 4.0 on Darwin has started always setting it to 0. * minsyms.c (lookup_minimal_symbol_text): #ifdef'ing out a copy & paste error. 2004-10-10 Klee Dienes * dbxread.c: Many reversions to FSF sources. Revert dbx_symfile_read to FSF sources; moved the Mach-O specific version to machoread.c. Moved mmap_strtabflag to machoread.c. Move the TEXT_SECTION_NAME / DATA_SECTION_NAME stuff to machoread.c. Don't just store the bfd from which we are reading symbols for fill_symbuf; store the entire objfile (so we know the symbol stride) (i.e., processing_objfile instead of symfile_bfd). Revert the calls to stabsect_build_psymtabs to the FSF sources. Lots of whitespace reversions to the FSF sources. * nlmread.c (nlm_symfile_read): Revert to original call to stabsect_build_psymtabs. * stabsread.c (define_symbol): Take 'prefix' as a const string. * stabsread.h (define_symbol): Ditto. 2004-10-08 Jason Molenda (jmolenda@apple.com) * corefile.c (reopen_exec_file): Call tell_objc_msgsend_cacher_objfile_changed notifier func. * symfile.c (reread_symbols, remove_symbol_file_command): Ditto. * objc-lang.c (find_objc_msgsend): If we've already cached the locations of the method call funcs and the cache is not stale, don't recompute them. (tell_objc_msgsend_cacher_objfile_changed): Invalidate the method call function address cache. * objc-lang.c: Add prototype. 2004-10-07 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command_1): Further fixes to output of realpath(). 2004-10-06 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command_1): Be more suspcicious about the filenames provided to F&C. There's apparently a failure mode given a bad filename where gdb can crash but I forgot the exact details so I didn't repo. 2004-10-04 Jim Ingham * symtab.c (search_symbols): If the symbol & the msymbol don't have the same address, they probably aren't the same symbol. 2004-09-29 Jim Ingham * breakpoint.c (describe_other_breakpoints): Call breakpoint_address_is_meaningful before mentioning a breakpoint as a duplicate. 2004-09-28 Jim Ingham * infcmd.c: Make pid_info non-static. * inferior.h: Export it. * utils.c: remove the exec save & restore. These HAVE to be done when the continuation is run, so you can't split the exec_error_chain across a catcher call. * (do_exec_cleanups): Check for the case where the exec_cleanup_chain is NULL, but the old_chain is not. Don't crash, but just return silently. This is probably because an error wiped out the exec_cleanup_chain. * defs.h: remove the definition of exec save & restore. 2004-09-27 Jim Ingham * utils.c: remove the exec_error save & restore. The async execution code relies on these getting run inside the catcher in complete_execution, so setting them aside won't work. * top.c: Ditto * defs.h: Ditto 2004-09-24 Jim Ingham * utils.c (save_exec_cleanups, save_exec_error_cleanups, restore_exec_cleanups, restore_exec_error_cleanups): New functions. * defs.h: Declare the above. * top.c (catcher): Save off the exec & exec_error cleanup chains, as well as the standard cleanup chain. (throw_exceptions): Add comment explaining that if you do all cleanups on any chain here, you have to preserve it in the catcher function. 2004-09-23 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command): Move argument expansion into fix_command_1(). (fix_command_1): New function, called from CLI and MI front ends, formerly fix_command_helper(). (get_fixed_file): Raise struct objfile's symbol reading level after the new bundle has been loaded. (pre_load_and_check_file): Ditto, for the pre-loaded bundle. (raise_objfile_load_level): Function to raise the symbol reading level of a given struct objfile. * defs.h: New prototype for fix_command_1(). 2004-09-23 Klee Dienes * i386-tdep.c (i386_analyze_frame_setup): Recognize 'mov $1, %edx' in function prologue (patch from Eric Albert). 2004-09-20 Jim Ingham * stabsread.c (attach_fields_to_type): Since the type length was moved out of main_type, we need to update it here for all the types in the type chain. 2004-09-16 Jim Ingham * eval.c (eval_subexp_standard): Don't set a type for the objc_msgSend call. This ends up getting used by some twisted logic as the type OF the method call if we can't find the debug info for it. The twisted logic should be cleaned up, but this will do for now. 2004-09-15 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_objc): Fix number mash-up from merging of muon-branch code to TOT. 2004-09-15 Jim Ingham * varobj.c (c_value_of_variable): Pass 0 for the deref_ref parameter of val_print. You never want to have the dereferenced value in the varobj's value, that's what the children are for. 2004-09-14 Jim Ingham * language.c (make_cleanup_restore_language): New function. (do_set_langauge): New function. * language.h: declare make_cleanup_restore_language. * linespec.c (find_methods): Since this is a C++ specific function, set the language to C++ before searching for the methods. 2004-09-10 Jim Ingham * infrun.c (init_execution_control_state): reset the ws->code to -1. (handle_inferior_event): Print the extra info from target_waitstatus if available. * target.h: Add code & address fields to the target_waitstatus. 2004-09-09 Jason Molenda (jmolenda@apple.com) * Makefile.in (LIBXML2_CFLAGS, LIBXML2_LDFLAGS): New settings. * configure.in: Test for libxml2 header files/libraries/settings. Define LIBXML2_IS_USABLE if everything appears to be in order. Substitute LIBXML2_INCLUDES, LIBXML2_LIBS in Makefile.in. * configure: Regenerated. * config.in: Regenerated. 2004-09-09 Jim Ingham * linespec.c (symtab_from_filename): The "No symbols loaded" error was not respecting the not_found_ptr. 2004-09-08 Jim Ingham * breakpoint.c (print_one_breakpoint): Since we keep the breakpoint condition around to see if we can parse it once we are running, we need to print the not-yet parsed condition string. 2004-09-08 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. Submitted to the FSF 2004-09-08. 2004-09-07 Jim Ingham * breakpoint.c (break_command_1): Fix a bug with quoted filenames. * symtab.c (rbreak_command): Pass the shared library name from the symtab down to break_command using the -shlib argument. 2004-09-07 Jason Molenda (jmolenda@apple.com) * c-exp.y (OBJC_SELECTOR): Add semicolon at end of grammar rule for compatability with some versions of bison. 2004-09-02 Jason Molenda (jmolenda@apple.com) * completer.h (gdb_completer_command_word_break_characters, gdb_completer_quote_characters): These now have static linkage; don't list them in a header file. * cp-abi.h (switch_to_cp_abi): Ditto. * gdbarch.sh (target_byte_order, target_byte_order_auto): Ditto. * gdbarch.h: Regenerated. * gdbtypes.c (cplus_struct_default): Remove const qualifier because of the NONULL macros in gdbtypes.h * gdbtypes.h (cplus_struct_default): Ditto. * stabsread.h (add_undefined_type): Function no longer has extern linkage. * target.h (cleanup_target): Ditto. 2004-08-31 Jason Molenda (jmolenda@apple.com) * breakpoint.c (parse_breakpoint_sals): OK, this change should be correct now. (break_command_2): Don't output the error message buffer when we're doing a pending breakpoint and a shlib was specified. 2004-08-30 Jason Molenda (jmolenda@apple.com) * breakpoint.c (parse_breakpoint_sals): Back out previous change; it just moves the error over to linespec.c. 2004-08-30 Jason Molenda (jmolenda@apple.com) * breakpoint.c (parse_breakpoint_sals): Don't issue error msg about solib not found if we're setting a pending (aka future) breakpoint. 2004-08-26 Jason Molenda (jmolenda@apple.com) * dbxread.c (objfile_contains_objc): Simplfy ObjC check. 2004-08-26 Jim Ingham * dbxread.c: Switch the default for mmap-string-tables to on. 2004-08-25 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_dbx_symtab): Pass in the # of nlist stab records instead of getting it from the objfile. (dbx_symfile_read): Set the offset/number of stab symbol table entries depending on whether this is a load-rules extern/container or not. (dbx_symfile_init): Duplicate initialization of DBX_LOCAL_STAB_* and DBX_NONLOCAL_STAB_* just like in (stabsect_build_psymtabs). (coffstab_build_psymtabs): For safe keeping, initialize the DBX_LOCAL_STAB_* and DBX_NONLOCAL_STAB_* structure members to 0. (elfstab_build_psymtabs): Ditto. (objfile_contains_objc): New function, to check for telltale BFD sections that indicate we're working with an ObjC objfile. * objfiles.h: Add an Apple Local marker. 2004-08-24 Jason Molenda (jmolenda@apple.com) * dbxread.c (stabsect_build_psymtabs): Look for the local_stab_name and nonlocal_stab_name BFD sections and record the #'s from those sections in the objfile if they're present, else record 0's. * gdb-stabs.h (struct dbx_symfile_info): New fields to record local/non-local nlist stab records if that information is available to us. (DBX_LOCAL_STAB_OFFSET, DBX_LOCAL_STAB_COUNT, DBX_NONLOCAL_STAB_OFFSET, DBX_NONLOCAL_STAB_COUNT): Accessor macros. * minsyms.c: Two small typeos in comments. * nlmread.c (nlm_symfile_read): Update call to stabsect_build_psymtabs to provided NULL values for new arguments. * stabsread.h (stabsect_build_psymtabs): Update prototype to list new arguments. 2004-08-24 Jason Molenda (jmolenda@apple.com) * eval.c (evaluate_subexp): Make prototype and func defn match. * configure.in: Define USE_MMALLOC to 1. * configure: Regenerate. 2004-08-26 Jim Ingham * Makefile.in: igore errors if _objcInit isn't in gdb when we go to run strip. It was removed late in Tiger. * dbxread.c (stabsect_read_psymtabs): Use bfd_get_section_contents_in_window_with_mode so we can pass the read-only flag. *infrun.c (handle_step_into_function): Try to up the debug level to OBJF_SYM_ALL before testing for presence of source line info. 2004-08-10 Jim Ingham * breakpoint.c (parse_breakpoint_sals): If requested_shlib is set then ensure the symbol load level is all before setting the breakpoint. * dbxread.c (read_dbx_symtab): Immediately skip over stabs if we aren't reading them in. Also added a comment. * objfiles.c (objfile_set_load_state): New function. (pc_set_load_state): New function. * objfiles.h: declare these. * stack.c: Make sure any objfiles on the stack are fully loaded. 2004-08-09 Jim Ingham * cp-namespace.c ((cp_lookup_transparent_type_loop): Fix recursion bug. Applying patch from D. Carlton on 2004-03-05. 2004-08-09 Jason Molenda (jmolenda@apple.com) * dbxread.c (read_so_stab_language_hint): New function. (read_dbx_symtab): Prefer language from SO stab's desc field over language based on the suffix of the source filename. (start_psymtab): Only use the source filename suffix if the language hasn't been already set. (process_one_symbol): When expanding psymtab to symtab, use the desc field to set the language if it contains anything meaningful. 2004-08-09 Klee Dienes * gdb/gdb.1: Replace the hard-coded pathname with GDB_DOCUMENTATION_DIRECTORY (see change to the top-level Makefile). 2004-07-30 Klee Dienes * exec.c (exec_file_attach): Remove extraneous check for 'osabi <= 0'. * symfile.c (symfile_bfd_open): Deduce the osabi if not already set, using the same logic as exec_file_attach. Don't error out if a member of an archive isn't an executable; just continue scanning. 2004-07-29 Klee Dienes * dbxread.c (stabsect_build_psymtabs): Warn, not error, if there is no data section. 2004-07-28 Klee Dienes * corefile.c (core_file_command): Split into core_file_attach. * gdbcore.h (core_file_attach): Add prototype. * main.c (quote_string): Remove (it was unused). Call core_file_attach in place instead of core_file_command. 2004-07-21 Klee Dienes * exec.c (exec_file_attach): Use the osabi code to select the correct version of the archive file. * symfile.c (symfile_bfd_open): Ditto. (reread_symbols): Ditto. 2004-07-21 Klee Dienes * top.c (_initialize_symread): Remove. 2004-07-21 Klee Dienes * valops.c (value_ind): Use value_as_address, not value_as_long, to get the value of the address when implicitly using an int as a pointer in a c-style deference. 2004-07-21 Jim Ingham * interps.c (set_interpreter_cmd): "set interpreter" to the current interpreter should be a no-op. * symfile.c (add_symbol_file_command): If we got no offset addresses, pass a NULL section_addrs rather than a section_addrs with 0 num_sections. The former is what the code below us is expecting. 2004-07-16 Jason Molenda (jmolenda@apple.com) * gdb.1: Update path to full gdb documentation. 2004-07-13 Jim Ingham * linespec.c (decode_variable): Treat the case were no symbols are found as a "file not found" error. This will allow future break to work in a ~/.gdbinit file. 2004-06-18 Jim Ingham * dummy-frame.c: Add the frame's ptid to the dummy frame. (find_dummy_frame): Match the ptid as well. (pc_in_dummy_frame): Ditto. (generic_push_dummy_frame): Ditto, also record the ptid for the new frame. (discard_innermost_dummy): Only discard the innermost frame for the current ptid. (generic_pop_dummy_frame): Pass in the current ptid. 2004-06-17 Jason Molenda (jmolenda@apple.com) * config/powerpc/macosx.mt: Don't ref ppc-macosx-frameops.c. 2004-06-17 Jason Molenda (jmolenda@apple.com) * dbxread.c (set_namestring): Add objfile prefix regardless of whether symbol starts with the expected prefix or not. 2004-06-15 Jim Ingham * infrun.c (handle_inferior_event): Adopt Daniel Jacobowitz's patch of 2004-03-09, remove special case code for signals to another thread. 2004-06-08 Jim Ingham * objfiles.c (objfile_matches_name): A better way to handle caches symfiles is to use the bfd name if there is a cached symfile. 2004-05-28 Jim Ingham * (breakpoint.c): break_command_2: If the interpreter is mi, then just return all the matches, don't set them. * linespec.c (decode_line_2): Add another parameter - the number of symbol-full matches. Then print the matches from non-debugging symbols more helpfully. (decode_objc): Pass in the new argument to decode_line_2. (find_method): Ditto. 2004-05-27 Klee Dienes * frame.c (deprecated_frame_next_hack): New function. (deprecated_frame_cache_hack): New function. (default_print_extra_frame_info): New function. * frame.h (deprecated_frame_next_hack): Add prototype. (deprecated_frame_cache_hack): Add prototype. (default_print_extra_frame_info): Add prototype. * gdbarch.c: Re-generate. * gdbarch.h: Re-generate. * gdbarch.sh (DEPRECATED_PRINT_EXTRA_FRAME_INFO): New method. * stack.c (frame_info): Restore call to PRINT_EXTRA_FRAME_INFO. 2004-05-26 Jason Molenda (jmolenda@apple.com) * completer.c (gdb_completer_command_word_break_characters): Add APPLE LOCAL comment about the change here. * language.c (default_word_break_characters): Update this copy of the gdb_completer_command_word_break_characters strings so that it matches the completer.c version; add APPLE LOCAL marker. 2004-05-26 Jim Ingham * objc-lang.c: Add _objc_msgSend_rtp to objc_methcall array. (find_objc_msgsend): If the symbol is the last symbol in the objfile, get its end address from the end address of the section containing the symbol. 2004-05-21 Jim Ingham * objfiles.c (objfile_matches_name): Consider the names a match if the objfile has a ".syms" on the end. 2004-05-21 Jason Molenda (jmolenda@apple.com) * dwarf2read.c: Change DWARF segment names APPLE LOCAL modification to look for segment name gcc'll be emitting as of this weekend. 2004-05-21 Jason Molenda (jmolenda@apple.com) * infcmd.c (print_return_value): Correct error string printing to include the type in question when struct/unions are used. * typeprint.c (type_sprint): Make comment a bit more explicit; note APPLE LOCALness. 2004-05-19 Klee Dienes * Makefile.in: Re-arrange order of library inclusion, to deal with monolithing libSystem.dylib on Tiger (cribbed from Jim's patch for an earlier Tiger submission). 2004-05-18 Stan Shebs * dwarf2read.c (dwarf_info_vma, dwarf_abbrev_vma, dwarf_line_vma, dwarf_str_vma): New globals. (INFO_SECTION, ABBREV_SECTION, etc): Set to names reported by BFD. (dwarf2_locate_sections): Set dwarf_info_vma and friends from bfd vmas. (read_comp_unit_head): Adjust abbrev offset by vma, comment out nonstandard extension. (read_file_scope): Adjust offsets by vma. 2004-05-15 Jim Ingham * varobj.c (varobj_create): Handle static & global varobj's which have no set frame. * varobj.h: Add NO_FRAME_NEEDED to the varobj_type. 2004-05-14 Jim Ingham These changes are just a scrub of uses of language_cplus to see places where we should also be accepting language_objcplus. * objc-lang.c (objcplus_demangle): New function. Use this for the language demangle for ObjC++. It tries the ObjC demangler, and if that fails, tries the C++ one. * symtab.c (symbol_find_demangled_name): ObjC++ names can be mangled too... (symbol_natural_name): Ditto. * buildsym.c (add_symbol_to_list): ObjC++ has namespaces... (finish_block): ObjC++ has same scoping rules as C++ (start_subfile): Don't demote ObjC++ to C for subfiles. * c-exp.y: ObjC++ & C++ share template true, false & other keywords. (c-typeprint.c): ObjC++ uses void, etc, like C++ does. * objc-exp.y: Ditto. * dbxread.c (read_dbx_symtab): Don't demote ObjC++ to C. * eval.c (evaluate_subexp_standard): Do overload resolution in ObjC++ as well as C++. * language.c (lang_bool_type): ObjC++ has the bool type like C++ does. * stack.c (print_frame_info): ObjC++ names can be C++ mangled names. (frame_info): Ditto (get_frame_language): Update a comment. * symfile.c (symbol_find_demangled_name): This should work with ObjC++ as well. 2004-05-14 Jason Molenda (jmolenda@apple.com) * target.c (update_current_target): Remove some unnecessary deltas from the FSF version. Add APPLE LOCAL comment around remaining diff. (push_target): Don't call setup_target_debug() here; document why. 2004-05-13 Jason Molenda (jmolenda@apple.com) * frame.c (get_prev_frame): Revert the two-identical-frames back to a warning from an error. It's rarely an unrecoverable error so it's better to try than to give up. 2004-05-13 Jason Molenda (jmolenda@apple.com) * objfiles.c (use_mapped_symbol_files): Set default value to 0 -- don't try to use cached symfiles until Klee has a chance to make it work again with newly merged sources. 2004-05-12 Jim Ingham * gdbtypes.c (make_cv_type): We may be resolving an opaque type as well as a stub type. So include that in the assert when we are copying over a type from one objfile to another. * frame.c (refine_prologue_limit): Don't reset prev_line to the prologue value every time round the loop! 2004-05-11 Jim Ingham * breakpoint.c (breakpoint_re_set_all): Don't need to call re_enable_breakpoints_in_shlibs. We will already know to reset them from tell_breakpoints_objfile_changed, so this is not necessary, and as long as PC_SOLIB doesn't work this will end up disabling ALL breakpoints. 2004-05-10 Jim Ingham * breakpoint.c (disable_breakpoints_in_shlibs): Comment out the test for PC_SOLIB till it works on Mac OS X. (re_enable_breakpoints_in_shlibs): Ditto. * dbxread.c (record_minimal_symbol): Look both in the straight text section and the coalesced text section when assigning a symbol to a section. (dbx_symfile_init): Look up the coalesced text section as well as the straight text section. (stabsect_build_psymtabs): Add a coalesced text section name. * gdb-stabs.h: Change declaration of stabsect_build_psymtabs. Also add coalesced text addresses to the stabs_symfile_info. * nlmread.c (nlm_symfile_read): Mutatis mutandi for above. * config/tm-macosx.h: Add COALESCED_TEXT_SECTION_NAME. 2004-05-06 Klee Dienes * ppc-sysv-tdep.c (ppc_darwin_abi_return_value): New function. (ppc64_darwin_abi_push_dummy_call): New function (currently stubbed out, final code to go in later). (ppc64_darwin_abi_return value): New function (currently stubbed out, final code to go in later). * ppc-tdep.h (ppc64_darwin_abi_push_dummy_call): Add prototype. (ppc64_darwin_abi_return_value): Add prototype. (ppc_darwin_abi_return_value): Add prototype. 2004-05-06 Jim Ingham * dbxread.c (read_dbx_symtab): Strip the leading character right when we read in the symtab. * minsyms.c (lookup_minimal_symbol): The change above meant we successfully demangle minsyms when we read in the symtab, so we don't need to do it here. (objfile_demangle_msymbols): No longer needed. (install_minimal_symbols): Don't strip the leading character here, since we already did it in dbxread.c. * objfiles.h: delete objfile_demangle_msymbols. * symtab.c (search_symbols) Don't need objfile_demangle_msymbols. * maint.c (maintenance_demangle): Revert to the older behavior rather than call language_demangle. It is stupid that you have to be currently in a C++ file for maint demangle to work. 2004-05-05 Jason Molenda (jmolenda@apple.com) * stabsread.c: Revert Apple Local changes to support very large non-negative enum values. We don't have any occurences of this in our libraries any longer and the contemporary gcc makes it hard to write them. 2004-05-05 Jason Molenda (jmolenda@apple.com) * inflow.c (kill_command): Don't query for confirmation if we're MIish. 2004-04-29 Jason Molenda (jmolenda@apple.com) * symtab.c (rbreak_command): Correct the canonicalization of strings so decode_line_1 can spot the ObjC method calls correctly. 2004-04-29 Jim Ingham * objfiles.c (number_of_dots): New function (objfiles_add_to_ordered_sections): Don't add the bfd sections that correspond to the Mach-O segments to the ordered sections array. (objfile_delete_from_ordered_sections): Don't try to remove them either. 2004-04-28 Jason Molenda (jmolenda@apple.com) * ppc-tdep.h: Add prototype for rs6000_fetch_pointer_argument. * rs6000-tdep.c (rs6000_fetch_pointer_argument): Change to non-static so ppc-macosx-tdep.c can get at it. 2004-04-28 Jason Molenda (jmolenda@apple.com) * blockframe.c (inside_main_func): Don't restrict search for main() to just the main symbol file - not valid if ZeroLink'ed. Short-circuit symbol lookups; new sources will search for main() two times for each frame in a backtrace. 2004-04-28 Jim Ingham * breakpoint.c: Refactor break_command_1 so that we could use it in gdb_breakpoints. Refactor condition_command for the same reason. Also get create_breakpoints to keep track of the breakpoints that it makes and pass them back to the caller. * tui/tui-interp.c (_initialize_tui_interp): Don't force the tui interp in place of the console interp. The tui interp is not as well tested, and should not be the default! 2004-04-27 Jason Molenda (jmolenda@apple.com) * objfiles.c (sanity_check_symtab_obsoleted_flag): Use the ALL_SYMTABS_INCL_OBSOLETED iterating macro so we don't re-call this sanity_check function. (sanity_check_psymtab_obsoleted_flag): Ditto. (symtab_get_first, symtab_get_next): Only do the sanity checks on 'obsolete' boolean if we're skipping obsolete symtabs. (psymtab_get_first, psymtab_get_next): Ditto. * symfile.h (ALL_PSYMTABS_INCL_OBSOLETED): Add macro. 2004-04-22 Jim Ingham This is more merge of our breakpoint changes to the FSF TOT. This adopts the gnu_v3 exception catching to Mac OS X, adds "break -shlib" and the code to be more discriminating about when we reset breakpoints in shared libraries. * breakpoint.c: Too many to list separately... * breakpoint.h: Add bp_gnu_v3_catch_catch and bp_gnu_b3_catch_throw breakpoint types. * inftarg.c: Change def'n of enable_exception_callback target vector back to the FSF version. * stack.c (catch_info): Ditto. * target.c: Ditto. * mi/mi-cmd-break.c (mi_cmd_break_catch): Ditto. * linespec.c (decode_all_digits): Renamed make_cleanup_temporarily_restrict_to_objfile. (minsym_found): Pass the section to find_pc_sect_line if we have it. * objfiles.c (make_cleanup_temporarily_restrict_to_objfile): renamed. (objfile_matches_name): New function. * symtab.c (find_pc_sect_psymtab): If you are given a non-null section, don't look in objfiles that are not in the bfd for that section. (find_pc_sect_symtab): Ditto. 2004-04-19 Klee Dienes * symfile.c (symfile_bfd_open): Use current_gdbarch to determine which subfile to load from a fat binary (instead of using #ifdefs). 2004-04-15 Jim Ingham * breakpoint.c: More pending breakpoint notification changes. Decided to make a separate resolve notify event rather than routing it through mention. * gdb-events.sh: Ditto. 2004-04-15 Jason Molenda (jmolenda@apple.com) * infrun.c: Add APPLE LOCAL markers around our changes. A few minor reorgs to make future merges easier. Removal of some old FSF code that slipped in. (process_event_stop_test): Reinstate local mod to use value of SOLIB_ADD. 2004-04-14 Jim Ingham This is the first set of changes merging our changes to breakpoint.c from the muon branch to TOT. * breakpoint.c: Too many to list individually... * breakpoint.h: ditto * gdb-events.sh: Need to pass the parent pending breakpoint into the notify events, so we can tell clients that the new breakpoints are related to it. * gdb-events.c: regenerate * gdb-events.h: regenerate * symfile.c (reread_symbols): Restore a local mod that bypasses the file pointer cached in the objfile's bfd and goes to the actual file on disk when we want the mtime of the file. 2004-04-13 Jason Molenda (jmolenda@apple.com) * infrun.c (follow_fork): Remove unused variable. (handle_step_into_function): Remove some Apple local code that is no longer necessary (and causes a few problems as-is). * fix-and-continue.c (struct active_func): Instead of keeping a copy of the frame, let's just save the information we need and print it ourselves. (free_active_threads_struct): Free new struct active_func fields. (create_current_active_funcs_list): Initialize new struct active_func fields. (print_active_functions): Print new struct active_func fields. 2004-04-09 Jason Molenda (jmolenda@apple.com) * top.c (_initialize_fix): Remove stubbed out routine. * symtab.c (lookup_block_symbol): Remove obsolete checks from lookup. * fix-and-continue.c: First set of changes to work in the post-merge world. Still a bunch of failures to fix. 2004-04-09 Jason Molenda (jmolenda@apple.com) * minsyms.c (lookup_minimal_symbol_by_pc_section_from): Move pc_section variable from here... (lookup_minimal_symbol_by_pc_section): To here. 2004-04-09 Klee Dienes * minsyms.c (lookup_minimal_symbol_by_pc): Don't use find_pc_section; trust lookup_minimal_symbol_by_pc_section to do the right thing. (lookup_minimal_symbol_by_pc_section_from_objfile): Remove the find_pc_section check for symbols after the last section. (lookup_minimal_symbol_by_pc_section): Add the check here. 2004-04-09 Klee Dienes * frame.c (frame_unwind_address_in_block): Don't subtract 1 from a 0 address. (frame_id_eq): Don't treat a 0 code-address as a wild-card. 2004-04-06 Jason Molenda (jmolenda@apple.com) * gdb.1: Update pointer to Apple local documentation. 2004-03-30 Klee Dienes * symfile.c (add_symbol_file_command): Update help text. 2004-03-29 Jim Ingham * varobj.c (varobj_pc_in_valid_block_p): Don't go through a frame-id to an address to get the frame, just call frame_from_id. 2004-03-29 Klee Dienes * breakpoint.c (watchpoint_equal): Re-add. (watchpoint_check): Re-add call to watchpoint_equal. 2004-03-29 Klee Dienes * symfile.c (add_symbol_file_command): Add syntax for specifying text address without a -s option. Update usage string. Fix crash when passing section offsets. 2004-03-29 Jason Molenda (jmolenda@apple.com) * cli/cli-setshow.c (do_setshow_command): Update error message to match current FSF error message. 2004-03-26 Jason Molenda (jmolenda@apple.com) * breakpoint.c (future_break_command, restore_saved_pending_break_support): Re-add future-break command, using the new pending_break_support that came with the merge. (_initialize_breakpoint): Register it. 2004-03-26 Jason Molenda (jmolenda@apple.com) * buildsym.c (end_symtab): Move symtab obsolete flag setting from here... * symfile.c (allocate_symtab): ...to here. So we don't miss any possible symtab allocations. 2004-03-26 Klee Dienes * infcall.c (hand_function_call): Don't stomp value_type by calling find_function_addr() twice. 2004-03-26 Jim Ingham (jingham@apple.com) * breakpoint.c (print_it_typical): Add back in the printing of the "commands" field for breakpoint hits. 2004-03-25 Jason Molenda (jmolenda@apple.com) * configure: Regenerated with updated ../gettext.m4. * defs.h: Don't include "tui.h". * main.c: Use ifdef, not if, for USE_MMALLOC. * macosx/macosx-nat-dyld.c: Ditto. 2004-03-01 Jim Ingham * linespec.c (decode_all_digits): Pass in funfirstline, and move past the prologue if it is set. 2004-03-01 Klee Dienes * ppc-sysv-tdep.c: Move the calls to set $sp and $lr, and call target_store_registers, into the *_push_dummy_call functions themselves. * ppc-tdep.h: Add prototype for ppc_darwin_abi_push_dummy_call. 2004-02-27 Jim Ingham * printcmd.c (print_address_symbolic): If the target address size is greater than the size of a CORE_ADDR, undo the sign extension that might have occured when we read in the address. These changes are needed to implement the mi command -break-commands. * breakpoint.c (find_breakpoint): New function. (breakpoint_add_commands): New function. (breakpoint_print_commands): New function. (commands_command): refactor to use breakpoint_add_commands. * breakpoint.h: Added new functions. * defs.h: added read_command_lines_1. * cli/cli-script.c: get_command_line: Pass the CLI read_next_line into recurse_read_control_structure. (read_next_line) Now return char * & just read, don't process. (process_next_line): New function, separates reading & processing. (recurse_read_control_structure): take a function pointer to the read function. (read_command_lines): Use read_command_lines_1 and the CLI read_next_line function. (read_command_lines_1): New function. 2004-02-03 Jim Ingham * objc-lang.c (find_methods): If matching an objc function name, make sure the whole name matches, not just the part that parse_method recognizes. * objc-lang.c (print_object_command): Check that it is safe to call functions on this thread before running the printForDebugger. (_initialize_objc_lang): Add the set variable to turn off the behavior above. target.c (update_target, cleanup_current_target): Handle new check_call_safe entry. target.h: Add check_call_safe entry. * dbxread.c (process_one_symbol): Add a hack to work around the fact that gcc3 doesn't emit LBRAC/RBRAC stabs for functions with no locals at the function scope. 2004-01-30 Jim Ingham * objc-lang.c (find_implementation_from_class): The end of method list marker in the ObjC runtime is EITHER a 0 method, or a -1 method pointer. (value_objc_target_type): pass in the block so we don't accidentally find another struct with the same name as our class. * objc-lang.h: mutatis mutandi for value_objc_target_type. * varobj.c (varobj_fixup_value): Pass the block down so we can get it to value_objc_target_type. (variable_language): Use C++ for the language for objects made in ObjC++ files. (value_of_child): pass block to varobj_fixup_value. (c_value_of_root): ditto. * wrapper.c (safe_value_objc_target_type): pass down the block again. * wrapper.h: mutatis mutandi for safe_value_objc_target_type. 2003-12-03 Jim Ingham * stack.c (get_frame_language): Make sure the function sym is not null before getting its language. 2003-11-20 Jim Ingham * breakpoint.c (re_enable_breakpoints_in_shlib): Add a call to check_duplicates. You should always do this whenever you enable a breakpoint! 2003-11-14 Klee Dienes * target.c (push_target): Move the cleanup_target and target debugging code from here ... (update_current_target): ... to here. (unpush_target): Remove call to cleanup_target (). * symfile.c (add_symbol_file_command): Update the section tables, and any breakpoints. 2003-11-14 Jim Ingham * eval.c (evaluate_subexp_with_coercion): Add in a missing check_typedef (present in the FSF version). * varobj.c (create_child): Same mistake repeated here. 2003-11-13 Jim Ingham * varobj.c (c_value_of_variable): Use the accessor function to get the number of children of an array variable. If you just use the structure member, the value may not have been set yet. 2003-11-12 Jim Ingham * breakpoint.c (breakpoint_re_set_one): When we successfully reset a breakpoint, reset the bp_objfile. * varobj.c (varobj_create): If we can't get either the value OR the type from the parsed expression, discard it. We will then reparse it later and maybe we will be in the right scope to do it correctly. * (varobj_type_is_equal_p): Don't return true if both inputs are NULL. * (value_of_root): Don't try to get the value if the type is NULL, even if the expression is not, as this is unlikely to work. 2003-11-03 Jim Ingham * cli/cli-setshow.c (do_setshow_command): Replace fprintf_unfiltered with fputs_unfiltered to avoid compiler warnings. 2003-10-31 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (load_fixed_objfile): Don't pass NSLINKMODULE_OPTION_BINDNOW to NSLinkModule() if the inferior is a ZeroLinked app. 2003-10-30 Jim Ingham * stack.c (return_command): Add a call to the stack_changed hook at the end of the command. 2003-10-28 Jim Ingham * breakpoint.c (bpstat_stop_status): Wrap the call to parse_exp_1 in a catch_errors. If the expression parse raises an error for some reason, then we will blow past the code which reinserts the instruction under the breakpoint, which is not good. (condition_command): Wrap the call to parse_exp_1. For now, we handle errors in parsing the expression in the same way (leaving the condition in place in the hopes that when you hit the breakpoint it will be successfully parsed. But this will allow us to be more discriminating if we want to. (set_raw_breakpoint): Initialize the breakpoint's objfile field. (create_breakpoints): Set the breakpoint's objfile when the breakpoint is set. (tell_breakpoints_objfile_changed): Only unset a set breakpoint if it was set IN the objfile that has changed. * breakpoint.h: Add bp_objfile to the breakpoint structure. * objc-lang.c (find_imps): coding convention cleanup. * cli/cli-setshow.c (do_setshow_command): Give the valid options for all error messages for enum type commands. 2003-10-22 Jason Molenda (jmolenda@apple.com) * infcmd.c (pid_info): New function, to return the process id of the inferior. (_initialize_infcmd): Register "info pid" command. 2003-10-21 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (struct fixedobj): Drop symtab and objfile pointers; in some circumstances objfiles can be copied around and freed so these pointers are not guaranteed to persist. (build_list_of_current_objfiles, find_newly_added_objfile): Use the names of objfiles from now on, so finding the struct objfile just added is not necessary. (find_symtab_by_name): A new convenience function. (mark_previous_fixes_obsolete): Find fixed file's objfile pointer when needed. A not mark globals as obsolete; this should be done by redirect_statics(). I missed a spot in the Sept 25 change. (get_fixed_file): Updated for new struct fixedobj layout. (do_final_fix_fixups): Updated to get objfile ptr when needed. (find_orig_static_symbols): Ditto. (find_and_parse_nonlazy_ptr_sect): Ditto. (build_list_of_objfiles_to_update): Ditto. (force_psymtab_expansion): Use PSYMTAB_TO_SYMTAB macro. (expand_all_objfile_psymtabs): Ditto. (find_original_object_file_name): Ditto. 2003-10-18 Jim Ingham * frame.c (refine_prologue_limit): Don't advance the prologue sal unless we actually cross a boundary between two different source lines. 2003-10-17 Jim Ingham * breakpoint.c (set_raw_breakpoint): Initialize requested_shlib field. * (create_breakpoints): Set requested_shlib field. * (make_cleanup_restrict_search_to_shlib): New function. * (parse_breakpoint_sals): If requested_shlib is set, then restrict the search to that objfile. * (break_command_1): Pass requested_shlib to do_captured_breakpoint. * (do_captured_breakpoint): Accept & use requested_shlib. * If the interpreter is mi-like and we get multiple breakpoint choices, then just report all the hits but don't set any breakpoints. * (gdb_breakpoint): Handle the requested_shlib. * (delete_breakpoint): Free the requested_shlib string. * (breakpoint_re_set_one): Restrict search to the requested_shlib if it has been set for the breakpoint. * breakpoint.h: Add requested_shlib to struct breakpoint. * gdb.h: Add requested_shlib to gdb_breakpoint declaration. * linespec.c (decode_objc): If ui is mi-like tell select_symbols to select all hits. * (select_symbols): Listen to the "all" parameter, and don't query the user. * objfiles.c: (objfile_restrict_search): return old restrict value. * (do_cleanup_temporarily_restrict_objfile): New function. * (make_cleanup_temporarily_restrict_to_objfile): New function. * objfiles.h: export make_cleanup_temporarily_restrict_to_objfile. * breakpoint.c (save_breakpoints_command): Handle save files with spaces in the path. * cli/cli-cmds.c (cd_command): Handle paths with spaces. * (source_command): Ditto. 2003-10-16 Jason Molenda (jmolenda@apple.com) * linespec.c (select_symbols_args): Correct 'canceled' spelling. 2003-10-03 James Ingham * eval.c (evaluate_subexp_standard): Add a check for deprecated_selected_frame not NULL before calling value_of_register. This wart is the result of not getting the complete register unwind implementation, and should go away when we do our next complete merge. 2003-09-29 Jason Molenda (jmolenda@apple.com) * utils.c (internal_error_problem, internal_warning_problem): Do not prompt the user "Create a core file of GDB? (y or n)" when we get an internal error. It's really annoying, and no one wants to. 2003-09-29 Klee Dienes * symfile.c (symbol_file_add_bfd_with_addrs_or_offsets): Check for symfile_objfile != NULL, not have_symbols. (symbol_file_clear): Ditto. (reread_symbols): Move the "#if 0" outside the entire test for have_symbols, not just the inner part. 2003-09-26 Jim Ingham * interpreter.c (gdb_new_interpreter): Accept and set the complete_proc. (gdb_interpreter_complete): New function. * interpreter.h: Add the complete_proc. * cli/cli-cmds.c (cli_interpreter_complete): New function. (complete_command): Recast to use cli_interpreter_complete. * cli/cli-cmds.h: Add cli_interpreter_complete. * cli-out.c (_initialize_cli_out): add cli_interpreter_complete. 2003-09-25 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (struct fixedobj): Retain pointer to the symtab for the source file being replaced in thix fix object. (mark_previous_fixes_obsolete): Don't mark file static/global data obsolete -- leave that for redirect_statics() to do. (get_fixed_file): Initialize new symtab pointer in fixedobj. (find_orig_static_symbols): Instead of looking for file static data in just the original object file, search the original object file and every fixed objfile we've added so far. So if a new global var is added in the 5th fix of a file, the 6th and 7th fixes will all have that global var pointing to the 5th fix where it originated. 2003-09-24 Jim Ingham * completer.c (complete_line): For filename completions, when you look for the last word before the cursor, actually start from the cursor & work backwards, rather than starting from the word you were handed. Starting from the word doesn't work if the input contains more than one word - as it does in the complete command. 2003-08-22 Jim Ingham * objc-lang.c (value_objc_target_type): Add a check for the base type of the value passed in being null, and for a structure that has no elements. The latter can happen, for instance, if we get a C++ object with a base class but no data in the class of the static type. 2003-09-19 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command_helper): Ask ZeroLink to load an object file before we search for the original source file. 2003-09-18 Jim Ingham * cli/cli-setshow.c (do_setshow_command): Don't just dump the doc line to gdb_stdout, it won't show up in the console-quoted interpreter then... 2003-09-16 Jason Molenda (jmolenda@apple.com) * objfiles.c (sanity_check_symtab_obsolete): Try to find the objfile that contains the bad symtab -- chances are all fields of the symtab will be 0 if we hit this function, including the filename. (sanity_check_psymtab_obsolete): Ditto. 2003-09-09 Jason Molenda (jmolenda@apple.com) * symtab.c (rbreak_command): Revert last. Works correctly with TOT FSF sources, but not our current sources. 2003-09-09 Jason Molenda (jmolenda@apple.com) * symtab.c (rbreak_command): Change quoting of canonicalized filename:function-name arguments for easier parsing of ObjC method names. 2003-09-09 Klee Dienes * breakpoint.c (break_command_1): Only store the breakpoint as a future-break if it has a valid address string. Use catch_errors for all breakpoint setting, even if we aren't going to bother doing anything if it fails. 2003-09-02 Klee Dienes * gdbtypes.c (check_typedef): Only modify TYPE_LENGTH if it actually needs changing, in case the symbol data is in a read-only section. * source.c (open_source_file): Only modify s->fullname if we successfully open the file. * symfile.c (symbol_file_add_bfd_with_addrs_or_offsets): If we are relocating a cached symbol file, make the pages writable when calling objfile_relocate. 2003-08-27 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_methods): Make static. Move prototype here from objc-lang.h so linespec.c can include objc-lang.h without a conflict with its find_methods function. * objc-lang.h (find_methods): Move prototype to objc-lang.c. 2003-08-26 Jason Molenda (jmolenda@apple.com) * Makefile.in: Update mi-main.c's dependencies. 2003-08-22 Jason Molenda (jmolenda@apple.com) * stack.c (backtrace_command_1): Save and restore current source line value around the backtrace cmd. 2003-08-22 Jim Ingham * blockframe.c (inside_entry_file, inside_entry_func, inside_main_func): Don't treat a pc of 0 as the bottom of the stack. Otherwise you won't be able to backtrace past a call through a NULL function pointer. * frame.c (get_prev_frame): Don't treat a pc value of 0 in the bottom-most frame as an error. It is much more likely the user has called through a NULL pointer. * value.h: Turn off the METHOD_PTR_IS_VIRTUAL macro for now, it makes no sense on Mac OS X (or most modern systems for that matter...) 2003-08-08 Jason Molenda (jmolenda@apple.com) * event-loop.c (use_poll): Don't use poll() just because the poll() wrapper is present in the system library--stick with select() for now. 2003-08-06 Jim Ingham * symfile.c (reread_symbols): Call objfile_relocate on the new objfile. Since you are keeping the old offsets you have to reapply them, or the new objfile won't get properly slid. In the longer term, we probably ought to let the solib layer handle symbol rereading, since it knows where things land. * cli-setshow.c (do_setshow_command): Don't print the doc string if the interpreter is mi_like. The mi uses the cli show command to report gdb variable values, and is not expecting the doc string. 2003-08-06 Klee Dienes * objfiles.c (_initialize_objfiles): Add aliases for generate-cached-symfiles and use-cached-symfiles. 2003-08-05 Jim Ingham (jingham@apple.com) * inflow.c (terminal_inferior, terminal_ours_2, child_terminal_info): check that inferior_ttystate is not null before passing it on to functions that will crash if it is null. * objc-lang.c (find_methods): Use find_pc_function_sect instead of find_pc_function. Since we know the section here, this will find the correct sym if we are looking up a pc before we run, and have a shared libraries that overlap each other. * cli-decode.c (print_doc_line): Use the stream we have been passed in rather than calling ui_out_text to print the doc line. 2003-08-04 Jason Molenda (jmolenda@apple.com) * objfiles.c (sanity_check_symtab_obsoleted_flag): Update comment. (sanity_check_psymtab_obsoleted_flag): Ditto. 2003-08-04 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restriction_cxx_zerolink): New function to see if the file being fixed is C++, and if so, whether the inferior is using ZeroLink. (do_pre_load_checks): Run this new check. 2003-07-31 Jim Ingham * breakpoint.c (bpstat_do_actions): Copy the bpstat passed in and use that in the loop that actually does the actions. This way we don't have to worry that somebody might have freed the bpstat (always stop_bpstat) our from under us. 2003-07-31 Klee Dienes (kdienes@apple.com) * objc-lang.c (lookup_child_selector): Rename to lookup_child_selector_nocache. (selector_entry): New struct. (SELECTOR_HASH_SIZE): New define. (selector_hash_generation): New variable. (reset_child_selector_cache): New function. (lookup_child_selector): New function; uses the selector cache. 2003-07-31 Jim Ingham (jingham@apple.com) * symfile.c (add_symbol_file_command): Fix a misplaced "?" in the prompt string. This was causing suprious testsuite failures in relocate.exp. 2003-07-31 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (struct fixinfo): Store the name of the original executable/dylib as well as the name of the original source file, instead of pointers to the objfile/psymtab. (fix_command_helper): Find original object file at this level. (mark_previous_fixes_obsolete): Update to use accessor functions to get original symtab/psymtab. (free_half_finished_fixinfo): Free new xstrdup'ed memory of original executable's filename. (find_orig_static_symbols): Use accessor function to find original objfile/symtab. (redirect_statics): Properly cast NULLs to avoid warnings with 64-bit CORE_ADDR. (build_list_of_objfiles_to_update): Use accessor function to get original objfile. do_final_fix_fixups_static_syms): Ditto. (pre_load_and_check_file): Properly cat NULL to avoid warnings with 64-bit CORE_ADDR. (pre_load_and_check_file): Hoist original objfile from here to fix_command_helper(). (do_pre_load_checks): Sanity check the new names. (check_restrictions_globals): Use accessor functions to get original objfile. (check_restrictions_statics): Ditto. (find_original_objfile): This function removed, but really transformed into ... (find_original_object_file_name): This function added. Much similarity to the old find_original_objfile(). (find_original_object_file): Accessor function to get the original object file. (find_original_symtab): Similar. (find_original_psymtab): Similar. 2003-07-29 Jim Ingham (jingham@apple.com) * breakpoint.c (print_one_breakpoint): replace calls to print_expression with gdb_print_expression, which is the safe version. Also, when printing the breakpoint condition, if print_expression fails, just print the cond_string. * (breakpoint_1): replace call to ui_out_table_begin with make_cleanup_ui_out_table_begin_end, and do_cleanups to close the table. Also replace a few more print_expression calls with the safe version. * ui-out.c (do_cleanup_table_end): New function. (make_cleanup_ui_out_table_begin_end): New function * ui-out.h: declare make_cleanup_ui_out_table_begin_end. * wrapper.c (wrap_print_expression): New function. (gdb_print_expression): New function. * wrapper.h: declare gdb_print_expression. * varobj.c (varobj_create): use get_selected_frame, not get_current_frame to get the saved frame id. The latter returns the currently executing frame, not the currently selected frame, which is not what we want here. Also if we aren't using varobj_runs_all_threads, make a null_cleanup for the schedlock_chain cleanup. 2003-07-25 Jim Ingham (jingham@apple.com) * objfiles.c (objfile_delete_from_ordered_sections): Don't add 1 to the section begin to find the to-be-deleted section index. This will fail for sections that are only one byte long. 2003-07-24 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (get_fixed_file): Only call remove_objfile_from_dyld_records in a native gdb. 2003-07-24 Klee Dienes * objfiles.c (link_objfile): Check to see that the objfile hasn't already been linked, before linking. 2003-07-24 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (load_fixed_objfile): Return a result code if NSLinkModule fails. (get_fixed_file): When load_fixed_objfile fails, find objfile for aborted file and remove it from gdb's global linked list structures. * objfiles.c (free_objfile): Add two APPLE LOCAL markers. * Makefile.in (fix-and-continue.o): Add dependency on macosx-nat-dyld-process.h. 2003-07-24 Jim Ingham (jingham@apple.com) This patch adds an "ordered_sections" lookup table to objfiles.c so that the pc->obj_section lookup can be done with a binary search rather than a linear search. * minsyms.c (lookup_minimal_symbol_by_pc_section_from_objfile): Delete the call to find_pc_section just to check that the pc is actually in a known section. Since this routine often gets called in a loop with the same pc it is more efficient for the callers to do this check. (lookup_minimal_symbol_by_pc_section): Use the ordered_sections lookup to find the minsym. If it fails we still fall back on the old search. * objfiles.c (backward_section_compare): New function. (forward_int_compare): New function (objfile_delete_from_ordered_sections ): New function. (get_insert_index_in_ordered_sections): New function. (objfile_add_to_ordered_sections): New function. (find_in_ordered_sections_index): New function. (find_pc_sect_in_ordered_sections): New function. (build_objfile_section_table): Add the new sections to the ordered_sections table. (free_objfile): remove the sections from the ordered_sections table. (objfile_relocate): remove the obj_sections from their old locations in the ordered_sections table, and move them to their relocated locations. (find_pc_sect_section): Use the ordered_sections table. If this fails fall back on the original ALL_OBJSECTIONS search. * objfiles.h: Add declarations to the new exported functions. * symfile.c (reread_symbols): Clear the old objfile's obj_sections from the ordered_sections array. * eval.c (evaluate_subexp_standard): Fix little goof, funaddr was used before being set. * symtab.h: Cast the -1 error return to CORE_ADDR. This removes a bunch of warnings from objfiles.c. 2003-07-09 Jim Ingham (jingham@apple.com) * breakpoint.c (insert_breakpoints): Revert the change that called error_stream if there was an error in setting a breakpoint. The upstream code actually can handle the return value, but was not expecting an actual error (i.e. longjmp). * printcmd.c (print_frame_args): Work around a problem with f2c'ed C code where the debug info says it is a .f file, but it is actually C so the variable names are case sensitive. gdb would assume a lookup_symbol never fails, and crash when it did. 2003-07-08 Jason Molenda (jmolenda@apple.com) * cli-out.c (cli_interpreter_resume): Clear print_frame_more_info_hook when returning to a console interpreter. (cli_quoted_interpreter_resume): Ditto. 2003-06-30 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (load_fixed_objfile): Clarify NSCreateObjectFileImageFromFile failure error message (tell user to retry fix). 2003-06-20 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (create_current_active_funcs_list): Make struct symbol copy deeper. (free_active_threads_struct): Free deeper struct symbol copy. 2003-06-19 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (load_fixed_objfile): Wrap error message prettily. (create_current_active_funcs_list): Copy the symbol we find, instead of saving a pointer to it. They can sneakily move around, it seems. (free_active_threads_struct): Free the copied symbol. 2003-06-19 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command_helper): Mark previous fixes, and the original source file, obsolete only after the new bundle has successfully been loaded. (mark_previous_fixes_obsolete): Don't mark the newest bundle as obsolete. 2003-06-19 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (find_objfile_by_name): If we fail to find an objfile by a given name, search the objfile's bfd structures; when cached-symfiles are being used, the objfile->name member is the cached-symfile name. 2003-06-18 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (load_fixed_objfile): Expand on error message a bit. (create_current_threads_list): Don't issue warning message when we can't change to a thread. Will revisit this later. (check_restrictions_statics): Don't include EOL at end of warning() text. 2003-06-17 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (load_fixed_objfile): Include return value from NSCreateObjectFileImageFromFile in error message. (find_orig_static_symbols): Add a debug warning for set debug fix-and-continue. 2003-06-17 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (create_current_threads_list): If we are unable to switch to a thread, skip that thread instead of aborting fix. A call to prune_threads() before I step through the list, but I think that function is intended to be static to thread.c, so we'll go with this for now. 2003-06-17 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restrictions_statics): If gdb has an incomplete type for a static, either the old or the new, skip the checks. They won't be meaningful, and we'll probably abort the fix needlessly. 2003-06-13 Jim Ingham (jingham@apple.com) * utils.c (make_cleanup_set_restore_scheduler_locking_mode): Change function to actually set up a locking mode restore cleanup. 2003-06-11 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (redirect_statics): Don't redirect static if we can't find symbol OR msymbol for it. 2003-06-03 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command_helper): Add cleanup to set/restore the current language settings based on the fix file filename. (tell_zerolink): Don't assume an object filename was provided if the inferior is a ZL app. (load_fixed_objfile): Check return value of NSLinkModule() and give an error about failure. More work needed here in the future to catch the failing NSLinkModule instead of letting it SIGABRT the inferior. (find_orig_static_symbols): Add case to find coalesced symbols. (do_final_fix_fixups_static_syms): Ditto. (check_restrictions_statics): If we can't find the symbol we're looking for, probably a mangling problem -- report failure as such. Add case to find coalesced symbols. Allow addition of static symbols, will doc restriction that static initialization won't happen automatically. (check_restrictions_locals): Use linkage name instead of source name; needed for languages where these are different. Add case to find coalesced symbols. (expand_all_objfile_psymtabs): New function. (find_original_objfile): When searching for a source filename, don't accidentally match the pre-loaded F&C bundle. (search_for_coalesced_symbol): New function. (restore_language): New function. (set_current_language): New function. (find_original_objfile): Make error message a little more clear. * symfile.c (deduce_language_from_filename): This function uses its arg const-correctly. * symtab.h (deduce_language_from_filename): Correct prototype. * Makefile.in (fix-and-continue.o): Add dependency on language.h 2003-06-01 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restrictions_statics): Skip the _OBJC_* symbols used by the ObjC runtime -- the simplistic handling of them as if they were normal statics is not correct. Also, remove a chunk of #if 0'ed code. 2003-06-01 Jim Ingham (jingham@apple.com) * symtab.c (find_line_pc_range): If we know we have asked for the pc by line number, once we have found the line, just report the pc, don't go back to the minsyms and look again. That part of the code is ONLY to handle some cases where we asked by pc... * inf-loop.c (handle_inferior_event): If fetch_inferior_event errors out, then set target_executing to 0. We don't really know, but this is the best guess of what is going on. These changes add internal control over the scheduler mode, and then uses that in the varobj code to stop other threads from running while we evaluate variable objects. * defs.h: Add def'ns for the scheduler_locking functions. * infcmd.c (run_stack_dummy): Signal a premature return if we stopped in a different thread from the one we tried to run the function. * infrun.c (scheduler_lock_on_p): New function. (scheduler_run_this_ptid): New function. (set_schedlock_helper): New function. (set_scheduler_locking_mode): New function. (set_schedlock_func): Use the new set_schedlock_helper. (init_wait_inferior): Clear the scheduler_lock_ptid. (resume): If you have the schedlock_mode on, resume the scheduler_lock_ptid if that thread still exists. * thread.c (do_captured_thread_select): If the scheduler locking is on, then switch the scheduler_locking_ptid to the newly selected thread. * utils.c (do_set_schedlock_mode, make_cleanup_set_restore_scheduler_locking_mode): New functions. * varobj.c (varobj_create): Lock the scheduler while we create the variables. (varobj_set_value): and when we update the value. (c_value_of_root): and when we update the root variable. (_initialize_varobj): Add a variable: varobj-print-object to control whether to lock the scheduler for updating varobj's. * objc_lang.c (value_objc_target_type): Fix the warning message. * wrapper.c (safe_value_objc_target_type): Suppress error messages. * symtab.c (find_line_pc_range): If we know the line was specified by line number not address, then don't look it up in the minimal tables. We found it already, use the linetable entry we just got instead. 2003-05-30 Jason Molenda (jmolenda@apple.com) Support for Fix and Continue to interoperate with ZeroLink. * fix-and-continue.c (struct fixinfo): Rename "obj_filename" to bundle_filename to more accurately represent what it is. Add "object_filename" variable. All users updated. (struct fixedobj): Change "object_filename" to "bundle_filename" to correctly reflect what it is. Callers updated. (fix_command): Record the 3rd argument of an object filename if provided. (fix_command_helper): Accept and record a third argument of an object filename. Call tell_zerolink() at the correct place. (tell_zerolink): New function (previously a placeholder stub). (inferior_is_zerolinked_p): New function (previously a placeholder stub) 2003-05-21 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command_helper): Return error if a bundle filename is reused. (find_objfile_by_name): New helper func. (mark_previous_fixes_obsolete): Check for NULL objfile ptr; issue warning but continue on if we find one. This should not happen. (get_fixed_file): Don't hook new fixedobj structure on to the fixed_object_files linked list until we've successfully loaded it via dyld. (load_fixed_objfile): Change error message to be less amusing. 2003-05-16 Jim Ingham * varobj.c (c_type_of_child): Call TYPE_TARGET_TYPE when getting the type of an array element. This preserves the typedef info, which is useful. 2003-05-13 Jim Ingham * varobj.c (varobj_create): Never hold onto struct frame *'s across calls that might run the inferior (in this case gdb_parse_expression). Hold onto frame_id's instead. 2003-05-12 Jim Ingham This set of changes adds support in the varobj system for getting the dynamic type of ObjC objects. * objc-lang.c (value_objc_target_type): New function, return the dynamic type of a value pointing to an ObjC object. * objc-lang.h: declare value_objc_target_type. * varobj.c (varobj_fixup_value): If you don't find a C++ dynamic type, look for an ObjC one. FIXME - this should be abstracted somehow. (c_type_of_child): Call get_type, not just check_typedef to get the parent's type. Needed to use dynamic types. * wrapper.c (wrap_value_objc_target_type, safe_value_objc_target_type): A safe interface to value_objc_target_type. * wrapper.h: Declare safe_value_objc_target_type. * infcmd.c (run_command): Handle the case there target_create_inferior actually fails to run the inferior at all. Reset target_executing, and get control of stdin back. 2003-05-07 Jim Ingham * valops.c (hand_function_call): On Mac OS X, call a function to prepare the thread before saving away register state. We need to call thread_abort_safely to coax the thread out of the kernel before we can get its state or safely call functions on it. 2003-05-08 Jason Molenda (jmolenda@apple.com) * symtab.c (lookup_symbol_aux_symtabs): Iterate over obsoleted objfiles--there may be non-obsoleted symbols contained therein. (lookup_transparent_type): Ditto. * fix-and-continue.c (struct file_static_fixups): Change member names. (find_new_static_symbols): Record the new minsym as well. (find_orig_static_symbols): Record the original minsym as well. (redirect_statics): Add sanity checks for the minsyms. Actually update the nl_symbol_ptr section so references go to the right place. (find_and_parse_nonlazy_ptr_sect): Initialize new minsym members. 2003-05-07 Klee Dienes * symfile.c (reread_symbols): Use stat() on the file when we have a filename, not bfd_get_mtime(). 2003-05-07 Jim Ingham (jingham@apple.com) * varobj.c: Turn varobj_use_dynamic_type default back to 1. 2003-05-07 Jason Molenda (jmolenda@apple.com) * stabsread.c (scan_file_globals): Scan for the matching minsym for a symbol in the current objfile before looking at the main application. That SVR4 assumption doesn't play well with F&C (and most likely two level namespaces, as well.) * fix-and-continue.c (struct file_static_fixups): Structure to record locations of file global/static data. (redirect_file_statics): Top-level function to redirect file static variables to the original version's addresses. (find_orig_static_symbols, redirect_statics, find_and_parse_nonlazy_ptr_sect): Support functions. 2003-05-07 Jim Ingham * wrapper.c: (gdb_evaluate_type, wrapped_evaluate_type): evaluate_type returns a value, not a type, dummy! * varobj.c (varobj_create): use gdb_evaluate_type correctly. 2003-05-06 Klee Dienes * fix-and-continue.c (update_picbase_register): Wrap with TARGET_POWERPC as a temporary measure to allow building on Intel. 2003-05-06 Jim Ingham (jingham@apple.com) * varobj.c (varobj_create): Use a wrapped version of evaluate_type, since even finding the type of an objc method call can sometimes crash. Then handle the case where we get this error. (varobj_get_value): Handle the case where the value is NULL even if the expression is good. (value_of_root): If the type is NULL, then we just need to recreate the varobj to get it into a good state. (c_number_of_children): Handle the case where the type is NULL. * wrapper.c (wrap_evaluate_type): New function. (gdb_evaluate_type): A wrapped version that also sets unwind_on_signal. * wrapper.h: declare gdb_evaluate_type. 2003-05-05 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_and_continue_debug_flag): New global flag. (fix_command): Only print debug messages if fix_and_continue_debug_flag. (do_final_fix_fixups_static_syms): Ditto. (_initialize_fix): Add 'set debug fix-and-continue' setting. * Makefile (fix-and-continue.o): Update dependencies. 2003-05-02 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (do_final_fix_fixups_global_syms): Initialize oldsym before it is used. Use paddr_nz for printing CORE_ADDRs. (do_final_fix_fixups_static_syms): Ditto. (update_picbase_register): New function to divine and set the picbase register and address for a function we're about to execute mid-way through. (print_active_functions): Change result message from file-fix-file to format its output more in the correct MI style. * Makefile.in (fix-and-continue.o): Update dependencies. * defs.h: Add prototype for update_picbase_register. * objfiles.h (ALL_SYMTABS_INCL_OBSOLETED): New macro for iterating over all objfiles + symtabs, including any obsoleted symtabs. * symtab.c (lookup_symbol_aux_block): Allow this function to match a symtab marked obsolete. (find_pc_sect_symtab): Ditto. 2003-05-01 Jim Ingham (jingham@apple.com) * symmisc.c (print_symbol): Trap the case where the block for a symbol is null. * dbxread.c: Initialize the context stack to null so the trap above will work if the block never gets set. * utils.c (do_restore_uiout_cleanup, make_cleanup_restore_uiout): Add cleanups to restore a given uiout. * defs.h: declare make_cleanup_restore_uiout. * defs.h: declare gdb_quitting * top.c (quit_force) set gdb_quitting if we are really quitting. * corefile.c (reopen_exec_file): Don't reread the file if we are quitting. 2003-05-01 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (fix_command): Accept and ignore third argument. (mark_previous_fixes_obsolete): Use INCL_OBSOLETED iterator for symtabs; mark old symtabs/psymtabs as obsolete. (do_final_fix_fixups): Use INCL_OBSOLETED iterator. (do_final_fix_fixups_global_syms): Ditto. (do_final_fix_fixups_static_syms): Ditto. (check_restrictions_globals): Ditto. (check_restrictions_statics): Ditto. (check_restrictions_locals): Ditto. (force_psymtab_expansion): Ditto. * objfiles.c (sanity_check_symtab_obsoleted_flag): Temporary debug function. (sanity_check_psymtab_obsoleted_flag): Temporary debug function. (symtab_get_first): Initial iterator for symtab structures with obsolete markers. (symtab_get_next): Continuing iterator for symtab structures with obsolete markers. (psymtab_get_first): Initial iterator for partial_symtab structures with obsolete markers. (psymtab_get_next): Continuing iterator for partial_symtab structures with obsolete markers. * objfiles.h: Prototypes for above functions. Use them in ALL_OBJFILE_SYMTABS and ALL_OBJFILE_PSYMTABS. Add new ALL_OBJFILE_SYMTABS_INCL_OBSOLETED and ALL_OBJFILE_PSYMTABS_INCL_OBSOLETED iterator macros. * buildsym.c (end_symtab): Initialize symtab obsolete flag. * coffread.c (coff_symfile_read): Use ALL_OBJFILE_SYMTABS to iterate. * dbxread.c (end_psymtab): Initialize partial_symtab obsolete flag. * mdebugread.c (parse_partial_symbols): Initialize partial_symtab obsolete flag. * source.c (select_source_symtab): Use ALL_OBJFILE_SYMTABS iteartor. (select_source_symtab): Ditto. (forget_cached_source_info): Ditto. * symfile.c (symbol_file_add_bfd_with_addrs_or_offset): Use ALL_OBJFILE_PSYMTABS iterator. (allocate_psymtab): Initialise partial_symtab obsolete value. (cashier_psymtab): Use ALL_OBJFILE_PSYMTABS iterator. * symmisc.c (dump_objfile): Use ALL_OBJFILE_PSYMTABS iterator. * symtab.h (struct symtab): Add obsolete flag. Add SYMTAB_OBSOLETED macro for selecting. (struct partial_symtab): Add obsolete flag. Add PSYMTAB_OBSOLETED macro for selecting. 2003-04-30 Jim Ingham (jingham@apple.com) * varobj.c (c_value_of_root): Move the call to release value INSIDE the test for gdb_evaluate_expression passing. Otherwise we might try to release a null value. 2003-04-29 Jim Ingham (jingham@apple.com) * wrapper.c (gdb_evaluate_expression): Set unwindonsignal when you do evaluate_expression here. We don't want to leave a crash on the stack when we are updating varobj's that contain functions, since that would mess up evaluating the next one. 2003-04-25 Jim Ingham (jingham@apple.com) * event-top.c (handle_sigint): Have to set quit_flag here, or we won't quit till we get back to the event loop, which is not good. (async_request_quit): Don't set quit_flag here, but rather assume whoever queued you up set it, and if it got unset that means a call to QUIT has already handled the signal, and you don't need to. linespec.c (select_symbols): Add a call to QUIT to the symbol iteration loops - in some cases there could be quite a few matching symbols. 2003-04-24 Klee Dienes * Makefile.in (COMMON_OBJS): Remove version.o. (gdb): Add version.o explicitly to the link line; build version.o as part of the target rule. 2003-04-23 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (create_current_threads_list): Fix call to gdb_thread_select. * Makefile.in: Update dependencies for fix-and-continue.c. 2003-04-23 Jim Ingham (jingham@apple.com) * gdb.h: declare make_cleanup_restore_current_thread, add print argument to gdb_thread_select. * thread.c (make_cleanup_restore_current_thread, restore_current_thread): add a "print" argument so you can restore the current thread quietly. * (gdb_thread_select): Add a "print" argument so you can set the current thread quietly. * ui_out.c (ui_out_is_mi_like): Check for the impl being null, and call a null uiout NOT mi-like. 2003-04-23 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (hi16, lo16): Rename to encode_{hi16,lo16}. Update callers. (decode_hi16_lo16): New function. (decode_fix_and_continue_trampoline): New function, previously in macosx/ppc-macosx-tdep.c. Entirely arch specific, but all the other arch specific functions are in f-and-c.c right now anyway so I'll keep them together. Fix a couple of bugs while moving it. * defs.h: Add prototype for decode_fix_and_continue_trampoline. * symtab.c (search_symbols): Don't match obsolete syms/msyms. 2003-04-22 Jim Ingham (jingham@apple.com) This change adds a "console-quoted" interpreter, so that from the mi you can run a console-like interpreter, the difference being that all the output comes in mi console wrapping. * cli-out.c (cli_quoted_out_new): New function. (cli_quoted_interpreter_resume): New function. (_initialize_cli_out): Create the console-quoted interpreter. 2003-04-22 Jason Molenda (jmolenda@apple.com) * objfiles.c (objfile_remove_from_restrict_list): Remove objfile from restrict list at the same time as we remove it from objfile list. 2003-04-21 Jason Molenda (jmolenda@apple.com) * objc-lang.c (find_methods): Don't match obsoleted symbols. 2003-04-18 Jason Molenda (jmolenda@apple.com) * gdbtypes.c (lookup_struct_elt_type): Use type_sprint() for printing a type. * varobj.c (varobj_get_type): Ditto. (varobj_get_dynamic_type): Ditto. 2003-04-17 Klee Dienes * symfile.c (reread_symbols): Remove call to flush the bfd cache. This was used earlier to make sure that any cached mtimes on bfd files got reset, but now we just make sure the mtimes are never cached in the first place. (symbol_file_add_bfd_with_addrs_or_offsets): Properly relocate a cached symfile that has been read in. 2003-04-17 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restrictions_locals): Skip non-function blocks. Use SYMBOL_MATCHES_NAME to check function name equivalency. (check_restrictions_globals): Change type checking to use new type printer. (check_restrictions_statics): Ditto. (check_restrictions_function): Rewrite. (sym_is_argument, sym_is_local): New helper functions. * typeprint.c (type_sprint): New func. * value.h: Prototype. 2003-04-17 Jim Ingham (jingham@apple.com) * gdbtypes.c (lookup_struct_elem_type): Replace the lame error reporting (some to stderr, some to the error call) with a real error message passed to error. Otherwise the mi gets a useless error return value. 2003-04-15 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restrictions_statics): Only check static functions for now. Use found sym's namespace when searching for old version; a few other small corner cases. (check_restrictions_locals): Fill in stub with content to iterate over local blocks of fix file. (check_restrictions_function): First version of function to check for invalid changes to functions in a fix. (in_active_func): Use SYMBOL_MATCHES_NAME. (remove_type_prefix): Removed. 2003-04-14 Jim Ingham (jingham@apple.com) This set of changes implements two features: 1) When resetting breakpoints, the ALL_OBJFILES macro is restricted to ONLY those files that have been added since the last time breakpoint_update was called. When breakpoint_re_set is called you pass in the objfile that has changed, and these form the list of changed objfiles. 2) Once a breakpoint is set, it is not reset till the objfile it was set in is changed. When objfiles change, you must call the new function tell_breakpoints_objfile_changed. * breakpoint.c (create_internal_breakpoint): set bp_set_p. (create_breakpoints): Ditto. (watch_command_1): Ditto. (breakpoint_re_set_1): Ditto. (breakpoints_update): Handle catchpoint resetting here, with the restricted search in place. (breakpoint_re_set): Take an objfile as argument, and add it to the restrict list. (breakpoint_re_set_all): use the objfile_restrict_search for bp_breakpoint type breakpoints. (tell_breakpoints_objfile_changed): New function. * breakpoint.h: Add bp_set_p to the breakpoint structure. Change def'n of breakpoint_re_set. Add def'n of tell_breakpoints_objfile_changed. * objfiles.c (objfile_relocate): Mutatis mutandi for breakpoint_re_set change. * rs6000-nat.c: Ditto. * symfile.c (new_symfile_objfile): Ditto. (clear_symtab_users): Ditto. * corefile.c (reopen_exec_file): Mark all breakpoints as unset, since who knows what may happen next. * symfile.c (reread_symbols): Call tell_breakpoints_objfile_changed. (remove_symbol_file_command): Ditto. * exec.c (exec_close): Don't call macosx_init_dyld_symfile on close. It is not necessary. * objfiles.c (objfile_restrict_search): New function. (objfile_add_to_restrict_list): New function. (objfile_clear_restrict_list): New function. (objfile_get_first): New function. (objfile_get_next): New function. * objfiles.h: Fix ALL_OBJFILES to use the iterators above, and declare the other restrict list helper functions. * infrun.c (lookup_minimal_symbol): Use the objfile_get_first and objfile_get_next iterators. (lookup_minimal_symbol_text): Ditto. * source.c (select_source_symtab): Ditto. (forget_cached_source_info): Ditto. * symfile.c (reread_symbols): Ditto. 2003-04-11 Jim Ingham (jingham@apple.com) * exec.c (exec_file_attach): On MacOSX, if you didn't find the exec file with the given name, see if the name you were given points to an app bundle. * symfile.c (symfile_bfd_open): Ditto. Also, add a mainline parameter, so you only do the app bundle check if this is indeed the main executable. (safe_symfile_bfd_open): Mutatis mutandi for mainline parameter to symfile_bfd_open. (symfile_bfd_open_helper): Ditto. * symfile.h: Ditto. * fix-and-continue.c (pre_load_and_check_file) Ditto. * somread.c (som_symfile_read): Ditto. 2003-04-10 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (check_restrictions_globals): Tidy up. Don't check the blockvectors of symtabs who are referencing another symtab's blockvector. Use proper type code for detecting functions. (check_restrictions_statics): Initial version. (in_active_func): Match either mangled or demangled names. 2003-04-08 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (file_exists_p): Check if a file exists before we try to fix it. (fix_command_helper): Call file_exists_p. (inferior_is_zerolinked_p): Placeholder stub. (do_pre_load_checks): Add calls to restriction check functions. (check_restrictions_globals): Initial checks on global symbols. (check_restrictions_statics): Placeholder stub. (check_restrictions_locals): Placeholder stub. 2003-04-03 Jason Molenda (jmolenda@apple.com) Back out change to avoid updating old fix objfiles - I couldn't cover all the BFD/dyld layers like this. * fix-and-continue.c (mark_previous_fixes_obsolete): Don't change old fix objfiles' mtime to LONG_MAX. * symfile.c (reread_symbols): Revert change to ignore objfiles with newer timestamps than the actual files. 2003-04-02 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (build_list_of_objfiles_to_update): Helper func; build up a list of all object files we need to update when a new fix comes in. (do_final_fix_fixups): Change to use build_list_of_objfiles_to_update. (get_fixinfo_for_new_request): Fix a little buglet. 2003-04-02 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c: Revert most of the previous change (the bit about hiding the objfiles.) It didn't work out after all. 2003-04-02 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (pre_load_and_check_file): Zero out addrs struct. Try hiding earlier versions of fixed objfiles so the same objfile name can be used for several different files. (get_fixed_file): Instead of full objfile list, remove the objfiles with the same name from the master object_files list, to be restored after the new objfile is loaded. (build_list_of_current_objfiles): Rewritten as hide_old_fixed_objfiles(). (restore_hidden_objfiles): New func. (find_newly_added_objfile): Simplified. 2003-04-01 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (mark_previous_fixes_obsolete): Fill out stubbed function. (get_fixed_file): Mark fixedobj->next with NULL for clarity. (build_list_of_current_objfiles): Fix typeo. * symfile.c (add_symbol_file_command): Clean up output for simple usage. (reread_symbols): Modify objfile re-loading slightly so multiple fixes to the same objfile don't trigger auto-reloading and updating of old versions. 2003-03-31 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (struct active_func): Also record the frame_info for the function that we found, for later reporting via MI. (create_current_active_funcs_list): Allocate it. (free_active_threads_struct): Free it. (print_active_functions): Print the "replaced-functions" message if uiout is MI-like. 2003-03-31 Jason Molenda (jmolenda@apple.com) * objc-lang.c (print_object_command): Set unwindonsignal unconditionally while print-object'ing. 2003-03-27 Klee Dienes * infrun.c (handle_inferior_event): Revert the change from 2002-11-07 in the MI case, as CodeWarrior was depending on the extra output. 2003-03-25 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c (load_fixed_objfile): Add NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES flag to NSLinkModule call. 2003-03-25 Jim Ingham (jingham@apple.com) * interpreter.c (gdb_set_interpreter): Don't run do_all_continuations here, since that may run a continuation from the enclosing interpreter in the wrong context. * breakpoint.c (breakpoint_re_set_one): Don't try to set the overlay breakpoint. It is bogus that this is attempted unconditionally, so I am removing it unconditionally. 2003-03-25 Jason Molenda (jmolenda@apple.com) * defs.h: Include prototype for make_cleanup_ui_out_delete. * fix-and-continue.c (fixedlib): Rename structure to "fixedobj" - a more descriptive name. (fix_command): Print a little status message when completed and using CLI. (get_fixinfo_for_new_request): Fix mistake when fixing an objfile more than once. (get_fixed_file): Initialize tail of objfile linked list to NULL. (create_current_threads_list): Turn off output while switching threads around; save the current thread before we start switching through all the threads. 2003-03-18 Jason Molenda (jmolenda@apple.com) * configure.in: Default is --with-mmalloc on MacOS X. * configure: Regenerated. 2003-03-18 Jason Molenda (jmolenda@apple.com) * fix-and-continue.c: New file. * Makefile.in: Build it. * buildsym.c (add_symbol_to_list): Mark sym as not obsolete. * minsyms.c (lookup_minimal_symbol): Ignore syms not marked obsolete. (lookup_minimal_symbol_text): Ditto. (prim_record_minimal_symbol_and_info): Mark as not obsolete. (install_minimal_symbols): Ditto. * symtab.h: Add obsolete flag to ginfo; SYMBOL_OBSOLETED and MSYMBOL_OBSOLETED. * symtab.c (lookup_symbol_aux): Skip obsolete syms. (lookup_symbol_aux_block): Ditto. (lookup_symbol_aux_symtabs): Ditto. (lookup_symbol_aux_psymtabs): Ditto. (lookup_symbol_aux_minsyms): Ditto. (lookup_transparent_type): Ditto. (lookup_block_symbol): Ditto. 2003-03-18 Jim Ingham * cli/cli-script.c (execute_control_command): call the mi interpreter through the mi_interpreter_exec_bp_cmd function, which will keep the mi from registering two continuations, one for the original command that set the target going, and one from the interpreter exec command. 2003-03-13 Klee Dienes * osabi.c (gdb_osabi_names): Rename "Darwin 64-bit" to "Darwin64", to avoid whitespace-parsing hassles. * config/powerpc/macosx.mh (MACOSX_FILES): add macosx-nat.o. 2003-03-07 Jim Ingham * dbxread.c (read_dbx_symtab): Revert the change that peeked at the stab after a BINCL stab, and would discard the pair if the next one was an EINCL. This throws off the include file numbering, and the type symbols no longer match up correctly. * (process_one_symbol): restore a fix to the fake line record created when we see a new FUN stab. This change was accepted by the FSF on 2-26-03, so we can retire the APPLE LOCAL marker then. * stabsread.c (read_type): Restore a fix for handling embedded built-in type definitions that somehow got lost in the latest merge. * (read_member_functions): Stub out Daniel.J.'s code to fix up some constructor & destructor def'ns. This did very little for gcc-3 and was very slow. 2003-03-03 Jim Ingham This set of changes updates the "catch catch" and "catch throw". The output is mi-ified, the object type being thrown is added, you can set a regexp for which objects to stop on both for catches & throws. It adds one target-vector entry to the catchpoint support: to_find_exception_catchpoints. This just splits out the "enabling" and the "setting breakpoints on catchpoints" parts of the target catchpoint support. * breakpoint.c: Define enabled flags & regexp strings. (print_it_typical): MI-ify the catchpoint printing info. (print_catch_info): New function, for printing info. (bpstat_stop_status): Only process the "catch" breakpoint that matches the stop address. Check the catch regexp to see if we should stop here. MI-ify the catch stop message. (update_exception_catchpoints): New function, more convenient client function than target_enable_exception_callback/ create_exception_catchpoints. (current_exception_should_stop): New function. (catch_exception_command_1): use update_exception_catchpoints. (exception_catchpoints_enabled): New function, needed for the mi command. (disable_exception_catch): New function, so you don't have to remove all the catch breakpoints by hand. (_initialize_breakpoint): Add set commands for the exception type regexp's. * breakpoint.h: Add declarations for new functions. * hppa-tdep.c: I didn't test this, I just did mutatis mutandi changes for the changes I made to the rest of the interface. * inftarg.c (child_enable_exception_callback): No longer return the SALS, this is done by child_find_exception_catchpoints. (child_find_exception_catchpoints): stubbed out version of this. (init_child_ops): add child_find_exception_catchpoints. * stack.c (catch_info): Still does nothing, but in the new form. * symtab.h: Add exception_type to exception_event_record & accessor macro. * target.c: Add to_find_exception_catchpoints everywhere necessary. * target.h: ditto. * infcmd.c (_initialize_infcmd): String constants can't have un-backslashed newlines. gcc-3.3 actually makes this an error so we ought to fix it... 2003-02-22 Klee Dienes * objfiles.c (_initialize_objfiles): Rename xxx-precompiled-symbol-tables to *-precompiled-symfiles. * symfile.c (new_symfile_objfile): Pass prefix to allocate_objfile. * symtab.c (fixup_section): Only modify the bfd_section if it actually differs from the value we will be setting it to (prevents errors accessing read-protected cached symfiles). 2003-02-16 Jason Molenda (jmolenda@apple.com) * symmisc.c (print_objfile_statistics): Patch accepted at FSF - use the final text that was accepted. 2003-02-12 Jason Molenda (jmolenda@apple.com) * symmisc.c (print_objfile_statistics): Include information about the number of psymtabs and symtabs in each object file. 2003-02-11 Jim Ingham (jingham@apple.com) * source.c (add_path): Look for quoted strings in the dir list, and ingest the quoted string as a whole. 2003-02-07 Klee Dienes * valops.c (hand_function_call): Make sure expected_type is non-NULL before calling check_typedef on it. 2003-02-06 Jason Molenda (jmolenda@apple.com) * breakpoint.c (reset_allow_objc_selectors_flag): Move function from here... * linespec.c (reset_allow_objc_selectors_flag): To here. (allow_objc_selectors_flag): Define storage for this global. * linespec.h: Add prototype and extern for above. * symtab.c (allow_objc_selectors_flag): Don't declare storage here. (rbreak_command): When setting breakpoints on matching symbol names, disable objc_selectors_flag to avoid ambiguous breakpoint dialogue. 2003-02-03 Jim Ingham (jingham@apple.com) * valops.c (hand_function_call): If you were passed in an expected_type, remember to call check_typedef on it before using it. * c-exp.y: For objc++ member data, look at the language of the current function to determine whether to emit OP_THIS or OP_OBJC_SELF. * stack.c (frame_info): For objc++, try cplus_demangle AND objc_demangle. (get_frame_language): For objc++, report the function's language, not the symtabs, since and objc++ file can be a mix of objc and c++ functions. * top.c (execute_command): Don't complain if the automatic language is objc++, and you see the frame language is c++. This is fine, it just means we detected a c++ function. * valops.c (value_of_this): For objc++ use the frame's language to determine whether to hang the instance data off of "this" or "self". This last bit is kind of bogus, since we are just checking what to do here, and then we have to redo the logic in c-exp.y when we actually get around to emitting the opcodes. 2003-01-21 Jim Ingham (jingham@apple.com) * varobj.h: declare new function varobj_is_fake_child. * varobj.c (varobj_is_fake_child): New function, does what it says. 2003-01-14 Jim Ingham (jingham@apple.com) * utils.c (fprintf_symbol_filtered): If the language is objcplus, then try both C++ demangling, and if that fails, try ObjC demangling. 2003-01-13 Jason Molenda (jmolenda@apple.com) * symtab.c (lookup_symbol): Demangle C++ names if ObjC++. (lookup_symbol_aux_minsyms): Don't re-invoke lookup_symbol_aux with tricky mangled+mangled name. 2002-01-07 Klee Dienes * Makefile.in: Remove i387-nat.o. * configure.in: Revert host/target Makefile fragment configuring to FSF sources. Update to autoconf-2.57. Add AC_MSG_CHECKING commands for the fragment names. * configure: Regenerate. 2002-01-07 Klee Dienes * config/i386/macosx.mt (TDEPFILES): Add machoread.o, symread.o, and pefread.o. 2002-01-07 Klee Dienes * varobj.c (varobj_use_dynamic_type): Default to zero. 2002-01-06 Klee Dienes * configure.in: Update to use AC_CONFIG_COMMANDS, and to stop using CONFIG_HEADERS (for autoconf 2.56). * configure: Regenerate. * aclocal.m4: Regenerate. * Makefile.in: Update to use libtool. 2002-01-06 Klee Dienes * exec.c: Remove UI_OUT conditionals. * infrun.c: Remove UI_OUT conditionals. * linespec.c (lookup_symbol_linkage): Provide temporary definition. (SYMBOL_PRINT_NAME): Provide temporary definition. * osabi.c (gdb_osabi_names): Change "Mac OS X" to "Darwin". * defs.h: Remove UI_OUT conditionals. (enum gdb_osabi): Add GDB_OSABI_DARWIN. 2002-12-15 Klee Dienes * defs.h: Removed the gxmalloc/gxrealloc/etc. redefinitions. * utils.c (nomem): Remove FSF whitespace diffs. (xfree): Remove; now provided by libiberty. 2002-12-13 Jim Ingham * breakpoint.c (breakpoint_re_set_one): Use a cleanup to reset the allow_objc_selectors_flag. 2002-12-11 Klee Dienes * ppc-tdep.h (ppc_sysv_abi_push_arguments): Move prototype to ppc-linux-tdep section. (ppc_darwin_abi_push_arguments): Add prototype. * ppc-sysv-tdep.c (round2): Rename to ROUND_UP. (ppc_stack_abi): New struct. Specifies ABI rules for argument pushing. (ppc_stack_context): New struct. Stores register/stack state throughout an invocation of ppc_push_arugments. (ppc_push_argument): New function. (ppc_push_arguments): New function, based on what used to be ppc_sysv_abi_push_arguments. (ppc_sysv_abi_push_arguments): Implement in terms of ppc_push_arguments. (ppc_darwin_abi_push_arguments): New function. 2002-12-11 Klee Dienes * linespec.c (decode_variable): Skip all the way to the end when it's not quoted, not just to the end of the last close-paren. 2002-12-11 Klee Dienes * gdbtypes.h (type_code_name): Add prototype. * gdbtypes.c (type_code_name): New function. Returns a constant string containing the ASCII name of the type code. (recursive_dump_type): Use type_code_name. 2002-12-07 Klee Dienes * Makefile.in (COMMON_OBS): Remove machoread.o, symread.o, and pefread.o. * config/powerpc/macosx.mt (TDEPFILES): add machoread.o, symread.o, and pefread.o. * config/i386/macosx.mt (TDEPFILES): add machoread.o, symread.o, and pefread.o. 2002-12-06 Klee Dienes * dbxread.c (read_dbx_symtab): Ignore BINCLs that are immediately followed by EINCLs. 2002-12-06 Klee Dienes * dbxread.c (header_file_location): New field 'hash'. (add_bincl_to_list): Set the 'hash' field. (find_corresponding_bincl_psymtab): Compute the hash of 'name' and use that to pre-check the comparison. 2002-12-07 Klee Dienes * infrun.c: Replace step_frame_address with step_frame_id. Use frame_id_eq to compare frame IDs. 2002-11-30 Klee Dienes * stabsread.h (dbx_lookup_type): Add objfile to the signature. * bcache.c (bcache_specify_allocation_with arg): Update prototype. (bcache_specify_allocation): Update prototype. * bcache.h (bcache_specify_allocation_with arg): Update prototype. (bcache_specify_allocation): Update prototype. * buildsym.c (finish_block): Clear the field structs before using. * gdbarch.h (*_gdb_arch_swap): Add prototypes. * gdbarch.c (*_gdb_arch_swap): Make statics. * gdbtypes.c (check_stub_method_group): Use TYPE_ALLOC to allocate TYPE_FN_FIELDLIST_NAME, not xmalloc. * objfiles.h (link_objfile): Add prototype. * objfiles.c (link_objfile): New function. (allocate_objfile): Update to use linn_objfile. (unlink_objfile): Update comment. * gdbtypes.h (INIT_CPLUS_SPECIFIC): Use a NULL value to mean "no cplus data". (HAVE_CPLUS_STRUCT): Update to the new convention. (TYPE_CPLUS_SPECIFIC_NONULL): Return a pointer to an empty cplus struct if called for a type with a NULL cplus struct pointer. (TYPE_xxx): Update to use TYPE_CPLUS_SPECIFIC_NONULL. * hpread.c (hpread_alloc_type): Rely on alloc_type to leave the cplus_specific field set to NULL. * mdebugread.c (new_type): Ditto. * stabsread.c (rs6000_builtin_type): Pass in an objfile; use when allocating new types. (dbx_lookup_type): Add objfile to the prototype for use when allocating new types. No longer cache returned types; just create a new one on the objfile type obstack for each call --- fix this later. (read_cfront_member_functions): Allocate the new physname on the type obstack. (define_symbol): Update calls to use the new dbx_lookup_type_interface. (update_method_from_phsyname): Pass in an objfile; use to store the returned method name. (read_member_functions): Use obsavestring, not savestring; obconcat, not concat; use new signature for update_method_name_from_physname. (read_one_struct_field): Use obsavestring, not savestring. (read_cfront_static_fields): Use obsavestring, not savestring. (read_args): Use obstack_alloc, not xmalloc for the new field structs. 2002-11-23 Klee Dienes * objfiles.c (objfile_relocate): Be smarter about how we sort the line-table. 2002-11-23 Klee Dienes symfile.c (symbol_file_add_bfd): ANSIfy prototype. 2002-11-23 Klee Dienes * objfiles.c: Include buildsym.h. (objfile_relocate): Re-sort the linetable after relocating. * Makefile.in (objfiles.o): Update dependencies. * buildsym.c (compare_line_numbers): Make global. * buildsym.h (compare_line_numbers): Add prototype. 2002-11-22 Klee Dienes * eval.c: Change NSSTRING->OBJC_NSSTRING, SELECTOR->OBJC_SELECTOR, etc., to match the FSF patches. * frame.h (frame_type): Remove merge typo. 2002-11-22 Klee Dienes * c-exp.y: Convert Obj-C to ObjC in comments. Change NSSTRING->OBJC_NSSTRING, SELECTOR->OBJC_SELECTOR, etc., to match the FSF patches. * defs.h (xrealloc): Define to gxrealloc, not grealloc. * stack.c: Merge Jason's fixes to print MI information for synthetic stack frames to the FSF sources. 2002-11-22 Klee Dienes * thread.c (do_captured_thread_select): Pass the user-visible thread-id (1, 2, etc.) to context_hook, not the internal thread-id. 2002-11-21 Klee Dienes * objc-lang.c (print_object_command): Validate the address before passing it to the print routine. 2002-11-19 Jason Molenda (jmolenda@apple.com) * printcmd.c (_initialize_printcmd): Add alias "set var" for "set variable" to avoid a few testsuite failures (gdb.c++/anon-union.exp) that depend on "set var" being unambiguous (due to our addition of 'varobj-print-object'). 2002-11-15 Jason Molenda (jmolenda@apple.com) * stack.c (print_frame_info_base): Apply patch submitted to FSF to print proper FRAME tuple for synthesized frames (call dummies, signal handlers), plus one Apple local change. * thread.c (gdb_thread_select): Drop Apple local changed I'd added a few weeks back - KeithS fixed it differently in mi/mi-main.c and my solution was causing a double-free error when mixed with his. 2002-11-18 Klee Dienes * defs.h: Declare gxmalloc/gxrealloc/gxcalloc/gxfree. Define xmalloc/xrealloc/xcalloc/xfree to refer to them (to prevent name conflicts with liberty). * infrun.c: Use xstrdup instead of strsave. * interpreter.c: Use xstrdup instead of strsave. * main.c: Use xstrdup instead of strsave. * top.c: Use xstrdup instead of strsave. * utils.c: Remove NeXT-specific code.o Remove GDB_FILE_ISATTY. Convert several functions to ANSI prototypes. Remove special-case for size_t definition. Remove strsave. Re-add xmalloc/xmmalloc definitions from the FSF sources. * config/i386/macosx.mh: Remove special-case of TERMCAP. * config/powerpc/macosx.mh: Remove special-case of TERMCAP. 2002-11-16 Klee Dienes * jv-lang.c: Use FSF_OBJFILES as the condition to choose FSF vs. Apple objfile support. * objfiles.c: Ditto. * symfile.c: Ditto. 2002-11-15 Klee Dienes * Makefile.in: Remove MACOSX_NAT_DEPFILES; the four files in question should be platform-independent. Re-add cached-symfile.o, machoread.o, symread.o, and pefread.o to COMMON_OBS. * configure.in: No longer default --with-mmalloc to true; it should work without it. Remove OSX-specific config tests. 2002-11-15 Klee Dienes * stabsread.c (read_args): Re-write. Fixed stack underflows for 0 or 1 types specified and overflow for > 1024 type specified. 2002-11-15 Klee Dienes * config/nm-macosx.h: Define ENABLE...MACOSX...HACKS... . 2002-11-15 Klee Dienes * symmisc.c (maintenance_check_symtabs): Also check the mangled name when doing the "only found in". A bit of a hack, but pending a fix to lookup_block_symbol, it's the only practical way. 2002-11-15 Klee Dienes * symtab.c (symbol_init_demangled_name): Re-write. Try C++ demangling for Objective-C++ code as well as C++ code. 2002-11-15 Klee Dienes * objfiles.c (allocate_objfile): Initialize symflags to -1 (all bits set). 2002-11-15 Klee Dienes * buildsym.h (pop_context): Check for stack underflow. * dbxread.c (process_one_symbol): Complain and stop processing that symbol if we are already at the top of the context stack for a function-end N_FUN (this would imply an umatched RBRAC). Ditto when processing N_RBRAC. 2002-11-11 Klee Dienes * linespec.c: Remove whitespace diffs from the FSF sources. 2002-11-10 Klee Dienes * valarith.c (value_subscripted_rvalue): Set the VALUE_REGNO field of the new value to that of the type being subscripted. * value.h (struct value): Update comment. 2002-11-10 Klee Dienes * c-exp.y (yylex): Store the initial character of the token in tokchr. Use to determine if a string is a string (tokchr is '"') or a nsstring (tokchr is '@'). * linespec.c (decode_objc): No longer pass next_component. (decode_line_1): Move the Obj-C selector parsing before the file check. Objective-C functions with a filename:function created by a previous canonicalization will already be fully canonicalized; we don't support users typing 'break file:selector'. 2002-11-10 Klee Dienes * linespec.c (set_flags): Add new parameter, if_pointer; returns pointer to the space before the 'if' in an if-clause, if present. (decode_line_1): Factor into decode_line_1 and decode_line_2; decode_line_2 contains the "guts"; while decode_line_1 calls set_flags, and conceals the trailing 'if'. 2002-11-09 Klee Dienes * corelow.c (core_close): Use target_resize_to_sections instead of resizing to_sections by hand. * exec.c (exec_close): Ditto. * defs.h (strsave): Add prototype. * symfile.c (syms_from_objfile): Call new_symfile_objfile and target_new_objfile_hook even if the symfile had no symbols. * target.c (target_info): Display the information for current_target in place of the top target-stack entry. (target_resize_to_sections): Also update current_target.to_sections, if appropriate. * cached-symfile.c: Fix a few warnings. 2002-11-08 Klee Dienes * breakpoint.c (do_captured_breakpoint): Ignore future-breakpoints if no address string is specified. 2002-11-07 Klee Dienes * infrun.c (handle_inferior_event): Remove the extra "[Switching to ...]" message; just rely on the one from normal_stop. We had used this message as a poor-man's thread-created notification, which I'm not sure was ever really all that useful (this is a reversion to the FSF sources). 2002-11-07 Jim Ingham * varobj.c (value_of_child): If we change the value we get from the lang->value_of_child, we need to free the old value, and release the new one. * varobj.c (value_of_child): Don't apply gdb_value_ind to a base class whose typecode is TYPE_CODE_REF. You already have the address of the class structure, so this is unnecessary. * stabsread.c (update_method_name_from_physname): Complain rather than erroring here. The fact that you can't demangle one method shouldn't abort the whole symbol parsing. 2002-11-06 Klee Dienes * exec.c (exec_close): Only call macosx_init_dyld_symfile if we're not quitting. 2002-11-06 Klee Dienes * exec.c (exec_close): Call macosx_init_dyld_symfile to notify the macosx layer of the exec_bfd change. (exec_file_attach): Ditto. 2002-11-01 Klee Dienes * utils.c (init_mmalloc_default_pool): Use a page-checked allocator instead of malloc as the default allocator if GDB_ENABLE_PAGECHECK is set in the environment. Wrap the default allocator with mmalloc_check_create if GDB_ENABLE_MMALLOC_CHECK is set. 2002-11-01 Klee Dienes * cp-abi.c (set_cp_abi_as_auto_default): Alloc (len + 1) when allocating a string, not just len. 2002-10-30 Jim Ingham Changes to make the varobj variables track the dynamic type of C++ class pointers: * varobj.c: Added dynamic_type field to the varobj struct. * Added a varobj_changelist to hand to clients, instead of handing out an array of varobj's. * Added a varobj_type_changed enum to make the type change code easier to read. This also passes through the value_of_{root,child} functions. * Added safe versions of value_rtti_type & value_rtti_target_type. * (varobj_fixup_value): New function. This determines the dynamic type from rtti, and fixes up the value to include the dynamic object. * (varobj_create): use varobj_fixup_value. * (varobj_get_dynamic_type) new function, gets a string representation of the dynamic type. * (varobj_update): instead of handing back a list of varobj's, hand back a token to a changelist, which clients can use varobj_changelist_pop to retrieve the contents. Handle the case of dynamic type changing both for a root variable and its children. * (create_child): value_of_child needs a type_changed. * (new_variable): initialize dynamic_type. * (get_type): use the dynamic type if present. * (varobj_changelist_init, varobj_changelist_pop, varobj_add_to_changelist): New functions, manipulate the varobj_update changelist. * (varobj_type_is_equal_p): New utility function. * (value_of_root): handle dynamic type changing. * (value_of_child): use varobj_fixup_value, handle dynamic type changing. * (type_changeable -> varobj_value_is_changeable_p): Old name was confusing, since it has nothing to do with types changing. * (c_value_of_root): use varobj_fixup_value, handle type changes. * (c_type_of_child): protect against null child. * (_initialize_varobj): Add a set variable to turn off dynamic type determination. * varobj.h: Added varobj_type_change, opaque reference to varobj_changelist, updated varobj_update, and added varobj_changelist_pop. * also changed mi-cmd-var.c to match these changes. 2002-10-30 Jason Molenda (jmolenda@apple.com) * ui-out.c (ui_out_cleanup_after_error): Move table close out of levels-loop. Adjust closing to work for either tuples or lists. 2002-10-30 Klee Dienes * exec.c (exec_file_attach): Replace checks for __i386__ and __ppc__ with TARGET_I386 and TARGET_POWERPC. This is still ugly, but at least it's not broken when cross-compiling. * symfile.c (symfile_bfd_open): Ditto. (reread_symbols): Ditto. 2002-10-29 Klee Dienes * breakpoint.c (bpstat_copy): Copy the command lines as well as the old value, to match what is freed in bpstat_clear. 2002-10-28 Klee Dienes * Makefile.in: Rename INTL_DEPS to INTL_DEP, to match other variable names. Remove the strip-gdb target; integrate into the gdb and insight targets themselves. Add new variables LIBTOOL and LINK; use in the gdb and insight link commands. * configure.in: Add AC_PROG_LIBTOOL. * configure: Regenerate. * aclocal.m4: Regenerate. 2002-10-28 Klee Dienes * symtab.c (find_line_pc_helper): Remove; integrate into find_line_pc_range. (find_line_pc): No longer use the value passed in for 'pc'; set it to zero at the start of the function. (find_line_pc_range): Only open the source file if lines_are_chars is set. Integrate find_line_pc_helper. 2002-10-28 Klee Dienes * config/nm-macosx.h: Move declarations of functions for macros next to the macros that use them. 2002-10-24 Jason Molenda (jmolenda@apple.com) * Makefile.in (MACOSX_NAT_DEPFILES): New variable to list MacOS X specific object files. (COMMON_OBS): Don't list MacOS X specific object files here. * configure.in: Only enable mmalloc by default on MacOS X systems. (MACOSX_NAT_DEPFILES): List MacOS X specific object files. * config.in, configure: Regenerated. * gcore.c (derive_heap_segment): Fix up find_function_in_inferior call to match new calling convention. * objfiles.c: Replace #if 0's with host detection macro. (allocate_objfile): Fix up bcache_xmalloc() calls. * jv-lang.c (get_dynamics_objfile): On only MacOS X systems, use MacOS X specific allocate_objfile() call. * symfile.c (symbol_file_add_bfd): On only MacOS X systems, use MacOS X specific allocate_objfile() call. 2002-10-23 Klee Dienes * infrun.c (handle_inferior_event): No longer do DECR_PC_AFTER_BREAK after a watchpoint, as it breaks page-protection watchpoints on i386. This is likely non-portable; my guess is that we will need to add a DECR_PC_AFTER_WATCHPOINT target macro. 2002-10-23 Klee Dienes * config/powerpc/nm-ppc-macosx.h: Remove definition of TARGET_NATIVE (it's unused in the current sources). 2002-10-22 Jason Molenda (jmolenda@apple.com) * varobj.c (varobj_set_display_format): Recognize unsigned setting. 2002-10-21 Klee Dienes * c-exp.y ('0' - '9'): Use 'tokchr' for the first character, not 'c'. 2002-10-21 Klee Dienes * c-exp.y ('0' - '9'): Revert to FSF code; memory leak in parse_number has since been fixed. 2002-10-21 Klee Dienes * config/nm-macosx.h (macosx_solib_add): Add prototype. (macosx_disable_page_protection_events): Add prototype. 2002-10-17 Klee Dienes * Makefile.in (version.c): Use the default FSF version if $(VERSION) is not set by the Makefile. 2002-10-17 Klee Dienes * symfile.c (syms_from_objfile) On macosx systems, call macosx_init_dyld_symfile to notify the dyld layer of the update to symfile_objfile. (new_symfile_objfile): Ditto. 2002-10-16 Jason Molenda (jmolenda@apple.com) * objc-lang.c (_initialize_objc_language): Remove extraneous \n at end of help msg. * thread.c (gdb_thread_select): On failure, return GDB_RC_FAIL. 2002-10-16 Jim Ingham * configure, configure.in: Turn off gdbtk by default for Mac OS X. 2002-10-16 Klee Dienes * stabsread.c (read_tilde_fields): Use name[sizeof(vptr_name)-2] to get the last character of a char[] buffer, not name[sizeof(vptr_name)-1]. 2002-10-16 Klee Dienes * dbxread.c (read_type_psym_p): Default to 'set'. 2002-10-14 Klee Dienes * c-valprint.c (c_val_print): Print "", not "", for TYPE_CODE_ERROR. It would perhaps be worth adding a new enum to distinguish TYPE_CODE_ERROR from TYPE_CODE_UNKNOWN, but for the moment, the "" is rather confusing to the user. * f-valprint.c (f_val_print): Ditto. * p-valprint.c (p_val_print): Ditto. 2002-10-14 Klee Dienes * symfile.c (symbol_file_clear): Only clear symfile_objfile, not all objfiles, in response to 'symbol-file' with no argument. Call macosx_dyld_init_symfile to properly update the macosx conception of the current set of load-state. 2002-10-13 Klee Dienes * arch-utils.c (generic_dynamic_trampoline_nextpc): Add. * arch-utils.h (generic_dynamic_trampoline_nextpc): Add. * gdbarch.sh (DYNAMIC_TRAMPOLINE_NEXTPC): Add. * gdbarch.c: Regenerate. * gdbarch.c: Ditto. 2002-10-06 Klee Dienes * rs6000-tdep.c (rs6000_info_powerpc_command): Make global. * ppc-tdep.h (rs6000_info_powerpc_command): Add prototype. * rs6000-tdep.c (info_powerpc_cmdlist): Make global. * ppc-tdep.h (info_powerpc_cmdlist): Add prototype. 2002-10-06 Klee Dienes * findvar.c (read_memory_typed_address): New function. * gdbcore.h (read_memory_typed_address): Add prototype. * blockframe.c (sigtramp_saved_pc): Use read_memory_typed_address to read a value destined for a CORE_ADDR, not read_memory_integer. * f-valprint.c (f77_get_dynamic_upperbound): Ditto. (f77_get_dynamic_lowerbound): Ditto. * symfile.c (simple_read_overlay_region_table): Revert to read_memory_integer (I believe this is incorrect, but the code is commented out, and I don't have a good way to test it). 2002-10-05 Klee Dienes * blockframe.c: Revert whitespace changes from the Cygnus sources. * gnu-nat.c: Revert to Cygnus sources. * i386-tdep.c: Restore read_memory_unsigned_integer to read_memory_integer. 2002-10-05 Klee Dienes * config/xm-aix4.h config/xm-nbsd.h config/alpha/xm-alphalinux.h config/alpha/xm-alphaosf.h config/arm/xm-linux.h config/i386/linux.mh config/i386/nm-fbsd.h config/i386/nm-linux.h config/i386/xm-cygwin.h config/i386/xm-i386bsd.h config/i386/xm-i386gnu.h config/i386/xm-i386v.h config/i386/xm-ptx.h config/i386/xm-symmetry.h config/ia64/xm-aix.h config/ia64/xm-linux.h config/m68k/xm-apollo68b.h config/m68k/xm-apollo68v.h config/m68k/xm-delta68.h config/m68k/xm-dpx2.h config/m68k/xm-hp300bsd.h config/m68k/xm-hp300hpux.h config/m68k/xm-m68k.h config/m68k/xm-sun2.h config/m68k/xm-sun3.h config/mips/xm-irix3.h config/mips/xm-irix5.h config/mips/xm-linux.h config/mips/xm-mips.h config/mips/xm-mipsm3.h config/mips/xm-riscos.h config/pa/hpux1020.mt config/pa/tm-hppa.h config/pa/tm-hppah.h config/pa/xm-hppab.h config/pa/xm-hppah.h config/powerpc/xm-linux.h config/rs6000/xm-rs6000.h config/s390/xm-linux.h config/sparc/tm-sparc.h config/vax/xm-vax.h: Revert to Cygnus sources. 2002-10-05 Klee Dienes * Makefile.in: Fold the Apple search-path changes into the target for init.c. This was specifically necessary in order to ensure that _initialize_gdbtypes was called first among the init functions (see the comment in gdbtypes.c). * osabi.h (enum gdb_osabi): Add GDB_OSABI_MACOSX. * osabi.c (gdb_osabi_names): Add string for GDB_OSABI_MACOSX. 2002-10-05 Klee Dienes * i387-tdep.c (i387_supply_register): When called with NULL as a buffer, mark the register as not provided (to mirror the behavior of supply_register). (i387_supply_fxsave): Ditto. (i387_supply_fsave): Ditto (inherits the behavior from i387_supply_register). 2002-10-04 Klee Dienes * c-exp.y: Minor stylistic fixes (periods and capitals in comments, etc.). (yyerror): Remove test for lexptr being non-empty (the upstream code now gives the string a correct value even at end-of-file). 2002-10-04 Klee Dienes * infcmd.c (default_print_registers_info): Print vectors and floats in 'natural' form, followed by the raw contents of the register. Print other types in hex, followed by their natural form. 2002-10-03 Jason Molenda (jmolenda@apple.com) * blockframe.c (flush_cached_frames): Drop Apple local change which trips up annotate test cases - looks like someone was being overly ambitious and trying to avoid unnecessary "frames-invalid" markers for annotate consumers. Innovation in annotate is not a good idea. 2002-09-27 Jason Molenda (jmolenda@apple.com) * symtab.c (make_symbol_overload_list): Fix thinko that was truncating overload-candidate func name. 2002-09-26 Klee Dienes * varobj.c (varobj_create): Use warning to report a warning, not fprintf_unfiltered. 2002-09-24 Klee Dienes The basic goal of this patch is to fix some inconsistencies in how GDB handles shared libraries. Previously, the OSX "dyld" shared library table was built up using the primary symbol file as a base, and section tables were updated using the list of active objfiles. This was not only "intuitively" wrong, it also led to errors when the exec file wasn't the same as the symbol file (i.e., didn't match it at all, for example because we were loading in saved data from a file created using the 'dump' command). In cases like that, the section table would as often as not end up pointing to the section from the sybol file, not the file of dumped data. Also, using just 'exec-file' and not 'symbol-file' would cause GDB to get into a bad state, and unable to run the program. This patch fixes both problems. It also has the happy side-effect of removing a huge chunk of diffs from objfiles.c * objfiles.c (update_section_tables): Remove. * objfiles.c (open_mapped_objfile, open_existing_mapped_file, add_to_objfile_sections, build_objfile_section_table, allocate_objfile): Revert from Cygnus objfiles.c. Most of these functions are not used, but reverting to the Cygnus versions will make merges less painful. * exec.c (solib_add_stub): Add. * exec.c (exec_file_attach): Call solib_add_stub after changing the exec file, so the sharedlibrary code can update other libraries the new executable might pull in. * symfile.c (symbol_file_add_bfd): No longer call update_section_tables (). * symfile.c (symbol_file_add_main_1): Add exec_bfd parameter to macosx_init_dyld_symfile. * objfiles.h (update_section_tables): Remove prototype. 2002-09-24 Klee Dienes * valops.c: Remove obsolete STACK_ALLOC definitions. 2002-09-24 Klee Dienes * Makefile.in: Don't create $(FRAMEWORK).framework/Versions/Current/Headers/cli twice; it causes an error. 2002-09-24 Klee Dienes * config/nm-macosx.h: Re-indent. Pass parameters to macosx_add_shared_symbol_files(). Re-define SOLIB_ADD from macosx_try_start_dyld to macosx_solib_add; pass all parameters. * config/{i386,powerpc}/macosx.{mh,mt}: Convert spaces to tabs in MACOSX_FILES and CFM_FILES. * config/powerpc/macosx.mh: Remove definition of NS_TARGET_MAJOR. * config/{i386,powerpc}/macosx.mh: Add -Wall -Wimplicit -Wno-long-double to CFLAGS. 2002-09-23 Jim Ingham (jingham@apple.com) * blockframe.c (refine_prologue_limit): moved here from rs6000-tdep.c so I could use it in ppc-macosx-tdep.c. Also pass max_skip_non_prologue_insns as a parameter. * frame.h: declare refine_prologue_limit. * rs6000-tdep.c: remove refine_prologue_limit, change calls to it to pass the max_skip_non_prologue_insns. 2002-09-21 Jason Molenda (jmolenda@apple.com) * linespec.c (decode_line_1a): Pop over finishing apostrophy character, don't let do_captured_breakpoint get confused by it. Fixes this - (gdb) break 'inheritance2' from gdb.c++/classes.exp. 2002-09-20 Jason Molenda (jmolenda@apple.com) * rs6000-tdep.c: Make rs6000_pop_frame() externally visible. * ppc-tdep.h: Provide prototype for rs6000_pop_frame(). 2002-09-19 Klee Dienes * valops.c (hand_function_call): Remove errant second call of find_function_addr(). 2002-09-18 Jason Molenda (jmolenda@apple.com) * maint.c (_initialize_maint_cmds): Remove mention of 'chill' from 'help maint' and 'maint demangle'. 2002-09-17 Jim Ingham (jingham@apple.com) * infcmd.c (break_command): Don't disable stdin BEFORE asking a question! 2002-09-16 Jason Molenda (jmolenda@apple.com) * top.c (init_main): Remove errant space char in help text. 2002-09-13 Jason Molenda (jmolenda@apple.com) * symtab.c (make_file_symbol_completion_list): Remove two errant exits from function that prevent returning a completion list of all symbols. Fixes this failure: FAIL: gdb.base/completion.exp: (timeout) complete (2) 'p no_var_named_this-' 2002-09-09 Jason Molenda (jmolenda@apple.com) * breakpoint.c (print_one_breakpoint, breakpoint_1): Revert these to the FSF versions--drop additional table columns which worked around a now-fixed UI bug. 2002-08-27 Klee Dienes * linespec.c (decode_line_2): Prototype. (decode_line_1): Rename to decode_line_1a; move has_if support to a wrapper function and move out to decode_line_1. * rs6000-tdep.c: Hack to allow use as part of the Mac OS X target. Define TEXT_SEGMENT_BASE if not already defined; rename _initialize_rs6000_tdep to x_initialize_rs6000_tdep so it is not called automaticallly (it conflicts with the ppc-macosx-tdep to attempt to register and arch handler for powerpc). * valops.c (hand_function_call): Revert to Cygnus sources. Re-add the cached value and expected-type support. * gdb/config/powerpc/macosx.mt: Add rs6000-tdep.o and ppc-sysv-tdep.o. 2002-08-14 Jason Molenda (jmolenda@apple.com) * breakpoint.c (breakpoint_re_set_one): Save recomputed expression in watchpoint. 2002-08-06 Klee Dienes * breakpoint.c (watchpoint_equal): New function. Like value_equal, but arrays only count as "equal" if they have the same contents. (watchpoint_check): Update to use watchpoint_equal. (breakpoint_re_set_one): Remove watchpoints if there is an error in setting them. (config/nm-macosx.h): Rename TARGET_RANGE_PROFITABLE_FOR_HW_WATCHPOINT to TARGET_RANGE_OK_FOR_HW_WATCHPOINT. 2002-08-09 Jason Molenda (jmolenda@apple.com) * breakpoint.c (breakpoint_re_set_one): Rewrite last patch by Klee to remove unnecessary code from hardware watchpoint resetting. (write_one_breakpoint): Write out watchpoints correctly. * wrapper.h: Include varobj.h for its juicy type decls. 2002-07-12 Jim Ingham * i386-tdep.c (i386_get_frame_setup): In two places a variable (pos) is used to hold an address, but declared int rather than CORE_ADDR. Fixed this. 2002-07-10 Jim Ingham * dbxread.c (process_one_symbol): Use last_function_start rather than function_start_offset to find the real beginning of the current function. The latter is just the text section offset on some systems, the latter is always the real function start... 2002-07-09 Jim Ingham * objfiles.h: declare objfile_demangle_symbols since we use in in more than one file... * symfile.c: Fix the usage message for add-symbol-file. 2002-07-02 Jim Ingham * varobj.c (create_child): Move the test for child->value AFTER you have created it, dope... 2002-06-12 Klee Dienes * config/i386/xm-i386-macosx.h: Remove the definitions for HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT, and HOST_LONG_DOUBLE_FORMAT (they are in xm-i386.h). 2002-06-12 Klee Dienes * i386-tdep.c (i386_skip_prologue): This should take a CORE_ADDR, not an int. * config/i386/tm-i386.h (i386_skip_prologue): Update prototype. 2002-06-10 Jim Ingham * breakpoint.c (breakpoint_stop_status): If we threw away the previous expression for the breakpoint condition, rebuild it here. (breakpoint_re_set_one): Discard & null out the parsed expression, but don't try to reparse it here, or we will recurse infinitely trying to reset the breakpoint if we need to call into the inferior to parse the expression. * minsyms.c (install_minimal_symbols): when we demangle symbols for an objfile, set the minimal_symbols_demangled flag so we don't do it all over again in objfile_demangle_msymbols. FIXME: in the long run, we should see whether we really need to do objfile_demangle_msymbols, since the net version doesn't need to... 2002-06-07 Jim Ingham * breakpoint.c (bpstat_do_actions): Notice whether we have run any commands, and if so, emit a ui_out "notify" message when we are done running them. (print_it_typical): add a uiout field to the breakpoint hit stopped message saying whether there are any commands associated with this stop. * ui-out.h: Add notify_begin & notify_end function slots to the ui_out_impl structure. Also declare ui_out_notify_begin & ui_out_notify_end. * ui-out.c: Add the default_notify_begin & _end functions to the default impl, and implement the ui_out & uo_out versions. Also added a make_cleanup_ui_out_notify_begin_end function, for use if you are going to do any work between starting & ending the notify session. * cli-out.c: Add NULL's for the cli version of the notify functions. 2002-05-31 Jim Ingham * config/powerpc/xm-ppc-macosx.h: Add defines for HOST_*_FORMAT for floats, doubles & long doubles. This will sidestep trying to convert floats from ppc native format to ppc native format, an amusing but pointless exercise... * config/i386/xm-i386-macosx.h: ditto. 2002-05-30 Rab Hagy * varobj.c, varobj.h: added "unsigned" format specification * stack.c: added frame pointer to output of a stack frame (for MI only) 2002-05-21 Jim Ingham * varobj.c (create_child): Don't do strncmp to set fake_child, or you will get false positives... (cplus_make_name_of_child): The logic for doing index -> {"public", "private", "protected"} was faulty. 2002-05-16 Klee Dienes * Makefile.in: no longer define free to xfree; all instances of free in the sources should now be converted. * xm-macosx.h: ditto. * Makefile.in: add cached-symfile.{c,o} * breakpoint.c: convert instances of free to xfree. * expprint.c: convert instances of free to xfree. * interpreter.c: convert instances of free to xfree. * linespec.c: convert instances of free to xfree. * objc-lang.c: convert instances of free to xfree. * core-macho.c: convert instances of free to xfree. * macosx-nat-dyld-info.c: convert instances of free to xfree. * macosx-nat-dyld-info.c: convert instances of asprintf to xasprintf. * macosx-nat-dyld-io.c: convert instances of asprintf to xasprintf. * macosx-nat-dyld-path.c: define strsave as xstrdup, not savestring. * macosx-nat-dyld-path.c: convert instances of free to xfree. * macosx-nat-dyld-process.c: convert instances of free to xfree. * macosx-nat-dyld.c: define strsave as xstrdup, not savestring. * macosx-nat-info.c: convert instances of free to xfree. * macosx-nat-info.c: convert instances of malloc to xmalloc. * utils.c (xvasprintf): use xstrdup to malloc the resulting string instead of the system malloc, so it can be passed to xfree without incident. * mi-main.c: add mi_interpreter_exec; add to the interpreter struct (so that interpreter-exec can also run MI commands). * dbxread.c: disable mapping string tables (mmap_strtabflag) by default. * defs.h: init_malloc now returns a mmalloc pool, possibly different from the one passed in (to support returning a mmalloc_check pool based on the pool passed in). * doublest.c: define NaN to be 0.0 regardless if it is defined by the system, to work around __nan issues on WWDC build. * objfiles.c: remove allocate_objfile and all related functions; replace with new functions in cached-symfile.c * objfiles.c: add new variables 'generate-persistent-symbol-tables' and 'use-persistent-symbol-tables'. * symfile.c: no longer force HAVE_MMAP to 0. remove test for bfd_supports_mmmap (bfd can simply return error from bfd_mmap_file). add "mapaddr" agrument to add-symbol-file. re-enable zeroing of msymbol table hash when creating objfile. * thread.c: properly cleanup the ui_out when there is an error generating the thread list. * utils.c (init_mmalloc_default_pool): create a mmalloc pool that defaults to system malloc, using mmalloc_malloc_create. (init_malloc): create a mmalloc_checked_malloc zone based on the mmalloc zone passed in, rather than modifying it in place using th mmcheckf interface. 2002-05-14 Jim Ingham * linespec.c (decode_line_1): don't use gdb_completer_word_break_characters when allow_objc_selectors_flag is false. This only happens when we are resetting breakpoints after shared library loads, so it just causes future-break to fail on ObjC symbols. 2002-05-03 Jim Ingham * objc-lang.c (_initialize_objc_lang): New function, set the lookup_objc_class_p. * (should_lookup_objc_class): New function, should we look up objc classes as an ordinary part of symbol lookup? * c-exp.y: Use should_lookup_objc_class. 2002-05-01 Klee Dienes * infcmd.c (do_registers_info): Print only things with type INT as both int and hex. * infcmd.c (do_registers_info): Don't check AltiVec types; instead treat all non-INT registers as "info all-regs" only. 2002-04-24 James Ingham * varobj.c (varobj_in_scope_p): New function, tell whether a variable is in scope. (c_type_of_child): A pointer type might point to a typedef, so you have to also call check_typedef on the target before creating its children. * varobj.h: declare varobj_in_scope_p. 2002-04-24 Klee Dienes * linespec.c (decode_line_1): Ignore most word separators when scanning for breakpoint expression, to allow for better Obj-C method parsing. 2002-04-23 Klee Dienes * infcmd.c (do_registers_info): Check for AltiVec types when deciding whether to print a register as float or int. 2002-04-19 James Ingham * varobj.c (type_changeable): Another place where we want to protect against accessing a NULL type structure in the varobj. 2002-04-18 James Ingham * varobj.c (varobj_create): Add a real block parameter to varobj_create. I was overloading the frame for this case, which is fragile, and broke in the latest merge. * (c_type_of_child): Call check_typedef on parent->type before using it to get the type of the child. * varobj.h: mutatis mutandi for varobj_create change. 2002-04-18 James Ingham (This is from Jason Merrill ): * gnu-v3-abi.c (gnuv3_rtti_type): If we get confused, just warn and return NULL. 2002-04-15 James Ingham * varobj.c (varobj_create): Make it possible to create a USE_SELECTED_FRAME varobj when the variable is not currently defined, and defer defining it till it shows up. (varobj_get_num_children): if we couldn't parse the expression yet, return -1 for number of children. (free_variable): Don't free the current expression if it is NULL. (variable_language): Punt (say it is C) for variables we couldn't find yet. (value_of_root): varobj_create can now return a non-null varobj, with a NULL exp struct. 2002-04-08 James Ingham * target.h: Add to_bind_function entry to target_ops. * target.c: initialize to_bind_function appropriately. * valops.c (create_cached_function): Initialize "bound" flag. (lookup_cached_function): bind the function before calling. * values.h: Add bound field to the cached_value struct. 2002-04-05 James Ingham * ui_out.c (ui_out_is_mi_like_p): Check for the uiout being NULL. 2002-04-04 James Ingham * valarith.c (find_size_for_pointer_math): New function, return the size of a pointer's target, or 1 for void *, or error with an appropriate message for incomplete types. (value_sub, value_add): use find_size_for_pointer_math. 2002-04-04 James Ingham * varobj.c (cplus_make_name_of_child, cplus_make_path_expr_of_child): Don't skip over the vptr entry, that is already taken care of in cplus_real_type_index_for_fake_child_index. 2002-04-03 James Ingham * infrun.c (restore_selected_frame): The code here was misusing fr->level, which is an absolute frame (coming from selected_frame_level) and not a relative frame level. * varobj.c (c_value_of_root): Restore both the selected_frame and the selected_frame_level. 2002-04-02 James Ingham * symtab.c (make_symbol_completion_list): Don't try to get the length of sym_text till after you've made sure it is not NULL. (make_symbol_file_completion_list): ditto. 2002-04-01 James Ingham * linespec.c (decode_line_1): When handling file:line specs, if funfirstline is 1, actually move the breakpoint past the prologue. This is done for functions, and the same rationale holds for source line specifications. * symtab.c (find_pc_line): fix silly bug - NB, this is already fixed on the FSF head, but that code relies on some other changes. * varobj.c (varobj_update): If selected_frame is NULL, then just don't bother with trying to restore it. 2002-03-29 James Ingham * valarith.c (value_sub): If you are doing pointer - integer, and TYPE_LENGTH of the pointer's target comes back 0, set it to 1. This is what value_add does, and we should be consistent. 2002-03-28 James Ingham * varobj.c (child_exists): New function. This is a fast way to get the child corresponding to a given index. (get_type_deref): Pass out whether the original was a pointer or not. (path_expr_of_variable): New function. This returns the full path expression to a variable. The intent here is that you could use this to make a new root varobj corresponding to the child varobj whose path expression you are getting. (varobj_get_path_expr): New function. External wrapper for path_expr_of_variable. (c_path_expr_of_child, cplus_path_expr_of_child, java_path_expr_of_child): New functions, return the path expr of a child in its parent. Also caches the expr for later use. (make_name_of_child, c_make_name_of_child, cplus_make_name_of_child, java_make_name_of_child): "name_of_variable" used to serve both the create name and the return name functions. This was inefficient; since you only need to compute the name when you make the variable, you ended up doing a whole bunch of work just to do simple lookups. So I split the two functions, and made separate calls for them. These are the make name calls. (name_of_variable): This now just returns the name, it doesn't recompute it. (is_root_p): New convenience function, returns whether a variable is a root. Then I changed all the uses of var->name to use name_of_variable, and the test for is this a root were changed to use is_root_p. (varobj_set_value): Remove the baseclass offsetting, since value_cast now handles this properly (Keith took this out of the FSF version too). * varobj.h: Added def'n of varobj_get_path_expr. 2002-03-27 James Ingham * config/i386/tm-i386-next.h: Define HAVE_I387_REGS properly so gdb doesn't think ALL registers are floating point registers. 2002-03-19 James Ingham * defs.h: Add test for gcc 3 to test of whether to use __PRETTY_FUNCTION__. 2002-03-15 James Ingham *c-exp.y: If you have found a variable that is a field of this, don't ALWAYS make it hang off "self" check the language first! 2002-03-12 James Ingham * cp-abi.c (set_cp_abi_cmd, show_cp_abi_cmd,): New functions, allow you to set & show cplus abi's in case gdb gets it wrong. (set_cp_abi_as_auto_default): New function, set the "auto" abi to be this abi. (is_cp_abi_auto_p): New function, say whether the current abi is the default or not. (_initialize_cp_abi): Define the cp-abi switching commands. * cp-abi.h: declare the new functions. * minsyms.c (install_minimal_symbols): don't switch the cp_abi unless the current abi is auto. * gnu-v2-abi.c (_initialize_gnu_v2_abi): don't switch to gnu-v2, but set it as the auto_default instead. 2002-03-05 James Ingham * stack.c (print_frame): restore the (local) print_frame_more_info_hook that got dropped in one of the merges. 2002-03-05 James Ingham * target.h: add print_section_info_objfile, it is used in next code. * utils.c (error_stream): Don't dump error info to the console for mi-like interpreters - it is already added to the command return. * valops.c (set_unwind_on_signal): New function, allow C-code to set the unwind_on_signal flag. * value.h: declare set_unwind_on_signal. * mi-cmd-var.c (mi_cmd_var_evaluate_expression): Add -u flag to unwind on signal for inferior function execution. 2002-02-21 James Ingham * valops.c (find_overload_match): remove some useless code that was removed from the FSF version but somehow didn't get expunged in the merge. * symtab.c (make_file_symbol_completion_list): remembet to set sym_text to the place in the input string where we think the symbol begins. 2002-02-20 James Ingham * event-top.c (gdb_setup_readline): Don't turn on readline event handling if instream is NULL (usually when reading script commands) since there is no input to wait on anyway... 2002-02-06 Klee Dienes * fork-inferior.c (fork_inferior): Add '!' to the list of characters that need to be quoted when building a string for the shell. Quote '!' specifically with a backslash, since CSH chokes when trying to evaluate "str!str". 2002-01-29 James Ingham * interpreter.c (gdb_interpreter_ui_out): Add accessor function. * interpreter.h: declare it. 2002-01-28 James Ingham * stabsread.c (read_type): Handle the case where there is a type def'n WITHIN the argument list for a class method. Need to step over the ";" that terminates the def'n or read_args will lose it. * (read_args): If for some reason you find NO types, return an error rather than crashing. 2002-01-25 James Ingham Generalize the gdb_event, and allow clients outside of event-loop.c to create & queue gdb events. Also, make sure that the client_data that gets passed into fetch_inferior_event makes it down to target_wait, which very well might need it. * defs.h: add client_data to target_wait_hook. * event-loop.c: export event_handler_func type. generalize the "fd" field of the gdb_event structure - make it a void *. * (gdb_create_event): New internal function, implements the generic parts of creating a new event structure. * (gdb_queue_event): New function, how clients will create & queue a new event. * various places - mutatis mutandi for the type changes in the gdb_event structure. * event-loop.h: declare gdb_client_data, the event_handler_func and gdb_queue_event. * infrun.c: Pass NULL (in the non-async case) or the client_data (in the async case) to target wait where appropriate. * inftarg.c: add gdb_client_data to child_wait. * target.c: add gdb_client_data to debug_to_wait. * target.h: fix declaration of to_wait element of the target vector. * thread-db.c: add gdb_client_data to thread_db_wait. * top.c: fix another call to target_wait_hook. * config/nm-nextstep.h: Fix declaration of child_wait. * dbxread.c (_initialize_dbxread): Add a flag: read_type_psyms to control whether we construct psyms for types. * (read_dbx_symtab): Check the flag. 2002-01-15 James Ingham * objc-lang.c: Have to include regcache.h or FETCH_ARGUMENT will not convert the return value from read_register correctly, and will mangle the value. * infcmd.c (attach_command): Guard use of SOLIB_ADD with #ifdef. 2002-01-15 James Ingham * ui-out.c (ui_out_end): Remove some bits of my patch to the list elements in a table bug that were superceded by Andrew's subsequent patch, and caused a crash if left in place. 2002-01-15 James Ingham stabsread.c (read_one_struct_field): gcc 3.1 inserts type def'ns into the class stab, and terminates the embedded type def'n with a ";", which gdb is not expecting. Strip it off if it does that. 2001-12-11 James Ingham utils.c (gdb_check_fatal): mutatis mutandi for changes to internal error. 2001-12-11 James Ingham These changes are a start at making varobj more robust when you get an error generating a type for a varobj you can't ignore. This arises, for instance, if you have an error in generating the varobj for a child variable. * varobj.c: Add fake_child element to the varobj structure. This is better than relying on type == NULL, value == NULL, since you can't tell the difference between a fake child and an error. (varobj_get_type): If we can't get the variable's type, don't continue as you will only crash... (create_child): set fake_child appropriately. (cplus_number_of_children): If you can't get the type, you can count the number of children. Just return 0. (cplus_value_of_child): If gdb_value_struct_elt returned an error, don't go on to try c_value_of_child. It won't work either... (cplus_type_of_child): skip over fake child to its parent when getting the type. 2001-12-03 James Ingham * breakpoint.c (bpstat_do_actions): Allow an async target to run breakpoint commands in an asynchronous fashion. The code before this was forcing the target to look synchronous to get the breakpoint commands to work right. (async_breakpoint_command_continuation): New function, the continuation for commands that run the inferior in a breakpoint command. * inf-loop.c (inferior_event_handler): reorder the complete_execution and the continuations to handle breakpoint commands that continue the target. * cli/cli-script.c (execute_control_command): If we are in the mi, then breakpoint commands should get run under the "interpreter execute" command to get the output right. * breakpoint.c, breakpoint.h (find_finish_breakpoint): Need access to the finish breakpoint so we can make the finish - hit solib breakpoint - continue sequence look like finish. * infrun.c (handle_inferior_event): store away the current finish breakpoint if we actually stop for a solib event while a finish is queued up. (normal_stop): print the function-finished result if we have hit the ersatz finish breakpoint. * symtab.c (find_line_pc_range): Don't error out if you can't find the source file. It is not needed to get the linetable mapping. 2001-12-03 James Ingham Import from Neutrino tools branch: * utils.c (make_my_cleanup): Add a guard for a null cleanup function. I have one bug report that this had happened, but I can't get it to repeat. This will hopefully help catch the bug... * ui-file.c (fputs_unfiltered): Don't pass null buffers to the lower layers of the ui_file code. * varobj.c (varobj_create): Remember to release the "type" value from the value chain if we make a varobj that we can't resolve immediately. Otherwise we will get a double free. * symtab.c (in_prologue): The check for metrowerks_stepping and NO metrowerks function range caused unnecessary stops. Remove it. * breakpoint.c (print_one_breakpoint): Print the address string of an unset future breakpoint. This was coming up empty before the change. * infrun.c (handle_inferior_event): Handle nexti when in a function prologue by ONLY continuing if we are at the beginning the prologue. * gdb/infrun.c, gdb/symtab.c, gdb-next/macosx-metrowerks.c: Add support for metrowerks step_func_start & step_func_end so we can more easily run under MW with no symbols. 2001-11-28 James Ingham * inferior.h: restore STARTUP_WITH_SHELL, and add the start_with_shell_flag variable to here. * infcmd.c: define start_with_shell_flag here, and prime it with STARTUP_WITH_SHELL. * fork-child.c: remove def'n of start_with_shell_flag from here but this is where you can dynamically change it still... * ui-out.c (verify_field_alignment): Don't verify the field alignment if you are building a table, but not at the table level (which is currently fixed at 1.). (ui_out_end): If you are building a table, and return to the table level you have just finished the current table column, and should begin the next. 2001-11-01 Klee Dienes (kdienes@apple.com) * Makefile.in: Remove objc-exp.y * c-exp.y: Pull Objective-C changes from objc-exp.y. * symfile.c (init_filename_language_table): Change ".M" and ".mm" to language_objcplus. * c-typeprint.c: Add test for language_objcplus to test for language_objc. * utils.c: Ditto. * symtab.h: Ditto. * symtab.c: Ditto. * stabsread.c: Ditto. * printcmd.c: Ditto. * language.c: Ditto. * maint.c: Ditto. * c-typeprint.c: Ditto. * partial-stab.h: Ditto. * language.h: Ditto. * objc-lang.h: Remove prototypes for objc-parse.y; reformat. * objc-lang.c: Add objcplus_language_defn; change parser for objc_language_defn to c_parse. * eval.c (evaluage_subexp): Remove objc_msgsend_typed; pass appropriate values to call_function_by_hand_expecting type instead. 2001-10-31 Jason Molenda (jmolenda@apple.com) * symtab.c (gdb_mangle_name): Merge didn't pull in FSF changes to this function. (lookup_partial_symbol): Fix language conditional. (make_symbol_overload_list): Move symbol check from here. (make_symbol_completion_list): To here, where it was pre-merge. * varobj.c: Comment typo. 2001-10-15 Jason Molenda (jmolenda@apple.com) * symtab.c (lookup_block_symbol): Remove this wrapper function. (lookup_block_symbol_helper): Rename to lookup_block_symbol() as it was originally; remove special handling for ObjC which assumes that lookup_block_symbol doesn't work correctly for unmangled identifiers (i.e. identifiers with spaces in them). 2001-10-12 Jim Ingham * valarith.c (value_sub): Don't pass a raw type to value_from_pointer, it has to go through check_typedef first. 2001-10-09 James Ingham * dbxread.c (process_one_symbol): Use complain, not warn, so we don't spam users too much. 2001-10-08 Jason Molenda (jmolenda@apple.com) * symtab.h (symtab_and_line): Revert kdienes' patch of 2000-05-22 and make sal.line a (signed int) again. 2001-10-05 James Ingham * dbxread.c (process_one_symbol): Ignore function end stabs when we are not currently in a function. Some linkers neglect to clean up properly when coalescing functions. 2001-09-07 Jason Molenda (jmolenda@apple.com) * symtab.c (lookup_block_symbol): Break out of linear search if we're past the range of possible matches. 2001-08-31 Jason Molenda (jmolenda@apple.com) * c-valprint.c (c_val_print): Second call to check_typedef () is no longer necessary. 2001-08-06 James Ingham * symtab.c (in_prologue): If the function start address doesn't look like a prologue start, try also scanning from the pc. This helps us in some cases where we have bad debug info so the function address is off in never-never land. I have seen this happen in PEF binaries where there are some functions with traceback tables inlined, but not all. 2001-08-02 James Ingham * varobj.c (cplus_real_type_index_for_fake_child_index): New function, return the index in the class type for the n'th child of one of the varobj fake children. (cplus_name_of_child): Use this function rather than just assume the class writer had ordered her variables in a particular order. (c_value_of_variable): Make sure you count the number of children before reporting it in an Array's value string. 2001-08-01 James Ingham * command.c (_initialize_command): The file name completer is more appropriate for "shell" than the default completer... 2001-07-09 James Ingham * valops.c (value_rtti_type): Check for minsym == NULL BEFORE using it. 2001-07-06 James Ingham * wrapper.c (gdb_varobj_get_value): provide a save varobj_get_value. * wrapper.h: declare it. * cli-out.c: wrapper.h now requires varobj.h. * gdbtypes.c: ditto * values.c: ditto * varobj.h: ditto 2001-06-21 James Ingham * varobj.c (cplus_value_of_child): Just cosmetic - I find the added brackets more readable. 2001-06-20 Ira L. Ruben * breakpoint.c (parse_breakpoint_sals): Handle case where address is NULL and default_breakpoint_valid to set addr_string to "*pc" (sal.pc) to avoid warning from breakpoint_re_set_one(). 2001-06-15 Ira L. Ruben * Makefile.in: Update dependencies for breakpoint.o * breakpoint.c (set_raw_breakpoint): init new original_type field. (create_breakpoints): Handle new original_type argument. (break_command_1): Ditto. (do_captured_breakpoint): Pass new original type to create_breakpoints. (break_at_finish_at_depth_command_1): pass original type to break_command_1. (break_at_finish_command_1): Ditto. (break_command): Ditto. (future_break_command_1): Ditto. (tbreak_command): Ditto. (hbreak_command): Ditto. (thbreak_command): Ditto. (stopin_command): Ditto. (stopat_command): Ditto. (watch_command_1): Handle new original_type argument. (watch_command): Pass new original type to watch_command_1. (rwatch_command_wrapper): Ditto. (awatch_command): Ditto. (ignore_command): Suppress newline if from_tty is false. (write_one_breakpoint): new routine for save_breakpoints_command. (save_breakpoints_command): Add save-breakpoints command. (_initialize_breakpoint): Define save-breakpoints and its aliases. * breakpoint.h (enum bptype): Add new breakpoint types. (struct breakpoint): Add field to recore original breakpoint type. * main.c (captured_main): Initialize $input_radix and $output_radix. These are referenced by a save-breakpoints file to preserve radix across the breakpoint restoration. * tracepoint.c (tracepoint_save_command): Fix fopen error reporting to show errno information just like save-breakpoints command. * valprint.c (set_input_radix_1): Set $input_radix. (set_output_radix_1): Set $output_radix. 2001-06-15 James Ingham * infcmd.c (_initialize_infcmd): If the "run" completer is the file completer, then the "set args" should be as well. Make it so... 2001-06-13 Jim Ingham * infcmd.c: Make the completer for run be the file completer. It is very common for file names to be the arguments to programs, nothing else really makes sense... * valops.c (value_cast): When you are consing up the pointer type for a superclass, set the enclosing type as well or all the superclass fields will be incorrect. 2001-06-08 James Ingham * breakpoint.c (_initialize_breakpoint): Add "break ... if to the documentation for the breakpoint command. 2001-04-17 James Ingham * blockframe.c (create_new_frame): move the INIT_EXTRA_FRAME_INFO call to BEFORE the find_pc_partial_function. This ensures that we will never get a frame without an extra_info because of an error in find_pc_partial_function. 2001-04-09 James Ingham * symtab.c (find_line_pc_range): Check that linetable is not null before you dereference it. * varobj.c (cplus_value_of_child): check that gdb_value_ind does not return null. In the C++ case, gdb_value_ind tries to look up the superclass, and sometimes fails miserable. Protect against that. 2001-03-12 James Ingham * valops.c (value_rtti_type): Remove the attempt to offset to the full type, since that never worked for the hard cases were it might be useful, and failed for the easy cases... NB. This code is pretty useless for GCC right now. But at least this renders it harmless. 2001-02-13 James Ingham * event-top.c (display_gdb_prompt): Call target_terminal_ours before we reinsert the readline callback handler. This is necessary if the inferior dies unexpectedly, and the code doesn't clean up. 2001-02-12 James Ingham * infrun.c (proceed): set target_executing to 0. normal_stop doesn't do this, and in the non-asynchronous case, complete_execution doesn't get called either. 2001-02-05 James Ingham * objc-lang.c: If syms is NULL, don't try to dereference it! 2001-01-25 James Ingham * infrun.c: Initialize sync_execution to 1 - this is the default mode for running gdb... * event-top.c (async_enable_stdin): Don't mess with sync_execution in this function. You should not lie about the mode of execution just to get the terminal multiplexing to work. It adds a lot of fragility to the code. (async_disable_stdin): ditto. FIXME: These changes reverse some hacks to get the remote target to work with async. The remote hacks are evil & bad, but these changes will have to be revised before we can submit the code to the FSF. * cli-out.c (cli_interpreter_resume): Initialize the sync_execution to 1 when you resume the cli interpreter. This is the correct value for the cli interpreter. 2001-01-24 James Ingham * inflow.c (terminal_ours_1): When you are attaching, don't try to get the inferior_process_group from the controlling terminal. This is almost never right, and will cause ^C not to work. 2001-01-17 James Ingham * varobj.c: Add in_scope field to the root structure. (new_root_variable): Initialize in_scope. (varobj_update): Better track variables going into & out of scope. (varobj_create): For non-use_selected_frame variables, always check whether the variable is in scope. Evaluation will often return true even when the variable is not in scope, but it is bogus... 2001-01-10 James Ingham * stack.c (print_frame): Add a call to print_frame_more_info_hook so other interpreters than the CLI can add info to the stack printing without affecting the CLI output. * defs.h: Added def'n of print_frame_more_info_hook. * top.c: Added declaration of print_frame_more_info_hook. 2001-01-09 James Ingham * symtab.c (lookup_symbol_aux): Call lookup_symbol_aux to lookup a mangled symbol rather than recursing into lookup_symbol, since this will just re-unmangle the name & call lookup_symbol_aux - leading to an infinite recursion. 2000-12-18 James Ingham * breakpoint.c (bpstat_do_actions): Force the execution of breakpoint commands to be synchronous. This is a hack to work around the fact that asynchronous execution of breakpoint commands doesn't work for truely synchronous commands. The correct fix is for synchronous versions of commands (like "continue" as opposed to "continue&") not to return till they have finished execution. Stay tuned. * gdbtypes.c (check_typedef): Make sure check_typedef never creates a type structure where the type & the target_type point to the same memory. This was happening when you had a typedef for an incomplete type. This is not the complete fix, since such types should not get get created in the first place, but this keeps the error from hanging gdb. 2000-12-15 James Ingham * varobj.c (varobj_create): Added USE_BLOCK_IN_FRAME which treats the "frame" variable as the address of a block structure. The varobj will be bound to that block. FIXME - need to come up with a type-safe interface to this. (varobj_get_valid_block): New function, returns the startaddr & endaddr for the valid block for a varobj. (value_of_root): Check that we are in the local block in which the varobj is defined (as opposed to the frame in which it is defined). (varobj_pc_in_valid_block_p): New function, returns whether the pc in the frame for this varobj is in the block in which this varobj is valid. 2000-12-12 James Ingham * breakpoint.c (do_captured_breakpoint): Move test for sals.nelts - i.e. "Did we find a breakpoint" AFTER test for "is this a future break..." 2000-12-04 James Ingham * main.c (captured_main): The coreargs variable has been quoted, so it is no longer a number, and fails the "could be a PID" test. Strip the quotes before the test... * top.c (execute_user_command): Set the target to synchronous during the execution of user defined commands. Otherwise the command execution will get out of order. * target.c (gdb_set_async_override): New function, overrides the target's can_async method when we really need to ensure that a command gets run synchronously... 2000-11-22 James Ingham * varobj.c (varobj_get_type_struct): New function, return the type structure (as opposed to a printed string) for the varobj. * event-top.c (_initialize_event_loop): Don't use the cli_command_hook if you are not using the event loop. (gdb_setup_readline): Don't muck with gdb_stdout & friends if you are not using the event loop. These ui_out's don't work right in that case. NB The non-event loop version of gdb should fade away at some point... (gdb_disable_readline): remove the gdb_stdout & gdb_stderr ui_outs when you disable readline. 2000-11-09 James Ingham * breakpoint.c (captured_parse_breakpoint_sals): New function, need to catch this call in gdb_breakpoint so I can implement future break in the mi. (do_captured_breakpoint): Add a futureflag, and if it is yes, then catch the error, and set a future breakpoint instead. * defs.h: Change definition of gdb_breakpoint to match. 2000-11-08 James Ingham * interpreter.c: Add an exec_proc to the interpreter structure, so you can instruct an interpreter to execute a text string - bypassing the UI. * cli-out.c (cli_interpreter_exec): New function, implements exec'ing a command in a safe way. * wrapper.c (safe_execute_command): New function - a catch_errors wrapper for execute_command. (wrap_execute_command): The wrapped function implementing safe_execute_command. * interpreter.c: Add the ability to set an interpreter into "quiet" mode where it doesn't print a startup notice, and supresses prompt printing. (gdb_interpreter_set_quiet): Sets the quiet flag (gdb_interpreter_is_quiet): Returns whether the interp is quiet or not. (gdb_set_interpreter): Don't print interpreter switch banner if we are quiet. * cli-out.c (cli_interpreter_display_prompt): Use the quiet flag in prompt display. 2000-11-07 James Ingham * infrun.c (handle_inferior_event): Add a separate test to handle the case where you are nexti'ing in code with NO symbols. In this case the old code assumed you were always in a function prologue, test if you are not, and stepi correctly... 2000-11-01 James Ingham * interpreter.c: New file, implements switchable interpreters for gdb. * interpreter.h: Ditto. * cli-out.c, cli-out.h: Add the interpreter functions. * event-loop.c (start_event_loop): Poll the interpreter's event loop as well as gdb... * event-top.c (gdb_setup_readline, gdb_disable_readline): New functions, used by console & mi to grab & relinquish control of the readline input. * main.c (captured_main): strsave the interpreter name, since we will eventually use it as a set variable. * top.c (gdb_init): Use the interpreter mechanism to startup the stdin handling. * mi/mi-cmds.c, mi/mi-cmds.h: Add mi command -interpreter-set. * (captured_mi_execute_command): actually return the MI result code out of this function. * (mi_execute_command): Don't print the prompt if the command return is MI_CMD_QUIET. * mi/mi-main.c: Add the interpreter functions. * mi/mi-main.c (mi_set_interpreter): implements -interpreter-set. * mi/mi-main.c (_initialize_mi): This now just registers the mi interpreter. 2000-10-19 James Ingham * partial-stab.h (switch): Add the N_BNSYM & N_ENSYM stabs to the stabs list. * dbxread.c (process_one_symbol): ditto. 2000-09-22 James Ingham * infrun.c (handle_inferior_event): Errors in the call to breakpoint_re_set will cause async_enable_stdin to get called from the exec_error_cleanup. So we need to disable stdin again before proceeding. 2000-09-06 Jim Ingham * exec.c (init_exec_ops): make function not static. We use it in the next nat code. * inftarg.c (init_child_ops): ditto * config/powerpc/macosx-mh: Move nextstep-nat-cfmthread.o to the to the CFM_FILES. 2000-08-09 James Ingham * values.c (value_change_enclosing_type): New function. * value.h: New function value_change_enclosing_type. * valops.c (value_cast): use the value_change_enclosing_type function rather than directly setting VALUE_ENCLOSING_TYPE. (value_assign): ditto. (value_assign): ditto. (value_addr): ditto. (value_ind): ditto. (value_ind): ditto. * buildsym.c (finish_block): Add the addresses to the Inner block outside outer block complaint even when we know the function name. No reason not to provide the info in this case, and it might be useful...