GDBserver
Classes | Macros | Typedefs | Functions | Variables
server.c File Reference
#include "server.h"
#include "gdbthread.h"
#include "agent.h"
#include "notif.h"
#include "tdesc.h"
#include "rsp-low.h"
#include "signals-state-save-restore.h"
#include <ctype.h>
#include <unistd.h>
#include "gdb_vecs.h"
#include "gdb_wait.h"
#include "btrace-common.h"
#include "filestuff.h"
#include "tracepoint.h"
#include "dll.h"
#include "hostio.h"
#include <vector>
#include "common-inferior.h"
#include "job-control.h"
#include "environ.h"
#include "common/selftest.h"

Go to the source code of this file.

Classes

struct  vstop_notif
 
struct  qxfer
 

Macros

#define require_running_or_return(BUF)
 
#define require_running_or_break(BUF)
 
#define SEARCH_CHUNK_SIZE   16000
 

Typedefs

typedef int() visit_actioned_threads_callback_ftype(const struct thread_resume *, struct thread_info *)
 

Functions

 DEFINE_QUEUE_P (notif_event_p)
 
static void queue_stop_reply (ptid_t ptid, struct target_waitstatus *status)
 
static int remove_all_on_match_ptid (QUEUE(notif_event_p) *q, QUEUE_ITER(notif_event_p) *iter, struct notif_event *event, void *data)
 
void discard_queued_stop_replies (ptid_t ptid)
 
static void vstop_notif_reply (struct notif_event *event, char *own_buf)
 
static int in_queued_stop_replies_ptid (QUEUE(notif_event_p) *q, QUEUE_ITER(notif_event_p) *iter, struct notif_event *event, void *data)
 
int in_queued_stop_replies (ptid_t ptid)
 
static int target_running (void)
 
const char * get_exec_wrapper ()
 
char * get_exec_file (int err)
 
gdb_environget_environ ()
 
static int attach_inferior (int pid)
 
static int decode_xfer_read (char *buf, CORE_ADDR *ofs, unsigned int *len)
 
static int decode_xfer (char *buf, char **object, char **rw, char **annex, char **offset)
 
static int write_qxfer_response (char *buf, const gdb_byte *data, int len, int is_more)
 
static const char * handle_btrace_enable_bts (struct thread_info *thread)
 
static const char * handle_btrace_enable_pt (struct thread_info *thread)
 
static const char * handle_btrace_disable (struct thread_info *thread)
 
static int handle_btrace_general_set (char *own_buf)
 
static int handle_btrace_conf_general_set (char *own_buf)
 
static void handle_general_set (char *own_buf)
 
static const char * get_features_xml (const char *annex)
 
static void monitor_show_help (void)
 
static int gdb_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 
static int gdb_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
 
static int handle_search_memory_1 (CORE_ADDR start_addr, CORE_ADDR search_space_len, gdb_byte *pattern, unsigned pattern_len, gdb_byte *search_buf, unsigned chunk_size, unsigned search_buf_size, CORE_ADDR *found_addrp)
 
static void handle_search_memory (char *own_buf, int packet_len)
 
static void handle_detach (char *own_buf)
 
static char * parse_debug_format_options (const char *arg, int is_monitor)
 
static void handle_monitor_command (char *mon, char *own_buf)
 
static int handle_qxfer_auxv (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_exec_file (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_features (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_libraries (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_libraries_svr4 (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_osdata (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_siginfo (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_spu (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_statictrace (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static void handle_qxfer_threads_worker (thread_info *thread, struct buffer *buffer)
 
static void handle_qxfer_threads_proper (struct buffer *buffer)
 
static int handle_qxfer_threads (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_traceframe_info (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_fdpic (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_btrace (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer_btrace_conf (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 
static int handle_qxfer (char *own_buf, int packet_len, int *new_packet_len_p)
 
static unsigned long long crc32 (CORE_ADDR base, int len, unsigned int crc)
 
static void supported_btrace_packets (char *buf)
 
static void handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
 
static void gdb_wants_all_threads_stopped (void)
 
static void resume (struct thread_resume *actions, size_t n)
 
static bool visit_actioned_threads (thread_info *thread, const struct thread_resume *actions, size_t num_actions, visit_actioned_threads_callback_ftype *callback)
 
static int handle_pending_status (const struct thread_resume *resumption, struct thread_info *thread)
 
static void handle_v_cont (char *own_buf)
 
static int handle_v_attach (char *own_buf)
 
static int handle_v_run (char *own_buf)
 
static int handle_v_kill (char *own_buf)
 
void handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
 
static void myresume (char *own_buf, int step, int sig)
 
static void queue_stop_reply_callback (thread_info *thread)
 
static void gdb_wants_thread_stopped (thread_info *thread)
 
static void set_pending_status_callback (thread_info *thread)
 
static void handle_status (char *own_buf)
 
static void gdbserver_version (void)
 
static void gdbserver_usage (FILE *stream)
 
static void gdbserver_show_disableable (FILE *stream)
 
static void kill_inferior_callback (process_info *process)
 
static void detach_or_kill_for_exit (void)
 
static void detach_or_kill_for_exit_cleanup (void *ignore)
 
static void ATTRIBUTE_NORETURN captured_main (int argc, char *argv[])
 
int main (int argc, char *argv[])
 
static void process_point_options (struct gdb_breakpoint *bp, const char **packet)
 
static int process_serial_event (void)
 
int handle_serial_event (int err, gdb_client_data client_data)
 
static void push_stop_notification (ptid_t ptid, struct target_waitstatus *status)
 
int handle_target_event (int err, gdb_client_data client_data)
 

Variables

static gdb_environ our_environ
 
int startup_with_shell = 1
 
ptid_t cont_thread
 
ptid_t general_thread
 
int server_waiting
 
static int extended_protocol
 
static int response_needed
 
static int exit_requested
 
int run_once
 
int multi_process
 
int report_fork_events
 
int report_vfork_events
 
int report_exec_events
 
int report_thread_events
 
static int report_no_resumed
 
int non_stop
 
int swbreak_feature
 
int hwbreak_feature
 
static int vCont_supported
 
int disable_randomization = 1
 
static char * program_name = NULL
 
static std::vector< char * > program_args
 
static std::string wrapper_argv
 
int pass_signals [GDB_SIGNAL_LAST]
 
int program_signals [GDB_SIGNAL_LAST]
 
int program_signals_p
 
unsigned long signal_pid
 
int disable_packet_vCont
 
int disable_packet_Tthread
 
int disable_packet_qC
 
int disable_packet_qfThreadInfo
 
struct target_waitstatus last_status
 
ptid_t last_ptid
 
char * own_buf
 
static unsigned char * mem_buf
 
static struct btrace_config current_btrace_conf
 
struct notif_server notif_stop
 
int remote_debug
 
static const struct qxfer qxfer_packets []
 
static int exit_code
 

Macro Definition Documentation

◆ require_running_or_break

#define require_running_or_break (   BUF)
Value:
if (!target_running ()) \
{ \
write_enn (BUF); \
break; \
}
static int target_running(void)
Definition: server.c:250

Definition at line 52 of file server.c.

Referenced by process_serial_event().

◆ require_running_or_return

#define require_running_or_return (   BUF)
Value:
if (!target_running ()) \
{ \
write_enn (BUF); \
return; \
}
static int target_running(void)
Definition: server.c:250

Definition at line 45 of file server.c.

Referenced by handle_detach(), and handle_query().

◆ SEARCH_CHUNK_SIZE

#define SEARCH_CHUNK_SIZE   16000

Referenced by handle_search_memory().

Typedef Documentation

◆ visit_actioned_threads_callback_ftype

typedef int() visit_actioned_threads_callback_ftype(const struct thread_resume *, struct thread_info *)

Definition at line 2679 of file server.c.

Function Documentation

◆ attach_inferior()

static int attach_inferior ( int  pid)
static

◆ captured_main()

static void ATTRIBUTE_NORETURN captured_main ( int  argc,
char *  argv[] 
)
static

◆ crc32()

static unsigned long long crc32 ( CORE_ADDR  base,
int  len,
unsigned int  crc 
)
static

Definition at line 2094 of file server.c.

References read_inferior_memory().

Referenced by handle_query().

◆ decode_xfer()

static int decode_xfer ( char *  buf,
char **  object,
char **  rw,
char **  annex,
char **  offset 
)
static

Definition at line 333 of file server.c.

References offset.

Referenced by handle_qxfer().

◆ decode_xfer_read()

static int decode_xfer_read ( char *  buf,
CORE_ADDR ofs,
unsigned int *  len 
)
static

Definition at line 323 of file server.c.

References decode_m_packet().

Referenced by handle_qxfer().

◆ DEFINE_QUEUE_P()

DEFINE_QUEUE_P ( notif_event_p  )

◆ detach_or_kill_for_exit()

static void detach_or_kill_for_exit ( void  )
static

◆ detach_or_kill_for_exit_cleanup()

static void detach_or_kill_for_exit_cleanup ( void *  ignore)
static

Definition at line 3531 of file server.c.

References CATCH, detach_or_kill_for_exit(), END_CATCH, exit_code, RETURN_MASK_ALL, and TRY.

Referenced by captured_main().

◆ discard_queued_stop_replies()

void discard_queued_stop_replies ( ptid_t  ptid)

◆ gdb_read_memory()

static int gdb_read_memory ( CORE_ADDR  memaddr,
unsigned char *  myaddr,
int  len 
)
static

◆ gdb_wants_all_threads_stopped()

static void gdb_wants_all_threads_stopped ( void  )
static

Definition at line 3283 of file server.c.

References for_each_thread(), and gdb_wants_thread_stopped().

Referenced by handle_status(), and resume().

◆ gdb_wants_thread_stopped()

static void gdb_wants_thread_stopped ( thread_info thread)
static

Definition at line 3267 of file server.c.

References thread_info::last_resume_kind, and thread_info::last_status.

Referenced by gdb_wants_all_threads_stopped().

◆ gdb_write_memory()

static int gdb_write_memory ( CORE_ADDR  memaddr,
const unsigned char *  myaddr,
int  len 
)
static

◆ gdbserver_show_disableable()

static void gdbserver_show_disableable ( FILE *  stream)
static

Definition at line 3458 of file server.c.

Referenced by captured_main().

◆ gdbserver_usage()

static void gdbserver_usage ( FILE *  stream)
static

Definition at line 3398 of file server.c.

References REPORT_BUGS_TO.

Referenced by captured_main().

◆ gdbserver_version()

static void gdbserver_version ( void  )
static

Definition at line 3387 of file server.c.

References host_name, PKGVERSION, and version.

Referenced by captured_main().

◆ 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().

◆ get_exec_file()

char* get_exec_file ( int  err)

Definition at line 266 of file server.c.

References _, error(), and program_name.

Referenced by fork_inferior().

◆ get_exec_wrapper()

const char* get_exec_wrapper ( )

Definition at line 258 of file server.c.

References wrapper_argv.

Referenced by execv_argv::init_for_shell(), and startup_inferior().

◆ get_features_xml()

static const char* get_features_xml ( const char *  annex)
static

Definition at line 905 of file server.c.

References current_target_desc(), tdesc_get_features_xml(), and xml_builtin.

Referenced by handle_qxfer_features().

◆ handle_btrace_conf_general_set()

static int handle_btrace_conf_general_set ( char *  own_buf)
static

◆ handle_btrace_disable()

static const char* handle_btrace_disable ( struct thread_info thread)
static

Definition at line 416 of file server.c.

References thread_info::btrace, and target_disable_btrace.

Referenced by handle_btrace_general_set().

◆ handle_btrace_enable_bts()

static const char* handle_btrace_enable_bts ( struct thread_info thread)
static

◆ handle_btrace_enable_pt()

static const char* handle_btrace_enable_pt ( struct thread_info thread)
static

◆ handle_btrace_general_set()

static int handle_btrace_general_set ( char *  own_buf)
static

◆ handle_detach()

static void handle_detach ( char *  own_buf)
static

◆ handle_general_set()

static void handle_general_set ( char *  own_buf)
static

◆ handle_monitor_command()

static void handle_monitor_command ( char *  mon,
char *  own_buf 
)
static

◆ handle_pending_status()

static int handle_pending_status ( const struct thread_resume resumption,
struct thread_info thread 
)
static

Definition at line 2714 of file server.c.

References last_ptid, last_status, own_buf, prepare_resume_reply(), and thread_resume::thread.

Referenced by resume().

◆ handle_query()

static void handle_query ( char *  own_buf,
int  packet_len,
int *  new_packet_len_p 
)
static

Definition at line 2144 of file server.c.

References all_threads, process_info::attached, crc32(), current_process(), current_thread, decode_address(), disable_packet_qC, disable_packet_qfThreadInfo, find_any_thread_of_pid(), find_process_pid(), find_thread_ptid(), free(), general_thread, target_ops::get_tib_address, target_ops::get_tls_address, target_ops::handle_monitor_command, handle_monitor_command(), handle_qxfer(), handle_search_memory(), handle_tracepoint_query(), hex2bin(), hostio_handle_new_gdb_connection(), hwbreak_feature, target_ops::look_up_symbols, minus_one_ptid, multi_process, null_ptid, own_buf, paddress(), PBUFSIZ, process_info::pid, target_ops::pid_to_exec_file, ptid_get_pid(), target_ops::qxfer_libraries_svr4, target_ops::qxfer_osdata, target_ops::qxfer_siginfo, target_ops::qxfer_spu, target_ops::read_auxv, target_ops::read_loadmap, target_ops::read_offsets, read_ptid(), report_exec_events, report_fork_events, report_no_resumed, report_vfork_events, require_running_or_return, startswith(), supported_btrace_packets(), swbreak_feature, target_handle_new_gdb_connection, target_process_qsupported, target_supports_agent, target_supports_catch_syscall, target_supports_disable_randomization, target_supports_exec_events, target_supports_fast_tracepoints, target_supports_fork_events, target_supports_hardware_single_step, target_supports_multi_process(), target_supports_non_stop, target_supports_software_single_step, target_supports_stopped_by_hw_breakpoint, target_supports_stopped_by_sw_breakpoint, target_supports_tracepoints, target_supports_vfork_events, the_target, tracepoint_look_up_symbols(), transport_is_reliable, unpack_varlen_hex(), validate_breakpoints(), vCont_supported, write_enn(), write_ok(), write_ptid(), XRESIZEVEC, and xstrdup().

Referenced by process_serial_event().

◆ handle_qxfer()

static int handle_qxfer ( char *  own_buf,
int  packet_len,
int *  new_packet_len_p 
)
static

◆ handle_qxfer_auxv()

static int handle_qxfer_auxv ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1441 of file server.c.

References current_thread, offset, target_ops::read_auxv, and the_target.

◆ handle_qxfer_btrace()

static int handle_qxfer_btrace ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

◆ handle_qxfer_btrace_conf()

static int handle_qxfer_btrace_conf ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

◆ handle_qxfer_exec_file()

static int handle_qxfer_exec_file ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

◆ handle_qxfer_fdpic()

static int handle_qxfer_fdpic ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1805 of file server.c.

References current_thread, offset, target_ops::read_loadmap, and the_target.

◆ handle_qxfer_features()

static int handle_qxfer_features ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1504 of file server.c.

References get_features_xml(), offset, and target_running().

◆ handle_qxfer_libraries()

static int handle_qxfer_libraries ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1537 of file server.c.

References all_dlls, current_thread, offset, string, and string_printf().

◆ handle_qxfer_libraries_svr4()

static int handle_qxfer_libraries_svr4 ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1570 of file server.c.

References current_thread, offset, target_ops::qxfer_libraries_svr4, and the_target.

◆ handle_qxfer_osdata()

static int handle_qxfer_osdata ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1586 of file server.c.

References offset, target_ops::qxfer_osdata, and the_target.

◆ handle_qxfer_siginfo()

static int handle_qxfer_siginfo ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1599 of file server.c.

References current_thread, offset, target_ops::qxfer_siginfo, and the_target.

◆ handle_qxfer_spu()

static int handle_qxfer_spu ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1615 of file server.c.

References current_thread, offset, target_ops::qxfer_spu, and the_target.

◆ handle_qxfer_statictrace()

static int handle_qxfer_statictrace ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

Definition at line 1631 of file server.c.

References current_thread, current_traceframe, offset, and traceframe_read_sdata().

◆ handle_qxfer_threads()

static int handle_qxfer_threads ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

◆ handle_qxfer_threads_proper()

static void handle_qxfer_threads_proper ( struct buffer buffer)
static

◆ handle_qxfer_threads_worker()

static void handle_qxfer_threads_worker ( thread_info thread,
struct buffer buffer 
)
static

◆ handle_qxfer_traceframe_info()

static int handle_qxfer_traceframe_info ( const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len 
)
static

◆ handle_search_memory()

static void handle_search_memory ( char *  own_buf,
int  packet_len 
)
static

◆ handle_search_memory_1()

static int handle_search_memory_1 ( CORE_ADDR  start_addr,
CORE_ADDR  search_space_len,
gdb_byte pattern,
unsigned  pattern_len,
gdb_byte search_buf,
unsigned  chunk_size,
unsigned  search_buf_size,
CORE_ADDR found_addrp 
)
static

Definition at line 1039 of file server.c.

References gdb_read_memory(), and warning().

Referenced by handle_search_memory().

◆ handle_serial_event()

int handle_serial_event ( int  err,
gdb_client_data  client_data 
)

◆ handle_status()

static void handle_status ( char *  own_buf)
static

◆ handle_target_event()

int handle_target_event ( int  err,
gdb_client_data  client_data 
)

◆ handle_v_attach()

static int handle_v_attach ( char *  own_buf)
static

◆ handle_v_cont()

static void handle_v_cont ( char *  own_buf)
static

◆ handle_v_kill()

static int handle_v_kill ( char *  own_buf)
static

◆ handle_v_requests()

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

◆ handle_v_run()

static int handle_v_run ( char *  own_buf)
static

◆ in_queued_stop_replies()

int in_queued_stop_replies ( ptid_t  ptid)

◆ in_queued_stop_replies_ptid()

static int in_queued_stop_replies_ptid ( QUEUE(notif_event_p) *  q,
QUEUE_ITER(notif_event_p) *  iter,
struct notif_event event,
void *  data 
)
static

Definition at line 215 of file server.c.

References vstop_notif::ptid, ptid_match(), and vstop_notif::status.

Referenced by in_queued_stop_replies().

◆ kill_inferior_callback()

static void kill_inferior_callback ( process_info process)
static

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ monitor_show_help()

static void monitor_show_help ( void  )
static

Definition at line 946 of file server.c.

References monitor_output().

Referenced by handle_monitor_command().

◆ myresume()

static void myresume ( char *  own_buf,
int  step,
int  sig 
)
static

◆ parse_debug_format_options()

static char* parse_debug_format_options ( const char *  arg,
int  is_monitor 
)
static

◆ process_point_options()

static void process_point_options ( struct gdb_breakpoint bp,
const char **  packet 
)
static

◆ process_serial_event()

static int process_serial_event ( void  )
static

◆ push_stop_notification()

static void push_stop_notification ( ptid_t  ptid,
struct target_waitstatus *  status 
)
static

Definition at line 4384 of file server.c.

References notif_push(), notif_stop, vstop_notif::ptid, vstop_notif::status, and XNEW.

Referenced by handle_target_event().

◆ queue_stop_reply()

static void queue_stop_reply ( ptid_t  ptid,
struct target_waitstatus *  status 
)
static

Definition at line 165 of file server.c.

References notif_event_enque(), notif_stop, vstop_notif::ptid, vstop_notif::status, and XNEW.

Referenced by queue_stop_reply_callback().

◆ queue_stop_reply_callback()

static void queue_stop_reply_callback ( thread_info thread)
static

◆ remove_all_on_match_ptid()

static int remove_all_on_match_ptid ( QUEUE(notif_event_p) *  q,
QUEUE_ITER(notif_event_p) *  iter,
struct notif_event event,
void *  data 
)
static

Definition at line 176 of file server.c.

References vstop_notif::ptid, ptid_match(), and QUEUE_remove_elem.

Referenced by discard_queued_stop_replies().

◆ resume()

static void resume ( struct thread_resume actions,
size_t  n 
)
static

◆ set_pending_status_callback()

static void set_pending_status_callback ( thread_info thread)
static

Definition at line 3292 of file server.c.

References thread_info::last_status, and thread_info::status_pending_p.

Referenced by handle_status().

◆ supported_btrace_packets()

static void supported_btrace_packets ( char *  buf)
static

Definition at line 2113 of file server.c.

References BTRACE_FORMAT_BTS, BTRACE_FORMAT_PT, and target_supports_btrace.

Referenced by handle_query().

◆ target_running()

static int target_running ( void  )
static

◆ visit_actioned_threads()

static bool visit_actioned_threads ( thread_info thread,
const struct thread_resume actions,
size_t  num_actions,
visit_actioned_threads_callback_ftype callback 
)
static

Definition at line 2687 of file server.c.

References minus_one_ptid, ptid_t::pid(), ptid_equal(), ptid_get_lwp(), ptid_get_pid(), and thread_resume::thread.

Referenced by resume().

◆ vstop_notif_reply()

static void vstop_notif_reply ( struct notif_event event,
char *  own_buf 
)
static

Definition at line 205 of file server.c.

References own_buf, prepare_resume_reply(), vstop_notif::ptid, and vstop_notif::status.

◆ write_qxfer_response()

static int write_qxfer_response ( char *  buf,
const gdb_byte data,
int  len,
int  is_more 
)
static

Definition at line 368 of file server.c.

References PBUFSIZ, and remote_escape_output().

Referenced by handle_qxfer().

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().

◆ current_btrace_conf

struct btrace_config current_btrace_conf
static

◆ 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 = 1

◆ exit_code

int exit_code
static

Definition at line 3526 of file server.c.

Referenced by detach_or_kill_for_exit_cleanup(), and main().

◆ exit_requested

int exit_requested
static

Definition at line 84 of file server.c.

Referenced by captured_main(), handle_monitor_command(), and process_serial_event().

◆ extended_protocol

int extended_protocol
static

Definition at line 82 of file server.c.

Referenced by captured_main(), handle_detach(), handle_v_requests(), and process_serial_event().

◆ general_thread

ptid_t general_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

◆ last_status

struct target_waitstatus last_status

◆ mem_buf

unsigned char* mem_buf
static

◆ multi_process

int multi_process

◆ non_stop

int non_stop

◆ notif_stop

struct notif_server notif_stop
Initial value:
=
{
"vStopped", "Stop", NULL, vstop_notif_reply,
}
static void vstop_notif_reply(struct notif_event *event, char *own_buf)
Definition: server.c:205

Definition at line 244 of file server.c.

Referenced by discard_queued_stop_replies(), handle_status(), in_queued_stop_replies(), push_stop_notification(), queue_stop_reply(), and queue_stop_reply_callback().

◆ our_environ

gdb_environ our_environ
static

Definition at line 61 of file server.c.

Referenced by captured_main(), get_environ(), and handle_general_set().

◆ own_buf

char* own_buf

◆ pass_signals

int pass_signals[GDB_SIGNAL_LAST]

Definition at line 115 of file server.c.

Referenced by handle_general_set(), and linux_wait_1().

◆ program_args

std::vector<char *> program_args
static

◆ program_name

char* program_name = NULL
static

Definition at line 111 of file server.c.

Referenced by captured_main(), get_exec_file(), handle_v_run(), and process_serial_event().

◆ program_signals

int program_signals[GDB_SIGNAL_LAST]

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().

◆ qxfer_packets

const struct qxfer qxfer_packets[]
static
Initial value:
=
{
{ "auxv", handle_qxfer_auxv },
{ "btrace", handle_qxfer_btrace },
{ "btrace-conf", handle_qxfer_btrace_conf },
{ "exec-file", handle_qxfer_exec_file},
{ "fdpic", handle_qxfer_fdpic},
{ "features", handle_qxfer_features },
{ "libraries", handle_qxfer_libraries },
{ "libraries-svr4", handle_qxfer_libraries_svr4 },
{ "osdata", handle_qxfer_osdata },
{ "siginfo", handle_qxfer_siginfo },
{ "spu", handle_qxfer_spu },
{ "statictrace", handle_qxfer_statictrace },
{ "threads", handle_qxfer_threads },
{ "traceframe-info", handle_qxfer_traceframe_info },
}
static int handle_qxfer_features(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1504
static int handle_qxfer_libraries_svr4(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1570
static int handle_qxfer_libraries(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1537
static int handle_qxfer_btrace(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1820
static int handle_qxfer_auxv(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1441
static int handle_qxfer_spu(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1615
static int handle_qxfer_btrace_conf(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1892
static int handle_qxfer_traceframe_info(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1755
static int handle_qxfer_osdata(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1586
static int handle_qxfer_threads(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1705
static int handle_qxfer_exec_file(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1457
static int handle_qxfer_fdpic(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1805
static int handle_qxfer_siginfo(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1599
static int handle_qxfer_statictrace(const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
Definition: server.c:1631

Definition at line 1951 of file server.c.

Referenced by handle_qxfer().

◆ remote_debug

int remote_debug

◆ report_exec_events

int report_exec_events

◆ report_fork_events

int report_fork_events

◆ report_no_resumed

int report_no_resumed
static

Definition at line 96 of file server.c.

Referenced by handle_query(), handle_target_event(), and resume().

◆ report_thread_events

int report_thread_events

◆ report_vfork_events

int report_vfork_events

◆ response_needed

int response_needed
static

Definition at line 83 of file server.c.

Referenced by captured_main(), and process_serial_event().

◆ 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

◆ startup_with_shell

int startup_with_shell = 1

Definition at line 67 of file server.c.

Referenced by captured_main(), fork_inferior(), handle_general_set(), and startup_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().

◆ vCont_supported

int vCont_supported
static

Definition at line 105 of file server.c.

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

◆ wrapper_argv

std::string wrapper_argv
static

Definition at line 113 of file server.c.

Referenced by captured_main(), and get_exec_wrapper().