GDBserver

Macros | Typedefs | Functions | Variables
server.h File Reference
`#include "common-defs.h"`
`#include "version.h"`
`#include "buffer.h"`
`#include "xml-utils.h"`
`#include "regcache.h"`
`#include "gdb_signals.h"`
`#include "target.h"`
`#include "mem-break.h"`
`#include "gdbthread.h"`
`#include "inferiors.h"`
`#include "environ.h"`
`#include "event-loop.h"`
`#include "remote-utils.h"`
`#include "utils.h"`
`#include "debug.h"`
`#include "gdb_vecs.h"`

Go to the source code of this file.

## Macros
#define | PROG "gdbserver"
#define | MAXBUFBYTES(N) (((N)-32)/2)
#define | PBUFSIZ 16384
#define | UNKNOWN_SYSCALL (-1)
#define | ANY_SYSCALL (-2)

## Typedefs
typedef int | gdb_fildes_t

## Functions
| gdb_static_assert (sizeof(CORE_ADDR) >=sizeof(void *))
char * | strerror (int)
void | perror (const char *)
int | vasprintf (char **strp, const char *fmt, va_list ap)
int | vsnprintf (char *str, size_t size, const char *format, va_list ap)
void | initialize_low ()
void | handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
int | handle_serial_event (int err, gdb_client_data client_data)
int | handle_target_event (int err, gdb_client_data client_data)
void | discard_queued_stop_replies (ptid_t ptid)
int | in_queued_stop_replies (ptid_t ptid)
void | post_fork_inferior (int pid, const char *program)
gdb_environ * | get_environ ()

## Variables
ptid_t | cont_thread
ptid_t | general_thread
int | server_waiting
int | pass_signals []
int | program_signals []
int | program_signals_p
int | disable_packet_vCont
int | disable_packet_Tthread
int | disable_packet_qC
int | disable_packet_qfThreadInfo
char * | own_buf
int | run_once
int | multi_process
int | report_fork_events
int | report_vfork_events
int | report_exec_events
int | report_thread_events
int | non_stop
int | swbreak_feature
int | hwbreak_feature
int | disable_randomization
target_waitstatus | last_status
ptid_t | last_ptid
unsigned long | signal_pid

## Macro Definition Documentation

## ◆ ANY_SYSCALL

#define ANY_SYSCALL (-2)

Definition at line 150 of file server.h.

Referenced by gdb_catch_this_syscall_p(), and handle_general_set().

## ◆ MAXBUFBYTES

#define MAXBUFBYTES | ( |  | N | ) | (((N)-32)/2)

Definition at line 139 of file server.h.

## ◆ PBUFSIZ

#define PBUFSIZ 16384

Definition at line 144 of file server.h.

Referenced by captured_main(), cmd_qtbuffer(), handle_pread(), handle_query(), handle_qxfer(), hostio_reply_with_data(), init_target_desc(), notif_push(), and write_qxfer_response().

## ◆ PROG

#define PROG "gdbserver"

Definition at line 54 of file server.h.

Referenced by ax_vdebug().

## ◆ UNKNOWN_SYSCALL

#define UNKNOWN_SYSCALL (-1)

Definition at line 147 of file server.h.

Referenced by arm_get_syscall_trapinfo(), and get_syscall_trapinfo().

## Typedef Documentation

## ◆ gdb_fildes_t

typedef int gdb_fildes_t

Definition at line 113 of file server.h.

## Function Documentation

## ◆ discard_queued_stop_replies()

void discard_queued_stop_replies | ( | ptid_t | ptid | ) |

Definition at line 198 of file server.c.

References notif_stop, vstop_notif::ptid, QUEUE_iterate, and remove_all_on_match_ptid().

Referenced by captured_main(), detach_or_kill_for_exit(), handle_detach(), handle_v_kill(), kill_inferior_callback(), and remove_thread().

## ◆ gdb_static_assert()

gdb_static_assert | ( | sizeof(CORE_ADDR) >=sizeof(void *) |  | ) |

## ◆ get_environ()

gdb_environ* get_environ | ( |  | ) |

Definition at line 277 of file server.c.

References our_environ.

Referenced by linux_create_inferior(), lynx_create_inferior(), and spu_create_inferior().

## ◆ handle_serial_event()

int handle_serial_event | ( | int | err,
|  | gdb_client_data | client_data
| ) |  |

Definition at line 4365 of file server.c.

References debug_printf(), debug_threads, process_serial_event(), and set_desired_thread().

Referenced by handle_accept_event(), process_remaining(), and remote_open().

## ◆ handle_target_event()

int handle_target_event | ( | int | err,
|  | gdb_client_data | client_data
| ) |  |

Definition at line 4397 of file server.c.

References current_thread, debug_printf(), debug_threads, find_process_pid(), gdb_connected(), process_info::gdb_detached, last_ptid, thread_info::last_resume_kind, thread_info::last_status, last_status, mark_breakpoints_out(), minus_one_ptid, mywait(), null_ptid, process_info::pid, ptid_get_pid(), push_stop_notification(), report_no_resumed, set_desired_thread(), target_continue(), target_mourn_inferior(), target_pid_to_str(), and target_running().

Referenced by linux_async().

## ◆ handle_v_requests()

void handle_v_requests | ( | char * | own_buf,
|  | int | packet_len,
|  | int * | new_packet_len
| ) |  |

Definition at line 3093 of file server.c.

References disable_packet_vCont, extended_protocol, handle_notif_ack(), handle_v_attach(), handle_v_cont(), handle_v_kill(), handle_v_run(), handle_vFile(), multi_process, own_buf, target_ops::request_interrupt, startswith(), target_running(), target_supports_hardware_single_step, target_supports_range_stepping, target_supports_software_single_step, the_target, vCont_supported, write_enn(), and write_ok().

Referenced by look_up_one_symbol(), and process_serial_event().

## ◆ in_queued_stop_replies()

int in_queued_stop_replies | ( | ptid_t | ptid | ) |

Definition at line 238 of file server.c.

References in_queued_stop_replies_ptid(), notif_stop, vstop_notif::ptid, and QUEUE_iterate.

Referenced by linux_set_resume_request().

## ◆ initialize_low()

void initialize_low | ( |  | ) |

Definition at line 7567 of file linux-low.c.

References linux_target_ops::arch_setup, init_registers_spu(), initialize_low_arch(), linux_check_ptrace_features(), linux_ptrace_init_warnings(), memset(), set_target_ops(), sigchld_handler(), spu_target_ops, the_low_target, and TRACE.

Referenced by captured_main().

## ◆ perror()

void perror | ( | const char * |  | ) |

Definition at line 24 of file wincecompat.c.

References strwinerror().

Referenced by lynx_fetch_registers(), lynx_store_registers(), postfork_child_hook(), putpkt_binary_1(), and readchar().

## ◆ post_fork_inferior()

void post_fork_inferior | ( | int | pid,
|  | const char * | program
| ) |  |

Definition at line 97 of file fork-child.c.

References current_thread, last_ptid, thread_info::last_resume_kind, thread_info::last_status, last_status, signal_pid, START_INFERIOR_TRAPS_EXPECTED, startup_inferior(), and target_post_create_inferior.

Referenced by linux_create_inferior(), lynx_create_inferior(), and spu_create_inferior().

## ◆ strerror()

char* strerror | ( | int |  | ) |

Referenced by attach_proc_task_lwp_callback(), delete_fast_tracepoint_jump(), gdb_connect_sync_socket(), initialize_fast_tracepoint_trampoline_buffer(), insert_memory_breakpoint(), linux_detach_one_lwp(), linux_kill_one_lwp(), linux_wait_for_event_filtered(), lynx_attach(), nto_resume(), nto_xfer_memory(), perror_with_name(), reinsert_fast_tracepoint_jumps_at(), remove_memory_breakpoint(), safe_strerror(), set_fast_tracepoint_jump(), spu_attach(), and uninsert_fast_tracepoint_jumps_at().

## ◆ vasprintf()

int vasprintf | ( | char ** | strp,
|  | const char * | fmt,
|  | va_list | ap
| ) |  |

Referenced by xstrvprintf().

## ◆ vsnprintf()

int vsnprintf | ( | char * | str,
|  | size_t | size,
|  | const char * | format,
|  | va_list | ap
| ) |  |

Referenced by string_printf(), string_vappendf(), string_vprintf(), and xsnprintf().

## Variable Documentation

## ◆ cont_thread

ptid_t cont_thread

Definition at line 75 of file server.c.

Referenced by captured_main(), myresume(), prefork_hook(), and process_serial_event().

## ◆ disable_packet_qC

int disable_packet_qC

Definition at line 131 of file server.c.

Referenced by captured_main(), and handle_query().

## ◆ disable_packet_qfThreadInfo

int disable_packet_qfThreadInfo

Definition at line 132 of file server.c.

Referenced by captured_main(), and handle_query().

## ◆ disable_packet_Tthread

int disable_packet_Tthread

Definition at line 130 of file server.c.

Referenced by captured_main(), and prepare_resume_reply().

## ◆ disable_packet_vCont

int disable_packet_vCont

Definition at line 129 of file server.c.

Referenced by captured_main(), and handle_v_requests().

## ◆ disable_randomization

int disable_randomization

Definition at line 109 of file server.c.

Referenced by captured_main(), handle_general_set(), linux_create_inferior(), and maybe_disable_address_space_randomization::maybe_disable_address_space_randomization().

## ◆ general_thread

ptid_t general_thread

Definition at line 78 of file server.c.

Referenced by done_accessing_memory(), handle_btrace_conf_general_set(), handle_btrace_general_set(), handle_query(), handle_qxfer_btrace(), handle_qxfer_btrace_conf(), handle_status(), handle_v_run(), prepare_resume_reply(), prepare_to_access_memory(), process_serial_event(), and set_desired_thread().

## ◆ hwbreak_feature

int hwbreak_feature

Definition at line 100 of file server.c.

Referenced by captured_main(), handle_query(), and prepare_resume_reply().

## ◆ last_ptid

ptid_t last_ptid

Definition at line 136 of file server.c.

Referenced by attach_inferior(), captured_main(), handle_detach(), handle_pending_status(), handle_status(), handle_target_event(), handle_v_attach(), handle_v_kill(), handle_v_run(), post_fork_inferior(), process_serial_event(), resume(), and startup_inferior().

## ◆ last_status

target_waitstatus last_status

Definition at line 135 of file server.c.

Referenced by attach_inferior(), captured_main(), handle_detach(), handle_pending_status(), handle_status(), handle_target_event(), handle_v_attach(), handle_v_kill(), handle_v_run(), post_fork_inferior(), process_serial_event(), and resume().

## ◆ multi_process

int multi_process

Definition at line 89 of file server.c.

Referenced by captured_main(), handle_detach(), handle_query(), handle_v_kill(), handle_v_requests(), prepare_resume_reply(), and write_ptid().

## ◆ non_stop

int non_stop

Definition at line 98 of file server.c.

Referenced by attach_inferior(), captured_main(), handle_detach(), handle_general_set(), handle_status(), handle_v_attach(), handle_v_run(), linux_attach(), linux_done_accessing_memory(), linux_prepare_to_access_memory(), linux_resume(), linux_wait_1(), prepare_resume_reply(), resume(), select_event_lwp(), and target_stop_and_wait().

## ◆ own_buf

char* own_buf

Definition at line 138 of file server.c.

Referenced by captured_main(), cmd_bigqtbuffer_circular(), cmd_bigqtbuffer_size(), cmd_qtbuffer(), cmd_qtdisconnected(), cmd_qtdp(), cmd_qtdpsrc(), cmd_qtdv(), cmd_qtenable_disable(), cmd_qtframe(), cmd_qtnotes(), cmd_qtp(), cmd_qtro(), cmd_qtv(), handle_btrace_conf_general_set(), handle_btrace_general_set(), handle_close(), handle_detach(), handle_fstat(), handle_general_set(), handle_monitor_command(), handle_notif_ack(), handle_open(), handle_pending_status(), handle_pread(), handle_pwrite(), handle_query(), handle_qxfer(), handle_qxfer_btrace(), handle_qxfer_btrace_conf(), handle_readlink(), handle_search_memory(), handle_setfs(), handle_status(), handle_unlink(), handle_v_attach(), handle_v_cont(), handle_v_kill(), handle_v_requests(), handle_v_run(), handle_vFile(), hostio_error(), hostio_packet_error(), hostio_reply(), hostio_reply_with_data(), install_tracepoint(), look_up_one_symbol(), notif_write_event(), process_serial_event(), relocate_instruction(), resume(), and vstop_notif_reply().

## ◆ pass_signals

int pass_signals[]

Definition at line 115 of file server.c.

Referenced by handle_general_set(), and linux_wait_1().

## ◆ program_signals

int program_signals[]

Definition at line 116 of file server.c.

Referenced by get_detach_signal(), and handle_general_set().

## ◆ program_signals_p

int program_signals_p

Definition at line 117 of file server.c.

Referenced by get_detach_signal(), and handle_general_set().

## ◆ report_exec_events

int report_exec_events

Definition at line 92 of file server.c.

Referenced by captured_main(), handle_extended_wait(), handle_query(), linux_low_ptrace_options(), and prepare_resume_reply().

## ◆ report_fork_events

int report_fork_events

Definition at line 90 of file server.c.

Referenced by captured_main(), handle_query(), linux_low_ptrace_options(), and prepare_resume_reply().

## ◆ report_thread_events

int report_thread_events

Definition at line 93 of file server.c.

Referenced by filter_exit_event(), handle_extended_wait(), handle_general_set(), linux_low_filter_event(), and prepare_resume_reply().

## ◆ report_vfork_events

int report_vfork_events

Definition at line 91 of file server.c.

Referenced by captured_main(), handle_query(), linux_low_ptrace_options(), and prepare_resume_reply().

## ◆ run_once

int run_once

Definition at line 87 of file server.c.

Referenced by captured_main(), and handle_accept_event().

## ◆ server_waiting

int server_waiting

Definition at line 80 of file server.c.

Referenced by handle_output_debug_string(), mywait(), and spu_wait().

## ◆ signal_pid

unsigned long signal_pid

Definition at line 124 of file server.c.

Referenced by attach_inferior(), handle_v_kill(), linux_request_interrupt(), and post_fork_inferior().

## ◆ swbreak_feature

int swbreak_feature

Definition at line 99 of file server.c.

Referenced by captured_main(), handle_query(), linux_wait_1(), and prepare_resume_reply().