2005-12-01 Ronnie Misra (rgmisra@apple.com) * macosx-nat.c (classic_socket_exists_p, attach_to_classic_process): Update to look for new socket filename. 2005-11-17 Jason Molenda (jmolenda@apple.com) * macosx-nat.c (attach_to_classic_process): Disable inferior function calls and objc class lookups when debugging translated processes. 2005-11-16 Jason Molenda (jmolenda@apple.com) * i386-macosx-thread-status.h (GDB_i386_THREAD_STATE): Update to match xnu's definition. 2005-10-21 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-process.c (dyld_libraries_compatible): Modify Klee's last change -- if two dyld_objfile_entries appear to be compatible but aren't similar, they aren't compatible. (don't assert here -- we can have a plug-in with the same name loaded twice at two different addresses.) 2005-10-13 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (do_check_is_thread_unsafe): Don't use gdb_thread_select, since it uses the parser. Instead, use the newly-exported switch_to_thread. (safe_macosx_check_is_thread_unsafe): Restore the current thread after checking safety. 2005-10-13 Jim Ingham (jingham@apple.com) * macosx-nat-dyld.c (map_shlib_numbers): Pass the index # of the dyld_objfile_entry. (dyld_generic_command_with_helper): Ditto. (add_helper): Ditto. (remove_helper): Ditto. (set_load_state_helper): Ditto. (section_info_helper): Ditto. (specify_symfile_helper): Don't emit MI notification here. (apply_load_rules_helper): New function. (dyld_apply_load_rules_command): Use map_shlib_numbers; re-enable breakpoints afterwards. (set_load_state_1): Emit MI notifications here. 2005-10-11 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (_initialize_macosx_inferior): Set up to_allocate_space_in_inferior to macosx_allocate_space_in_inferior. * macosx-nat-mutils.c (allocate_space_in_inferior_mach): New function. (macosx_allocate_space_in_inferior): New function. * macosx-nat-mutils.c (macosx_allocate_space_in_inferior): Add prototype. Fixes <rdar://problem/4287513>. 2005-10-11 Jason Molenda (jmolenda@apple.com) * i386-macosx-thread-status.h (struct gdb_i386_thread_fpstate): Change "hw_state" to "hw_fu_state" (for "floating point unit") to avoid a namespace collision from xnu's osfmk/mach/i386/thread_status.h * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Ditto. (i386_macosx_store_fp_registers): Ditto. * remote-kdp.c (kdp_fetch_registers_i386): Ditto. (kdp_store_registers_i386): Ditto. 2005-10-11 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (do_check_is_thread_unsafe): Use get_current_frame(), not parse_frame_specification, to avoid trashing parser state. Use pid_to_thread_id (inferior_ptid), instead of assuming a thread was passed in. Fixes <rdar://problem/4287454> 2005-10-11 Jason Molenda (jmolenda@apple.com) * macosx-nat-cfm.c (cfm_update): If we fail to read the cfm cookie because we have an invalid address, stop trying to parse the cfm data. 2005-10-03 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Assume we always get a valid fpu context from the inferior. (i386_macosx_store_fp_registers): Because we always get a valid fpu context from the inferior, we don't have to worry about pushing it back in to the inferior. 2005-09-30 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-io.c (mach_o_inferior_read): Handle both 32 and 64 bit segments. 2005-09-15 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (_initialize_macosx_inferior): Smash the contents of exec_ops with macosx_exec_ops. 2005-09-15 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-io.c (inferior_read): Read from the inferior's memory for macos-child and for remote. (mach_o_inferior_read): Ditto. 2005-09-15 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_objfile_move_load_data): Fix propagation of the requested load data level to the new entry. 2005-09-12 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_gdbarch_init): Fully initialize the tdep, even the unused fields. 2005-09-06 Jim Ingham <jingham@apple.com> * machoread.c (macho_symfile_read): Remove un-needed assert. 2005-08-24 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_symfile_loaded_hook): Move CFM initialization code to cfm_init. Check one symbol at a time, for greater efficiency. * macosx-nat-cfm.c (cfm_init): New function. Contains CFM initialization code moved from dyld_symfile_loaded_hook. (library_offset): If the library was loaded from memory, use the loaded address as it's address. (cfm_update): Call cfm_init(), if necessary. * macosx-nat-cfmthread.c (macosx_cfm_thread_create): No longer takes a task_t (we weren't using it). Call cfm_init(), if necessary. * macosx-nat-cfmthread.h (macosx_cfm_thread_create): Update prototype. * macosx-nat-dyld-process.c (dyld_libraries_compatible): Rename F and L to OLDENT and NEWENT, to be a bit more clear. Properly handle libraries for which the symbols have been read from memory (CFM fragments, generally speaking). Verify that compatible => similar. (dyld_objfile_move_load_data): Clear the previous library record entirely after moving out the load data. * macosx-nat-dyld.c (macosx_cfm_init): New function. (macosx_dyld_init): Update comment and add return value. * macosx-nat-dyld.c (macosx_solib_add): Try to start both the dyld and cfm subsections on every event. If we successfully start either, do a full (non-incremental) refresh of the shared library state. (macosx_dyld_update): After processing all new libraries, try initializing the CFM state yet again, in case we have loaded new symbols that will allow us to initialize it. * macosx-nat-dyld.h (macosx_dyld_init): Update prototype. 2005-08-09 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (info_sharedlibrary_command): Use parse_and_eval_address so symbolic things are evaluated correctly. 2005-07-26 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-process.c (dyld_add_image_libraries): Properly null terminate the dyld_name. * macosx-tdep.c (macosx_internalize_symbol): Report whether the N_SECT bit was set on the external version of the nlist symbol. macosx_record_symbols_from_sect_p: New function. * macosx-tdep.h: mutatis mutandi for above changes. 2005-07-25 Jim Ingham <jingham@apple.com> * macosx-nat-inferior.c (macosx_kill_inferior): Have to call wait after killing the child or it becomes a zombie. 2005-06-14 Jim Ingham <jingham@apple.com> * macosx_excthread.h: Add the error pipe. Also add the task. * macosx_excthread.c (macosx_exception_thread_init): Null out the error pipe. (macosx_exception_thread_create): Create the error pipe. Also make the msg data storage. (macosx_exception_thread_destroy): Write a byte to the exception thread to wake it up before killing it. Also close the error pipe. (alloc_msg_data): New function. (macosx_exception_thread): Add the ability to read in ALL the outstanding exceptions, and hand them all off to the main thread before waiting. Then reply to all on the way out. * macosx-nat-inferior.c (macosx_add_to_port_set): Add the error pipe to the select port set. (macosx_fetch_event): Read the error pipe if it wakes up. (macosx_async): Handle the error pipe. (macosx_add_to_pending_events): Return the new event structure. (macosx_free_pending_event): New function. (macosx_count_pending_events): New function. (macosx_remove_pending_event): New function. (macosx_clear_pending_events): Use maocsx_remove_pending_event. (macosx_post_pending_event): Ditto. (macosx_service_event): Handle an error event. (get_event_type): New function. (macosx_service_one_other_event): New function. (macosx_backup_before_break): New function. (macosx_process_events): Get all the events posted from the excthread side. Handle one, and arrange as best you can to reschedule the others. (do_check_is_thread_unsafe): To catch errors on macosx_check_safe_call. (safe_macosx_check_is_thread_unsafe): New function. (macosx_check_safe_call): If we are locking the scheduler, check ALL the threads for unsafe calls. 2005-05-27 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.h (struct ppc_function_properties): Add gpr_bitmap and fpr_bitmap, to store the "is this register saved" property for the gprs/fprs. * ppc-macosx-frameinfo.c (ppc_clear_function_properties): Clear gpr_bitmap and fpr_bitmap. (ppc_frame_saved_regs): Only set addresses for registers marked as saved by gpr_bitmap and fpr_bitmap. (ppc_parse_instructions): For save_world, mark all the gprs and fprs as saved. For saveFP, mark from reg->r31 as saved. For "stfd", mark only the stored register as having been saved (but go ahead and update the fpr_offset as we did before). Split "stmw" from "stw" and "std". For "stmw", mark all the gprs as saved. For "stw" and "std", mark only the stored register as having been saved (but go ahead and update the gpr_offset as we did before). 2005-05-27 Klee Dienes <kdienes@apple.com> * macosx-nat-watchpoint.c (get_dictionary_bucket_of_page): Use CORE_ADDR for the hash, not int, to avoid overflow. (write_protect_page): Convert to the 64-bit Mach interfaces. 2005-05-26 Stan Shebs <shebs@apple.com> * i386-macosx-tdep.c (i386_macosx_init_abi): Remove dynamic_trampoline_nextpc bit. * macosx-tdep.c, macosx-tdep.h: Likewise. * ppc-macosx-tdep.c (ppc_gdbarch_init): Likewise. 2005-05-19 Klee Dienes <kdienes@apple.com> * macosx-nat-excthread.c: General overhaul to improve debugging messages. * macosx-nat-sigthread.c: Ditto. 2005-05-18 Stan Shebs <shebs@apple.com> Remove cached symfile machinery. * cached-symfile.c: Merge bits into objfiles.c and delete. * cached-symfile.c: Likewise. * macosx-nat-dyld-process.c (dyld_load_symfile): Remove mapped symfile code. (dyld_lookup_objfile_entry): Remove OBJF_MAPPED case. * macosx-nat-dyld.c (cache_symfiles_helper): Remove. (dyld_cache_symfiles_command): Always error. (dyld_cache_symfile_command): Always error. 2005-05-12 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_load_library_from_file): New function. (dyld_load_library_from_memory): New function. (dyld_load_library): Implement in terms of dyld_load_library_from_file and dyld_load_library_from_memory. 2005-05-12 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (i386_macosx_sigcontext_addr): Use variable names that are easier to understand. 2005-05-11 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (macosx_lookup_dyld_name): realpath the dylinker name for the times when it's a symlink and we need to get to the real name. (dyld_info_read): When we're creating the dyld_objfile_entry for dyld by hand, realpath its name so we expand any symlinks and get to the actual name. 2005-05-10 Jason Molenda (jmolenda@apple.com) * i386-macosx-nat-float.c: Unused file -- away it goes. 2005-05-09 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (info_sharedlibrary_command): New function. (info_sharedlibrary_raw_dyld_command): New function. (_initialize_macosx_nat_dyld): Add "info sharedlibrary raw-dyld" command. 2005-05-09 Ronnie Misra (rgmisra@apple.com) Edited by Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (i386_macosx_sigcontext_addr): Updated to find sigcontext on newer kernels. 2005-05-06 Klee Dienes <kdienes@apple.com> * macosx-xdep.c: Include "regcache.h", to avoid some warnings. * macosx-nat-info.c: Don't cast the 'count' parameter to macosx_debug_regions to a mach_vm_address_t, since it's a count, not an address. 2005-05-03 Ronnie Misra (rgmisra@apple.com) Edited by Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c (macosx_process_completer_quoted): See if we can attach to a process before we list it in the tab completion list of processes. (macosx_child_attach): If we're attaching to a classic process, set up a classic debug connection and skip out of this routine. * macosx-nat.c (macosx_classic_unix_close, macosx_classic_unix_open, macosx_classic_deliver_signal, macosx_classic_stop_inferior): New functions that should probably be in serial.c but I'm putting here for now. (macosx_classic_create_inferior, classic_socket_exists_p, is_pid_classic, can_attach, attaching_to_classic_process_p, attach_to_classic_process: New functions for attaching to classic processes. (_initialize_macosx_nat): Register the socket style remote protocol process support. * macosx-nat.h: New file, prototypes for the global functions in macosx-nat.c. 2005-05-03 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_load_library): If we have previously gotten an error trying to load the file because GDB was unable to find it, continue to retry, but don't print any warning messages. (dyld_libraries_similar): Pass in a dyld_path_info, just like we pass to dyld_libraries_compatible. Pass the dyld_path_info to dyld_entry_filename. (dyld_merge_shlib): Update call to dyld_libraries_similar. (dyld_prune_shlib): Pass in a dyld_path_info. Pass the dyld_path_info to dyld_libraries_similar. (dyld_merge_shlibs): Update call to dyld_prune_shlib. * macosx-nat-dyld-process.h (dyld_prune_shlib): Update prototype. * macosx-nat-dyld.c (macosx_dyld_add_libraries): Update call to dyld_prune_shlib. 2005-04-29 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-process.c (dyld_is_objfile_loaded): Consider the main executable and the dyld shlib ALWAYS loaded. 2005-04-18 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (stack_flush_command, update_command): Move to macosx-xdep.c. (_initialize_macosx_xdep): Add commands for "flush", "flushstack", and "update". * macosx-xdep.c (stack_flush_command, update_command): Move from macosx-nat-inferior.c. (_initialize_macosx_inferior): Remove commands for "flush", "flushstack", and "update". 2005-04-18 Klee Dienes <kdienes@apple.com> * kdp-protocol.h (kdp_log_level): Add KDP_LOG_PACKET. * kdp-udp.c (kdp_log_packetbuf): New function. (kdp_transmit_fd, kdp_receive_fd): Use kdp_log_packetbuf to log raw packets, if the debuglevel is KDP_LOG_PACKET. * remote-kdp.c (kdp_connect): Set the endianness immediately after creating the connection. * remote-kdp.c (kdp_reattach): Set the endianness immediately after creating the connection, not before. 2005-04-06 Klee Dienes <kdienes@apple.com> * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Update to use i387_swap_fxsave. (i386_macosx_store_fp_registers): Ditto. 2005-03-31 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Fix FCW constant so I'm not putting any values in reserved bit positions. 2005-03-31 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (i386_macosx_sigcontext_addr): Rewrite to work. (i386_macosx_sc_reg_offset): Define the offsets into the struct sigcontext for Mach. (i386_macosx_init_abi): Register it with the tdep. 2005-03-30 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Set the FCW and MXCSR to mask off all exceptions if we didn't get a valid fpu context for the inferior. Avoids cases where we may push our invalid context into the inferior's process control block. 2005-03-30 Jim Ingham <jingham@apple.com> * i386-macosx-tdep.c (mread, i386-_acosx_skip_trampoline_code, i386_macosx_in_solib_return_trampoline, i386_macosx_in_solib_call_trampoline): Removed. (i386_macosx_init_abi): Register the macosx generic versions of the above for i386. * macosx-tdep.c (macosx_skip_trampoline_code, macosx_dynamic_trampoline_nextpc, macosx_in_solib_return_trampoline, macosx_in_solib_call_trampoline): New functions, moved from ppc-macosx-tdep.c 'cause they are really generic. (info_trampoline_command): Use the generic functions. * macosx-tdep.h: Define the trampoline functions above. * ppc-macosx-tdep.c (ppc_gdbarch_init): Use the generic versions of the trampoline functions. (ppc_macosx_skip_trampoline_code, ppc_macosx_dynamic_trampoline_nextpc, ppc_macosx_in_solib_return_trampoline, ppc_macosx_in_solib_call_trampoline): remove. * ppc-macosx-tdep.h: Ditto. * macosx-nat-inferior.c (macosx_check_safe_call): Add a newline to the console output. * ppc-macosx-frameinfo.c (ppc_parse_instructions): Fix off by 4 error in handling saveFP builtin. * ppc-macosx-tdep.c (ppc_frame_prev_register): Don't play the might be 64 bits but only 32 bits saved game for FP & Vector registers, it doesn't apply to them. * ppc-macosx-tdep.c (ppc_fast_show_stack): Add a sanity check to keep us from infinitely recursing. 2005-03-25 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Reset the fp_initialized_p state var to 0 if we get an uninitialized regset, e.g. on re-running or when we switch to a thread that doesn't have the fpu used yet. 2005-03-24 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.c (fpu_initialized_p): A static var to indicate whether we've received valid data from the inferior's fpu. (i386_macosx_fetch_fp_registers): Rewrite; set fpu_initialized_p. (i386_macosx_store_fp_registers): Only get the fpu register contents if fpu_initialized_p is set. Return a 1 or a 0 to indicate whether the buffer being returned has valid data in it or not. * i386-macosx-tdep.h (i386_macosx_store_fp_registers): Prototype update. * i386-macosx-thread-status.h: Add a couple comments about the origins of a couple of constants. * remote-kdp.c (kdp_store_registers_i386): Only send the FP regs to the remote system if we got valid FP registers from the remote system earlier on. * i386-macosx-nat-exec.c (fetch_inferior_registers): Use the correct constant to keep consistent. (store_inferior_registers): Only push the FP regs to the inferior process if we got valid FP registers from the inferior earlier on. * i386-macosx-tdep.c (i386_integer_to_address): New function. (i386_macosx_init_abi): register it. 2005-03-07 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (macosx_lookup_dyld_name): Lose unnecessary unsigned. (FETCH_ARGUMENT): Lose comment. (macosx_dyld_add_libraries): No need to initialize pentry here. 2005-03-07 Jason Molenda (jmolenda@apple.com) Bring over Klee's fix from tiger-banch to TOT: * macosx-nat-dyld-path.c (get_framework_pathname): Make sure we don't search for "Contents/MacOS/Foo" in a NULL string. 2005-03-04 Jim Ingham <jingham@apple.com> * macosx-nat-dyld.c (macosx_init_addresses): apply the dyld slide to the address of the dyld notify function. (dyld_starts_here_p): convert to the mach_vm_* interfaces. (macosx_locate_dyld): Ditto. 2005-03-02 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-path.c (get_framework_pathname): Make sure we don't search for "Contents/MacOS/Foo" in a NULL string. 2005-02-24 Jim Ingham <jingham@apple.com> * ppc-macosx-frameinfo.c (ppc_frame_function_properties): If you can't get the frame bounds, don't set body_start. 2005-02-24 Klee Dienes <kdienes@apple.com> i386-macosx-nat-exec.c (fetch_inferior_registers): Enable SSE support. Add warning for requests to fetch unknown register numbers. (store_inferior_registers): Enable SSE support. i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Enable SSE support. (i386_macosx_store_fp_registers): Enable SSE support. 2005-02-23 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.h (safe_read_memory_unsigned_integer): Remove. * ppc-macosx-frameinfo.c (safe_read_memory_unsigned_integer): Remove. (wrap_read_memory_unsigned_integer): Remove. (read_memory_unsigned_int_args): Remove. 2005-02-23 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior-debug.c: Convert to use the 64-bit Mach VM accessors. * macosx-nat-inferior-debug.h: Ditto. * macosx-nat-info.c: Ditto. * macosx-nat-info.h: Ditto. 2005-02-10 Jim Ingham <jingham@apple.com> * macosx-nat-infthread.c (get_application_thread_port): Check the return value of mach_port_names before using the names array. 2005-02-10 Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c (macosx_child_attach): Speling korrection. 2005-01-21 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-path.c (dyld_library_basename): Look up the user's DYLD_IMAGE_SUFFIX, if any, and strip it from and libraries names we're returning. (dyld_zero_path_info): Zero out the dyld_path_info pointers when we've created a new macosx_status structure. (dyld_init_paths): Free dyld_path_info members if we've previously xstrdup'ed something into them. Free the contents of home which were previously being leaked. * macosx-nat-dyld-path.h (dyld_zero_path_info): Prototype. * macosx-nat-dyld-info.c (dyld_shlib_info_basename_length): Free string returned from dyld_library_basename(). (dyld_print_entry_info): Ditto. * macosx-nat-dyld-process.c (dyld_libraries_similar): Ditto. * macosx-nat-dyld.c (macosx_dyld_thread_init): Zero out dyld_path_info pointers. * macosx-nat-inferior.c (macosx_child_create_inferior): Re-set the dyld_path_info values when we're starting the inferior so we'll pick up any DYLD_IMAGE_SUFFIX type settings that may have been made between the time when the executable file was specified and the file was actually run. 2005-01-21 Jim Ingham <jingham@apple.com> * macosx-nat-dyld.c (macosx_dyld_add_libraries): When a library gets loaded, call breakpoint_re_set to refresh it's breakpoints. (macosx_solib_add): Call breakpoint_update after we have added the libraries. 2005-01-18 Jim Ingham (jingham@apple.com) * macosx-nat-mutils.c (mach_xfer_memory): Use mach_vm_protect, not vm_protect on Tiger. * macosx-nat-watchpoint.c (write_protect_page): Ditto. (unwrite_protect_page): Ditto. 2005-01-17 Jim Ingham (jingham@apple.com) * macosx-nat-dyld.c (dyld_set_objfile_load_state): Revert the change to this function from 2004-12-14. It can cause re_enable_breakpoints_in_shlibs to get called recursively, which is a bad thing. 2005-01-13 Jason Molenda (jmolenda@apple.com) * cached-symfile.h: Include objfiles.h to flag any prototype changes for allocate_objfile between the two. * cached-symfile.c (allocate_objfile): Set syms_only_objfile flag to default value when creating new objfiles. 2005-01-13 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (dyld_generic_command_with_helper): Tiny whitespace rearrange. 2005-01-12 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-process.c (dyld_is_objfile_loaded): If this objfile is a add-symbol-file'ed, it's shadowing a real objfile and we should insert any breakpoints associated with it. 2005-01-11 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-process.c (dyld_find_dylib_name): Mark a bit of code that is probably wrong for 64 bit. 2005-01-11 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-process.c (dyld_find_dylib_name): Remove cast which drops upper 32 bits of addresses. 2005-01-10 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-info.h: Comment. 2005-01-10 Jason Molenda (jmolenda@apple.com) * cached-symfile.c: Provide prototype for allocate_objfile. * macosx-nat-dyld-info.c (dyld_entry_shlib_num): Fix calculation of shlib entry index. Use DYLD_ALL_OBJFILE_INFO_ENTRIES iterator. 2005-01-07 Jason Molenda (jmolenda@apple.com) * macosx-tdep.c (BFD_GET32, BFD_GETL32, BFD_GET64, BFD_GETL64): Use new-fangled casts to make the size explicit. 2005-01-06 Jim Ingham <jingham@apple.com> * macosx-tdep.c (BFD_GETB64, BFD_GETL64): Don't cast this result back to an unsigned long. 2005-01-04 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-process.c (dyld_is_objfile_loaded): When given a NULL objfile pointer, always return 0 (objfile is not loaded). * macosx-nat-dyld.c (macosx_set_start_breakpoint): Rewrite breakpoint setting call to use the correct breakpoint.c function. (macosx_dyld_mourn_inferior): Revert 2004-12-21 change and go back to marking dyld_objfile_entries as not-loaded instead of zero'ing out the whole array. 2005-01-03 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-info.c (dyld_objfile_info_clear_objfiles, dyld_objfile_info_pack, dyld_objfile_info_compare, dyld_next_allocated_shlib): Unsigned cleanup. (dyld_objfile_info_copy_entries, dyld_shlib_info_basename_length, dyld_print_shlib_info): Use DYLD_ALL_OBJFILE_INFO_ENTRIES instead of doing it by hand. Unsigned cleanup. (dyld_entry_filename): Declare an enumerated type as such, not as int. * macosx-nat-dyld-info.h: Update prototypes to match. Fix definition of dyld_entry_filename_type enum; use it. Add comment re. struct dyld_objfile_entry. * macosx-nat-dyld-path.c (build_suffix_name): Don't use size_t's for the length of filename strings. (dyld_library_basename): Unsigned int cleanup. * macosx-nat-dyld-path.h: Corresponding prototypes. * macosx-nat-dyld-process.c (dyld_find_dylib_name): Unsigned cleanup. No, there will never be more than 2 billion load commands. (dyld_parse_load_level, dyld_purge_objfiles, dyld_objfile_move_load_data): Unsigned cleanup. * macosx-nat-dyld-process.h: Corresponding prototypes. 2004-12-22 Jim Ingham <jingham@apple.com> * macosx-nat-inferior.c: The macosx child target uses dyld_is_objfile_loaded for its to_check_is_objfile_loaded method. 2004-12-21 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (macosx_dyld_mourn_inferior): Instead of marking d_o_e's as not-loaded, purge the lot of them when the inferior has gone away. (update_section_tables_dyld): Little cleanup. 2004-12-16 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-info.h: Comment add. 2004-12-16 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c: Comment tweak. * macosx-nat-dyld-process.c: Code rearrangement. Suppress pointless use of unsigned ints. Use DYLD_ALL_OBJFILE_INFO_ENTRIES instead of hand-written iterators. 2004-12-14 Jim Ingham <jingham@apple.com> * macosx-nat-dyld.c (dyld_set_load_state_command): Call re_enable_breakpoints_in_shlibs to set any breakpoints that might take with the new debug info. (dyld_set_objfile_load_state): Ditto. 2004-12-13 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-info.c (dyld_entry_filename): realpath the name before we return it. * macosx-nat-dyld-info.h (struct dyld_objfile_entry): Document what a text_name is. * macosx-nat-dyld-io.c: Minor reformatting. * macosx-nat-dyld-path.c: Ditto. * macosx-nat-dyld-processs.c: Ditto. * macosx-nat-dyld.c (macosx_init_dyld): Realpath the application name before we save it away. All dyld_objfile_entry names should be realpathed as far as I can tell. 2004-12-09 Jason Molenda (jmolenda@apple.com) * All files: Expand tabs, remote ws at end of lines. 2004-12-08 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.h: Provide struct decl for prototype. 2004-12-08 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.h: Prototype for dyld_objfile_set_load_state. * macosx-nat-infthread.h: Prototype for macosx_setup_registers_before_hand_call. 2004-12-06 Jason Molenda (jmolenda@apple.com) * i386-macosx-tdep.h: Define INVALID_ADDRESS for dyld_is_objfile_loaded() in macosx-nat-dyld-process.c. 2004-12-03 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-process.c (dyld_is_objfile_loaded): A function that higher levels of gdb can call to see if a given struct objfile is actually resident in memory or not (e.g. before/after executing when none of the objfiles are really present.) * macosx-nat-dyld-process.h: Prototype for above. * macosx-nat-dyld.c (macosx_dyld_mourn_inferior): A function called when the inferior has gone away; make a pass through the dyld_objfile_entries and mark them as not-resident. * macosx-nat-dyld.h: Prototype for above. * macosx-nat-inferior.c (macosx_mourn_inferior): Call macosx_dyld_mourn_inferior in our period of mourning. A little reformatting and such. * macosx-nat-dyld-info.h: Comment fix. 2004-12-03 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-path.c (get_framework_pathname): Apply patch from Eric Albert <ejalbert@apple.com> to recognize .bundle's correctly. Minor reworking of the functions variables/etc by me. 2004-12-02 Jason Molenda (jmolenda@apple.com) Remove dyld_index from the dyld_objfile_entry. I don't think it does anything except point at the mach_header of an image which dyld_addr already does. So out it goes. * macosx-nat-cfm.c (cfm_update): Don't initialize dyld_index. * macosx-nat-dyld-info.c (dyld_objfile_entry_clear): Ditto. (dyld_objfile_entry_compare): Don't use dyld_index in comparisons. (dyld_offset_string): Add comment. * macosx-nat-dyld-info.h: Remove dyld_index. Add a few comments as I'm going along. * macosx-nat-dyld-process.c (dyld_info_process_raw): Don't set dyld_index. (dyld_info_read): Don't initialize dyld_index. 2004-11-29 Jim Ingham <jingham@apple.com> * ppc-macosx-frameinfo.c (ppc_parse_instructions): Fix a typo in the stdu if branch. And add to the terminal "scan-ahead" section a bit looking for setting up the stack frame. Since we are now relying on unwinding r30 to get the frame, getting this bit of info is more important. * ppc-macosx-tdep.c (ppc_frame_find_prev_fp): Do some sanity checking on the frame pointer you have just unwound, and it if seems bad, fall back on the stack pointer. 2004-11-30 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (dyld_info_process_raw): Change ppc64 file handling to work better. * macosx-nat-dyld-info.c (dyld_entry_string, dyld_entry_info, dyld_entry_shlib_num): Pedantic cleanups - whitespace, unsigneds, maybe a comment or two. The usual. 2004-11-29 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (macosx_dyld_init): Make macosx_locate_dyld call a little clearer. Always look up the dyld info even if it's in the same location as the past - maybe not necessary, but I don't trust this optimization without knowing more about what's going on. (macosx_solib_add): If we're called without a running inferior (i.e. we can't find dyld), don't try to read the non-existant dyld's data structures. (dyld_info_read_raw_data): Short-circuit a do-nothing call to this func. 2004-11-29 Jim Ingham <jingham@apple.com> * ppc-macosx-tdep.c (ppc_sigtramp_frame_cache): Offset the registers after CR in the save area, that is always stored in an 4 byte int regardless of the size of the GPR's. (ppc_sigtramp_frame_prev_register): Also distinguish 32 bit and 64 bit signal context areas here. * ppc-macosx-frameinfo.c: Add sigtramp_gp_save_size to pass info about what the save size is. 2004-11-23 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c: Switch over to the new dyld interface for receiving notifications about image files loaded in the inferior process. Run the file through gdb_indent. There remains work to do, but the basics are in place. * macosx-nat-dyld.h: Same. * macosx-nat-dyld-info.c: Add comments. Beginnings of my pogrom against the fear of signed types for counting small quantities which pervades this entire subdirectory. Remove tabs. * macosx-nat-dyld-info.h: Same. * macosx-nat-dyld-path.c (strsave): Wow, a macro alias for xstrdup in one file. Gone. Small formatting cleanups. * macosx-nat-dyld-process.c: Add comments. Removed unsigneds. Fix a couple small mistakes gdb_indent made. * macosx-nat-dyld-process.h: Same. 2004-11-23 Jim Ingham <jingham@apple.com> * ppc-macosx-frameinfo.c: (ppc_parse_instructions): Catch the case where std is used to save the link register. Also recognize std for saving the GPR's. And recognize stdu for updating the stack pointer. (ppc_frame_function_properties): When overriding the prologue parser for frames up on the stack, set the lr store offset to a value appropriate to the architecture. * ppc-macosx-tdep.c (ppc_frame_prev_register): When reading the frame pointer, take architecture into account. 2004-11-22 Eric Albert <ejalbert@apple.com> * ppc-macosx-tdep.c (ppc_mach_o_osabi_sniffer): Sniff the correct side of fat files. * i386-macosx-tdep.c (i386_mach_o_osabi_sniffer): Ditto, and register the sniffer for unknown architectures. 2004-11-18 Jim Ingham <jingham@apple.com> * macosx-nat-inferior.c (macosx_handle_exception): Cast exception_data to an unsigned int first, THEN to a CORE_ADDR. This keeps it from getting sign extended. 2004-11-16 Jason Molenda (jmolenda@apple.com) Revert change from 2004-11-10; it doesn't work for host cross host configs. Reimplement. * i386-macosx-tdep.c (osabi_seen_in_attached_dyld): New global, unused. * ppc-macosx-tdep.c (osabi_seen_in_attached_dyld): New global. (ppc_mach_o_osabi_sniffer): Use value in osabi_seen_in_attached_dyld if it has been set. * macosx-nat-dyld.c (macosx_dyld_init): Initialize osabi_seen_in_attached_dyld if we find a ppc/ppc64 dyld in memory when attaching. * cached-symfile.c i386-macosx-tdep.c kdp-protocol.c macosx-metrowerks.c macosx-nat-cfm-io.c macosx-nat-cfm.c macosx-nat-cmds-load.c macosx-nat-dyld-info.c macosx-nat-dyld-io.c macosx-nat-dyld-process.c macosx-nat-excthread.c macosx-nat-inferior-debug.c macosx-nat-mutils.c macosx-tdep.c ppc-macosx-frameinfo.c ppc-macosx-tdep.c remote-kdp.c: Change from printing addresses with 0x%lx to 0x%s and paddr_nz. Fix up most of the gcc warnings while I was at it. * i386-macosx-tdep.h macosx-nat-dyld-info.h macosx-nat-dyld-process.h macosx-nat-inferior-debug.h macosx-nat-inferior-util.h macosx-nat-inferior.h macosx-nat-infthread.h macosx-nat-mutils.h macosx-tdep.h ppc-macosx-frameinfo.h ppc-macosx-tdep.h: Drop PARAMS(). 2004-11-12 Jason Molenda (jmolenda@apple.com) * All files: Run them though ../gdb_indent.sh and be done with it. 2004-11-12 Jim Ingham <jingham@apple.com> * macosx-nat-infthread.c (modify_trace_bit): Always use the GDB_PPC_THREAD_STATE_64 calls to get the thread state. * ppc-maocsx-nat-exec.c (fetch_inferior_registers): Ditto. (store_inferior_registers): Ditto. * ppc-macosx-frameinfo.c (ppc_frame_saved_regs): Use the word size rather than the register size (word size is 4 on 32 bit apps, but register size is 8). * ppc-macosx-regs.c: (supply_unsigned_int): Zero out buf. (ppc_macosx_fetch_gp_registers_64): Have to supply the mq register so it gets marked valid. * ppc-macosx-tdep.c (ppc_unwind_dummy_id): Use register size, not addr bit. * (ppc_register_virtual_type): Since we always tread the registers as 8 byte, call them long_long. * (ppc_frame_prev_register): wordsize is what gets stored on the stack, not register size. * (ppc_macosx_convert_register_p): New function. * (ppc_macosx_value_to_register): New function. * (ppc_macosx_register_to_value): New function. * (ppc_macosx_init_abi): register the new functions with the 32 bit ABI. 2004-11-11 Jason Molenda (jmolenda@apple.com) * i386-macosx-nat-exec.c, i386-macosx-nat-float.c, i386-macosx-tdep.c, kdp-protocol.c, kdp-transactions.c, kdp-udp.c, machoread.c, macosx-metrowerks.c, macosx-nat-cfm.c, macosx-nat-cfmthread.c, macosx-nat-cmds-load.c, pefread.c, remote-kdp.c, smread.c: St-st-st-st-standards. 2004-11-11 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c: Stds r tasty. 2004-11-10 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.h: Add cpu type/subtype fields to macosx_dyld_thread_status. * macosx-nat-dyld.c (dyld_starts_here_p): In addition to PPC32 magic number, look for other variants that may occur. (macosx_dyld_init): Set the cputype and cpusubtype when we're attaching. (macosx_dyld_thread_init): Zero out cpu type/subtype. Oh, and standards are tasty. * ppc-macosx-tdep.c (ppc_mach_o_osabi_sniffer): Call ppc_mach_o_osabi_sniffer_use_dyld_hint() to see if we've already found the OSABI we're using by looking at an in-memory dyld (i.e. in the case of an attach). (ppc_mach_o_osabi_sniffer_use_dyld_hint): New function. * macosx-nat-dyld-process.c: Standards are tasty. 2004-11-05 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-info.c, macosx-nat-dyld-process.c, macosx-nat-dyld.c, macosx-nat-excthread.c, macosx-nat-inferior.c: Standards are tasty. 2004-10-28 Jim Ingham <jingham@apple.com> * cached-symfile.c (allocate_objfile): Set check_for_equivalence flag in the libSystem objfile. 2004-10-10 Klee Dienes <kdienes@apple.com> * machoread.c: Move mmap_strtabflag from dbxread.c. (macho_build_psymtabd): New function, based on dbx_symfile_read. Handle 32- vs. 64-bit symbol strides. (macho_symfile_read): Update to call macho_build_psymtabs. * macosx-tdep.c (BFD_GETB64): New function. (BFD_GETL64): New function. (macosx_internalize_symbol): Update to support 64-bit symbols. 2004-10-08 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld.c (set_load_state_1): Call tell_objc_msgsend_cacher_objfile_changed notifier function. * macosx-nat-dyld-process.c (dyld_load_symfile, dyld_prune_shlib): Ditto. 2004-10-04 Jim Ingham <jingham@apple.com> * ppc-macosx-tdep.c (ppc_frame_find_prev_pc): Fix typo, lr_reg's invalid value is -1, not 0. (ppc_frame_find_prev_pc): Fix dopey start condition error. 2004-09-23 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-process.c (dyld_add_image_libraries): Run realpath on the name we read from the load commands. 2004-09-15 Jim Ingham <jingham@apple.com> * ppc-macosx-tdep.c (ppc_fast_show_stack): Scan the first 3 frames using get_prev_frame (used to do the first 2). This will help keep sync'ed with the get_prev_frame version in more cases. 2004-09-13 Jim Ingham <jingham@apple.com> This set of changes converts safe_read_memory_unsigned_integer from returning the memory in a "unsigned long" to a ULONGEST. * ppc-macosx-frameinfo.c: Convert ret_val to ULONGEST. (safe_read_memory_unsigned_integer): Convert pc arg to ULONGEST *. (ppc_parse_instruction): Use unsigned ints for lr_reg & cr_reg so math with a ULONGEST won't sign extend. Then convert all the arguments we pass to safe_read_memory_unsigned_integer to ULONGEST. * ppc-macosx-frameinfo.h: Change the declaration. * ppc-macosx-tdep.c (ppc_fast_show_stack): Convert to ULONGEST. (ppc_throw_catch_find_typeinfo): Ditto. (ppc_frame_this_id): Now we can do this generically for ppc or ppc_64. This change adds a longjmp_target for ppc & ppc64. * ppc-macosx-tdep.c (ppc_gdbarch_init): Set the longjmp_target function in the ppc gdbarch. (ppc_64_gdbarch_init): Ditto. (ppc_macosx_get_longjmp_target_helper): New function. (ppc_64_macosx_get_longjmp_target): New function. (ppc_macosx_get_longjmp_target): New function. 2004-09-10 Jim Ingham <jingham@apple.com> * macosx-nat-inferior-util.c (macosx_inferior_suspend_ptrace): Set the code field of the static target_waitstatus to -1. * macosx-nat-inferior.c (macosx_handle_exception): Transfer the exception code & address to the target_waitstatus struct. (macosx_service_event): Set the code field of the target_waitstatus to -1. (macosx_child_resume): Ditto. (macosx_print_extra_stop_info): New function. 2004-09-09 Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c: Use libxml2 to parse the Info.plist file in an application bundle to get the correct executable name. (macosx_filename_in_bundle): Call into get_bundle_executable_from_plist() to find the executable name. (get_bundle_executable_from_plist, find_executable_name_in_xml_tree): The XML reading/scanning functions. 2004-08-24 Jason Molenda (jmolenda@apple.com) * machoread.c (macho_symfile_read): Provide new arguments to stabsect_build_psymtabs. 2004-08-19 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (update_command): Print a message if called interactively. (_initialize_macosx_inferior): Make "flush" an alias for "flushregs", to avoid breaking existing macros by making it ambiguous. 2004-08-17 Jim Ingham <jingham@apple.com> * macosx-nat-dyld.c (set_load_state_1): The bfd associated with a given objfile holds a pointer to the strtab allocated on the objfile's objstack. Have to null this out before reconstituting the objfile. 2004-08-12 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-process.h: Add dyld_reload_result enum, and use it for return of dyld_should_reload_objfile_for_flags * macosx-nat-dyld-process.c (dyld_should_reload_objfile_for_flags): Return the right dyld_reload_result. * macosx-nat-dyld.c (set_load_state_1): Capture thre reload_result so we can use it once we figure out how to flush varobj's. * macosx-nat-mutils.c (child_get_pagesize): Cache the return value so we don't need to make the mach call over & over. 2004-08-11 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_should_reload_objfile_for_flags): New function. (dyld_remove_objfiles): Modify to use dyld_should_reload_objfile_for_flags. * macosx-nat-dyld-process.h (dyld_should_reload_objfile_for_flags): Add prototype. (dyld_load_library): Add prototype. * macosx-nat-dyld.c (dyld_reload_on_downgrade_flag): New variable. (set_load_state_1): Take a dyld_path_info, to pass to dyld_load_library. Do the right thing if no objfile exists yet for the entry. Use dyld_should_reload_objfile_for_flags. (dyld_objfile_set_load_state): Pass in the default path info (a bit of a hack, but the alternative is complicated). (_initialize_macosx_nat_dyld): Add "set sharedlibrary reload-on-downgrade". 2004-08-11 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (macosx_dyld_update): Fix typo ("struct cleanups" vs. "struct cleanup"). 2004-08-11 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (dyld_generic_command_with_helper): New function. (dyld_add_symbol_file_command): Convert to use dyld_generic_command_with_helper. (dyld_remove_symbol_file_command): Ditto. (dyld_specify_symbol_file_command): Ditto. (set_to_default_helper): New function. (dyld_apply_load_rules_command): New function. (_initialize_macosx_nat_dyld): Register dyld_apply_load_rules_command as "sharedlibrary apply-load-rules". 2004-08-11 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_resolve_load_flag): Explicitly specify the strings used for dyld-load-rules matching, making them distinct from dyld_reason_string. * macosx-nat-dyld-process.h (dyld_default_load_flag): Add prototype. 2004-08-10 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-process.c (dyld_load_symfiles): Move a comment next to the code it refers to. (dyld_remove_objfile): remove an assert (for non-null bfd), since the rest of the function works fine if this is null, and I want to use the NULL case. * macosx-nat-dyld-process.h: export dyld_load_symfile. * macosx-nat-dyld.c (set_load_state_1): New function, make setting the load state reuseable. Also, just reset the objfiles that were passed in. There is no need to do the whole update & merge shlibs dance here. (dyld_info_process_raw): use the realpath here. 2004-08-09 Klee Dienes <kdienes@apple.com> * macosx-tdep.c (macosx_symbol_type): Rename macho_other to macho_sect. Add comments. Do the right thing if the Mach-O section is NULL. 2004-08-09 Klee Dienes <kdienes@apple.com> * kdp-protocol.c (kdp_req_string): Add KDP_HOSTREBOOT. (kdp_log_packet): Add KDP_HOSTREBOOT. Add default case. (kdp_marshal): Add KDP_HOSTREBOOT. (kdp_unmarshal): Add KDP_HOSTREBOOT. * kdp-protocol.h: Add KDP_HOSTREBOOT. Add kdp_hostreboot_req_t. * kdp-transactions.c (kdp_reattach): New function. (kdp_hostreboot): New function. * kdp-transactions.h (kdp_reattach): Add prototype. (kdp_hostreboot): Add prototype. * remote-kdp.c (kdp_reattach_command): Call kdp_reattach. (kdp_reboot_command): New function. (_initialize_remote_kdp): Register kdp_reboot_command as "kdp-reboot". * macosx-nat-inferior.c (stack_flush_command): New function. Flushes the stack cache (but not the register data). (_initialize_macosx_inferior): Register stack_flush_command as "maintenance flushstack". 2004-08-09 Klee Dienes <kdienes@apple.com> * core-macho.c (core_prepare_to_store): New function. No-op. (core_store_registers): New function. No-op. (init_macho_core_ops): Register prepare_to_store and store_registers. Allows the user to set register values from the command line when debugging a core file. Register values won't be saved. 2004-07-29 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_entry_filename): If the filename is entirely user-specified (for example, by DYLD_INSERT_LIBRARIES, before the program has been run), then return the user-specified as the dyld-name. (dyld_entry_info): Return the name from the objfile for the commpage objfile name, as the bfd will have been freed. * macosx-nat-dyld-process.c (dyld_load_symfile): Update for the e->abfd == NULL convention. Re-indent. 2004-07-28 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_print_entry_info): Always output the name (as defined by objfile->name) as "path". Emit the descriptive text (which used to be in "path") as "description". 2004-07-28 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_entry_filename): Call 'realpath' on the resolved path, if appropriate. (dyld_entry_string): Change the string for memory objects to match that used by the rest of gdb and bfd. (dyld_entry_info): Clean up the name-selection logic. (dyld_convert_entry): Change to the new "abfd is null once the objfile has been read" convention. * macosx-nat-dyld-process.c (dyld_load_library): Change to the new "abfd is null once the objfile has been read" convention. (dyld_load_symfile): Ditto. Ditto for the commpage objfile. (dyld_remove_objfile): Ditto. (dyld_load_symfile): Clean up name storage logic. * macosx-nat-dyld.c (macosx_init_dyld): Change to the new "abfd is null once the objfile has been read" convention. Store the filename based on the bfd name. (dyld_cache_symfile_command): Ditto. (dyld_info_process_raw): Canonicalize incoming names using realpath (). 2004-07-28 Klee Dienes <kdienes@apple.com> * macosx-nat-cfm-io.c (pef_load_library): Count the sections for the correct bfd. 2004-07-22 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_integer_to_address): New function. (ppc_gdbarch_init): Register ppc_integer_to_address. 2004-07-22 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_mach_o_query_64bit): New function. TRUE if the host will select 64-bit binaries by default. (ppc_mach_o_osabi_sniffer): Fix abfd/nbfd typo. Only select the 64-bit variant if the host will also select it. (_initialize_ppc_tdep): Register the mach-o sniffer for all targets, not just bfd_arch_powerpc, so it gets called for mach-o fat files. 2004-07-19 Klee Dienes <kdienes@apple.com> * macosx-nat-cfm-io.c (pef_load_library): Update for the new dyld interfaces, and new interfaces from the previous FSF merge (section tables, * macosx-nat-cfm.c: Include macosx-nat-cfm.h. * symread.c: Re-enable SYM support. Convert to use new dictionary code. (convert_path): Add support for 3.3R0-style paths. (Based on code from Miklos Fazekas <boga@mac.com>). 2004-07-13 Jim Ingham <jingham@apple.com> * ppc-macosx-tdep.c (ppc_frame_this_id): Commit the 32 bit version of the backtrace stopping code. Still need to generalize this to the 64 bit case, but at least this way if we submit a gdb to Tiger, we won't break 32 bit debugging. * ppc-macosx-frameinfo.c (ppc_frame_function_boundaries): If you get an error parsing the boundaries, don't return the boundaries structure or callers will think it is good. * macosx-nat-excthread.c (macosx_exception_thread): Some more explicit error output - only affects the case where "debug exception" is on. 2004-07-06 Jason Molenda (jmolenda@apple.com) * kdp-transactions.c (kdp_transaction): Fix typeo in error message. 2004-06-17 Jim Ingham <jingham@apple.com> * macosx-tdep.c (macosx_symbol_type): Protect against N_SECT symbols with the n_sect field set to 0. 2004-06-17 Jason Molenda (jmolenda@apple.com) * ppc-macosx-frameops.c, ppc-macosx-frameops.h: Removed. * ppc-macosx-tdep.c: Don't include ppc-macosx-frameops.h. 2004-06-16 Klee Dienes <kdienes@apple.com> * macosx-nat-mutils.c: Define MACH64 for 10.4 and above. Use that to control inclusion of mach_vm.h, and define the new types/sizes/functions to use the 32-bit ones on 10.3 and below. (mach_xfer_memory_remainder): Convert to the 64-bit API. (mach_xfer_memory_block): Convert to the 64-bit API. (mach_xfer_memory): Convert to the 64-bit API. 2004-06-15 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_macosx_init_abi_64): Use the correct bit-sizes for 64-bit types. 2004-06-11 Jim Ingham <jingham@apple.com> * macosx-metrowerks.c (metrowerks_address_to_name_command): Don't use find_pc_sect_in_ordered_sections directly, use find_pc_sect_section so you can fall back to a linear search if the section isn't in the ordered section list. * macosx-nat-dyld.c (info_sharedlibrary_address): Ditto. 2004-06-04 Jason Molenda (jmolenda@apple.com) * ppc-macosx-frameinfo.c (ppc_frame_function_properties): When looking at a PC where we can't determine the function boundaries, and the PC is not mod 4, set the default props so that backtracing will continue past this frame. 2005-05-27 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c (ppc_frame_saved_regs): Register saves are based on an offset from the previous $sp. Don't forget to set the saved regs as valid, so they don't get computed over and over again. * ppc-macosx-frameinfo.h (struct ppc_frame_cache): Store both the base and the stack value. * ppc-macosx-tdep.c (ppc_alloc_frame_cache): Initialize stack, frame, pc to -1, so they can be lazily evaluated. (ppc_frame_cache): Don't need anything fancy here, just set the base to be the unwound $fp, and stack to be the unwound $sp. (ppc_find_frame_pc): Rename to ppc_frame_find_prev_pc, so it's clear that we are unwinding. (ppc_find_frame_sp): Rename to ppc_frame_find_prev_sp, so it's clear that we are unwinding. Remove check for SIGTRAMP_FRAME, as well as all the get_frame_base (prev_frame) gunk ... this is now just a simple "fetch *$sp, unless the function is frameless." (ppc_find_frame_fp): Rename to ppc_frame_find_prev_fp, so it's clear that we are unwinding. Enable alloca-detection. (ppc_frame_base_address): Cache and return the previos $fp. (ppc_frame_this_id): Rename cache->base to cache->stack. (ppc_gdbarch_init): Register ppc_print_extra_frame_info. * ppc-macosx-tdep.h (ppc_frame_find_fp): Rename to ppc_frame_find_prev_fp. (ppc_frame_find_sp): Rename to ppc_frame_find_prev_sp. (ppc_frame_find_pc): Rename to ppc_frame_find_prev_pc. 2005-05-26 Jim Ingham <jingham@apple.com> * ppc-macosx-tdep.c (ppc_fetch_pointer_argument): New function. (ppc_gdbarch_init): Use this rather than rs6000_fetch_pointer_argument which gets the bare value of the register, which is wrong... 2005-05-20 Jim Ingham <jingham@apple.com> * machoread.c (macho_symfile_read): Be sure to init symtabs then reset mainline so the stabs & dwarf2 symtab readers don't stomp on each other. 2004-05-18 Stan Shebs (shebs@apple.com) * machoread.c (macho_symfile_read): Jump to dwarf2 reading if we see some dwarf2 info. 2004-05-17 Jason Molenda (jmolenda@apple.com) * i386-macosx-nat-exec.c (i386_sse_regnum_p, i386_mxcsr_regnum_p): Copied from ../i386-tdep.c. (fetch_inferior_registers): IS_SSE_REGNUM() macro no longer exists; use the above two functions. * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Comment out body of function to get it compiling. (i386_macosx_sigcontext_addr): Don't reference struct frame_info member directly; use accessor function. 2004-05-17 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c: Include "regcache.h". * ppc-macosx-tdep.c (ppc_frame_cache): Use SP_REGNUM, not ppc_frame_find_fp (revert change from 5-16, temporarily). (ppc_frame_find_fp): Always return $sp (revert change from 5-16, temporarily). 2004-05-16 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_offset_string): Operate on CORE_ADDR, not unsigned long (offsets are still relative to a 32-bit address space). * macosx-nat-dyld-info.h (dyld_offset_string): Operate on a CORE_ADDR, not unsigned long. 2004-05-16 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c (ppc_frame_saved_regs): Call ppc_frame_find_fp for the frame pointer; use for register offsets. * ppc-macosx-tdep.c (ppc_frame_cache): Use ppc_frame_find_fp to find the frame pointer; use for the "base" field of the frame ID. (ppc_frame_find_fp): New function. * ppc-macosx-tdep.c (ppc_frame_find_fp): Add prototype. 2004-05-15 Jim Ingham <jingham@apple.com> * remote-kdp.c (kdp_fetch_registers_i386): #if 0 fetching the i386 FP registers from the remote side. The kernel doesn't provide them anyway. 2004-05-14 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c: Update comments to reflect new sigtramp layout. (ppc_print_extra_frame_info): Update to new frame-parsing code. (ppc_frame_find_sp): Don't bother reading *$sp if the frame is frameless. Don't bother checking for DUMMY_FRAME; this function shouldn't be called at all in that case. (ppc_frameless_function_invocation): Remove. (ppc_sigtramp_frame_cache): New function. (ppc_sigtramp_frame_id): New function. (ppc_sigtramp_fame_prev_register): New function. (ppc_sigtramp_frame_unwind): New function. (ppc_sigtramp_frame_sniffer): New function. (ppc_gdbarch_init): Add ppc_sigtramp_frame_sniffer. (ppc_macosx_init_abi_64): Set the word-size to 8. * ppc-macosx-tdep.h (ppc_print_extra_frame_info): Update to new signature. 2004-05-13 Jason Molenda (jmolenda@apple.com) * cached-symfiles.c (cached_symfile_version): Bump version # so we don't accidentally try to read cached symfiles from older gdb's. 2004-05-13 Jim Ingham <jingham@apple.com> * machoread.c (macho_read_indirect_symbols): Give the dyld_stub symbols the correct bfd section. 2004-05-12 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_gdbarch_init): Properly set PS_REGNUM. 2004-05-10 Jim Ingham <jingham@apple.com> * machoread.c (macho_symfile_read): Pass in the textcoal_nt name. 2004-05-06 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c (ppc_parse_instructions): Rename LR_REGNUM to PPC_MACOSX_LR_REGNUM. 2004-05-06 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c: Add include for ppc-macosx-regnums.h. Prefix macros from ppc-macosx-regnums.h with PPC_MACOSX_. (extract_ds): New function; extracts ds field of a 64-bit memory operation. (GET_SRC_REG): Make inline. (ppc_parse_instructions): Add recognizer for 'stdu'. * ppc-macosx-frameinfo.h: Remove include for ppc-macosx-regs.h. Change saved_regs to be dynamically allocated (so it no longer depends on ppc-macosx-regnums.h). * ppc-macosx-nat-exec.c: Add include for ppc-macosx-regnums.h. Prefix macros from ppc-macosx-regnums.h with PPC_MACOSX_. * ppc-macosx-regs.c: Add include for ppc-macosx-regnums.h. Prefix macros from ppc-macosx-regnums.h with PPC_MACOSX_. * ppc-macosx-regs.h: Move register constants to ppc-macosx-regnums.h. * ppc-macosx-tdep.c: Add include for ppc-macosx-regnums.h. Prefix macros from ppc-macosx-regnums.h with PPC_MACOSX_. (ppc_alloc_frame_cache): Allocate saved registers dynamically using NUM_REGS. (ppc_extract_struct_value_address): Remove. (ppc_extract_return_value): Remove. (ppc_store_struct_return): Remove. (ppc_store_return_value): Remove. (ppc_push_return_address): Remove. (ppc_register_convertible): Remove. (ppc_register_convert_to_virtual): Remove. (ppc_register_convert_to_raw): Remove. (ppc_breakpoint_from_pc): Move breakpoint constants from global #defines into static local variables. (ppc_gdbarch_init): Set tdep->ppc_gp0_regnum. (ppc_gdbarch_init): Remove many deprecated functions. (ppc_macosx_init_abi_64): Set push_dummy_call and return_value. * remote-kdp.c: Add include for ppc-macosx-regnums.h. Prefix macros from ppc-macosx-regnums.h with PPC_MACOSX_. 2004-05-05 Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior-util.c: Text rearranging; make function names start on a newline for grep goodness. 2004-04-28 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c (ppc_gdbarch_init): Initialize gdbarch_fetch_pointer_argument. 2004-04-26 Jason Molenda (jmolenda@apple.com) * ppc-macosx-frameinfo.c (ppc_parse_instructions): Recognize a fix-and-continue-stomped-on prologue, assume the function was not frameless to allow backtrace to continue up the stack. 2004-04-22 Jim Ingham <jingham@apple.com> * macosx/macosx-nat-inferior.c: Changed the macosx C++ exception catching back to use the gnu_v3 mechanism. 2004-04-21 Jason Molenda (jmolenda@apple.com) * macosx-metrowerks.c (metrowerks_address_to_name_command): Change shared library finding mechanism, avoid FindContainingBFD() which would need rewriting to work. Drop annotations. (FindContainingBFD): Removed. 2004-04-17 Klee Dienes <kdienes@apple.com> * cached-symfile.c (create_objfile): Remove Jim's note to me (he was right). * ppc-macosx-frameinfo.c (ppc_frame_saved_regs): Don't bother with SP/PC; these are special cased in the unwind code. Clear up some this_frame/next_frame confusion. (ppc_frame_initial_stack_address): Remove. (ppc_frame_cache_properties): Remove special-casing for dummy frames. Add dummy-frame check for the "am I a leaf" section. Clear up this_frame/next_frame confusion. Return more reasonable results when unable to determine the function boundaries. (ppc_frame_function-boundaries): Remove special-casing for dummy frames. * ppc-macosx-tdep.c (ppc_unwind_dummy_id): Extend to be 64-bit-happy. (ppc_frame_find_pc): Ditto. (ppc_frame_find_sp): Ditto. (ppc_frame_chain_valid): Remove. (ppc_is_dummy_frame): Remove. (ppc_unwind_pc): Extend to be 64-bit-happy. (ppc_frame_this_id): Return a NULL frame if $sp is 0. (ppc_gdbarch_init): No longer default to Darwin; trust the sniffer. (ppc_macosx_init_abi): Set addr_bit, not deprecated_register_size. (ppc_macosx_init_abi_64): Set addr_bit, not deprecated_register_size. (ppc_mach_o_osabi_sniffer): Select DARWIN64 if the binary has a 64-bit entry, otherwise select DARWIN. 2004-04-12 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c (ppc_macosx_skip_trampoline_code): Re-enable F&C trampoline spotting code. 2004-04-09 Jason Molenda (jmolenda@apple.com) * ppc-macosx-frameinfo.h: Depends on ppc-macosx-regs.h. 2004-04-09 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c: Backtrace-parsing fixes. * ppc-macosx-frameinfo.h: Backtrace-parsing fixes. * ppc-macosx-tdep.c: Backtrace-parsing fixes. * ppc-macosx-tdep.h: Backtrace-parsing fixes. 2004-03-29 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c: Set gdbarch_deprecated_store_return_value. 2004-03-25 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c: Set gdbarch_deprecated_extract_return_value. 2004-03-01 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c: Convert to new stack-parsing interfaces. * ppc-macosx-frameinfo.h: Convert to new stack-parsing interfaces. * ppc-macosx-frameops.c: Convert to new stack-parsing interfaces. * ppc-macosx-frameops.h: Convert to new stack-parsing interfaces. * ppc-macosx-tdep.c: Convert to new stack-parsing interfaces. * ppc-macosx-tdep.h: Convert to new stack-parsing interfaces. 2004-02-03 Jim Ingham <jingham@apple.com> * macosx-nat-inferior.c (macosx_check_safe_call): New function. (_initialize_macosx_inferior): Add above fn. to the target vector. 2003-12-03 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (map_shlib_numbers): Don't call freeargv explicitly, the memory is managed by make_cleanup_freeargv (). 2003-11-14 Klee Dienes <kdienes@platinum.local> * macosx-nat-dyld-process.c (dyld_shlibs_updated): Call update_current_target to propagate the section tables up from the exec target. * macosx-nat-dyld.h (update_section_tables): Update prototype. * macosx-nat-dyld.c (update_section_tables): Build the section table for the exec_target using all currently loaded objfiles. Be careful to put the section entries in the correct order. * remote-kdp.c: Just call update_current_target, not cleanup_target. 2003-11-11 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-info.h (dyld_shlib_info_basename_length): Add prototype. * macosx-nat-dyld.c (info_sharedlibrary_command): Modify to accept an optional argument, an address. (info_sharedlibrary_address): Given an address, print the name of the objfile containing that addr. (_initialize_macosx_nat_dyld): Update for new usage. 2003-11-05 Klee Dienes <kdienes@platinum.local> * macosx-nat-dyld-process.c: Properly define MAPPED_SYMFILES. 2003-10-31 Klee Dienes <kdienes@platinum.local> * macosx-nat-dyld-process.c: Fix the string-comparison algorithm. 2003-10-06 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (map_shlib_numbers): Parse the final argument of the argslist as if it were a possibly-quoted string. 2003-10-06 Jason Molenda (jmolenda@apple.com) * cached-symfile.c (open_objfile_from_mmalloc_pool): Fix warning formatter string. 2003-10-06 Klee Dienes <kdienes@apple.com> * cached-symfile.c (cached_symfile_version): Increment. 2003-10-03 Jim Ingham <jingham@apple.com> * ppc-macosx-tdep.c (ppc_frameless_function_invocation): If the pc is not readable, we should treat the function as frameless (it means we crashed following a bad function pointer, and so surely didn't set up a frame.) 2003-09-29 Klee Dienes <kdienes@apple.com> * cached-symfile.c (check_timestamp): New variable; defaults to 'on'. (_initialize_cached_symfile): Bind 'cached-symfiles-check-timestamp' to check_timestamp. (cache_bfd): Null out the objfile pointer when prepping the objfile for write. Don't build the section table; leave that to be done on read-in. (relocate): Ignore pointers that match the objfile entry of the relocation. (move_symtab): Set the objfile field, if one is specified by the relocation. (move_psymtab): Ditto. (move_main_type): Ditto. (move_psymbol_allocation_list): Stop iterating through the psymbol table when you reach a NULL pointer. (move_objfile): Don't NULL the section table, just check that it's NULL. Check for a NULL msymbol table when iterating through the msymbols to relocate them. (verify): Initialize the 'objfile' field of the relocation to NULL. (open_objfile_from_mmalloc_pool): If check_timestamp is not set, warn, but do not reject cached symfiles based on timestamp mismatches. Set the 'objfile' key of the saved memory descriptor to be an offset, not an absolute value. Set the 'objfile' field of the relocation struct when relocating the objfile; don't set the objfile field explicitly. Allocate a fresh malloc()-based memory allocator, and fresh obstacks, so that other code can add new types to the newly-consed objfile. Generate the section table after reading in the cached objfile. * cached-symfile.h (struct relocation_context): Add new 'objfile' field, to allow the relocation code to munge objfile pointers to the newly-allocated objfile. 2003-09-29 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_libraries_compatible): If one of the prefixes is NULL, the other must be as well. Ditto for the library name. 2003-09-29 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_entry_string): Refer to memory objects as 'memory object', not just 'memory'. (dyld_entry_out): Remove. (dyld_print_entry_info): Incorporate dyld_entry_out, removing an extra call to dyld_entry_info. 2003-09-02 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_objfile_info_clear_objfiles): New function. (dyld_entry_filename): Re-organize; honor DYLD_ENTRY_FILENAME_USER. (dyld_entry_out): Fix parameter order to dyld_entry_info. (dyld_entry_info): Convert to use dyld_entry_filename where possible. (dyld_print_entry_info): Add explanatory text to the symfile and commpage fields when not using MI. (dyld_convert_entry): Set the user_name field of the synthesized dyld_objfile_entry. * macosx-nat-dyld-info.h: (dyld_objfile_info_clear_objfiles): Add prototype. (dyld_entry_filename_type): Add DYLD_ENTRY_FILENAME_BASE and DYLD_ENTRY_FILENAME_USER. * macosx-nat-dyld-process.c (dyld_resolve_load_flag): Use DYLD_ENTRY_FILENAME_LOADED. (dyld_load_library): Use DYLD_LOAD_LIBRARY. Only set loaded_name and loaded_from_memory if we actually succeed in loading the file. (dyld_objfile_move_load_data): Make sure we aren't stomping any objfile or bfd references in the 'to' struct. (dyld_merge_shlib): Once we merge a library into the specified entry, don't bother looking for more. (dyld_prune_shlib): Only call tell_breakpoints_objfile_changed if the objfile has actually changed. (dyld_merge_shlibs): Only try to merge objfiles into entries that don't already have one. * macosx-nat-dyld.c (dyld_add_symbol_file_command): Clear any objfiles from the dyld_objfile_info_struct after copying it, to preserve correct reference-counting semantics. (dyld_specify_symbol_file_command): Ditto. (dyld_remove_symbol_file_command): Ditto. (dyld_set_load_state_command): Ditto. (specify_symfile_helper): Reset the 'error' flag for the entry. (dyld_cache_symfile_command): Free the loaded objfile, if it hasn't been captured by the returned objfile. 2003-09-02 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior-debug.c (macosx_debug_regions): Use prev_info for the fields to output; we've already advanced info to the next region. 2003-09-02 Klee Dienes <kdienes@apple.com> * cached-symfile.c (mmalloc_xfree_hook): New function. (mmalloc_xmalloc_hook): New function. (mmalloc_xrealloc_hook): New function. (open_objfile_from_mmalloc_pool): Re-organize the function to make the mapped malloc pool read-only as soon as possible. Make copies of all objfile, symtabs, and psymtab structs into malloc'd (writable) memory. 2003-08-21 Jim Ingham <jingham@apple.com> * ppc-macosx-frameinfo.c (ppc_parse_instructions): If we have passed max_insn, but still haven't seen the stored pc moved back from r0, look a little forward to see if it get put back into lr. * ppc-macosx-tdep.c (ppc_frame_find_pc): Check for pc % 4 before passing it ot ppc_parse_instructions. If it doesn't pass the test, then look in the link register in bottom-most frame, or the stack otherwise. 2003-08-06 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_objfile_entry_clear): Rename sym_bfd to commpage_bfd, sym_objfile to commpage_objfile. (dyld_objfile_entry_compare): Ditto. (dyld_entry_string): Update to use new dyld_entry_info. (dyld_entry_out): Update to use new dyld_entry_info. (dyld_entry_info): Add two new parameters, to fetch the objfile and symfile name for the commpage symbol data. Allow the caller to specify NULL to mean "don't bother telling me this pathname" for the pathname arguments to dyld_entry_info. (dyld_resolve_shlib_num): Rename sym_objfile to commpage_objfile. (dyld_shlib_info_basename_length): Ditto. (dyld_print_entry_info): Rename sym_objfile to commpage_objfile. Output the objfile and symfile name for the commpage symbol data, if they are present. * macosx-nat-dyld-info.h (dyld_objfile_entry): Rename sym_bfd to commpage_bfd, sym_objfile to commpage_objfile. (dyld_entry_info): Update prototype. * macosx-nat-dyld-process.c (dyld_load_symfile): Check for a __DATA.__commpage section, and load it into commpage_objfile, if found. (dyld_remove_objfile): Free the commpage_objfile and commpage_bfd, if present. (dyld_objfile_move_load_data): Move the commpage objfile and bfd to the new entry. 2003-08-06 Klee Dienes <kdienes@apple.com> * cached-symfile.c (_initialize_cached_symfile): Fix the entry for cached-symfile-dir to refer to the correct GDB variable. 2003-07-31 Jim Ingham <jingham@apple.com> * ppc-macosx-tdep.c: Change the PPC_SIGCONTEXT_PC_OFFSET and PPC_SIGCONTEXT_SP_OFFSET numbers for Panther B25 and above. 2003-07-31 Klee Dienes <kdienes@apple.com> * machoread.c (macho_symfile_read): Pass in "__DATA.__bss" as the name for the bss section. * macosx-tdep.c (macosx_symbol_type): Properly set the symbol flags for symbols in the bss section. 2003-07-31 Jim Ingham <jingham@apple.com> * cached-symfile.c (cache_bfd): Cache the prefix string in the mmalloc pool, and set the objfile->prefix pointing at that, rather than caching the pointer value in the current running gdb. 2003-07-25 Klee Dienes <kdienes@apple.com> * cached-symfile.c (open_objfile_from_mmalloc_pool): Check the prefix fo 'orig_objfile', not 'objfile'. 2003-07-25 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (cache_symfile_helper): Don't re-link the objfile, it's already linked by cache_bfd. (dyld_cache_symfile_command): Ditto. * cached-symfile.c (cache_bfd): Document. 2003-07-25 Klee Dienes (kdienes@apple.com) * cached-symfile.c (open_objfile_from_mmalloc_pool): Correctly set the 'md' field. 2003-07-25 Klee Dienes (kdienes@apple.com) * cached-symfile.c (open_objfile_from_mmalloc_pool): Add 'prefix' field; check against the prefix of the cached-symfile. (open_mapped_objfile): Add 'prefix' field. * cached-symfile.h: Update prototypes. 2003-07-24 Jason Molenda (jmolenda@apple.com) * macosx-nat-dyld-process.c (remove_objfile_from_dyld_records): New function. With a comment and everything. * macosx-nat-dyld-process.h: Add prototypes for remove_objfile_from_dyld_records and dyld_remove_objfile. 2003-07-24 Jim Ingham <jingham@apple.com> This is the macosx native side of the ordered_sections patch. * cached-symfile.c (build_objfile_section_table): This is the cached symfile version of this function. Add the sections for the new objfile to the ordered_sections table. * machoread.c (macho-symfile-offsets): We don't use relocate_objfile, so we need to handle relocating the ordered_sections entries here, where we do the ofsetting for mach-o files. * pefread.c (pef_symfile_offsets): and ditto for pef. * symread.c (sym_symfile_offsets): and ditto for sym. 2003-07-16 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_lookup_objfile_safe): New function. (dyld_lookup_objfile_entry): New function. * macosx-nat-dyld-process.h: Add prototypes. 2003-06-10 Klee Dienes <klee@apple.com> cached-symfile.c (cache_bfd): Create the cached symfile with a .new extension and then move it in place rather than creating it in place, so if something goes wrong, you won't be making a little landmine for future gdb sessions. 2003-06-06 Klee Dienes <klee@apple.com> macosx-nat-dyld-process.c (dyld_remove_objfiles): If you have found a cached symbol file, then use is so long as it's load level is greater than or equal to that requested. 2003-06-01 Jim Ingham <jingham@apple.com> This set of changes fixes a problem with finding the correct dyld when you attach without being given an executable file to look at. * macosx-nat-dyld.c (macosx_dyld_init): If we don't have an exec_bfd, then get the path to the dyld executable by parsing the load commands for the dyld we found in memory. * macosx-nat-dyld-process.c (dyld_resolve_filename_image): Separate the portion that actually finds the filename into dyld_find_dylib_name and use that here. (dyld_find_dylib_name): New function, the guts of dyld_resolve_filename_image. * macosx-nat-dyld-process.h: export dyld_find_dylib_name. This set implements the macosx side of scheduler locking. * macosx-nat-inferior.c (macosx_child_resume): If the ptid is set, actually stop all other threads but that one. This is what TARGET_RESUME is supposed to do. * macosx-nat-infthread.c (prepare_threads_after_stop): Add some useful debugging output. (prepare_threads_before_run): Suspend other thread if stop_others is set. Also remove a redundant call to clear_trace_bit. This just moves the exception breakpoints to a more convenient point in the catch & throw functions. * macosx-nat-inferior.c (macosx_handle_exception): Don't call macosx_check_new_threads before calling prepare_threads_after_stop, which also calls this. * macosx-nat-infthread.c (prepare_threads_before_run) Ditto. And this maps gdb's internal port numbers back to the application port numbers. * macosx-nat-inferior.c (macosx_check_new_threads): Record the applications port name for each thread in the thread_info private structure. (macosx_pid_to_str): Report the application's port name if we know it. The gdb name is not useful. (print_thread_info): ditto. (get_application_thread_port): New function. 2003-05-23 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info (dyld_print_shlib_info): Revert change from 05-21. 2003-05-22 Jim Ingham <jingham@apple.com> * macosx-nat-inferior.c (macosx_find_exception_catchpoints): Move the breakpoints past the prologue of the catch & throw functions. 2003-05-22 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior-debug.c (macosx_debug_regions): Check for any error result, not just KERN_NO_SPACE. Be sure to set the "size" field to zero if no region was actually found. 2003-05-21 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_entry_filename): Fix bug in the name-resolution logic (we want to resolve names that have *not* been resolved, not ones that have). (dyld_print_shlib_info): Check against sym_objfile, not objfile. 2003-05-12 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_resolve_load_flag): Update to use dyld_entry_filename. (dyld_load_library): Update to use dyld_entry_filename. (dyld_remove_objfile): Be sure to clear loaded_name and loaded_memaddr. (dyld_remove_objfiles): Update the reaload logic to reload if the desired source file name has changed, or the symfile load flags have changed. Update to use dyld_entry_filename. * macosx-nat-dyld.c (specify_symfile_helper): Set the "user specified name" of the dyld entry. * macosx-nat-dyld-info.h (dyld_entry_filename_type): New parameter. (dyld_entry_info): Add objfile field. * macosx-nat-dyld-info.c (dyld_entry_source_filename_is_absolute): Remove. (dyld_entry_filename): Add new argument 'type', to determine if the user wants the name of the entry as loaded, or the one that is supposed to be loaded. (dyld_entry_string): Handle the new 'object name' field from dyld. (dyld_entry_info): Handle the new 'object name' field from dyld. Update calls to dyld_entry_filename to pass DYLD_ENTRY_FILENAME_LOADED, as appropriate. 2003-05-12 Klee Dienes <kdienes@apple.com> * remote-kdp.c (kdp_fetch_registers_ppc): Block out fetching floating-point registers for i386, since the i386 kernel currently returns a mal-formed packet instead of an error code. 2003-05-11 Klee Dienes <kdienes@apple.com> * machoread.c (macho_read_indirect_symbols): S_SYMBOL_STUBS is a value, not a flag. 2003-05-07 Jim Ingham <jingham@apple.com> * macosx-nat-infthread.c (macosx_setup_registers_before_hand_call): New function. 2003-05-04 Klee Dienes <kdienes@apple.com> * cached-symfile.c (cached_symfile_version): Increment. 2003-05-02 Jason Molenda (jmolenda@apple.com) * ppc-macosx-frameinfo.h (struct ppc_function_properties): Add pic_base_address field to clearly demarcate the address that the pic base should hold for this function. * ppc-macosx-frameinfo.c (ppc_parse_instructions): Set the pic_base_address field when we've found one. Recognize ObjC selector prologues' setting of the pic base register from r12. (ppc_clear_function_properties): Initialize pic_base_address. 2003-04-29 Klee Dienes <kdienes@apple.com> * machoread.c (macho_read_indirect_symbols): Ignore sections which do not specify reserved2, even if S_SYMBOL_STUBS is set. 2003-04-23 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c (ppc_macosx_skip_trampoline_code): Move F&C trampoline detection code to fix-and-continue.c for now. 2003-04-18 Klee Dienes <kdienes@apple.com> * cached-symfile.c (cache_bfd): Pass new "preferred baseaddr" argument to mmalloc_findbase. 2003-04-18 Jason Molenda (jmolenda@apple.com) * macosx-nat.c: Include bfd.h. Must have bfd_set_cache_max_open() prototype. 2003-04-18 Klee Dienes <kdienes@apple.com> * macosx-nat.c (_initialize_macosx_nat): Allocate an appropriate number of file descriptors for use by BFD (previously it would use the default of 10, no matter how many were available). 2003-04-17 Jim Ingham (jingham@apple.com) * machoread.c (macho_read_indirect_symbols): Don't hard-code the names of sections containing symbol stubs, instead scan all the sections and read in all the ones of type BFD_MACH_O_S_SYMBOL_STUBS. (macho_symfile_read): Ditto. 2003-04-15 Jim Ingham (jingham@apple.com) This set of changes are the Mac OS X side of the changes to only set breakpoints in newly added objfiles, and not reset them once set unless the objfile they are set in changes. * macosx-nat-dyld-process.c (dyld_prune_shlib): Call tell_breakpoints_objfile_changed. (dyld_shlibs_updated): No need to call breakpoint_re_set here. This change moves handling the exeception catchpoints to generic code where it properly belongs. * macosx-nat-dyld.c (macosx_solib_add): Don't update the catchpoints here. Marking the solib as changed will trigger it in generic code. (macosx_init_dyld_symfile): Ditto. 2003-04-11 Jim Ingham (jingham@apple.com) * ppc-macosx-frameinfo.c: Set max_skip_non_prologue_insns to 2. 10 is excessive, since we are just looking for the FIRST non-prologue instruction... * (ppc_parse_instructions): This was returning the last recognized prologue instruction, it should return the first body instruction. * (ppc_frame_cache_properties): Pass body_start to ppc_parse_instructions, not function_end. That really is the bounds of the prologue scan, and if we got it wrong in ppc_frame_cache_boundaries, looking further won't help us now. 2003-04-11 Jim Ingham (jingham@apple.com) * macosx-nat-dyld.c (dyld_cache_symfile_command): Pass the mainline parameter to symfile_open_bfd. * macosx-nat-inferior.c: (macosx_filename_in_bundle): New function. * config/nm-macosx.h: declare macosx_filename_in_bundle. 2003-04-02 Jason Molenda (jmolenda@apple.com) * cached-symfile.c (_initialize_cached_symfile): Change default cached symfile directory name to be more descriptive. 2003-03-29 Klee Dienes <kdienes@apple.com> * macosx_nat_infthread.c (modify_trace_bit): New function. Generalizes clear/set_trace_bit. Add support for systems using 64-bit registers. 2003-03-29 Klee Dienes <kdienes@apple.com> * remote-kdp.c (kdp_fetch_registers_ppc): Update to use new IS_GSP_REGNUM interface; previously registers were not always getting fetched when necessary. 2003-03-27 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_gdbarch_init): Call ppc_macosx_init_abi to default to a 32-bit ABI, even if no exec_bfd is set. 2003-03-25 Jason Molenda (jmolenda@apple.com) * cached-symfile.c (allocate_objfile): Only create 'syms' directory when we're about to create a cached symfile. 2003-03-25 Jim Ingham (jingham@apple.com) * ppc-macosx-tdep.c (_initialize_macosx_inferior): Turn on the to_has_thread_control bits for the schedlock-mode command. The native bits still don't obey this but at least the upper layers will. 2003-03-25 Jason Molenda (jmolenda@apple.com) * ppc-macosx-frameinfo.c (ppc_parse_instructions): Recognize and ignore fix-and-continue NOP prologue padding. * cached-symfile.c (allocate_objfile): Don't create "syms" directory turds when I'm running gdb. Waiting for fix of r. 3204584. 2003-03-24 Jim Ingham (jingham@apple.com) * ppc-macosx-frameops.c (ppc_frame_saved_regs): The saved_regs for the PC is expected to be the ADDRESS at which the PC is stored, not the value of the PC. Only the SP is stored by value here. Make it so. * ppc-macosx-tdep.c: Move #define of DEFAULT_LR_SAVE to ppc-macosx-regs.h. * ppc-macosx-frameinfo.c: Ditto 2003-03-19 Jim Ingham (jingham@apple.com) * ppc-macosx-tdep.c (ppc_fast_show_stack): pc & fp were swapped in calls to print_fun. 2003-03-18 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c (ppc_macosx_skip_trampoline_code): Recognize fix and continue trampoline. 2003-03-13 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_macosx_init_abi): Set the register size to four bytes. * ppc-macosx-tdep.c (ppc_macosx_init_abi_64): Set the register size to eight bytes. * ppc-macosx-regs.c (collect_unsigned_int): Fix to use the appropriate end of the buffer for reading a 32-bit value from a 64-bit buffer. 2003-03-13 Klee Dienes <kdienes@apple.com> * macosx-nat.c (_initialize_macosx_nat): Set the file-descriptor limit to the maximum allowable. 2003-03-11 Jim Ingham <jingham@apple.com> * macosx-nat-dyld.c (dyld_starts_here_p): If vm_read gets an error, don't try to vm_deallocate the buffer or you will die a horrible death. 2003-03-03 Jim Ingham <jingham@apple.com> This set of changes are the MacOS X specific side of catching exception throws & catches. * macosx-nat-dyld.c (macosx_solib_add): update catchpoints for the objfile just added. (macosx_dyld_update): update all catchpoints. * macosx-nat-inferior.c: (macosx_find_exception_catchpoints): New function. (macosx_get_current_exception_event): New function. (_initialize_macosx_nat_inferior): Add the exception catching functions to the macosx_child target vector, and to the exec_ops target vector. We CAN set catchpoints when the target is not running. * ppc-macosx-tdep.c (ppc_throw_catch_fine_typeinfo): This is the ppc version of grubbing around for the exception type object. * tm-ppc-macosx.h: Add define for THROW_CATCH_FIND_TYPEINFO. * macosx-nat-dyld-process.c (dyld_load_symfile): Add a couple of missing #if MAPPED_SYMFILE's. 2003-02-27 Klee Dienes <kdienes@apple.com> * ppc-macosx-nat-exec.c (store_inferior_registers): Add 64-bit register support. (fetch_inferior_registers): Add 64-bit register support. * ppc-macosx-regs.c (supply_unsigned_int): Convert to inline function. Add 64-bit register support. (collect_unsigned_int): Convert to inline function. Add 64-bit register support. (supply_unsigned_int_64): New function. Add 64-bit register support. (collect_unsigned_int_64): New function. Add 64-bit register support. (ppc_macosx_fetch_gp_registers_64): New function. Add 64-bit register support. (ppc_macosx_store_gp_registers_64): New function. Add 64-bit register support. * ppc-macosx-regs.h (REGISTER_BYTES_64): Define. (ppc_macosx_fetch_gp_registers): Add prototype. (ppc_macosx_store_gp_registers): Add prototype. * ppc-macosx-thread-status.h (GDB_PPC_THREAD_STATE_64): Define. (GDB_PPC_THREAD_STATE_64_COUNT): Define. (gdb_ppc_thread_state_64): New struct. * ppc-macosx-tdep.c (ppc_register_byte): Remove. (ppc_register_raw_size): Remove. (ppc_register_virtual_size): Remove. (ppc_register_virtual_type): Add 64-bit register support. (ppc_gdbarch_init): Remove set_gdbarch_register_size, set_gdbarch_register_byte, set_gdb_arch_register_*_size. (ppc_macosx_init_abi): New function. (ppc_macosx_init_abi_64): New function. (ppc_mach_o_osabi_sniffer): New function. Default to OSABI_DARWIN. (_initialize_ppc_tdep): Register OSABI handlers for DARWIN and DARWIN64. 2003-02-26 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (cache_bfd): Move function from here ... * cached-symfile.c (cache_bfd): ... to here. 2003-02-24 Klee Dienes <kdienes@apple.com> * cached-symfile.h (relocation_context): Now specifies three addresses: the start of the region which pointers should be mapped, the start of the region they should be mapped into, and the address where the pointers currently reside. * cached-symfile.c (init_objfile): New function. Move common objfile initialization routines to here. (cached_symfile_version): Increment. (cached_symfile_dir): New variable. Specifies the directory GDB will use to store automatically generated precompiled symbol files. (allocate_objfile): Use cache_bfd to generate the symfile if appropriate. Create cached_symfile_dir if it does not exist. Use build_objfile_section_table to build the section table. Use link_objfile to link the objfile rather than doing it manually (mmalloc_protect): New function. Sets the protections for the contents of MD to FLAGS. (open_objfile_from_mmalloc_pool): Re-locate the objfile in memory if necessary. Re-build the section table. Set the objfile for all symbols to the correct address. Update the filename. Set MD to NULL, so there are no accidental attempts to malloc new memory. Propagate OBJF_MAPPED to the top-level objfile, if using a checked mmalloc pool. (open_mapped_objfile): Allow either an explicit cached-symfile, or find one implictly based on the name of the objfile. (create_mapped_objfile): Remove. (relocate): Update to new relocation specification. (create_objfile): Use init_objfile. (validate_context): New function. Check a relocation context to ensure there are no overlapping regions. (objfile_move): Remove. (move_objfile): Add more relocations to top-level objfile fields. (_initialized_cached_symfile): Add new user variable cached-symfile-dir, defaulting to "./syms". Add "./syms" to the default cached-symfile-path. * machoread.c (macho_symfile_offsets): There are SECT_OFF_MAX section_offsets, not MAX_SECTIONS. * macosx-nat-dyld-info.h (dyld_entry_info): Update prototype. * macosx-nat-dyld-info.c: Add default cases to most entry_string functions. (dyld_entry_string): Simplify. Add support for printing the cached symfile as well as the object file for an entry. (dyld_entry_info): Return the name of the symfile, if appropriate. (dyld_entry_out): Output the name of the cached symfile as well as he * macosx-nat-dyld-process.c (dyld_load_symfile): Make the memory region temporarily writeable when relocating. Manually regenerate the section ofsets, rather than using the sym_offsets method of the objfile symfunctions. * macosx-nat-dyld.h (cache_bfd): Add prototype. * macosx-nat-dyld.c (macosx_locate_dyld_static): Check the filename of the BFD, not the name of the objfile, in case we are using a precompiled symfile for /usr/lib/dyld. (map_shlib_numbers): Add support for "all" as a shared-library specification. (cache_bfd): Cache to the specified filename, or to basename + '.syms', if the specified filename is an existing directory. Reposition the objfile to '0' before saving, then re-read the mapped objfile and map it read-only and relocate to its final address. (cache_symfiles_helper): Rename from cache_symfile_helper. Reorganize. (move_helper): Remove. (verify_helper): Remove. (dyld_cache_symfile_command): New function. Caches a single objfile to the specified file/directory, without affecting the current GDB session. (_initialize_macosx_nat_dyld): Remove the "move" and "verify" commands. Add new command "cache-symfile". 2003-02-03 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-path.c (dyld_resolve_image): If you see a load command with the @executable_path cookie, after you have resolved the path, stat it to make sure the file has actually been copied into place. If not, continue on with the rest of the DYLD search. 2003-02-02 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c: Use get_next_frame (frame) instead of frame-next. * ppc-macosx-tdep.c: Use get_next_frame (frame) instead of frame-next. 2003-02-02 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_fast_show_stack): Honor backtace_below_main. (ppc_is_dummy_frame): Update to new stack-trace interface. 2003-01-20 Jim Ingham <jingham@apple.com> * ppc-macosx-frameinfo.h: Add frameptr_pc field to the properties struct to record when the frame pointer becomes valid. * ppc-macosx-frameinfo.c (ppc_parse_prologue): Record WHEN the frame pointer actually gets set - if used. * ppc-macosx-tdep.c (ppc_frame_initial_stack_address): Don't take the initial stack address from the framepointer unless we are past the point in the prologue where it is set. 2003-01-07 Klee Dienes <kdienes@apple.com> * i386-macosx-tdep.c (_initialize_i386_macosx_tdep): Update to new OSABI API. 2003-01-06 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_gdbarch_init): Update to new OSABI API. Remove call to set_gdbarch_coerce_float_to_double. (ppc_dump_tdep): Remove. (_initialize_ppc_tdep): Update call to register_gdbarch_init. 2002-12-17 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c (ppc_frame_cache_boundaries): Don't allocate frame->extra_info->bounds if there is an error parsing the boundaries. * ppc-macosx-tdep.c (ppc_init_frame_pc_first): Return the PC, as well as setting it in the frame struct. (ppc_init_frame_pc): Ditto. (ppc_get_unsaved_pc): Use frame_read_unsigned_register. * ppc-macosx-tdep.h (ppc_init_frame_pc_first): Update prototype. (ppc_init_frame_pc): Update prototype. 2002-12-17 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_reason_string): Update to new bitfield layout. Standardize (and shorten) the output strings. * macosx-nat-dyld-info.h (dyld_objfile_reason): Make layout more bitfield-oriented. In particular, 'deallocated' is now all-bits-zero, rather than a separate value. Add new bitfield values for 'cached' and 'weak'. * macosx-nat-dyld-process.c (dyld_add_image_libraries): Set 'weak' flag, if appropriate. (dyld_resolve_load_flag): Don't warn if unable to locate a weak library. Print the pre-resolved name of a library in the "unable to resolve" error message. (dyld_minimal_load_flag): Propagate any non-zero result from dyld_resolve_load_flag (shouldn't change the behavior of the function). (dyld_merge_shlibs): Mark cached entries with the 'cached' bit. 2002-12-14 Klee Dienes <kdienes@apple.com> * macosx-nat-mutils.c (MAX_INSTRUCTION_CACHE_WARNINGS): New variable. (mach_xfer_memory): Honor MAX_INSTRUCTION_CACHE_WARNINGS. 2002-12-14 Klee Dienes <kdienes@apple.com> * macosx-nat-cfm.c: Change error-code constants to CFM_*_ERROR. 2002-12-11 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_fast_show_stack): Replace LIMIT with COUNT_LIMIT and PRINT_LIMIT. Update to honor both arguments (which may be different from each other). Remove hard-coded 10,000-frame limit (this can now be specified by PRINT_LIMIT). * ppc-macosx-tdep.h (ppc_fast_show_stack): Update prototype. * tm-ppc-macosx.h (ppc_fast_show_stack): Update prototype. (FAST_COUNT_STACK_DEPTH): Update definition. 2002-12-11 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_use_struct_convention): New function. (ppc_gdbarch_init): Use ppc_use_struct_convection, not ppc_sysv_abi_use_struct_convention. Use default_coerce_float_to_double, not standard_coerce_float_to_double. Use ppc_darwin_abi_push_arguments, not rs6000_push_arguments. 2002-12-08 Klee Dienes <kdienes@apple.com> * macosx-metrowerks.c (metrowerks_step): Replace step_frame_address with step_frame_id. * ppc-macosx-tdep.c (ppc_gdbarch_init): Use deprecated_init_frame_pc_firsst. 2002-12-07 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_gdbarch_init): Do OSABI dispatching. (ppc_dump_tdep): New function. (_initialize_ppc_tdep): Use gdbarch_register to register ppc_dump_tdep. 2002-12-06 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.h (dyld_event_counter): New field. * macosx-nat-dyld.c (dyld_combine_shlibs_added): New variable. (macosx_dyld_thread_init): Initialize dyld_event_counter. (_initialize_macosx_nat_dyld): Add command for dyld_combine_shlibs_added. (macosx_solib_add): Don't disable the "generic" dyld breakpoint after the first time it is triggered. Upon receiving an IMAGE_ADDED event, don't stop for stop-on-solib-events if combine-shlibs is set; just increment dyld_event_counter. Upon completion of a full set of dyld events, stop for stop-on-solib events if at least one IMAGE_ADDED event was received. 2002-12-06 Klee Dienes <kdienes@apple.com> * ppc-macosx-regs.c (ppc_macosx_fetch_gp_registers, ppc_macosx_store_gp_registers, ppc_macosx_store_vp_registers, ppc_macosx_fetch_vp_registers): Supply and fetch VRSAVE from the general register state. The save_vrvalid field is a mask for setting/fetching, not used to set VRSAVE. * ppc-macosx-regs.h (IS_VSP_REGNUM, IS_GSP_REGNUM): VRSAVE is set with the general registers, not the vector registers. * ppc-macosx-tdep.c (ppc_use_struct_convection): Remove. (ppc_register_reggroup_p): New function. Add VSCR and VRSAVE to 'vector' group; FPSCR to 'float' group. (ppc_gdbarch_init): Use ppc_sysv_abi_use_struct_convention instead of ppc_use_struct_convention. Use ppc_register_reggroup_p. 2002-11-30 Klee Dienes <kdienes@apple.com> * cached-symfile.h (struct relocation_context): New structure. Contains the specification for relocating the internal pointer addresses of an objfile, with objfile_reposition. (objfile_reposition): Add prototype. (objfile_verify): Add prototype. (symbol_verify): Add prototype. (type_verify): Add prototype. * cached-symfile.c: Implement objfile_move, objfile_reposition, objfile_verify, symbol_verify, type_verify, and supporting functions. 2002-11-30 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (USE_MMALLOC): Move check to after inclusion of defs.h. (cache_bfd): New function, factored out from dyld_cache_symfiles. Caches a single shlib entry (specified by index) according to the provided parameters. Swap out some of the generic builtin types and replace them with objfile-specific versions so that they can be saved in the cached symbol file. (cache_symfile_helper): New function. Helper function to cache shared library entries specified by (move_helper): New function. Moves a shared library to a new memory address given by malloc. (verify_helper): New function. Verifies that an objfile is completely contained in the mmalloc unit for that objfile. (dyld_move_command): New function. Added as "maintenance sharedlibrary move". (dyld_verify_command): New function. Added as "maintenance sharedlibrary verify". (dyld_cache_symfiles_command): New function. Added as "maintenance sharedlibrary cache-symfiles". (dyld_cache_purge_command): Move from "sharedlibrary cache-purge" to "maintenance sharedlibrary cache-purge". (macosx_dyld_init_command): Merge into macosx_dyld_update_command. 2002-11-30 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.h (dyld_prune_shlib): Add prototype. 2002-11-30 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_fast_show_stack): Count the number of frames completely even if we aren't going to print all off them. 2002-11-24 Jim Ingham <jingham@apple.com> * macosx-nat-infthread.c (_initialize_threads): Make the command doc strings for suspend & resume more accurate. (thread_resume_command): Check for thread suspend count of 0 and a more helpful error message than a kernel error number. 2002-11-23 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (extend_slide): Make static. (macosx_solib_add): Extend the slide from a dyld image added breakpoint event. 2002-11-23 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_load_library): Don't complain if we can't locate the test section. (dyld_symfile_loaded_hook): New function. Handles CFM updates on load of CarbonCore. (dyld_load_symfile): Move CFM code to dyld_symfile_loaded_hook. Handle relocating shared libraries who have already had an objfile loaded. (dyld_load_symfiles): Call dyld_load_symfile for shared libraries who need their symbols relocated. (dyld_libraries_compatible): Objfiles are now considered compatible even if they are at different addresses (i.e., one may need to be relocated). 2002-11-21 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_print_extra_frame_info): Convert all references to signal_handler_caller to use get_frame_type (). (ppc_init_extra_frame_info): No longer set signal_handler_caller. 2002-11-18 Klee Dienes <kdienes@apple.com> * cached-symfile.c (allocate_objfile): Replace strsave with xstrdup. 2002-11-18 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c: No longer need to call set_gdbarch_get_saved_register. 2002-11-16 Klee Dienes <kdienes@apple.com> * cached-symfile.c: Use FSF_OBJFILES as the condition to choose FSF vs. Apple objfile support. 2002-11-15 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_load_library): Remove "reading from memory" parts of the error messages; they weren't always true. Don't check for e->dyld_valid with an assert; just don't try to read from memory if it's not set. 2002-11-15 Klee Dienes <kdienes@apple.com> * cached-symfile.c: Protect mmalloc-specific code with #if USE_MMALLOC. * macosx-nat-dyld.c: Protect mmalloc-specific code with #if USE_MMALLOC. 2002-11-13 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (macosx_child_detach): Accept 'stopped_in_softec' when returning from suspend_ptrace as well. 2002-11-09 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c: Factor out shared-library post-update code to dyld_shlibs_updated; call from both dyld_update_shlibs and dyld_purge_cached_libraries. 2002-11-09 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_update_shlibs): Update the section information for current_target, not exec_ops. (dyld_purge_cached_libraries): Use dyld_update_shlibs to handle the update portion of the purge. * macosx-nat-dyld.c (update_section_tables): Re-implement. Now uses target_resize_to_sections instead of managing to_sections by hand. 2002-11-07 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c: Document the kernel signal-handler layout. Define PPC_SIGCONTEXT_PC_OFFSET and PPC_SIGCONTEXT_SP_OFFSET. (ppc_frame_find_pc): Use PPC_SIGCONTEXT_PC_OFFSET. (ppc_frame_chain): Use PPC_SIGCONTEXT_SP_OFFSET. const unsigned int PPC_SIGCONTEXT_PC_OFFSET = 0x98; const unsigned int PPC_SIGCONTEXT_SP_OFFSET = 0xa4; 2002-11-06 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (macosx_solib_add): Don't assume that entry pointers will remain valid after a call to dyld_update_shlibs (it can pack the entries). 2002-11-06 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (macosx_init_dyld): Only add the dyld_reason_executable entry if symfile_objfile is set. * macosx-nat-dyld-process.c (dyld_load_symfile): If an executable, check to make sure it matches symfile objfile. Propagate back any changes to e->objfile to symfile_objfile (i.e., replace the special-case handling with the standard mechanism). 2002-11-06 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_load_library): If an executable, check to make sure it matches symfile objfile. Propagate back any changes to e->objfile to symfile_objfile. (dyld_load_symfile): Ditto. (dyld_remove_objfile): Ditto. (dyld_remove_objfiles): If an executable, check to make sure it matches symfile objfile. * macosx-nat-dyld.c (macosx_init_dyld): Clear the objfile/bfd for any existing executable entries. Set the objfile/bfd field for the new executable entry to include all available information. 2002-11-06 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_next_allocated_shlib): Formerly next_allocated, moved from macosx-nat-dyld-process.c. * macosx-nat-dyld-info.h (dyld_next_allocated_shlib): Add prototype. (DYLD_ALL_OBJFILE_INFO_ENTRIES): Moved from macosx-nat-dyld-process.c. * macosx-nat-dyld-process.c (DYLD_ALL_OBJFILE_INFO_ENTRIES): Moved to macosx-nat-dyld-info.h (next_allocated): Moved to macosx-nat-dyld-info.h * macosx-nat-inferior.c (macosx_mourn_inferior): Replace hand-written code in the #if 0 with a call to macosx_init_dyld_symfile. 2002-11-02 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (dyld_stop_on_shlibs_added): New variable. Causes macosx_solib_add to return a library-changed indicator if a shared library is added (using the "=shlibs-added notification, as opposed to "=shlibs-updated"). Without this variable set, macosx_solib_add will return zero even if a shared library is added. (dyld_stop_on_shlibs_updated): New variable. Like dyld_stop_on_solibs_added, but corresponds to a full shared library update (using the "=shlibs-updated") notification. (macosx_solib_add): Honor dyld_stop_on_shlibs_added. Rely on macosx_dyld_update to honor dyld_stop_on_shlibs_updated. (macosx_dyld_update): Honor dyld_stop_on_shlibs_updated. (_initialize_macosx_nat_dyld): Export dyld_stop_on_shlibs_added and dyld_stop_on_shlibs_updated as 'set/show sharedlibrary stop-on-shlibs-added' and 'set/show sharedlibrary stop-on-shlibs-updated'. 2002-11-02 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_add_image_libraries): Add handler for LC_LOAD_WEAK_DYLIB. 2002-11-01 Klee Dienes <kdienes@apple.com> * symread.c (sym_read_type): Use bfd_bread instead of bfd_read. 2002-11-01 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (dyld_info_read): Remember the saved space for the executable as an index into the info, not a pointer --- otherwise it can end up pointing to stale data if dyld_objfile_entry_alloc ends up reallocating the array. 2002-11-01 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_prune_shlibs): New function. Remove all shared libraries in 'old' that match the entry 'n'. (dyld_merge_shlibs): Update to use dyld_prune_shlibs. Algorithm is (finally) reasonably simple --- copy the old shlibs that can be re-used; purge the ones that shouldn't be cached; cache the rest. Update prototype to be "update from 'old' into 'new'" (previously it was "update from 'old' into 'result' according to 'new'"). * macosx-nat-dyld-process.h (dyld_prune_shlibs): Update prototype. * macosx-nat-dyld.c (macosx_init_dyld): Update to new prototype for dyld_merge_shlibs. (macosx_dyld_update): Ditto. (dyld_add_symbol_file_command): Ditto. (dyld_remove_symbol_file_command): Ditto. (dyld_set_load_state_command): Ditto. 2002-10-31 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_objfile_entry_clear): Initialize dyld_length to 0. (dyld_resolve_shlib_num): Swap the order of "user" and non-user shared library ordering. The new order in all cases should be exec, dyld, dyld libraries, cached objects, user libraries. (dyld_entry_shlib_num): Remove the section for counting user-loaded libraires (they now come last). (dyld_print_entry_info): Print a "!" in the "reason" field if the objfile is invalid, rather than crashing. (dyld_print_shlib_info): Reformat the table header. Increase the minimum library field width to 12, to accomodate the new table headers (in practice the field is always that long anyway). Swap the order of "user" and non-user shared library ordering. * macosx-nat-dyld-io.c (extend_vma): Remove. (inferior_bfd_generic): No longer call extend_vma; rely on offset to be properly sign-extended. * macosx-nat-dyld-process.c (dyld_objfile_allocated): Export. (dyld_libraries_compatible): Libraries are incompatible if _either_ offset is non-zero and not equal to the other offset (previously both had to be non-zero). (next_allocated): New function. Returns the next index into 'info' that points to an allocated shared library entry. (DYLD_ALL_OBJFILE_INFO_ENTRIES): New macro. Iterates 'o', 'n' through the allocated shared library entries of 'info'. (dyld_merge_shlib): No longer tries to handle removal of old/cached libraries; only handles copying of objfile information from the previous info into the new entry (if possible). (dyld_merge_shlibs): Re-implement (see comments in dyld_merge_shlib). No longer call dyld_remove_objfiles or dyld_objfile_info_pack (these have been moved into dyld_update_shlibs). * macosx-nat-dyld-process.h (dyld_objfile_allocated): Add prototype. * macosx-nat-dyld.c (struct dyld_raw_info): Revert 'slide' to a CORE_ADDR. We don't know whether a slide of a 32-bit address will be positive or negative until we know the address upon which it operates. (dyld_info_process_raw): Revert 'slide' to a CORE_ADDR. (macosx_init_dyld): Move the 'exec' entry to the top of the info list. (extend_slide): New function. Given a slide and an address, sign-extend the slide as appropriate to operate as a CORE_ADDR. (dyld_info_read_raw): Read 'slide' as an unsigned integer; instead use extend_slide to extend it once we have read the address. (dyld_info_read): Reserve space for the 'exec' entry; fill it with the first entry of dyld_reason_executable ready by dyld. 2002-10-31 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (macosx_solib_add): Recognize DYLD_MODULE_*, DYLD_PAST_EVENTS_END, and DYLD_IMAGE_REMOVED. Do a full dyld update on DYLD_IMAGE_REMOVED; ignore all other events. For unknown events, emit a warning and do a fulld dyld update. (macosx_dyld_update): Only emit a shlibs-updated notification if the library state has actually changed. 2002-10-31 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior-debug.c (macosx_debug_regions): Update to take a start address and maximum number of regions to be printed. Coalesce adjacent regions with identical permissions into a single printed line; print the number of sub-regions as part of the line. Shorten output to fit in a 100-character line (still too long, but a big improvement). (macosx_debug_region): Replace with a call to macosx_debug_region. * macosx-nat-inferior-debug.h (macosx_debug_regsions): Update prototype. * macosx-nat-info.c (info_mach_regions_command): Update to new interface for macosx_debug_regions. 2002-10-30 Jim Ingham <jingham@apple.com> * macosx-nat-dyld-path.c (dyld_resolve_image): Handle the case where the dyld name contains @executable_path. 2002-10-29 Klee Dienes <kdienes@apple.com> * i386-macosx-tdep.c: Remove extraneous definitions of ss and st: they were a useless cut-and-paste accident, and now break the i386 build. 2002-10-28 Klee Dienes <kdienes@apple.com> * macosx-nat-watchpoint.c: Include macosx-nat-watchpoint.h. (hppa_insert_hw_watchpoint): Make static. (hppa_remove_hw_watchpoint): Make static. (macosx_can_use_hw_watchpoint): Take an int instead of an enum bptype (less correct, but it avoids a giant header-dependency headache, and besides, this stuff should be gdbarched anyway). * macosx-nat-watchpoint.h: New file. Contains prototypes for functions in macosx-nat-watchpoint.c 2002-10-28 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameops.c (ppc_frame_saved_regs): Use signed long for the offset, not unsigned, to prevent bogus values on 64-bit BFDs. 2002-10-28 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-io.c (inferior_stat): New function. (inferior_bfd_generic): Pass inferior_stat as part of the inferior bfd function vector. 2002-10-26 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_frame_find_pc): Convert to use frame_unwind_unsigned_register instead of deprecated_read_register. 2002-10-24 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c (ppc_fast_show_stack): Stop counting frames at the limit, if a limit is given. 2002-10-23 Klee Dienes <kdienes@apple.com> * i386-macosx-tdep.c (i386_macosx_sigcontext_addr): New function. (i386_macosx_init_abi): Set tdep->sigcontext_addr to i386_macosx_sigcontext_addr; set values for tdep->sc_pc_offset and tdep->sc_sp_offset. 2002-10-23 Klee Dienes <kdienes@apple.com> * i386-macosx-nat-exec.c (store_inferior_registers): Disable the attempt to set the FP registers (until #3067308 is fixed). * macosx-nat-inferior-debug.c (macosx_debug_region): Use 0x%lx instead of 0x%ulx as a format string for unsigned long. * macosx-nat-inferior.c: Update debug levels passed to inferior_debug. * i386-macosx-tdep.c (i386_macosx_fetch_fp_registers): Handle SSE registers. (i386_macosx_store_fp_registers): Ditto. 2002-10-23 Klee Dienes <kdienes@apple.com> * macosx-nat-excthread.c (macosx_exception_thread): Include the exception data in exception thread debug output. 2002-10-22 Klee Dienes <kdienes@apple.com> * i386-macosx-tdep.c (i386_macosx_init_abi): Set the target struct_return field to reg_struct_return. 2002-10-21 Klee Dienes <kdienes@apple.com> * cached-symfile.h: New file. Add prototypes for functions in * cached-symfile.c: Include cached-symfile.h. Remove local declarations for exported functions. * macosx-nat-cfm.c (cfm_update): Convert to use cfm_fetch_context_containers instead of cfm_fetch_context_connections. (cfm_fetch_context_connections): Remove, and replace with cfm_fetch_context_containers. (cfm_parse_container_info): Also parse the 'next' field of the container. (cfm_fetch_connection_section_info): Remove, and replace with cfm_fetch_container_section_info. No longer return the instance information; it's difficult to access since it is part of the connection structure, and it appears to be unused. * macosx-nat-cfm.h: Update prototypes. (NCFragContainerInfo): Add 'next' pointer. * macosx-nat-cfmthread.c (macosx_cfm_thread_init): Clear the breakpoint_offset and cfm_breakpoint fields. (macosx_cfm_thread_create): Store the cfm breakpoint in the thread status for future reference. (macosx_cfm-thread_destroy): Delete the cfm breakpoint, if present. * macosx-nat-cfmthread.h (macosx_cfm_thread_status): Add cfm_breakpoint. * macosx-nat-dyld-process.c (dyld_load_symfile): When generating the cfm parser, set cfm breakpoint offset to the last instruction of PrepareClosure. (dyld_libraries_similar): If both libraries provide a load address or offset, they compare similar only if the addresses or offsets are the same. This allows for images to have multiple bundles with the same basename loaded simultaneously, yet still replace 'cached' libraries with ones supplied by dyld. (dyld_libraries_compatible): Fix bug that would trigger a fatal assertion if (fres == lres == NULL), but fname and lname compared equal. (dyld_merge_shlib): New function. Like dyld_merge_shlibs, but for a single library. Fill in a dyld_objfile_entry 'n' with any objfile data from the dyld_objfile_info passed in as 'old'. Removes the objfile data from 'old' as it merges it into 'n'. (dyld_merge_shlibs): Update to use dyld_merge_shlib. (dyld_update_shlibs): No longer call dyld_merge_shlibs (it must now be called explicitly). * macosx-nat-dyld-process.h: Update prototypes. * macosx-nat-dyld-info.c (dyld_entry_info): Remove prototype. (dyld_reason_string): Add vlaues for dyld_reason_deallocated, dyld_reason_user, and dyld_reason_init. (dyld_objfile_entry_clear): Clear cfm_container instead of cfm_connection. (dyld_objfile_entry_compare): Compare cfm_container instead of cfm_connection. (dyld_entry_shlib_num): New function. Returns the shared library number of the entry at 'eptr' in 'numptr'. Returns 0 on success, anything else on failure. (dyld_shlib_info_basename_length): New function. Returns the length of the longest field that would be printed when displaying 's' according to 'reason_mask'. Code was previously in dyld_print_entry info. Convert to use dyld_convert_entry. (dyld_entry_shlib_num_matches): New function. Return true if and only if the shared library specifier 'shlibnum' matches the string in 'args'. Returns 'false' on error; outputs warning messages only if 'verbose' is passed as true. (dyld_print_entry_info): New function. Prints a dyld_obfile_entry, using 'shlibnum' as the shared library number and 'baselen' to determine the padding. (dyld_convert_entry): Fill a dyld_objfile_entry structure based on the contents of a struct objfile. (dyld_print_shlib_info): Convert to use dyld_shlib_info_basename_length, dyld_entry_shlib_num_matches, dyld_print_entry_info, and dyld_convert_entry. Only output the table header if 'header' is specified as true. Fix the table header to line up properly. * macosx-nat-dyld-info.h: Update prototyles. (enum dyld_objfile_reason): Add exclude 'user' objects from dyld_reason_all_mask. (struct dyld_objfile_entry): Replace cfm_connection with cfm_container. * macosx-nat-dyld.c (_initialize_macosx_nat_dyld): Add new command "info sharedlibrary all", both for general use, and to allow "info sharedlibrary all 1-4 10". It would be nice to have "info sharedlibrary" accept this same syntax, but since "info sharedlibrary" is a prefix command, that is a bit more challenging. (info_raw_cfm_comamnd, info_cfm_command, info_dyld_command, info_sharedlibrary_command): Replace with info_sharedlibrary_command, info_sharedlibrary_all_command, info_sharedlibrary_dyld_command, info_sharedlibrary_cfm_command, and info_sharedlibrary_raw_cfm_command. Update to use new interfaces to dyld_print_status_info and dyld_print_shlib_info. Only print 'status' information for info_sharedlibrary_command. (section_info_helper): Convert to use cfm_fetch_container_info instead of cfm_fetch_connection_info. (dyld_add_symbol_file_command): Call dyld_merge_shlibs explicitly; it's no longer called by dyld_update_shlibs. (dyld_remove_symbol_file_command): Ditto. (dyld_set_load_state_command): Ditto. (struct dyld_raw_info): New structure. Used by dyld_info_read_raw to return raw dyld address information read from the target. (dyld_info_read): The dyld_info_read_raw function has been split into dyld_info_read_raw, dyld_info_process_raw, and dyld_info_read. The dyld_info_read_raw function reads the raw information from dyld into a dyld_raw_info structure; dyld_info_process_raw processes the raw information into dyld_objfile_entries, and dyld_info_read adds the dyld pseudo-entry and uses dyld_info_read_raw and dyld_info_process_raw to implement the previous behavior of dyld_info_read_raw. (dyld_info_read_raw): See above. (dyld_info_process_raw): See above. Update to read name information from the LC_ID entry of the library itself if no name information is provided by the caller (by specifying a 'name' argument of INVALID_ADDRESS) (dyld_print_status_info): Update to allow lists of libraires to be processed. Remove check for 'uses_dyld' (it will now just print an empty list). (macosx_set_start_breakpoint): Also take a macosx_dyld_thread_status; update the dyld_breakpoint if it has not already been set. (FETCH_ARGUMENT): Ugly, and should be replaced, but stolen from the Objective-C code. Returns the value at the n'th argument of the currently-executing stack frame. (macosx_add_shard_symbol_files): No longer check the value of uses_dyld. (macosx_dyld_update): Update to use dyld_info_read instead of dyld_info_read_raw. Update to call dyld_merge_shlibs expliicitly. Add MI notification ("=shlibs-updated") that the shared library state needs to be fully refreshed. (macosx_solib_add): Properly return the value of libraries_changed to the calling code. Add support to break at the DYLD event routine used by the old dyld_debug code, to detect individual shared library events. Dispatch based on the location at which GDB has stopped in the inferior; if we have stopped at the event routine, do an incremental update where possible, otherwise revert to re-parsing the entire shared library state. Add MI notification ("=shlibs-added") for the incremental-update case. * macosx-nat-dyld.h (macosx_dyld_thread_status): Convert unsigned ints to unsigned longs. Add dyld_event_breakpoint. Remove uses_dyld. (dyld_print_status_info): Update prototype. (macosx_set_start_breakpoint): Update prototype. (macosx_solib_add): Update prototype. * macosx-nat-mutils.c (macosx_thread_valid): Remove obsolete comment. 2002-10-17 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (macosx_child_detach): Print "Detaching from program" message when detaching. 2002-10-17 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c (macosx_child_attach): Use stop_soon_quietly/wait_for_inferior, not macosx_wait, to read the initial attach-events. Otherwise the stop-status doesn't get correctly set, and we end up not printing the current stack frame in normal_stop after the attach. (macosx_child_attach): Print "Attaching to program" message when attaching. 2002-10-17 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (dyld_info_read_raw): Don't bother reading if status->dyld_addr hasn't yet been set. Set prefix to dyld_symbols_prefix, not hardcoded to "__dyld_". Set the name from status->dyld_name, not hard-coded to "/usr/lib/dyld" (this is set as the default if no dyld_name is provided). Only set dyld_slide if status->dyld_slide has been set. No longer call macosx_init_addresses; that's handled by macosx_dyld_init. Don't bother checking for images if dyld_slide isn't set. Improve sanity-checking and error-handling for bogus dyld data; no longer call error (instead, print a warning and stop processing libraries, returning any libraries already processed). (dyld_info_process_raw): Don't mess around with crazy bit-shifting tactics for the slide; just read it as a signed integer. (macosx_init_dyld): Only use o->obfd to set the bfd for the entry if 'o' is non-NULL. (macosx_dyld_thread_init): Initialize the dyld fields to NULL/INVALID_ADDRESS. (macosx_solib_add); Just call macosx_dyld_init to "do the right thing" to update the dyld state. (info_sharedlibrary_command): Update to use dyld_reason_all_mask. (macosx_init_addresses): Pass in a dyld_thread_status; don't use global. (lookup_dyld_value): Ditto. (lookup_dyld_address): Ditto. Use the slide from the dyld_thread_status, not a global. (dyld_starts_here_p): Pass a correct value for the 'count' field into vm_region. Reformat. (macosx_lookup_dyld_name): New function. Tries to find the name string for the dynamic linker used by the bfd given as an argument. Returns 1 if it found a name, 0 if it didn't, -1 if there was an error. (macosx_locate_dyld): New function. Searches the target address space for dyld itself, returning it in 'value'. Returns 1 if it found dyld, 0 if it didn't, -1 if there was an error. If 'hint' is not INVALID_ADDRESS, check there first as a hint for where to find dyld. (macosx_locate_dyld_static): New function. Determine the address where the current target expected DYLD to be loaded. This is used when first guessing the address of dyld for symbol loading on dynamic executables, and also to compute the proper slide to be applied to values found in the dyld memory itself. Returns 1 if it found the address, 0 if it did not. (macosx_dyld_init): Update to use the new functions defined above. This function should now be able to be called at any time, and should always do as much of the right thing as possible based on the information available at the time. See the comments in the function for more details. * macosx-nat-dyld-process.c (dyld_load_library): Use dyld_reason_executable_mask to account for an entry in state dyld_reason_cached_executable. (dyld_load_symfile): Ditto. (dyld_remove_objfile): Ditto. (dyld_remove_objfiles): Ditto. (dyld_merge_shlibs): Ditto. Also, when marking an entry as 'cached', use dyld_reason_cached_executable or dyld_reason_cached_library, as appropriate. (dyld_purge_cached_libries): Update to use dyld_reason_cached_mask, not dyld_reason_cached. * macosx-nat-dyld.h: Add new fields dyld_addr, dyld_slide, and dyld_name. Update function declarations to match macosx-nat-dyld.c. * macosx-nat-inferior.c (macosx_child_create_inferior): Replace call to macosx_set_start_breakpoint with macosx_dyld_init. * ppc-macosx-tdep.h (INVALID_ADDRESS): Define as ((CORE_ADDR) -1), not 0xffffffff, for proper behavior when building 64-bit. * macosx-nat-dyld-info.h (dyld_objfile_reason): Split the 'cached' value into 'cached_library' and 'dyld_reason_cached_executable'. Replace the masks 'image', 'shlib', and 'all' with 'cached_mask', 'executable_mask', 'image_mask', and 'all_mask'. * macosx-nat-dyld-info.c (dyld_reason_string): Add string values for dyld_reason_cached_library and dyld_reason_cached_executable. (dyld_print_shlib_info): Update output accomdate wider values for the 'reason' field. 2002-10-14 Klee Dienes <kdienes@apple.com> * i386-macosx-thread-status.h (GDB_i386_FP_SSE2): Define. (GDB_i386_FP_387_STATE_SIZE): Define. (GDB_i386_FP_SSE2_STATE_SIZE): Define. (gdb_i386_thread_fpstate): Use GDB_i386_FP_SSE2_STATE_SIZE instead of hard-coding the value. 2002-10-13 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c (ppc_frame_cache_boundaries): Use frame_address_in_block to choose the address to pass to ppc_find_function_boundaries. 2002-10-13 Klee Dienes <kdienes@apple.com> * ppc-macosx-frameinfo.c: Remove local declarations for types/functions now provided by core GDB header files. Convert functions to ANSI prototypes. Convert calls from obstack_alloc to frame_obstack_alloc. (ppc_frame_cache_properties): Parse function properties directly into frame->extra_info->props, rather than storing in a local variable first. Force the properties to set lr_saved to '1' for all non-leaf functions, regardless of what ppc_parse_instructions claims (previously it would only set it to ($pc - 8), when it was not set by ppc_parse_instructions). This solved a problem where a function was calling a function declared 'volatile' and not expecting it to return, so the prev-frame $pc was past the end of the calling function and at the beginning of the next. ppc_parse_instructions was returning (correctly) that the function saved its $lr at ($pc + 8), and so the prev_saved_pc code was (incorrectly) deducing that the register had not been saved on the stack. The real place to fix this problem is by calling ppc_parse_instructions on the correct address range ... but regardless, there's nothing that GDB can do if $lr isn't saved on a non-leaf, and so it's best for it to look in the $lr save-area in all situations. * ppc-macosx-frameops.h: Remove obsolete function declarations. * ppc-macosx-frameops.c: Remove local declarations for types/functions now provided by core GDB header files. Convert functions to ANSI prototypes. (ppc_frame_saved_regs): Offset should be a CORE_ADDR, not a signed long. 2002-10-13 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c Convert functions to ANSI prototypes. (ppc_null_fix_call_dummy): Remove. (gdb_register_names): Convert to const char *. 2002-10-13 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.h: Remove SKIP_TRAMPOLINE_CODE, DYNAMIC_TRAMPOLINE_NEXTPC, IN_SOLIB_DYNSYM_RESOLVE_CODE, IN_SOLIB_CALL_TRAMPOLINE, IN_SOLIB_RETURN_TRAMPOLINE, INIT_FRAME_PC_FIRST, INIT_FRAME_PC, and CONVERT_FROM_FUNC_PTR_ADDR (they will be moved to use gdbarch in macosx-nat-tdep.c). Remove STACK_ALLOC. * ppc-macosx-tdep.c: Remove ppc_convert_from_func_ptr_addr, ppc_find_toc_address, and ppc_macosx_in_solib_dynsym_resolve_code. Use gdbarch to set init_frame_pc_first, skip_trampoline_code, dynamic_trampoline_nextpc, in_solib_call_trampoline, in_solib_return_trampoline, init_frame_pc_first, and init_frame_pc. * ppc-macosx-frameinfo.c (ppc_parse_instructions): Remove unused target_reg declaration (removes compiler warning). 2002-10-06 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_extract_return_value): Remove unused tdep pointer. Convert to ANSI prototype. (_initialize_ppc_tdep): Add command for "info powerpc" (to match RS/6000 behavior). (ppc_breakpoint_from_pc): Now returned a const unsigned char *. 2002-10-05 Klee Dienes <kdienes@apple.com> * i386-macosx-nat-exec.c (fetch_inferior_regsisters): Mark all SSE registers as NULL. Add i386-tdep.h for IS_SSE_REGNUM (). * i386-macosx-tdep.c Include i386-tdep.h, i387-tdep.h, and osabi.h. (i386_macosx_fetch_fp_registers): Mark all FP registers as invalid, if declared so by the kernel. (sigtramp_saved_pc): Convert to ANSI-style declaration. (i386_macosx_init_abi): New function. Update NUM_REGS to include the SSE registers. (i386_mach_o_osabi_sniffer): New function. Return GDB_OSABI_MACOSX if debugging any Mach-O file. (_initialize_i386_macosx_tdep): New function. Register i386_macosx_init_abi and i386_mach_o_osabi_sniffer. 2002-10-04 Klee Dienes <kdienes@apple.com> * ppc-macosx-regs.h: Remove 'registers' argument from fetch/set function prototypes. * i386-macosx-tdep.h: Remove IS_GSP_REGNUM, add IS_VP_REGNUM. Provide correct values for FIRST/LAST_*_REGNUM and NUM_*_REGS. Prototype i386_macosx_fetch/store_*_registers. * ppc-macosx-thread-status.h: Regularize names of function and macros to gdb_i386_thread_state/fpstate/vpstate. * i386-macosx-thread-status.h: Use the FLOAT_STATE instead of the THREAD_FPSTATE interface to fetch registers from the thread. Remove structures used for decoding floating-point information (the new interface provides a single buffer of raw data in FSAVE format). Regularize names of function and macros to gdb_i386_thread_state/fpstate/vpstate. * ppc-macosx-regs.c (ppc_macosx_fetch/store_gp/fp/vp_registers): Re-implement using regcache_collect and supply_register. * i386-macosx-tdep.c: (ppc_macosx_fetch/store_gp/fp/vp_registers): Re-implement using regcache_collect, supply_register, and the new thread interface from i386-macosx-thread-status.h. * ppc-macosx-nat-exec.c: Include "regcache.h". (fetch_inferior_registers): Convert to new interface from ppc-macosx-tdep.h. No longer set register_valid directly. (store_inferior_registers): Ditto. * i386-macosx-nat-exec.c: Include "regcache.h". (fetch_inferior_registers): Convert to new interface from i386-macosx-tdep.h. No longer set register_valid directly. (store_inferior_registers): Ditto. * core-macho.c: Include the proper register definition header based on the target. Convert to new register interface for both i386 and powerpc (we now use supply/collect_register instead of registers/register_valid). * remote-kdp.c: Properly conditionalize inclusion of "ppc-macosx-regs.h" and "i386-macosx-tdep.h". Move inclusion before "defs.h" to avoid conflicting with the target.h definitions of PC_REGNUM and the like. Fix compiler warnings. * macosx-nat-inferior.c: No longer check for tm_print_insn; it's not used by function any more (it used to be used for debugging output) (previous ChangeLog entry is spurious; change was mistakenly not committed previously). * macosx-metrowerks.c: No longer include ppc-macosx-tdep.h directly. 2002-10-02 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c (ppc_gdbarch_init): Don't say chars are unsigned. This is causing some fails from the improperly written charset.exp test cases; there are precisely four targets that set char_signed to 0, and I can't come up with any benefit from being one of them. 2002-09-30 Klee Dienes <kdienes@apple.com> * macosx-nat-inferior.c: No longer check for tm_print_insn; it's not used by function any more (it used to be used for debugging output). 2002-09-27 Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c (macosx_pid_to_str): Revert last - adjusting the testsuite is the right way to go on this one. 2002-09-27 Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c (macosx_pid_to_str): Change text to match pthreads.exp's expectations. * macosx-nat-mutils.h (__MACH_CHECK_FUNCTION): Don't bother checking for gcc's older than 2.6. 2002-09-29 Klee Dienes <kdienes@apple.com> * cached-symfile.c (build_objfile_section_table): Properly Terminate objfiles->sections_end even if there are no sections in the objfile. * core-macho.c (check_thread): Use a process-id of 1 for the core threads; store (1, logical thread number, bfd section number) as (pid, lwp, tid). This allows proper output of thread numbers when displaying threads, and avoids a previous bug where a thread stored as the first load command in a core file would be confused with null_ptid (since both tuples are 0, 0, 0). (macosx_core_ptid_to_str): Output correct thread IDs, not "??". : Use the new macros for ptid access instead of PITGET/TIDGET. 2002-09-28 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.h (macosx_dyld_thread_init): Add. (macosx_dyld_thread_status): Add dyld_breakpoint field. * macosx-nat-dyld.c (macosx_dyld_thread_init): Add. (macosx_set_start_breakpoint): Only set the breakpoint if it hasn't already been created. (macosx_solib_add): Don't call macosx_remove_start_breakpoint --- this breaks stop-on-solib, since macosx_solib_add gets called from the stop-on-solib breakpoint, and ends up trashing the stop_bpstat when it removes and re-adds the breakpoint. Instead, rely on macosx_set_start_breakpoint to only set the breakpoint if it hasn't been created yet. * macosx-nat-inferior-util.c (macosx_inferior_reset): Call macosx_dyld_thread_init. 2002-09-28 Klee Dienes <kdienes@apple.com> * ppc-macosx-tdep.c (ppc_store_return_value): Convert floats to doubles before storing in registers. Store shorts and chars in the proper end of registers on big-endian machines. 2002-09-27 Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c (macosx_pid_to_str): Revert last - adjusting the testsuite is the right way to go on this one. 2002-09-27 Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c (macosx_pid_to_str): Change text to match pthreads.exp's expectations. * macosx-nat-mutils.h (__MACH_CHECK_FUNCTION): Don't bother checking for gcc's older than 2.6. 2002-09-26 Klee Dienes <kdienes@apple.com> * macosx-nat-mutils.h (__MACH_CHECK_FUNCTION): Update to account for gcc3. 2002-09-24 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld.c (macosx_locate_dyld): Don't check for the Mach-O structures for non- Mach-O files. 2002-09-24 Klee Dienes <kdienes@apple.com> See comments in the top-level ChangeLog. * macosx-nat-dyld.c (lookup_dyld_address): Return -1 on error, instead of throwing an error. * (lookup_dyld_address): Propagate -1 from lookup_dyld_address. * (macosx_locate_dyld): No longer called from SOLIB_ADD; update comment. * (macosx_locate_dyld): Warn, rather than error, when unable to find address of dylinker. * (macosx_set_start_breakpoint): Just set the breakpoint; don't try to locate dyld or init addresses. * (macosx_solib_add): Replaces macosx_try_start_dyld. Inits addresses, sets start breakpoint, does section table updates. Designed to be able to be called repeatedly and "do the right thing" whenever. * (macosx_init_dyld): Update to take exec_bfd as an argument. If exec_bfd does not match the bfd for the current symfile, use it in preference. * (update_section_tables): Move from objfile.c. Re-implement to base section tables off of a dyld_objfile_info, not the list of objfiles (which is more correctly a list of symbols loaded, not executables). * macosx-nat-dyld.h (update_section_tables): Add prototype. * (macosx_init_dyld_symfile): Add exec_bfd as argument. * macosx-nat-inferior.c (macosx_set_auto_start_dyld): Use macosx_solib_add. * (macosx_child_attach): Ditto. 2002-09-23 Jim Ingham (jingham@apple.com) * ppc-macosx-tdep.c (ppc_find_function_boundaries): Use refine_prologue_limit so if there is line number information, we get its benefit in trying to skip the prologue. 2002-09-20 Jason Molenda (jmolenda@apple.com) * ppc-macosx-tdep.c (ppc_gdbarch_init): Set pop_frame to rs6000_pop_frame, not generic_pop_dummy_frame. Set ppc_lr_regnum - rs600-tdep.c uses this way of storing these register numbers and rs6000_pop_frame needs to know the $lr regnum. 2002-08-27 Klee Dienes <kdienes@apple.com> * macosx-nat-frameops.c: Delete all but ppc_frame_cache_saved_regs and ppc_frame_saved_regs. We now use the rs6000 code for pushing function arguments. * ppc-macosx-tdep.c: Remove gdbarch_tdep; we now use the one from "ppc-tdep.h". * ppc-macos-tdep.c: Update to use the rs6000 and generic call-dummy support. (ppc_push_return_address): Store the new return address in the LR and in the saved LR location in the linkage area. (ppc_call_dummy_words): Remove. (ppc_frame_find_pc): Update to use generic call_dummy support. (rs6000_push_arguments): Add local prototype. (ppc_gdbarch_init): Update to use the rs6000 and generic call-dummy support. * macosx-nat-inferior.c (macosx_child_create_inferior): Make sure exec_bfd isn't NULL before checking to see if it is a PEF binary. * ppc-macosx-frameops.c (ppc_push_dummy_frame): Delete. 2002-08-20 Jim Ingham <jingham@apple.com> * macosx-tdep.c (macosx_symbol_type): If the section is not the first section, see if it is in the TEXT segment to determine whether to label it TEXT or DATA... 2002-08-06 Klee Dienes <kdienes@bluegill.localnet> * (macosx-nat-watchpoint.c): Rename target_range_profitable_for_hw_watchpoint to target_range_ok_for_hw_watchpoint. 2002-08-06 Klee Dienes <kdienes@bluegill.localnet> * macosx-nat-inferior.c (macosx_handle_exception): macosx_status is already a pointer; pass it to macosx_inferior_resume_mach, not its address. * macosx-nat-inferior-util.c (macosx_inferior_resume_ptrace): Pass the signal to ptrace whever the inferior is either (a) detaching, or (b) not stopped by a software exception. 2002-08-06 Klee Dienes <kdienes@bluegill.localnet> * ppc-macosx-tdep.c: Made the maximum stack frame size configurable via 'ppp-maximum-frame-size', and set the default to 'unlimited'. It's tempting to have ppc-maximum-frame-size default to 512K, since that's the default stack allocation size on Mac OS X. But I couldn't think of a compelling reason to do it, and UINT_MAX is much less dependent on OS-level changes. 2002-07-19 Jim Ingham <jingham@apple.com> * macosx-nat-inferior.c (macosx_child_create_inferior): Don't let someone try to run a CFM binary, error out here instead. 2002-07-12 Jim Ingham <jingham@apple.com> * tm-ppc-macosx.h: Change FAST_SHOW_STACK macro to take a print function. * ppc-macosx-tdep.c: Remove the ppc_fast_show_stack command, only the MI version is really interesting. ppc_fast_show_stack_helper becomes ppc_fast_show_stack, and now takes the print_fun argument. 2002-07-09 Jim Ingham <jingham@apple.com> * machoread.c (macho_symfile_offsets): don't cast a CORE_ADDR as a long, that's no way to truncate it... * macosx-nat-dyld.c (dyld_info_process_raw): Handle the case where a CORE_ADDR is bigger than the native address size, and the dyld slide causes the load address to wrap around. 2002-06-27 Jim Ingham <jingham@apple.com> * macosx-nat-inferior-util.c (macosx_inferior_reset): Set uses_dyld to 1. If we are wrong about this, it is only a problem when we go to set the start breakpoint, and we always check before we do that, so this is a better setting. * macosx-nat-dyld.c (macosx_locate_dyld): exec_bfd is NULL currently when you attach. (FIXME - why is this the case?). So only change uses_dyld if you really have an exec_bfd to look at. 2002-06-26 Klee Dienes <kdienes@annecy.apple.com> * ppc-macosx-frameinfo.c (ppc_parse_instructions): properly initialize 'start'. 2002-06-17 Klee Dienes <kdienes@bluegill.localnet> * macosx-nat-inferior-util.c, macosx-nat-inferior.c: move the signal to the exception thread that causes it to continue out of individual functions, and into macosx_inferior_resume_mach. Add calls to sched_yield() after killing the target and before terminating the debug thread, so that the debug thread has a chance to reap the dead target in waitpid(). 2002-06-17 Klee Dienes <kdienes@bluegill.localnet> * macosx-nat-inferior-util.c (macosx_inferior_resume_ptrace): check for PTRACE_DETACH, and always call ptrace in that case. 2002-06-17 Klee Dienes <kdienes@law.apple.com> * macosx-nat-mutils.c (mach_xfer_memory): Handle integer overflow when returning negative values. Previously when the next available address was more -INT_MIN away from the address requested, mach_xfer_memory would overflow and return a positive number in error. Now it just returns 0. A better fix for this would be to change the signature for mach_xfer_memory, but that's a much bigger change. 2002-06-13 Jim Ingham <jingham@apple.com> * ppc-macosx-regs.c: New function ppc_macosx_stab_reg_to_regnum, this implements the mapping from the gcc3 stabs register numbering scheme to gdb's internal numbering scheme. * ppc-macosx-regs.h: Declare it. * ppc-macosx-tdep.c: Add ppc_macosx_stab_reg_to_regnum to the ppc gdbarch. 2002-06-12 Klee Dienes <kdienes@law.apple.com> * macosx-nat.c: remove obsolete (#ifdef 0) exception processing code. 2002-06-07 Jim Ingham <jingham@apple.com> * macosx-nat-dyld.c (macosx_locate_dyld): If we notice that the exec_bfd doesn't have the DYLINKER load command, then note that that fact in the dyld_status. (dyld_print_status_info): don't try to print dyld info if dyld isn't used. (macosx_set_start_breakpoint): don't try to set the start breakpoint if the executable doesn't load dyld. (macosx_add_shared_symbol_files): don't try to do this if the executable doesn't load dyld either. * macosx-nat-dyld.h: add uses_dyld to the dyld_status structure. * macosx-tdep.c (dyld_symbol_stub_function_addr): check that the block for the symbol value we just found is valid before trying to access it. * ppc-macosx-frameinfo.c (ppc_parse_instructions): treat an "sc" or a bare branch (except for the ones we recognize) as end of prologue markers. This way we don't scan too far in some hand-crafted functions, "read" being the example I found. 2002-05-30 Rab Hagy <rhagy@apple.com> * ppc-macosx-tdep.c, tm-ppc-macosx.h: added a limit argument to ppc_fast_show_stack_helper. 2002-05-24 Klee Dienes <kdienes@bluegill.localnet> * cached-symfile.c: Improve logic to detect mismatch between cached symbol files and object file / GDB versions. 2002-05-24 Klee Dienes <kdienes@bluegill.localnet> * cached-symfile.c (open_mapped_objfile): Use openp instead of explicit search logic to find the cached symbol file; respect the 'cached-symfile-path' variable. (_initialize_cached_symfile): Add cached-symfile-path variable. (dyld_cache_symfiles): Cleanup. 2002-05-23 Jim Ingham <jingham@apple.com> * machoread.c (macho_read_indirect_symbols): New function, encapsulate getting the "dyld_stub" symbols from a SYMBOL_STUB type section. (macho_symfile_read): read in both the __picsymbol_stub and the new __symbol_stub sections. 2002-05-14 Jim Ingham <jingham@apple.com> * ppc-macosx-frameinfo.c (ppc_parse_instructions): Keep track of the last recognized instruction so we don't over report the prologue's size. 2002-05-01 Klee Dienes <kdienes@bluegill.localnet> * config/i386/macosx.mh, config/i386/nm-i386-macosx.h, config/i386/tm-i386-macosx.h, macosx/i386-macosx-nat-exec.c, macosx/i386-macosx-tdep.c, macosx/macosx-nat-inferior.c: Fixes for i386. 2002-05-01 Klee Dienes <kdienes@bluegill.localnet> * ppc-macosx-regs.h: re-order register numbering. VSCR is a 4-byte integer. * ppc-macosx-tdep.c (gdb_register_names): update to new ordering. * ppc-macosx-tdep.c (ppc_register_virtual_type): Change type of AltiVec registers to builtin_type_vec128. * ppc-macosx-regs.c (ppc_macosx_skip_trampoline_code, ppc_macosx_dynamic_trampoline_nextpc, ppc_macosx_in_solib_dynsym_resolve_code, ppc_macosx_in_solib_return_trampoline): move to ppc-macosx-tdep.c. 2002-05-01 Klee Dienes <kdienes@bluegill.localnet> * ppc-macosx-frameinfo.c (ppc_parse_instructions): gcc3 has a new instruction 'mr r31,r12' in a function prologue. Ignore it. 2002-04-23 Klee Dienes <kdienes@bluegill.localnet> * ppc-macosx-regs.c (ppc_macosx_fetch_vp_registers) Process the vector data as unsigned integer, not as float (the Mach interface returns them as unsigned int as well). (ppc_macosx_store_vp_registers): Ditto. 2002-04-15 Jim Ingham <jingham@apple.com> * core-macho.c: Small cleanups to remove compiler warnings. * macosx-metrowerks.c: ditto. * nextstep-core.c: ditto. * nextstep-nat-cfm.c: ditto. * nextstep-nat-cfmthread.c: ditto. * nextstep-nat-dyld-info.c: ditto. * nextstep-nat-dyld-io.c: ditto. * nextstep-nat-dyld-path.c: ditto. * nextstep-nat-dyld-process.c: ditto. * nextstep-nat-dyld-process.h: ditto. * nextstep-nat-dyld.c: ditto. * nextstep-nat-excthread.c: ditto. * nextstep-nat-inferior-debug.c: ditto. * nextstep-nat-inferior-debug.h: ditto. * nextstep-nat-inferior-util.c: ditto. * nextstep-nat-inferior.c: ditto. * nextstep-nat-inferior.h: ditto. * nextstep-nat-info.c: ditto. * nextstep-nat-mutils.c: ditto. * nextstep-nat-sigthread.c: ditto. * nextstep-nat-threads.c: ditto. * nextstep-nat-watchpoint.c: ditto. * ppc-frameinfo.c: ditto. * ppc-frameops.c: ditto. * ppc-next-tdep.h: ditto. * ppc-tdep.h: ditto. 2002-04-11 Jim Ingham <jingham@apple.com> * nextstep-nat-dyld.c (dyld_lookup_and_bind_function): New function calls NSLookupAndBindSymbol on a function to make sure the module is bound before we try to call a function. * nextstep-nat-dyld.h: declare dyld_lookup_and_bind_function. * nextstep-nat-inferior.c (_initialize_next_inferior): Add dyld_lookup_and_bind_function to the child_ops. 2002-03-26 Jim Ingham <jingham@apple.com> * macosx-nat-dyld.c: (macosx_locate_dyld): New function, extract this functionality from macosx_set_start_breakpoint. Also, don't pass a null cleanup to do_cleanups. (dyld_starts_here_p): New function, again, refactoring for convenience. 2002-03-19 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-process.c: rearrange the include order to remove a few compiler warnings. * ppc-tdep.c (ppc_fast_show_stack_helper): Return 1 when you find only 1 frame, not 0 dummy... * ppc-frameinfo.c (ppc_parse_instructions): Fix a bug with handling the saveFP builtin function in prologues. 2002-03-19 Klee Dienes <klee@apple.com> * macosx-nat-inferior.c: Check incoming exceptions --- if the task receiving the exception is not the same as the one being debugged by GDB, reset the exception ports of the task back to the ones GDB saved for the target when it first started debugging; then resume the task. This isn't quite perfect, since ideally GDB would allow changes to the exception ports made by the target be reflected in children of the target as well; and also because it relies on being able to repeat an exception by simply continuing the child without modifying the program state (I think this should always work, but there may be cases I haven't thought of). 2002-03-19 Klee Dienes <klee@apple.com> * macosx-nat-dyld.c (dyld_info_process_raw); Treat ':' as a string terminator when reading library names from DYLD. 2002-03-14 James Ingham <jingham@inghji.apple.com> * ppc-tdep.c (ppc_fast_show_stack_helper): Use lookup_minimal_symbol to find _sigtramp, it is much more efficient than parse_and_eval_address... 2002-03-05 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld.c (dyld_starts_here_p): New function, does the memory passed in actually contain dyld? (macosx_locate_dyld): New function, find where dyld got loaded in this executable. (macosx_set_start_breakpoint): call macosx_locate_dyld. (dyld_lookup_address): use the slide set by macosx_locate_dyld. * macosx-nat-cfm.h: add cfm_update to silence compiler warnings. * macosx-nat-dyld-info.h: add dyld_objfile_info_compare. * macosx-nat-dyld-process.h: add dyld_parse_load_level and dyld_minimal_load_flag. * macosx-nat-dyld.h: remove macosx_start_dyld - it is never used or defined. 2002-02-26 James Ingham <jingham@inghji.apple.com> * macosx-nat-sigthread.c (macosx_signal_thread): Don't call pause in between pthread_testcancel calls, we never get a signal to wake us up... * macosx-nat-inferior.c (macosx_clear_pending_events): New function, clears out the pending event chain. (macosx_mourn_inferior): Call macosx_clear_pending_events. 2002-02-21 James Ingham <jingham@inghji.apple.com> * remote-kdp.c (kdp_resume): Fix signature of kdp_resume - should be a ptid_t for first argument, not an int... 2002-02-06 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-process.c (dyld_libraries_compatible): The prefix may be NULL, check this before comparing the contents. (dyld_objfile_move_load_data): copy the prefix over as well. * macosx-nat-dyld-info.c (dyld_objfile_entry_clear): The unset value for the prefix should be NULL, not "". 2002-01-25 James Ingham <jingham@inghji.apple.com> Create a queue of "pending events" to handle the case where we get more than one event from either Mach or BSD when the inferior stops. If we get more than one event, then we report them to the user serially, and each call to macosx_child_resume will fetch the next pending event till the queue is exhausted. Only then do we really resume the inferior. * macosx-nat-inferior-stubs.c: Fix child_wait to pass the client_data field. * macosx-nat-inferior-util.c (macosx_inferior_suspend_ptrace): Fix call to macosx_wait. * macosx-nat-inferior.h: Change declaration of macosx_wait. * macosx-nat-inferior.c: Include regcache.h to remove compiler warnings. Generalize the signal & exception handling functions so we can share them between the immediate event handling and the deferred servicing routines. Add the macosx_pending_event struct, queue, and handling functions. * kdp.c: change declaration of kdp_wait, and since the gdb_queue_event function is now exported, remove the copy of it from here. 2002-01-18 James Ingham <jingham@inghji.apple.com> * i386-macosx-nat-exec.c (fetch_inferior_registers): Fix a reference to the obsolete inferior_pid. (store_inferior_registers): ditto 2002-01-11 James Ingham <jingham@inghji.apple.com> * ppc-tdep.c (ppc_breakpoint_from_pc): Fixed a couple of places where we needed to switch BIG_ENDIAN for BFD_BIG_ENDIAN. 2001-12-07 James Ingham <jingham@inghji.apple.com> (From Bernard Semeria) * remote-kdp.c (kdp_attach): Use the version packet rather than hijacking the region packet to get the kdp version. * kdp-protocol.c (kdp_marshall, kdp_unmarshall): ditto. * kdp-protocol.h: ditto. 2001-12-03 James Ingham <jingham@inghji.apple.com> * macosx-nat-inferior.c: Format changes, more functions comply with the GNU coding conventions. Also added a few prototypes, and extern'ed some functions from exec.c to remove compiler warnings. * macosx-nat-inferior.c (macosx_set_auto_start_dyld): New function, used to dynamically switch the dyld breakpoint on and off. (_initialize_macosx_inferior): use macosx_set_auto_start_dyld. (macosx_process_events): drain both event sources here, not just the one you got the first hit on. We have more chance of handling extraneous events here than in macosx_child_resume... 2001-11-01 James Ingham <jingham@inghji.apple.com> * ppc-tdep.c (ppc_fast_show_stack_helper): Move most of the functionality into this function, and set it as the FAST_COUNT_STACK_DEPTH function, which is used in mi_cmd_info_stack_depth. * tm-ppc.h: Add define for FAST_COUNT_STACK_DEPTH 2001-10-31 James Ingham <jingham@inghji.apple.com> * ppc-tdep.c (ppc_fast_show_stack): New function. Run up the stack and return pc & fp for each frame, and a frame count. Since this doesn't build up the frame cache, it is much faster. (ppc_frame_find_pc): We were looking in the wrong place for the frame stored PC for signal frames. 2001-10-30 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-process.c (dyld_add_image_libraries): recognize BFD_MACH_O_LC_LOAD_WEAK_DYLIB; treat it like LC_LOAD_DYLIB for now. 2001-10-26 Klee Dienes <kdienes@apple.com> * macosx-nat-dyld-info.c (dyld_entry_out): Send the basename as the "path" field when talking via MI. The ProjectBuilder shared library dialog uses the pathname as the key for the table, so all entries without a "path" field were getting collapsed into one line in the table. The correct fix for this is to have PB used a different algorithm for building the table, but this fix should work well for now. * macosx-nat-dyld-process.c (dyld_load_library): Automatically load CFM fragments from memory, rather than trying to load from disk first. The only time we should be relying on the fragment name to match a disk file is when looking for xSym files. Trying to read from disk was taking extra time in the cases where the disk access failed, and the warning messages when it failed were distracting. * macosx-nat-dyld-.c (inferior_bfd_generic): Handle the case where a memory object is provided without a text string for the name (previously it would crash). 2001-10-23 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld.c (macosx_dyld_update): If you have turned off cfm with the inferior-auto-start-cfm variable, then don't call update-cfm when you update the libraries. 2001-10-17 James Ingham <jingham@inghji.apple.com> * ppc-tdep.c (ppc_frame_find_pc): Actually return the signal frame value. Dopey bug... (ppc_frame_saved_pc_after_call): remove spurious warning. This is always supposed to return the link register, and looking for the frame saved value is not relevant. (ppc_frame_chain_valid): Guard the call that reads the stack from errors. Callers don't expect ppc_frame_chain_valid to error out, but it can if the stack is mauled so that the fp is an unreadable address. * ppc-frameinfo.h: define safe_read_memory_unsigned_integer, so that ppc-tdep can use is. * ppc-frameinfo.c (ppc_parse_instructions): Don't assume that the pic base will use register 31. The dyld stub code uses 11, for instance. 2001-10-02 Jim Ingham (jingham@apple.com) and Jason Molenda (jmolenda@apple.com) * macosx-nat-inferior.c (macosx_fetch_event): Accept a third type of timeout: Check for an event to read, but don't block if there's nothing there. (macosx_process_events, macosx_child_resume): Update callers. 2001-08-06 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.c (safe_read_memory_unsigned_integer): The wrapped function has to return a value, or bad things happen... (ppc_frame_cache_properties): pass the function_end as the stop for the parsing, not the pc. This way we can correctly parse the prologue & figure out where we are EVEN IF the pc is in the prologue. 2001-08-03 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-info.c (dyld_entry_info): Check for e->loaded_name not null before passing to strrchr. 2001-08-02 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld.c (_initialize_macosx_nat_dyld): fix up doc strings. (macosx_init_dyld): Add a missing check for the ofile being NULL. 2001-08-02 Derek Kumar * remote-kdp.c: Added breakpoint packets, kdp-reattach and versioning support and kdp_mourn_inferior() 2001-07-31 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-process.c: The dyld code doesn't own the objfile for the executable. The generic gdb code keeps a pointer to this through the symfile_objfile pointer. So let the generic code handle the lifetime of the executable objfile. 2001-07-27 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.c (safe_read_memory_unsigned_integer): New function, safe version of read_memory_unsigned_int. (wrap_read_memory_unsigned_integer): This is the wrapper function. (ppc_parse_instructions): catch errors from read_memory_unsigned_integer, this gives us a much better chance of cleaning up from cases where the pc is off in unreadable memory. 2001-06-21 Klee Dienes <kdienes@localhost> * macosx-nat-dyld.c (section_info_helper): protect the CFM section of the code with #if WITH_CFM . 2001-06-14 James Ingham <jingham@gdbrulez.apple.com> * ppc-frameinfo.c (ppc_parse_instructions): properly sign extend the instruction offset from the "bl" instruction - the old way didn't work for CORE_ADDR = unsigned long long. * macosx-nat-dyld-path.c (dyld_resolve_image): check for name being null and don't crash. * macosx-nat-dyld-process.c (dyld_resolve_load_flag): Ditto... 2001-06-07 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.c (ppc_frame_cache_properties): protect against the case where we think the lr wasn't saved in a non-leaf function. * ppc-tdep.c (ppc_frame_find_pc): ditto. 2001-05-18 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.c (ppc_parse_instructions): Add a fallback if we don't recognize ANY valid prologue instructions. In that case, we are just guessing, but guess that the pc is stored on the stack, since this is usually the case. 2001-05-15 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-info.c (dyld_print_shlib_info): use dyld_entry_out to output the path, offset & slide in ui-out'ified form. (dyld_entry_string): Use dyld_entry_info. (dyld_entry_out): New function, format the path, offset & slide in ui-out. (dyld_entry_info): Generic function, returns path, offset & slide in separate fields, for use in dyld_entry_string & dyld_entry_out. 2001-05-10 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld.c (dyld_print_status_info): ui_out'ify the info messages so we don't spam the mi... * macosx-nat-dyld-info.c (dyld_print_shlib_info): ui_out'ify the output from info sharedlibrary. 2001-04-18 Jim Ingham <jingham@localhost.apple.com> * ppc-tdep.c (ppc_get_unsaved_pc): New function. How to get the frame's pc if it hasn't been saved in the frame. (ppc_frame_find_pc): Reworked the logic to better handle cases where the of the parent frame is in its prologue. (ppc_frame_chain_valid): If the frame pointer is null, we are at the end of the stack. Re-enable the code that does this check. Klee thinks this might cause trouble somewhere but can't remember where, and it is the right thing to do, so... * ppc-frameinfo.h: Removed the offset2 field, it was just for use IN ppc_parse_instructions. Added lr_invalid to handle prologues that temporarily invalidate the link register. * ppc-frameinfo.c (ppc_print_properties): mutatis mutandi for changes to the properties structure. (ppc_parse_instructions): Add support for the saveFP and saveVec gcc prolog setup routines. Also record WHEN the link register is stored in the frame so we can do a better job of backtraces while in the prolog. (ppc_clear_function_properties): mutatis mutandi for changes to the properties structure. 2001-02-21 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-process.c (dyld_load_library): If you get an error in getting the TEXT segment for a shlib, mark the entry as invalid. You can't free it, it wasn't malloc'ed... 2001-01-24 James Ingham <jingham@inghji.apple.com> * macosx-nat-inferior.c (macosx_fetch_task_info): Comment out the call to macosx_init_dyld_symfile. This caused gdb to reset shared library info when quitting. (macosx_child_stop): New function: don't use child_stop, it sends a kill (-pid, SIGINT) which doesn't work on MacOS X unless the inferior actually IS a process group leader. But apps in MacOS X almost never are (they are children of the WindowServer). initialize remote_async_terminal_ours_p to 1 - this reflects truth: gdb at startup DOES own the terminal. * remote-kdp.c: ditto. 2001-01-22 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.c (ppc_frame_cache_properties): Check that the frame's extra_info is set. 2000-11-07 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.c (ppc_parse_instructions): If the FIRST instruction of the prologue is a bl, we are probably NOT in the prologue. * ppc-tdep.c (ppc_frame_find_pc): In the case where we have no symbols, use the instruction parser to tell us whether the return address has been put on the stack yet or not. 2000-09-06 Jim Ingham <jingham@localhost> * macosx-nat-inferior-util.c: add WITH_CFM guards in the appropriate places. * macosx-nat-inferior.c: ditto * macosx-nat-inferior.h: ditto. 2000-09-05 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.c (ppc_parse_instructions): Cleanup a comment & remove an unused variable. 2000-09-01 James Ingham <jingham@inghji.apple.com> * ppc-frameinfo.h: Added a few comments. * ppc-frameinfo.c (ppc_parse_instructions): Detect the "save_world" stack setup routine that gcc uses for C++, and set up the props structure based on what it does. NB. This will break if gcc changes this routine, but there's not much I can do about this... 2000-08-09 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-path.c (build_suffix_name): new function, find full name including the DYLD_IMAGE_SUFFIX. (search_for_name_in_path): Pass in the suffix that comes from DYLD_IMAGE_SUFFIX, and use in search. (get_framework_pathname): pass in flag telling whether to use the image suffix, and use it. (dyld_resolve_image): use the image suffix in resolving the image path. (dyld_init_paths): Initialize the image_suffix from the environment. * macosx-nat-dyld-path.c: Add image_suffix to dyld_path_info struct. 2000-07-20 James Ingham <jingham@inghji.apple.com> * macosx-nat-inferior-debug.c: Add fflush to the inferior_stderr. There may be other places where this is needed as well, but we will chase them down as we find them. * macosx-nat-inferior.c: Open the inferior_stderr "w", not "w+", so the debugging output will work when gdb is running as pipe under another program. 2000-06-23 James Ingham <jingham@inghji.apple.com> * macosx-nat-dyld-process.c: Take out the call to build_objfile_section_table, since it only screwed up the section table, and had no other purpose...