Home | History | Annotate | Line # | Download | only in gdbsupport
      1      1.1  christos /* Shared utility routines for GDB to interact with agent.
      2      1.1  christos 
      3  1.1.1.3  christos    Copyright (C) 2009-2024 Free Software Foundation, Inc.
      4      1.1  christos 
      5      1.1  christos    This file is part of GDB.
      6      1.1  christos 
      7      1.1  christos    This program is free software; you can redistribute it and/or modify
      8      1.1  christos    it under the terms of the GNU General Public License as published by
      9      1.1  christos    the Free Software Foundation; either version 3 of the License, or
     10      1.1  christos    (at your option) any later version.
     11      1.1  christos 
     12      1.1  christos    This program is distributed in the hope that it will be useful,
     13      1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     14      1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15      1.1  christos    GNU General Public License for more details.
     16      1.1  christos 
     17      1.1  christos    You should have received a copy of the GNU General Public License
     18      1.1  christos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
     19      1.1  christos 
     20      1.1  christos #ifndef COMMON_AGENT_H
     21      1.1  christos #define COMMON_AGENT_H
     22      1.1  christos 
     23      1.1  christos #include "gdbsupport/preprocessor.h"
     24      1.1  christos 
     25  1.1.1.3  christos int agent_run_command (int pid, char *cmd, int len);
     26      1.1  christos 
     27      1.1  christos int agent_look_up_symbols (void *);
     28      1.1  christos 
     29      1.1  christos #define IPA_SYM_EXPORTED_NAME(SYM) gdb_agent_ ## SYM
     30      1.1  christos 
     31      1.1  christos /* Define an entry in an IPA symbol list array.  If IPA_SYM is used, the macro
     32      1.1  christos    IPA_SYM_STRUCT_NAME must be defined to the structure name holding the IPA
     33      1.1  christos    symbol addresses in that particular file, before including
     34      1.1  christos    gdbsupport/agent.h.  */
     35      1.1  christos #define IPA_SYM(SYM)                                   \
     36      1.1  christos   {                                                    \
     37      1.1  christos     STRINGIFY (IPA_SYM_EXPORTED_NAME (SYM)),           \
     38      1.1  christos     offsetof (IPA_SYM_STRUCT_NAME, addr_ ## SYM)       \
     39      1.1  christos   }
     40      1.1  christos 
     41      1.1  christos /* The size in bytes of the buffer used to talk to the IPA helper
     42      1.1  christos    thread.  */
     43      1.1  christos #define IPA_CMD_BUF_SIZE 1024
     44      1.1  christos 
     45      1.1  christos bool agent_loaded_p (void);
     46      1.1  christos 
     47      1.1  christos extern bool debug_agent;
     48      1.1  christos 
     49      1.1  christos extern bool use_agent;
     50      1.1  christos 
     51      1.1  christos /* Capability of agent.  Different agents may have different capabilities,
     52      1.1  christos    such as installing fast tracepoint or evaluating breakpoint conditions.
     53      1.1  christos    Capabilities are represented by bit-maps, and each capability occupies one
     54      1.1  christos    bit.  */
     55      1.1  christos 
     56      1.1  christos enum agent_capa
     57      1.1  christos {
     58      1.1  christos   /* Capability to install fast tracepoint.  */
     59      1.1  christos   AGENT_CAPA_FAST_TRACE = 0x1,
     60      1.1  christos   /* Capability to install static tracepoint.  */
     61      1.1  christos   AGENT_CAPA_STATIC_TRACE = (0x1 << 1),
     62      1.1  christos };
     63      1.1  christos 
     64      1.1  christos bool agent_capability_check (enum agent_capa);
     65      1.1  christos 
     66      1.1  christos void agent_capability_invalidate (void);
     67      1.1  christos 
     68      1.1  christos #endif /* COMMON_AGENT_H */
     69