GDB (API)
|
00001 /* Branch trace support for GDB, the GNU debugger. 00002 00003 Copyright (C) 2013 Free Software Foundation, Inc. 00004 00005 Contributed by Intel Corp. <markus.t.metzger@intel.com>. 00006 00007 This file is part of GDB. 00008 00009 This program is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; either version 3 of the License, or 00012 (at your option) any later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00021 00022 #ifndef BTRACE_COMMON_H 00023 #define BTRACE_COMMON_H 00024 00025 /* Branch tracing (btrace) is a per-thread control-flow execution trace of the 00026 inferior. For presentation purposes, the branch trace is represented as a 00027 list of sequential control-flow blocks, one such list per thread. */ 00028 00029 #ifdef GDBSERVER 00030 # include "server.h" 00031 #else 00032 # include "defs.h" 00033 #endif 00034 00035 #include "vec.h" 00036 00037 /* A branch trace block. 00038 00039 This represents a block of sequential control-flow. Adjacent blocks will be 00040 connected via calls, returns, or jumps. The latter can be direct or 00041 indirect, conditional or unconditional. Branches can further be 00042 asynchronous, e.g. interrupts. */ 00043 struct btrace_block 00044 { 00045 /* The address of the first byte of the first instruction in the block. */ 00046 CORE_ADDR begin; 00047 00048 /* The address of the first byte of the last instruction in the block. */ 00049 CORE_ADDR end; 00050 }; 00051 00052 /* Branch trace is represented as a vector of branch trace blocks starting with 00053 the most recent block. */ 00054 typedef struct btrace_block btrace_block_s; 00055 00056 /* Define functions operating on a vector of branch trace blocks. */ 00057 DEF_VEC_O (btrace_block_s); 00058 00059 /* Target specific branch trace information. */ 00060 struct btrace_target_info; 00061 00062 /* Enumeration of btrace read types. */ 00063 00064 enum btrace_read_type 00065 { 00066 /* Send all available trace. */ 00067 btrace_read_all, 00068 00069 /* Send all available trace, if it changed. */ 00070 btrace_read_new 00071 }; 00072 00073 #endif /* BTRACE_COMMON_H */