+2008-03-26 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * objfiles.h (struct objfile): New GDBARCH member.
+ (get_objfile_arch): Add prototype.
+ * objfiles.c: Include "arch-utils.h".
+ (allocate_objfile): Look up gdbarch associated with bfd.
+ (get_objfile_arch): New function.
+ * Makefile (objfiles.o): Update dependencies.
+
+ * dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch
+ by objfile arch.
+ * dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch
+ by frame arch.
+ (locexpr_describe_location): Replace current_gdbarch by
+ objfile arch.
+ * dwarf2read.c (die_type): Replace current_gdbarch by objfile arch.
+ (dwarf2_add_field): Likewise.
+ (read_tag_pointer_type): Likewise.
+ (read_base_type): Likewise.
+ (new_symbol): Likewise.
+
+ * coffread.c (decode_type): Add OBJFILE argument. Update callers.
+ (decode_base_type, decode_function_type): Likewise.
+ (coff_read_struct_type, coff_read_enum_type): Likewise.
+ (coff_symtab_read): Replace current_gdbarch by objfile arch.
+ (decode_base_type): Likewise.
+ (coff_read_enum_type): Likewise.
+ (coff_read_struct_type): Replace current_objfile by OBJFILE argument.
+ (coff_read_enum_type): Likewise.
+
+ * dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch.
+ (end_psymtab): Likewise.
+ (process_one_symbol): Likewise.
+
+ * mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch.
+ (parse_procedure): Likewise.
+ (parse_partial_symbols): Likewise.
+
+ * somread.c (som_symtab_read): Replace current_gdbarch by objfile arch.
+
+ * stabsread.c (define_symbol): Replace current_gdbarch by objfile arch.
+ Replace static pcc_promotion_type and pcc_unsigned_promotion_type by
+ built-in types.
+ (read_range_type): Replace current_gdbarch by objfile arch. Replace
+ static range_index_type by built-in type.
+ (read_one_struct_field): Replace current_gdbarch by objfile arch.
+ (read_enum_type): Likewise.
+
+ * xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by
+ objfile arch.
+
+2008-03-26 Vladimir Prus <vladimir@codesourcery.com>
+
+ * varobj.h (varobj_floating_p): Declare.
+ * varobj.c (varobj_floating_p): New.
+ * mi/mi-cmd-var.c (mi_cmd_var_update): When passed
+ '@' as the name, update all floating varobjs.
+
+2008-03-26 Vladimir Prus <vladimir@codesourcery.com>
+
+ * varobj.c (struct varobj_root): Rename use_selected_frame to
+ floating, and clarify the meaning.
+ (varobj_create, varobj_update, new_root_variable): Adjust.
+ (value_of_root): Don't use type_changed as in variable,
+ adjust comment.
+ (c_value_of_root): Adjust.
+
+2008-03-25 Pedro Alves <pedro@codesourcery.com>
+
+ * linux-nat.c (linux_nat_attach): Add the pid we attached to, to
+ gdb's thread list.
+ (linux_nat_wait): Add main lwp to gdb's thread list.
+ * linux-thread-db.c (find_new_threads_callback): Also attach to
+ already listed threads which thread_db didn't know about yet.
+
+2008-03-25 Pedro Alves <pedro@codesourcery.com>
+
+ * linux-nat.c (drain_queued_events): Fix comment typo.
+ (linux_nat_attach): In async mode, don't rely on storing a pending
+ status. Instead place the wait status on the pipe.
+ (linux_nat_resume): Remove unreacheable shortcut code in async
+ mode.
+ (stop_wait_callback): In async mode, don't store pending status.
+ Instead, cancel breakpoints or resend the signal appropriatelly.
+ (cancel_breakpoint): New, refactored from
+ cancel_breakpoints_callback.
+ (cancel_breakpoints_callback): Call cancel_breakpoint.
+ (pipe_to_local_event_queue): Remove special token processing.
+ (linux_nat_wait): Issue an internal error if a pending status is
+ found in async mode.
+
+2008-03-24 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * inflow.c (gdb_has_a_terminal): Guard access to our_process_group.
+
+2008-03-24 Nick Roberts <nickrob@snap.net.nz>
+ Vladimir Prus <vladimir@codesourcery.com>
+
+ * varobj.c (struct varobj_root): New component thread_id.
+ (varobj_get_thread_id, check_scope): New functions.
+ (c_value_of_root): Use check_scope. Switch to the
+ proper thread if necessary.
+
+ * varobj.h (varobj_get_thread_id): New extern.
+
+ * mi/mi-cmd-var.c (print_varobj): Add thread-id field.
+
+2008-03-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR gdb/544
+ * top.c: Revert 2008-03-21 changes.
+
+2008-03-23 Vladimir Prus <vladimir@codesourcery.com>
+
+ * thread.c (make_cleanup_restore_current_thread): Make it
+ globally visible.
+ * gdbthread.h (make_cleanup_restore_current_thread): Declare.
+ * varobj.c (varobj_update): Don't save/restore frame.
+ (c_value_of_root): Save/restore thread and frame here,
+ using make_cleanup_restore_current_thread.
+ * Makefile.in: Update dependecies.
+
+2008-03-23 Vladimir Prus <vladimir@codesourcery.com>
+
+ * varobj.c (struct varobj_root): Clarify
+ comment on the frame field.
+ (varobj_create): Don't set frame if we have no
+ block.
+
+2008-03-21 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR gdb/544
+ Suggested by Jan Kratochvil:
+ * top.c (gdb_rl_operate_and_get_next_completion): Call
+ rl_redisplay_function.
+ (gdb_rl_redisplay): New.
+ (init_main): Set rl_redisplay_function.
+
+2008-03-21 Thomas Mittelstaedt <T.Mittelstaedt@cadenas.de> (tiny change)
+
+ * aix-thread.c (pdc_read_regs): Fix compiler warning.
+ (pdc_write_regs, aix_thread_resume, fetch_regs_kernel_thread)
+ (store_regs_kernel_thread): Likewise.
+
+2008-03-21 Pedro Alves <pedro@codesourcery.com>
+
+ Linux native async support.
+
+ * target.h (struct target_ops): Delete to_async_mask_value and add
+ to_async_mask.
+ (target_is_async_p, target_async): Formatting.
+ (target_async_mask_value): Delete.
+ (target_async_mask): Delete function declaration, and add new
+ target macro with the same name.
+
+ * target.c (update_current_target): Replace to_async_mask_value by
+ to_async_mask. Default to_async_mask to return_one.
+ (target_async_mask): Delete.
+ (find_default_can_async_p, find_default_is_async_p): New.
+ (init_dummy_target): register find_default_can_async_p and
+ find_default_is_async_p on the dummy target.
+
+ * linux-nat.c: Include inf-loop.h, event-loop.h and event-top.h.
+ (debug_linux_nat_async): New global.
+ (show_debug_linux_nat_async): New function.
+ (linux_nat_async_enabled, linux_nat_async_mask_value)
+ (linux_nat_event_pipe, linux_nat_num_queued_events)
+ (linux_nat_async_events_enabled): New globals.
+ (struct waitpid_result): New struct.
+ (waitpid_queue): New global.
+ (queued_waitpid, push_waitpid, drain_queued_events): New.
+ (my_waitpid): Call queued_waitpid.
+ (linux_child_follow_fork): Disable async events during the call.
+ (blocked_mask): Delete.
+ (sync_sigchld_action, async_sigchld_action): New globals.
+ (lin_lwp_attach_lwp): In sync mode, don't reblock SIGCHLD. In
+ async mode, block events during the call.
+ (linux_nat_create_inferior): New.
+ (linux_nat_attach): In sync mode, restore the mask states. In
+ async mode, wake the event loop immediatelly.
+ (detach_callback): Drain all queued events of the lwp we're
+ detaching from.
+ (linux_nat_detach): Block async mode, and drain events of the main
+ process.
+ (linux_nat_resume): If in async mode, mask async events during the
+ call. If short circuiting, force event loop to wake up. If
+ resuming, set target_executing, and register target events in the
+ event loop.
+ (pipe_to_local_event_queue, local_event_queue_to_pipe): New.
+ (linux_nat_wait): In async mode, block events during the call.
+ Only enable/disable passing SIGINT to the inferior in sync mode.
+ Get events from local waitpid queue. If no interesting events was
+ found, return to events loop. Reregister target events in the
+ event loop on exit. In sync mode, no need to reblock SIGCHLD.
+ (linux_nat_kill): Disable events on entry.
+ (linux_nat_mourn_inferior): In sync mode, don't restore the masks
+ here. Detach async mode from the event loop if there are no more
+ forks available, otherwise leave it on.
+ (sigchld_handler): Assure this is called only in sync mode.
+ (linux_async_permitted, linux_async_permitted_1): New globals.
+ (set_maintenance_linux_async_permitted)
+ (show_maintenance_linux_async_permitted): New functions.
+ (linux_nat_is_async_p, linux_nat_can_async_p)
+ (linux_nat_async_mask): New.
+ (linux_nat_event_pipe_pop, linux_nat_event_pipe_push): New.
+ (get_pending_events, async_sigchld_handler): New.
+ (linux_nat_async_events): New.
+ (async_terminal_is_ours): New global.
+ (linux_nat_terminal_inferior, linux_nat_terminal_ours): New.
+ (async_client_callback, async_client_context): New.
+ (linux_nat_async_file_handler, linux_nat_async)
+ (linux_nat_disable_async, linux_nat_enable_async): New.
+ (linux_nat_add_target): Register linux_nat_create_inferior,
+ linux_nat_can_async_p, linux_nat_is_async_p, linux_nat_async,
+ linux_nat_async_mask, linux_nat_terminal_inferior and
+ linux_nat_terminal_ours.
+ (_initialize_linux_nat): Remove local action variable, and update
+ code that used it to use sync_sigchld_action. Add new
+ "lin-lwp-async" debug set/show command. Put the "lin-lwp" debug
+ set/show command in the maintenance class. Add new "linux-async"
+ maintenance set/show command. Block SIGCHLD by default. Setup
+ async_sichld_action, and sync_sigchld_action. Install the default
+ async mode.
+ (lin_thread_get_thread_signals): Use a local sigset_t for blocking
+ the cancel signals.
+
+ * linux-thread-db.c (re_check_for_thread_db): New.
+ (clear_lwpid_callback): Handle TARGET_WAITKIND_IGNORE.
+ (thread_db_can_async_p, thread_db_is_async_p, thread_db_async)
+ (thread_db_async_mask): New.
+ (init_thread_db_ops): Register thread_db_can_async_p,
+ thread_db_is_async_p, thread_db_async and thread_db_async_mask.
+
+ * remote.c (remote_async_mask_value): New.
+ (remote_return_zero): New.
+ (init_remote_ops): Register remote_return_zero as callbacks of
+ to_can_async_p and to_is_async_p.
+ (remote_can_async_p, remote_is_async_p, remote_async): Update to
+ use remote_async_mask_value.
+ (remote_async_mask): New.
+ (init_remote_async_ops): Remove to_async_mask_value setting and
+ register remote_async_mask as to_async_mask callback in
+ remote_async_ops.
+
+ * Makefile.in (linux-nat.o): Update.
+
+2008-03-21 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdbthread.h (add_thread_with_info): New.
+ * linux-thread-db.c: Add some documentation.
+ (GET_LWP, GET_PID, GET_THREAD, is_lwp, is_thread, BUILD_LWP): Delete.
+ (struct private_thread_info): Remove th_valid and ti_valid.
+ Replace ti with tid.
+ (thread_get_info_callback): Do not add TID to the new ptid. Do
+ not cache th or ti.
+ (thread_db_map_id2thr, lwp_from_thread): Delete functions.
+ (thread_from_lwp): Assert that the LWP is set. Do not add TID to the
+ new PTID.
+ (attach_thread): Handle an already-existing thread. Use
+ add_thread_with_info. Cache the th and tid.
+ (detach_thread): Verify that private was set. Remove verbose
+ argument and printing. Update caller.
+ (thread_db_detach): Do not adjust inferior_ptid.
+ (clear_lwpid_callback, thread_db_resume, thread_db_kill): Delete.
+ (check_event, find_new_threads_callback): Do not add TID to the new PTID.
+ (thread_db_wait): Do not use lwp_from_thread.
+ (thread_db_pid_to_str): Use the cached TID.
+ (thread_db_extra_thread_info): Check that private is set.
+ (same_ptid_callback): Delete.
+ (thread_db_get_thread_local_address): Do not use it or check
+ is_thread. Check that private is set. Assume that the thread
+ handle is already cached.
+ (init_thread_db_ops): Remove to_resume and to_kill.
+ * thread.c (add_thread_with_info): New.
+ (add_thread): Use it.
+ * linux-nat.c (find_thread_from_lwp): Delete.
+ (exit_lwp): Do not use it. Check print_thread_events. Print before
+ deleting the thread.
+ (GET_PID, GET_LWP, BUILD_LWP, is_lwp): Move to...
+ * linux-nat.h (GET_PID, GET_LWP, BUILD_LWP, is_lwp): ...here.
+ * inf-ttrace.c (inf_ttrace_wait): Use print_thread_events and
+ printf_unfiltered for thread exits.
+ * procfs.c (procfs_wait): Likewise.
+
2008-03-21 Chris Demetriou <cgd@google.com>
* symtab.c (rbreak_command): Quote symbol name before passing