2 * Copyright (c) 2009 The Regents of The University of Michigan
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef TRACECHILD_ARM_HH
33 #define TRACECHILD_ARM_HH
38 #include <sys/ptrace.h>
39 #include "tracechild.hh"
42 class ARMTraceChild : public TraceChild
47 // r0 - r3 argument, temp, caller save
48 // r4 - r10 callee save
54 R0, R1, R2, R3, R4, R5, R6, R7,
55 R8, R9, R10, FP, R12, SP, LR, PC,
60 char printBuffer[256];
61 static const char *regNames[numregs];
62 uint32_t getRegs(user_regs& myregs, int num);
65 bool regDiffSinceUpdate[numregs];
72 bool sendState(int socket);
79 bool diffSinceUpdate(int num)
81 assert(num < numregs && num >= 0);
82 return regDiffSinceUpdate[num];
85 std::string getRegName(int num)
87 assert(num < numregs && num >= 0);
91 int64_t getRegVal(int num);
92 int64_t getOldRegVal(int num);
103 return getRegVal(SP);
106 char * printReg(int num);
108 std::ostream & outputStartState(std::ostream & os);