GDBserver

Classes | Macros | Functions | Variables
agent.c File Reference
`#include "common-defs.h"`
`#include "target/target.h"`
`#include "common/symbol.h"`
`#include <unistd.h>`
`#include "agent.h"`
`#include "filestuff.h"`

Go to the source code of this file.

## Classes
struct | ipa_sym_addresses

## Macros
#define | DEBUG_AGENT debug_agent_printf

## Functions
static void | ATTRIBUTE_PRINTF (1, 2)
int | agent_loaded_p (void)
int | agent_look_up_symbols (void *arg)
static unsigned int | agent_get_helper_thread_id (void)
static int | gdb_connect_sync_socket (int pid)
int | agent_run_command (int pid, const char *cmd, int len)
int | agent_capability_check (enum agent_capa agent_capa)
void | agent_capability_invalidate (void)

## Variables
int | debug_agent = 0
int | use_agent = 0
static uint32_t | helper_thread_id = 0
struct {
const char * name
int offset
} | symbol_list []
static struct ipa_sym_addresses | ipa_sym_addrs
static int | all_agent_symbols_looked_up = 0
static uint32_t | agent_capability = 0

## Macro Definition Documentation

## ◆ DEBUG_AGENT

#define DEBUG_AGENT debug_agent_printf

Definition at line 43 of file agent.c.

Referenced by agent_look_up_symbols(), and agent_run_command().

## Function Documentation

## ◆ agent_capability_check()

int agent_capability_check | ( | enum agent_capa agent_capa |  | ) |

Definition at line 263 of file agent.c.

References _, ipa_sym_addresses::addr_capability, agent_capability, ipa_sym_addrs, target_read_uint32(), and warning().

Referenced by cmd_qtdp(), cmd_qtstart(), and in_process_agent_supports_ust().

## ◆ agent_capability_invalidate()

void agent_capability_invalidate | ( | void |  | ) |

Definition at line 278 of file agent.c.

References agent_capability.

## ◆ agent_get_helper_thread_id()

static unsigned int agent_get_helper_thread_id | ( | void |  | ) |
| static

Definition at line 111 of file agent.c.

References _, ipa_sym_addresses::addr_helper_thread_id, helper_thread_id, ipa_sym_addrs, target_read_uint32(), and warning().

Referenced by agent_run_command().

## ◆ agent_loaded_p()

int agent_loaded_p | ( | void |  | ) |

Definition at line 77 of file agent.c.

References all_agent_symbols_looked_up.

Referenced by cmd_qtstart(), cmd_qtstatus(), handle_tracepoint_bkpts(), in_process_agent_supports_ust(), install_tracepoint(), linux_wait_1(), maybe_move_out_of_jump_pad(), maybe_write_ipa_not_loaded(), maybe_write_ipa_ust_not_loaded(), stop_tracing(), stuck_in_jump_pad_callback(), tracepoint_finished_step(), tracepoint_look_up_symbols(), and x86_get_min_fast_tracepoint_insn_len().

## ◆ agent_look_up_symbols()

int agent_look_up_symbols | ( | void * | arg | ) |

Definition at line 86 of file agent.c.

References all_agent_symbols_looked_up, DEBUG_AGENT, find_minimal_symbol_address(), ipa_sym_addrs, name, and symbol_list.

Referenced by tracepoint_look_up_symbols().

## ◆ agent_run_command()

int agent_run_command | ( | int | pid,
|  | const char * | cmd,
|  | int | len
| ) |  |

Definition at line 189 of file agent.c.

References _, ipa_sym_addresses::addr_cmd_buf, agent_get_helper_thread_id(), DEBUG_AGENT, errno, gdb_connect_sync_socket(), IPA_CMD_BUF_SIZE, ipa_sym_addrs, null_ptid, ptid_build(), ptid_equal(), target_continue_no_signal(), target_read_memory(), target_stop_and_wait(), target_write_memory(), and warning().

Referenced by run_inferior_command().

## ◆ ATTRIBUTE_PRINTF()

static void ATTRIBUTE_PRINTF | ( | 1 | ,
|  | 2 |
| ) |  |
| static

Definition at line 31 of file agent.c.

References debug_agent, and debug_vprintf().

## ◆ gdb_connect_sync_socket()

static int gdb_connect_sync_socket | ( | int | pid | ) |
| static

Definition at line 138 of file agent.c.

References _, errno, gdb_socket_cloexec(), strerror(), warning(), and xsnprintf().

Referenced by agent_run_command().

## Variable Documentation

## ◆ agent_capability

uint32_t agent_capability = 0
| static

Definition at line 258 of file agent.c.

Referenced by agent_capability_check(), and agent_capability_invalidate().

## ◆ all_agent_symbols_looked_up

int all_agent_symbols_looked_up = 0
| static

Definition at line 74 of file agent.c.

Referenced by agent_loaded_p(), and agent_look_up_symbols().

## ◆ debug_agent

int debug_agent = 0

Definition at line 27 of file agent.c.

Referenced by ATTRIBUTE_PRINTF().

## ◆ helper_thread_id

uint32_t helper_thread_id = 0
| static

Definition at line 60 of file agent.c.

Referenced by agent_get_helper_thread_id().

## ◆ ipa_sym_addrs

struct ipa_sym_addresses ipa_sym_addrs
| static

Definition at line 72 of file agent.c.

Referenced by agent_capability_check(), agent_get_helper_thread_id(), agent_look_up_symbols(), and agent_run_command().

## ◆ name

const char* name

Definition at line 64 of file agent.c.

Referenced by agent_look_up_symbols().

## ◆ offset

int offset

Definition at line 65 of file agent.c.

## ◆ symbol_list

struct { ... } symbol_list[]

Initial value:
= {
IPA_SYM(helper_thread_id),
IPA_SYM(cmd_buf),
IPA_SYM(capability),
}
helper_thread_id
static uint32_t helper_thread_id
Definition: agent.c:60
IPA_SYM
#define IPA_SYM(SYM)
Definition: agent.h:30

Referenced by agent_look_up_symbols().

## ◆ use_agent

int use_agent = 0

Definition at line 46 of file agent.c.

Referenced by cmd_qtdp(), cmd_qtstart(), and handle_general_set().