2 * See the dyninst/COPYRIGHT file for copyright information.
4 * We provide the Paradyn Tools (below described as "Paradyn")
5 * on an AS IS basis, and do not warrant its validity or performance.
6 * We reserve the right to update, modify, or discontinue this
7 * software at any time. We shall have no obligation to supply such
8 * updates or modifications or any other form of support to you.
10 * By your use of Paradyn, you understand and agree that we (or any
11 * other person or entity with proprietary rights in Paradyn) are
12 * under no obligation to provide either maintenance services,
13 * update services, notices of latent defects, or correction of
14 * defects for Paradyn.
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 #include "common/src/Types.h"
37 #include "BPatch_instruction.h"
38 #include "BPatch_basicBlock.h"
39 #include "BPatch_libInfo.h"
40 #include "BPatch_process.h"
43 #include "instPoint.h"
44 #include "addressSpace.h"
46 #include "legacy-instruction.h"
48 /**************************************************************************
50 *************************************************************************/
52 #if defined(arch_x86) || defined(arch_x86_64)
53 const unsigned int BPatch_instruction::nmaxacc_NP = 2;
55 const unsigned int BPatch_instruction::nmaxacc_NP = 1;
58 BPatch_instruction::BPatch_instruction(internal_instruction *insn,
60 : nacc(0), insn_(insn), parent(NULL), addr(addr_)
62 isLoad = new bool[nmaxacc_NP];
63 isStore = new bool[nmaxacc_NP];
64 preFcn = new int[nmaxacc_NP];
65 condition = new int[nmaxacc_NP];
66 nonTemporal = new bool[nmaxacc_NP];
68 for (unsigned int i=0; i < nmaxacc_NP; i++) {
73 nonTemporal[i] = false;
78 internal_instruction *BPatch_instruction::insn() { return insn_; }
80 BPatch_instruction::~BPatch_instruction() {
92 BPatch_basicBlock *BPatch_instruction::getParent()
97 void *BPatch_instruction::getAddress()
101 BPatch_point *BPatch_instruction::getInstPoint()
103 func_instance *ifunc = parent->ifunc();
104 AddressSpace *proc = ifunc->proc();
105 BPatch_addressSpace *bpproc = (BPatch_addressSpace *)proc->up_ptr();
107 instPoint *point = instPoint::preInsn(ifunc,
111 BPatch_point *ret = bpproc->findOrCreateBPPoint(NULL, point, BPatch_locInstruction);
114 fprintf(stderr, "%s[%d]: getInstPoint failing!\n", FILE__, __LINE__);
118 std::string BPatch_register::name() const{