1/*
| 1/*
|
| 2 * Copyright 2014 Google, Inc.
|
2 * Copyright (c) 2013 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated 11 * unmodified and in its entirety in all distributions of the software, 12 * modified or unmodified, in source code or in binary form. 13 * 14 * Copyright (c) 2002-2005 The Regents of The University of Michigan 15 * Copyright (c) 2007-2008 The Florida State University 16 * All rights reserved. 17 * 18 * Redistribution and use in source and binary forms, with or without 19 * modification, are permitted provided that the following conditions are 20 * met: redistributions of source code must retain the above copyright 21 * notice, this list of conditions and the following disclaimer; 22 * redistributions in binary form must reproduce the above copyright 23 * notice, this list of conditions and the following disclaimer in the 24 * documentation and/or other materials provided with the distribution; 25 * neither the name of the copyright holders nor the names of its 26 * contributors may be used to endorse or promote products derived from 27 * this software without specific prior written permission. 28 * 29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 33 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 34 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 * 41 * Authors: Nathan Binkert 42 * Stephen Hines 43 */ 44 45#ifndef __ARCH_ARM_REMOTE_GDB_HH__ 46#define __ARCH_ARM_REMOTE_GDB_HH__ 47
| 3 * Copyright (c) 2013 ARM Limited 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating 9 * to a hardware implementation of the functionality of the software 10 * licensed hereunder. You may use the software subject to the license 11 * terms below provided that you ensure that this notice is replicated 12 * unmodified and in its entirety in all distributions of the software, 13 * modified or unmodified, in source code or in binary form. 14 * 15 * Copyright (c) 2002-2005 The Regents of The University of Michigan 16 * Copyright (c) 2007-2008 The Florida State University 17 * All rights reserved. 18 * 19 * Redistribution and use in source and binary forms, with or without 20 * modification, are permitted provided that the following conditions are 21 * met: redistributions of source code must retain the above copyright 22 * notice, this list of conditions and the following disclaimer; 23 * redistributions in binary form must reproduce the above copyright 24 * notice, this list of conditions and the following disclaimer in the 25 * documentation and/or other materials provided with the distribution; 26 * neither the name of the copyright holders nor the names of its 27 * contributors may be used to endorse or promote products derived from 28 * this software without specific prior written permission. 29 * 30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 34 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 37 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 40 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 * 42 * Authors: Nathan Binkert 43 * Stephen Hines 44 */ 45 46#ifndef __ARCH_ARM_REMOTE_GDB_HH__ 47#define __ARCH_ARM_REMOTE_GDB_HH__ 48
|
| 49#include <algorithm> 50
|
48#include "base/remote_gdb.hh" 49 50class System; 51class ThreadContext; 52 53namespace ArmISA 54{ 55 56// AArch32 registers with vfpv3/neon
| 51#include "base/remote_gdb.hh" 52 53class System; 54class ThreadContext; 55 56namespace ArmISA 57{ 58 59// AArch32 registers with vfpv3/neon
|
57const int NUMREGS = 41; /* r0-r15, cpsr, d0-d31, fpscr */ 58const int REG_R0 = 0; 59const int REG_F0 = 8; 60const int REG_CPSR = 8; /* bit 512 to bit 543 */ 61const int REG_FPSCR = 40; /* bit 2592 to bit 2623 */
| 60enum { 61 GDB32_R0 = 0, 62 GDB32_CPSR = 16, 63 GDB32_F0 = 17, 64 GDB32_FPSCR = 81, 65 GDB32_NUMREGS = 82 66};
|
62 63// AArch64 registers
| 67 68// AArch64 registers
|
64const int NUMREGS_64 = 98; // x0-x31, pc, cpsr (64-bit GPRs) 65 // v0-v31 (128-bit FPRs) 66const int REG_X0 = 0; 67const int REG_PC_64 = 32; 68const int REG_CPSR_64 = 33; 69const int REG_V0 = 34;
| 69enum { 70 GDB64_X0 = 0, 71 GDB64_PC = 32, 72 GDB64_CPSR = 33, 73 GDB64_V0 = 34, 74 GDB64_V0_32 = 2 * GDB64_V0, 75 GDB64_NUMREGS = 98 76};
|
70
| 77
|
71const int MAX_NUMREGS = NUMREGS_64;
| 78const int GDB_REG_BYTES = std::max(GDB64_NUMREGS * sizeof(uint64_t), 79 GDB32_NUMREGS * sizeof(uint32_t));
|
72 73class RemoteGDB : public BaseRemoteGDB 74{ 75 76protected: 77 Addr notTakenBkpt; 78 Addr takenBkpt; 79 80protected: 81 bool acc(Addr addr, size_t len); 82 bool write(Addr addr, size_t size, const char *data); 83 84 void getregs(); 85 void setregs(); 86 87 void clearSingleStep(); 88 void setSingleStep(); 89 90public: 91 RemoteGDB(System *_system, ThreadContext *tc); 92}; 93} // namespace ArmISA 94 95#endif /* __ARCH_ARM_REMOTE_GDB_H__ */
| 80 81class RemoteGDB : public BaseRemoteGDB 82{ 83 84protected: 85 Addr notTakenBkpt; 86 Addr takenBkpt; 87 88protected: 89 bool acc(Addr addr, size_t len); 90 bool write(Addr addr, size_t size, const char *data); 91 92 void getregs(); 93 void setregs(); 94 95 void clearSingleStep(); 96 void setSingleStep(); 97 98public: 99 RemoteGDB(System *_system, ThreadContext *tc); 100}; 101} // namespace ArmISA 102 103#endif /* __ARCH_ARM_REMOTE_GDB_H__ */
|