gem5  v21.1.0.2
remote_gdb.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 LabWare
3  * Copyright (c) 2002-2005 The Regents of The University of Michigan
4  * Copyright (c) 2007-2008 The Florida State University
5  * Copyright (c) 2009 The University of Edinburgh
6  * Copyright (c) 2021 IBM Corporation
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are
11  * met: redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer;
13  * redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution;
16  * neither the name of the copyright holders nor the names of its
17  * contributors may be used to endorse or promote products derived from
18  * this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef __ARCH_POWER_REMOTE_GDB_HH__
34 #define __ARCH_POWER_REMOTE_GDB_HH__
35 
36 #include "arch/power/regs/float.hh"
37 #include "arch/power/regs/int.hh"
38 #include "arch/power/remote_gdb.hh"
39 #include "base/remote_gdb.hh"
40 
41 namespace gem5
42 {
43 
44 namespace PowerISA
45 {
46 
47 
48 class RemoteGDB : public BaseRemoteGDB
49 {
50  protected:
51  bool acc(Addr addr, size_t len);
52 
54  {
56  private:
57  struct GEM5_PACKED
58  {
59  uint32_t gpr[NumIntArchRegs];
60  uint64_t fpr[NumFloatArchRegs];
61  uint32_t pc;
62  uint32_t msr;
63  uint32_t cr;
64  uint32_t lr;
65  uint32_t ctr;
66  uint32_t xer;
67  uint32_t fpscr;
68  } r;
69 
70  public:
71  char *data() const { return (char *)&r; }
72  size_t size() const { return sizeof(r); }
73  void getRegs(ThreadContext*);
74  void setRegs(ThreadContext*) const;
75  const std::string
76  name() const
77  {
78  return gdb->name() + ".PowerGdbRegCache";
79  }
80  };
81 
83  {
85  private:
86  struct GEM5_PACKED
87  {
88  uint64_t gpr[NumIntArchRegs];
89  uint64_t fpr[NumFloatArchRegs];
90  uint64_t pc;
91  uint64_t msr;
92  uint32_t cr;
93  uint64_t lr;
94  uint64_t ctr;
95  uint32_t xer;
96  uint32_t fpscr;
97  } r;
98 
99  public:
100  char *data() const { return (char *)&r; }
101  size_t size() const { return sizeof(r); }
102  void getRegs(ThreadContext*);
103  void setRegs(ThreadContext*) const;
104  const std::string
105  name() const
106  {
107  return gdb->name() + ".Power64GdbRegCache";
108  }
109  };
110 
113 
114  public:
115  RemoteGDB(System *_system, int _port);
117 
120  {
121  return {"qXfer:features:read+"};
122  };
123 
124  bool getXferFeaturesRead(const std::string &annex, std::string &output);
125 };
126 
127 } // namespace PowerISA
128 } // namespace gem5
129 
130 #endif /* __ARCH_POWER_REMOTE_GDB_H__ */
remote_gdb.hh
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:76
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::xer
uint32_t xer
Definition: remote_gdb.hh:66
gem5::PowerISA::RemoteGDB::Power64GdbRegCache
Definition: remote_gdb.hh:82
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:178
gem5::ArmISA::len
Bitfield< 18, 16 > len
Definition: misc_types.hh:444
gem5::PowerISA::RemoteGDB::gdbRegs
BaseGdbRegCache * gdbRegs()
gem5::output
static void output(const char *filename)
Definition: debug.cc:66
remote_gdb.hh
std::vector< std::string >
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED
Definition: remote_gdb.hh:57
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::ctr
uint64_t ctr
Definition: remote_gdb.hh:94
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:100
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:231
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::fpr
uint64_t fpr[NumFloatArchRegs]
Definition: remote_gdb.hh:89
gem5::BaseGdbRegCache
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Definition: remote_gdb.hh:85
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED
Definition: remote_gdb.hh:86
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:205
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::size
size_t size() const
Return the size of the raw buffer, in bytes (i.e., half of the number of digits in the g/G packet).
Definition: remote_gdb.hh:101
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:71
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:259
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::gpr
uint64_t gpr[NumIntArchRegs]
Definition: remote_gdb.hh:88
gem5::System
Definition: system.hh:77
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::fpscr
uint32_t fpscr
Definition: remote_gdb.hh:96
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:93
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::lr
uint32_t lr
Definition: remote_gdb.hh:64
gem5::PowerISA::NumFloatArchRegs
const int NumFloatArchRegs
Definition: float.hh:38
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::fpscr
uint32_t fpscr
Definition: remote_gdb.hh:67
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::r
struct gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED r
gem5::BaseRemoteGDB::name
std::string name()
Definition: remote_gdb.cc:368
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::ctr
uint32_t ctr
Definition: remote_gdb.hh:65
gem5::PowerISA::RemoteGDB::RemoteGDB
RemoteGDB(System *_system, int _port)
gem5::BaseRemoteGDB::_port
int _port
Definition: remote_gdb.hh:220
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::msr
uint32_t msr
Definition: remote_gdb.hh:62
int.hh
gem5::BaseGdbRegCache::gdb
BaseRemoteGDB * gdb
Definition: remote_gdb.hh:140
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::pc
uint32_t pc
Definition: remote_gdb.hh:61
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::fpr
uint64_t fpr[NumFloatArchRegs]
Definition: remote_gdb.hh:60
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::cr
uint32_t cr
Definition: remote_gdb.hh:92
gem5::PowerISA::RemoteGDB::regCache32
PowerGdbRegCache regCache32
Definition: remote_gdb.hh:111
gem5::BaseGdbRegCache::BaseGdbRegCache
BaseGdbRegCache(BaseRemoteGDB *g)
Definition: remote_gdb.hh:134
gem5::PowerISA::RemoteGDB::acc
bool acc(Addr addr, size_t len)
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::cr
uint32_t cr
Definition: remote_gdb.hh:63
gem5::PowerISA::RemoteGDB::getXferFeaturesRead
bool getXferFeaturesRead(const std::string &annex, std::string &output)
Get an XML target description.
gem5::PowerISA::RemoteGDB::PowerGdbRegCache
Definition: remote_gdb.hh:53
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:105
float.hh
gem5::PowerISA::RemoteGDB::regCache64
Power64GdbRegCache regCache64
Definition: remote_gdb.hh:112
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::lr
uint64_t lr
Definition: remote_gdb.hh:93
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::pc
uint64_t pc
Definition: remote_gdb.hh:90
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED::gpr
uint32_t gpr[NumIntArchRegs]
Definition: remote_gdb.hh:59
gem5::PowerISA::RemoteGDB::PowerGdbRegCache::size
size_t size() const
Return the size of the raw buffer, in bytes (i.e., half of the number of digits in the g/G packet).
Definition: remote_gdb.hh:72
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::msr
uint64_t msr
Definition: remote_gdb.hh:91
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::r
struct gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED r
gem5::PowerISA::RemoteGDB::availableFeatures
std::vector< std::string > availableFeatures() const
Definition: remote_gdb.hh:119
gem5::BaseRemoteGDB
Definition: remote_gdb.hh:48
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::PowerISA::NumIntArchRegs
const int NumIntArchRegs
Definition: int.hh:40
gem5::PowerISA::RemoteGDB
Definition: remote_gdb.hh:48
gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED::xer
uint32_t xer
Definition: remote_gdb.hh:95
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

Generated on Tue Sep 21 2021 12:24:44 for gem5 by doxygen 1.8.17