remote_gdb.hh (10601:6efb37480d87) | remote_gdb.hh (11274:d9a0136ab8cc) |
---|---|
1/* | 1/* |
2 * Copyright 2015 LabWare |
|
2 * Copyright 2014 Google, Inc. 3 * Copyright (c) 2007 The Regents of The University of Michigan 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer; --- 12 unchanged lines hidden (view full) --- 22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * Authors: Nathan Binkert | 3 * Copyright 2014 Google, Inc. 4 * Copyright (c) 2007 The Regents of The University of Michigan 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are 9 * met: redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer; --- 12 unchanged lines hidden (view full) --- 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * 30 * Authors: Nathan Binkert |
31 * Boris Shingarov |
|
30 */ 31 32#ifndef __ARCH_MIPS_REMOTE_GDB_HH__ 33#define __ARCH_MIPS_REMOTE_GDB_HH__ 34 35#include "arch/mips/registers.hh" 36#include "base/bitfield.hh" 37#include "base/remote_gdb.hh" 38 39class System; 40class ThreadContext; 41 42namespace MipsISA 43{ 44 | 32 */ 33 34#ifndef __ARCH_MIPS_REMOTE_GDB_HH__ 35#define __ARCH_MIPS_REMOTE_GDB_HH__ 36 37#include "arch/mips/registers.hh" 38#include "base/bitfield.hh" 39#include "base/remote_gdb.hh" 40 41class System; 42class ThreadContext; 43 44namespace MipsISA 45{ 46 |
45 // The number of special regs depends on gdb. 46 const int GdbIntArchRegs = NumIntArchRegs; 47 const int GdbIntSpecialRegs = 6; 48 const int GdbFloatArchRegs = NumFloatArchRegs; 49 const int GdbFloatSpecialRegs = 2; | 47class RemoteGDB : public BaseRemoteGDB 48{ 49 protected: 50 bool acc(Addr addr, size_t len); |
50 | 51 |
51 const int GdbIntRegs = GdbIntArchRegs + GdbIntSpecialRegs; 52 const int GdbFloatRegs = GdbFloatArchRegs + GdbFloatSpecialRegs; 53 const int GdbNumRegs = GdbIntRegs + GdbFloatRegs; 54 55 class RemoteGDB : public BaseRemoteGDB | 52 class MipsGdbRegCache : public BaseGdbRegCache |
56 { | 53 { |
54 using BaseGdbRegCache::BaseGdbRegCache; 55 private: 56 struct { 57 uint32_t gpr[32]; 58 uint32_t sr; 59 uint32_t lo; 60 uint32_t hi; 61 uint32_t badvaddr; 62 uint32_t cause; 63 uint32_t pc; 64 uint32_t fpr[32]; 65 uint32_t fsr; 66 uint32_t fir; 67 } r; |
|
57 public: | 68 public: |
58 RemoteGDB(System *_system, ThreadContext *tc); | 69 char *data() const { return (char *)&r; } 70 size_t size() const { return sizeof(r); } 71 void getRegs(ThreadContext*); 72 void setRegs(ThreadContext*) const; 73 const std::string name() const { return gdb->name() + ".MipsGdbRegCache"; } 74 }; |
59 | 75 |
60 protected: 61 bool acc(Addr addr, size_t len); | |
62 | 76 |
63 void getregs(); 64 void setregs(); 65 }; 66} | 77 public: 78 RemoteGDB(System *_system, ThreadContext *tc); 79 BaseGdbRegCache *gdbRegs(); 80}; |
67 | 81 |
82} // namespace MipsISA 83 |
|
68#endif /* __ARCH_MIPS_REMOTE_GDB_H__ */ | 84#endif /* __ARCH_MIPS_REMOTE_GDB_H__ */ |