1*ef5ccd6cSJohn Marino /* Shared utility routines for GDB to interact with agent. 2*ef5ccd6cSJohn Marino 3*ef5ccd6cSJohn Marino Copyright (C) 2009-2013 Free Software Foundation, Inc. 4*ef5ccd6cSJohn Marino 5*ef5ccd6cSJohn Marino This file is part of GDB. 6*ef5ccd6cSJohn Marino 7*ef5ccd6cSJohn Marino This program is free software; you can redistribute it and/or modify 8*ef5ccd6cSJohn Marino it under the terms of the GNU General Public License as published by 9*ef5ccd6cSJohn Marino the Free Software Foundation; either version 3 of the License, or 10*ef5ccd6cSJohn Marino (at your option) any later version. 11*ef5ccd6cSJohn Marino 12*ef5ccd6cSJohn Marino This program is distributed in the hope that it will be useful, 13*ef5ccd6cSJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of 14*ef5ccd6cSJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*ef5ccd6cSJohn Marino GNU General Public License for more details. 16*ef5ccd6cSJohn Marino 17*ef5ccd6cSJohn Marino You should have received a copy of the GNU General Public License 18*ef5ccd6cSJohn Marino along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19*ef5ccd6cSJohn Marino 20*ef5ccd6cSJohn Marino int agent_run_command (int pid, const char *cmd, int len); 21*ef5ccd6cSJohn Marino 22*ef5ccd6cSJohn Marino int agent_look_up_symbols (void *); 23*ef5ccd6cSJohn Marino 24*ef5ccd6cSJohn Marino #define STRINGIZE_1(STR) #STR 25*ef5ccd6cSJohn Marino #define STRINGIZE(STR) STRINGIZE_1(STR) 26*ef5ccd6cSJohn Marino #define IPA_SYM(SYM) \ 27*ef5ccd6cSJohn Marino { \ 28*ef5ccd6cSJohn Marino STRINGIZE (gdb_agent_ ## SYM), \ 29*ef5ccd6cSJohn Marino offsetof (struct ipa_sym_addresses, addr_ ## SYM) \ 30*ef5ccd6cSJohn Marino } 31*ef5ccd6cSJohn Marino 32*ef5ccd6cSJohn Marino /* The size in bytes of the buffer used to talk to the IPA helper 33*ef5ccd6cSJohn Marino thread. */ 34*ef5ccd6cSJohn Marino #define IPA_CMD_BUF_SIZE 1024 35*ef5ccd6cSJohn Marino 36*ef5ccd6cSJohn Marino int agent_loaded_p (void); 37*ef5ccd6cSJohn Marino 38*ef5ccd6cSJohn Marino extern int debug_agent; 39*ef5ccd6cSJohn Marino 40*ef5ccd6cSJohn Marino extern int use_agent; 41*ef5ccd6cSJohn Marino 42*ef5ccd6cSJohn Marino /* Capability of agent. Different agents may have different capabilities, 43*ef5ccd6cSJohn Marino such as installing fast tracepoint or evaluating breakpoint conditions. 44*ef5ccd6cSJohn Marino Capabilities are represented by bit-maps, and each capability occupies one 45*ef5ccd6cSJohn Marino bit. */ 46*ef5ccd6cSJohn Marino 47*ef5ccd6cSJohn Marino enum agent_capa 48*ef5ccd6cSJohn Marino { 49*ef5ccd6cSJohn Marino /* Capability to install fast tracepoint. */ 50*ef5ccd6cSJohn Marino AGENT_CAPA_FAST_TRACE = 0x1, 51*ef5ccd6cSJohn Marino /* Capability to install static tracepoint. */ 52*ef5ccd6cSJohn Marino AGENT_CAPA_STATIC_TRACE = (0x1 << 1), 53*ef5ccd6cSJohn Marino }; 54*ef5ccd6cSJohn Marino 55*ef5ccd6cSJohn Marino int agent_capability_check (enum agent_capa); 56*ef5ccd6cSJohn Marino 57*ef5ccd6cSJohn Marino void agent_capability_invalidate (void); 58