binutils-gdb/gdb/gdbserver/inferiors.h

158 lines
4.9 KiB
C
Raw Normal View History

Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
/* Inferior process information for the remote server for GDB.
Copyright (C) 1993-2016 Free Software Foundation, Inc.
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef INFERIORS_H
#define INFERIORS_H
/* Generic information for tracking a list of ``inferiors'' - threads,
processes, etc. */
struct inferior_list
{
struct inferior_list_entry *head;
struct inferior_list_entry *tail;
};
struct inferior_list_entry
{
ptid_t id;
struct inferior_list_entry *next;
};
struct thread_info;
struct regcache;
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
struct target_desc;
struct sym_cache;
struct breakpoint;
struct raw_breakpoint;
struct fast_tracepoint_jump;
struct process_info_private;
struct process_info
{
/* This must appear first.
The list iterator functions assume it. */
struct inferior_list_entry entry;
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
/* Nonzero if this child process was attached rather than
spawned. */
int attached;
/* True if GDB asked us to detach from this process, but we remained
attached anyway. */
int gdb_detached;
/* The symbol cache. */
struct sym_cache *symbol_cache;
/* The list of memory breakpoints. */
struct breakpoint *breakpoints;
/* The list of raw memory breakpoints. */
struct raw_breakpoint *raw_breakpoints;
/* The list of installed fast tracepoints. */
struct fast_tracepoint_jump *fast_tracepoint_jumps;
const struct target_desc *tdesc;
/* Private target data. */
struct process_info_private *priv;
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
};
Remove all_lwps global. * inferiors.h (ptid_of): Move here from linux-low.h. (pid_of, lwpid_of): Ditto. * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry" parameter is a struct thread_info * now. (aarch64_notify_debug_reg_change): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior instead of &all_lwps. (aarch64_stopped_data_address): Fetch lwpid from current_inferior directly. (aarch64_linux_prepare_to_resume): Fetch ptid from thread. (aarch64_arch_setup): Fetch lwpid from current_inferior directly. * linux-arm-low.c (update_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from current_inferior directly. (arm_insert_point): Pass &all_threads to find_inferior instead of &all_lwps. (arm_remove_point): Ditto. (arm_stopped_by_watchpoint): Fetch lwp from current_inferior. (arm_prepare_to_resume): Fetch pid from thread. (arm_read_description): Fetch lwpid from current_inferior directly. * linux-low.c (all_lwps): Delete. (delete_lwp): Delete call to remove_inferior. (handle_extended_wait): Fetch lwpid from thread. (add_lwp): Don't set lwp->entry.id. Remove call to add_inferior_to_list. (linux_attach_lwp_1): Fetch pid from current_inferior directly. (linux_kill_one_lwp): Fetch ptid,lwpid from thread. (kill_one_lwp_callback): Ditto. (linux_kill): Don't dereference NULL pointer. Fetch ptid,lwpid from thread. (get_detach_signal): Fetch ptid from thread. (linux_detach_one_lwp): Fetch ptid,lwpid from thread. Simplify call to regcache_invalidate_thread. (delete_lwp_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps. (status_pending_p_callback): Update, "entry" parameter is a struct thread_info * now. Fetch ptid from thread. (find_lwp_pid): Update, "entry" parameter is a struct thread_info * now. (linux_wait_for_lwp): Fetch pid from thread. (linux_fast_tracepoint_collecting): Fetch lwpid from thread. (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior. (enqueue_one_deferred_signal): Fetch lwpid from thread. (dequeue_one_deferred_signal): Ditto. (cancel_breakpoint): Fetch ptid from current_inferior. (linux_wait_for_event): Pass &all_threads to find_inferior, not &all_lwps. Fetch ptid, lwpid from thread. (count_events_callback): Update, "entry" parameter is a struct thread_info * now. (select_singlestep_lwp_callback): Ditto. (select_event_lwp_callback): Ditto. (cancel_breakpoints_callback): Ditto. (linux_cancel_breakpoints): Pass &all_threads to find_inferior, not &all_lwps. (select_event_lwp): Ditto. Fetch ptid from event_thread. (unsuspend_one_lwp): Update, "entry" parameter is a struct thread_info * now. (unsuspend_all_lwps): Pass &all_threads to find_inferior, not &all_lwps. (linux_stabilize_threads): Ditto. And for for_each_inferior. Fetch lwpid from thread, not lwp. (linux_wait_1): Fetch ptid, lwpid from current_inferior. Pass &all_threads to find_inferior, not &all_lwps. (send_sigstop): Fetch lwpid from thread, not lwp. (send_sigstop_callback): Update, "entry" parameter is a struct thread_info * now. (suspend_and_send_sigstop_callback): Ditto. (wait_for_sigstop): Ditto. Fetch ptid, lwpid from thread, lwp. (stuck_in_jump_pad_callback): Update, "entry" parameter is a struct thread_info * now. (move_out_of_jump_pad_callback): Ditto. Fetch ptid, lwpid from thread, lwp. (lwp_running): Update, "entry" parameter is a struct thread_info * now. (stop_all_lwps): Fetch ptid from thread. Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps. (linux_resume_one_lwp): Fetch lwpid from thread. (linux_set_resume_request): Update, "entry" parameter is a struct thread_info * now. Fetch pid, lwpid from thread. (resume_status_pending_p): Update, "entry" parameter is a struct thread_info * now. (need_step_over_p): Ditto. Fetch lwpid from thread. (start_step_over): Fetch lwpid from thread. (linux_resume_one_thread): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from thread. (linux_resume): Pass &all_threads to find_inferior, not &all_lwps. (proceed_one_lwp): Update, "entry" parameter is a struct thread_info * now. Fetch lwpid from thread. (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a struct thread_info * now. (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps. (unstop_all_lwps): Ditto. Fetch lwpid from thread. (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior directly. (regsets_store_inferior_registers): Ditto. (fetch_register, store_register): Ditto. (linux_read_memory, linux_write_memory): Ditto. (linux_request_interrupt): Ditto. (linux_read_auxv): Ditto. (linux_xfer_siginfo): Ditto. (linux_qxfer_spu): Ditto. (linux_qxfer_libraries_svr4): Ditto. * linux-low.h (ptid_of, pid_of, lwpid_of): Delete, moved to inferiors.h. (get_lwp): Delete. (get_thread_lwp): Update. (struct lwp_info): Delete member "entry". Simplify comment for member "thread". (all_lwps): Delete. * linux-mips-low.c (mips_read_description): Fetch lwpid from current_inferior directly. (update_watch_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (mips_linux_prepare_to_resume): Fetch ptid from thread. (mips_insert_point): Fetch lwpid from current_inferior. Pass &all_threads to find_inferior, not &all_lwps. (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps. (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior directly. (mips_stopped_data_address): Ditto. * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior directly. * linux-tile-low.c (tile_arch_setup): Ditto. * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread. (update_debug_registers_callback): Update, "entry" parameter is a struct thread_info * now. Fetch pid from thread. (i386_dr_low_set_addr): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior, not &all_lwps. (i386_dr_low_get_addr): Fetch ptid from current_inferior directly. (i386_dr_low_set_control): Fetch pid from current_inferior directly. Pass &all_threads to find_inferior, not &all_lwps. (i386_dr_low_get_control): Fetch ptid from current_inferior directly. (i386_dr_low_get_status): Ditto. (x86_linux_prepare_to_resume): Fetch ptid from thread. (x86_siginfo_fixup): Fetch lwpid from current_inferior directly. (x86_linux_read_description): Ditto. * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
2014-02-20 21:23:26 +01:00
#define ptid_of(inf) ((inf)->entry.id)
#define pid_of(inf) ptid_get_pid ((inf)->entry.id)
#define lwpid_of(inf) ptid_get_lwp ((inf)->entry.id)
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
/* Return a pointer to the process that corresponds to the current
Rename current_inferior as current_thread in gdbserver GDB has a function named "current_inferior" and gdbserver has a global variable named "current_inferior", but the two are not equivalent; indeed, gdbserver does not have any real equivalent of what GDB calls an inferior. What gdbserver's "current_inferior" is actually pointing to is a structure describing the current thread. This commit renames current_inferior as current_thread in gdbserver to clarify this. It also renames the function "set_desired_inferior" to "set_desired_thread" and renames various local variables from foo_inferior to foo_thread. gdb/gdbserver/ChangeLog: * inferiors.h (current_inferior): Renamed as... (current_thread): New variable. All uses updated. * linux-low.c (get_pc): Renamed saved_inferior as saved_thread. (maybe_move_out_of_jump_pad): Likewise. (cancel_breakpoint): Likewise. (linux_low_filter_event): Likewise. (wait_for_sigstop): Likewise. (linux_resume_one_lwp): Likewise. (need_step_over_p): Likewise. (start_step_over): Likewise. (linux_stabilize_threads): Renamed save_inferior as saved_thread. * linux-x86-low.c (x86_linux_update_xmltarget): Likewise. * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread and save_inferior as saved_thread. * regcache.c (get_thread_regcache): Renamed saved_inferior as saved_thread. (regcache_invalidate_thread): Likewise. * remote-utils.c (prepare_resume_reply): Likewise. * thread-db.c (thread_db_get_tls_address): Likewise. (disable_thread_event_reporting): Likewise. (remove_thread_event_breakpoints): Likewise. * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior as saved_thread. * target.h (set_desired_inferior): Renamed as... (set_desired_thread): New declaration. All uses updated. * server.c (myresume): Updated comment to reference thread instead of inferior. (handle_serial_event): Likewise. (handle_target_event): Likewise.
2014-09-10 11:37:11 +02:00
thread (current_thread). It is an error to call this if there is
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
no current thread selected. */
struct process_info *current_process (void);
struct process_info *get_thread_process (struct thread_info *);
extern struct inferior_list all_processes;
void add_inferior_to_list (struct inferior_list *list,
struct inferior_list_entry *new_inferior);
void for_each_inferior (struct inferior_list *list,
void (*action) (struct inferior_list_entry *));
Replace code accessing list implementation details with API calls. * dll.c (clear_dlls): Replace accessing list implemention details with API function. * gdbthread.h (get_first_thread): Declare. * inferiors.c (for_each_inferior_with_data): New function. (get_first_thread): New function. (find_thread_ptid): Simplify. (get_first_inferior): New function. (clear_list): Delete. (one_inferior_p): New function. (clear_inferior_list): New function. (clear_inferiors): Update. * inferiors.h (for_each_inferior_with_data): Declare. (clear_inferior_list): Declare. (one_inferior_p): Declare. (get_first_inferior): Declare. * linux-low.c (linux_wait_for_event): Replace accessing list implemention details with API function. * server.c (target_running): Ditto. (accumulate_file_name_length): New function. (emit_dll_description): New function. (handle_qxfer_libraries): Replace accessing list implemention details with API function. (handle_qxfer_threads_worker): New function. (handle_qxfer_threads_proper): Replace accessing list implemention details with API function. (handle_query): Ditto. (visit_actioned_threads_callback_ftype): New typedef. (visit_actioned_threads_data): New struct. (visit_actioned_threads): Rewrite to be find_inferior callback. (resume): Call find_inferior. (handle_status): Replace accessing list implemention details with API function. (process_serial_event): Replace accessing list implemention details with API function. * target.c (set_desired_inferior): Replace accessing list implemention details with API function. * tracepoint.c (same_process_p): New function. (gdb_agent_about_to_close): Replace accessing list implemention details with API function. * win32-low.c (child_delete_thread): Replace accessing list implemention details with API function. (match_dll_by_basename): New function. (dll_is_loaded_by_basename): New function. (win32_ensure_ntdll_loaded): Replace accessing list implemention details call to dll_is_loaded_by_basename.
2014-02-20 00:28:50 +01:00
void for_each_inferior_with_data
(struct inferior_list *list,
void (*action) (struct inferior_list_entry *, void *),
void *data);
void clear_inferior_list (struct inferior_list *list);
int one_inferior_p (struct inferior_list *list);
Teach GDBserver's Linux backend about no unwaited-for children (TARGET_WAITKIND_NO_RESUMED). GDBserver currently hangs forever in waitpid if the leader thread exits before other threads, or if all resumed threads exit - e.g., next over a thread exit with sched-locking on. This is exposed by leader-exit.exp. leader-exit.exp is part of a series of tests for a set of related problems. See <http://www.sourceware.org/ml/gdb-patches/2011-10/msg00704.html>: " To recap, on the Linux kernel, ptrace/waitpid don't allow reaping the leader thread until all other threads in the group are reaped. When the leader exits, it goes zombie, but waitpid will not return an exit status until the other threads are gone. This is presently exercised by the gdb.threads/leader-exit.exp test. The fix for that test, in linux-nat.c:wait_lwp, handles the case where we see the leader gone when we're stopping all threads to report an event to some other thread to the core. (...) The latter bit about not blocking if there no resumed threads in the process also applies to some other thread exiting, not just the main thread. E.g., this test starts a thread, and runs to a breakpoint in that thread: ... (gdb) c Continuing. [New Thread 0x7ffff75a4700 (LWP 23397)] [Switching to Thread 0x7ffff75a4700 (LWP 23397)] Breakpoint 2, thread_a (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/no-unwaited-for-left.c:28 28 return 0; /* break-here */ (gdb) info threads * 2 Thread 0x7ffff75a4700 (LWP 23397) thread_a (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/no-unwaited-for-left.c:28 1 Thread 0x7ffff7fcb720 (LWP 23391) 0x00007ffff7bc606d in pthread_join (threadid=140737343276800, thread_return=0x0) at pthread_join.c:89 The thread will exit as soon as we resume it. But if we only resume that thread, leaving the rest of the threads stopped: (gdb) set scheduler-locking on (gdb) c Continuing. ^C^C^C^C^C^C^C^C " This patch fixes the issues by implementing TARGET_WAITKIND_NO_RESUMED on GDBserver, similarly to what the patch above did for native Linux GDB. gdb.threads/leader-exit.exp now passes. gdb.threads/no-unwaited-for-left.exp now at least errors out instead of hanging: continue Continuing. warning: Remote failure reply: E.No unwaited-for children left. [Thread 15454] #1 stopped. 0x00000034cf408e60 in pthread_join (threadid=140737353922368, thread_return=0x0) at pthread_join.c:93 93 lll_wait_tid (pd->tid); (gdb) FAIL: gdb.threads/no-unwaited-for-left.exp: continue stops when the main thread exits The gdb.threads/non-ldr-exc-*.exp tests are skipped because GDBserver unfortunately doesn't support fork/exec yet, but I'm confident this fixes the related issues. I'm leaving modeling TARGET_WAITKIND_NO_RESUMED in the RSP for a separate pass. (BTW, in case of error in response to a vCont, it would be better for GDB to query the target for the current thread, or re-select one, instead of assuming current inferior_ptid is still the selected thread.) This implementation is a little different from GDB's, because I'm avoiding bringing in more of this broken use of waitpid(PID) into GDBserver. Specifically, this avoids waitpid(PID) when stopping all threads. There's really no need for wait_for_sigstop to wait for each LWP in turn. Instead, with some refactoring, we make it reuse linux_wait_for_event. gdb/gdbserver/ 2014-02-27 Pedro Alves <palves@redhat.com> PR 12702 * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New macros. * linux-low.c (delete_lwp, handle_extended_wait): Add debug output. (last_thread_of_process_p): Take a PID argument instead of a thread pointer. (linux_wait_for_lwp): Delete. (num_lwps, check_zombie_leaders, not_stopped_callback): New functions. (linux_low_filter_event): New function, party factored out from linux_wait_for_event. (linux_wait_for_event): Rename to ... (linux_wait_for_event_filtered): ... this. Add new filter ptid argument. Partly rewrite. Always use waitpid(-1, WNOHANG) and sigsuspend. Check for zombie leaders. (linux_wait_for_event): Reimplement as wrapper around linux_wait_for_event_filtered. (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED. Assume that if a normal or signal exit is seen, it's the whole process exiting. (wait_for_sigstop): No longer a for_each_inferior callback. Rewrite on top of linux_wait_for_event_filtered. (stop_all_lwps): Call wait_for_sigstop directly. * server.c (resume, handle_target_event): Handle TARGET_WAITKIND_NO_RESUMED.
2014-02-27 15:30:08 +01:00
/* Helper for ALL_INFERIORS_TYPE. Gets the next element starting at
CUR, if CUR is not NULL. */
#define A_I_NEXT(type, list, cur) \
((cur) != NULL \
? (type *) ((struct inferior_list_entry *) cur)->next \
: NULL)
/* Iterate over all inferiors of type TYPE in LIST, open loop
style. */
#define ALL_INFERIORS_TYPE(type, list, cur, tmp) \
for ((cur) = (type *) (list)->head, (tmp) = A_I_NEXT (type, list, cur); \
(cur) != NULL; \
(cur) = (tmp), (tmp) = A_I_NEXT (type, list, cur))
/* Iterate over all inferiors in LIST, open loop style. */
#define ALL_INFERIORS(list, cur, tmp) \
ALL_INFERIORS_TYPE (struct inferior_list_entry, list, cur, tmp)
/* Iterate over all processes, open loop style. */
#define ALL_PROCESSES(cur, tmp) \
ALL_INFERIORS_TYPE (struct process_info, &all_processes, cur, tmp)
Rename current_inferior as current_thread in gdbserver GDB has a function named "current_inferior" and gdbserver has a global variable named "current_inferior", but the two are not equivalent; indeed, gdbserver does not have any real equivalent of what GDB calls an inferior. What gdbserver's "current_inferior" is actually pointing to is a structure describing the current thread. This commit renames current_inferior as current_thread in gdbserver to clarify this. It also renames the function "set_desired_inferior" to "set_desired_thread" and renames various local variables from foo_inferior to foo_thread. gdb/gdbserver/ChangeLog: * inferiors.h (current_inferior): Renamed as... (current_thread): New variable. All uses updated. * linux-low.c (get_pc): Renamed saved_inferior as saved_thread. (maybe_move_out_of_jump_pad): Likewise. (cancel_breakpoint): Likewise. (linux_low_filter_event): Likewise. (wait_for_sigstop): Likewise. (linux_resume_one_lwp): Likewise. (need_step_over_p): Likewise. (start_step_over): Likewise. (linux_stabilize_threads): Renamed save_inferior as saved_thread. * linux-x86-low.c (x86_linux_update_xmltarget): Likewise. * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread and save_inferior as saved_thread. * regcache.c (get_thread_regcache): Renamed saved_inferior as saved_thread. (regcache_invalidate_thread): Likewise. * remote-utils.c (prepare_resume_reply): Likewise. * thread-db.c (thread_db_get_tls_address): Likewise. (disable_thread_event_reporting): Likewise. (remove_thread_event_breakpoints): Likewise. * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior as saved_thread. * target.h (set_desired_inferior): Renamed as... (set_desired_thread): New declaration. All uses updated. * server.c (myresume): Updated comment to reference thread instead of inferior. (handle_serial_event): Likewise. (handle_target_event): Likewise.
2014-09-10 11:37:11 +02:00
extern struct thread_info *current_thread;
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
void remove_inferior (struct inferior_list *list,
struct inferior_list_entry *entry);
Replace code accessing list implementation details with API calls. * dll.c (clear_dlls): Replace accessing list implemention details with API function. * gdbthread.h (get_first_thread): Declare. * inferiors.c (for_each_inferior_with_data): New function. (get_first_thread): New function. (find_thread_ptid): Simplify. (get_first_inferior): New function. (clear_list): Delete. (one_inferior_p): New function. (clear_inferior_list): New function. (clear_inferiors): Update. * inferiors.h (for_each_inferior_with_data): Declare. (clear_inferior_list): Declare. (one_inferior_p): Declare. (get_first_inferior): Declare. * linux-low.c (linux_wait_for_event): Replace accessing list implemention details with API function. * server.c (target_running): Ditto. (accumulate_file_name_length): New function. (emit_dll_description): New function. (handle_qxfer_libraries): Replace accessing list implemention details with API function. (handle_qxfer_threads_worker): New function. (handle_qxfer_threads_proper): Replace accessing list implemention details with API function. (handle_query): Ditto. (visit_actioned_threads_callback_ftype): New typedef. (visit_actioned_threads_data): New struct. (visit_actioned_threads): Rewrite to be find_inferior callback. (resume): Call find_inferior. (handle_status): Replace accessing list implemention details with API function. (process_serial_event): Replace accessing list implemention details with API function. * target.c (set_desired_inferior): Replace accessing list implemention details with API function. * tracepoint.c (same_process_p): New function. (gdb_agent_about_to_close): Replace accessing list implemention details with API function. * win32-low.c (child_delete_thread): Replace accessing list implemention details with API function. (match_dll_by_basename): New function. (dll_is_loaded_by_basename): New function. (win32_ensure_ntdll_loaded): Replace accessing list implemention details call to dll_is_loaded_by_basename.
2014-02-20 00:28:50 +01:00
struct inferior_list_entry *get_first_inferior (struct inferior_list *list);
/* Return the first process in the processes list. */
struct process_info *get_first_process (void);
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
struct process_info *add_process (int pid, int attached);
void remove_process (struct process_info *process);
struct process_info *find_process_pid (int pid);
int have_started_inferiors_p (void);
int have_attached_inferiors_p (void);
ptid_t thread_to_gdb_id (struct thread_info *);
ptid_t gdb_id_to_thread_id (ptid_t);
void clear_inferiors (void);
struct inferior_list_entry *find_inferior
(struct inferior_list *,
int (*func) (struct inferior_list_entry *,
void *),
void *arg);
struct inferior_list_entry *find_inferior_id (struct inferior_list *list,
ptid_t id);
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
void *inferior_target_data (struct thread_info *);
void set_inferior_target_data (struct thread_info *, void *);
struct regcache *inferior_regcache_data (struct thread_info *);
void set_inferior_regcache_data (struct thread_info *, struct regcache *);
Add missing new files from these previous commits: 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (handle_vFile, hostio_last_error_from_errno): Move to ... * hostio.h: ... this new file. * hostio.c, server.c, linux-low.c, nto-low.c, spu-low, win32-low.c: Include hostio.h. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (gdb_client_data, handler_func, callback_handler_func) (delete_file_handler, add_file_handler, append_callback_event) (delete_callback_event, start_event_loop, initialize_event_loop): Move to event-loop.h and include it. * event-loop.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h". * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls) (loaded_dll, unloaded_dll): Move to ... * dll.h: ... this new file. * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h". 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (current_process, get_thread_process, all_processes) (add_inferior_to_list, for_each_inferior, current_inferior) (remove_inferior, add_process, remove_process, find_process_pid) (have_started_inferiors_p, have_attached_inferiors_p) (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id) (clear_inferiors, find_inferior, find_inferior_id) (inferior_target_data, set_inferior_target_data) (inferior_regcache_data, set_inferior_regcache_data): Move to inferiors.h, and include it. * inferiors.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * ax.c, linux-low.c, linux-x86-low.c, server.c: Include tracepoint.h. * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing) (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing (handle_tracepoint_general_set, handle_tracepoint_query) (tracepoint_finished_step, tracepoint_was_hit) (release_while_stepping_state_list, current_traceframe) (in_readonly_region, traceframe_read_mem) (fetch_traceframe_registers, traceframe_read_sdata) (traceframe_read_info, struct fast_tpoint_collect_status) (fast_tracepoint_collecting, force_unlock_trace_buffer) (handle_tracepoit_bkpts, initialize_low_tracepoint) (supply_fast_tracepoint_registers) (supply_static_tracepoint_registers, set_trampoline_buffer_space) (ipa_tdesc, claim_trampoline_space) (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close) (agent_mem_read, agent_get_trace_state_variable_value) (agent_set_trace_state_variable_value, agent_tsv_read) (agent_mem_read_string, get_raw_reg_func_addr) (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ... * tracepoint.h: ... this new file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (perror_with_name, error, fatal, warning, paddress) (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and include it. * utils.h: New file. 2013-09-05 Pedro Alves <palves@redhat.com> * server.h (remote_debug, noack_mode, transport_is_reliable) (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio) (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif) (getpkt, remote_prepare, remote_open, remote_close, write_ok) (write_enn, initialize_async_io, enable_async_io) (disable_async_io, check_remote_input_interrupt_request) (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify) (dead_thread_notify, prepare_resume_reply) (decode_address_to_semicolon, decode_address, decode_m_packet) (decode_M_packet, decode_X_packet, decode_xfer_write) (decode_search_memory_packet, unhexify, hexify) (remote_escape_output, unpack_varlen_hex, clear_symbol_cache) (look_up_one_symbol, relocate_instruction) (monitor_output): Move to remote-utils.h, and include it. * remote-utils.h: New file.
2013-09-06 00:18:48 +02:00
#endif /* INFERIORS_H */