gem5  v22.1.0.0
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  {
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  {
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__ */
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Definition: remote_gdb.hh:86
BaseRemoteGDB * gdb
Definition: remote_gdb.hh:140
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:234
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:100
struct gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED r
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:105
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
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:262
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:76
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:71
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:208
struct gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED r
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:179
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
std::vector< std::string > availableFeatures() const
Definition: remote_gdb.hh:119
PowerGdbRegCache regCache32
Definition: remote_gdb.hh:111
Power64GdbRegCache regCache64
Definition: remote_gdb.hh:112
BaseGdbRegCache * gdbRegs()
bool getXferFeaturesRead(const std::string &annex, std::string &output)
Get an XML target description.
bool acc(Addr addr, size_t len)
RemoteGDB(System *_system, int _port)
ThreadContext is the external interface to all thread state for anything outside of the CPU.
BaseGdbRegCache(BaseRemoteGDB *g)
Definition: remote_gdb.hh:134
std::string name()
Definition: remote_gdb.cc:407
uint16_t len
Definition: helpers.cc:62
const int NumArchRegs
Definition: float.hh:44
Bitfield< 3 > addr
Definition: types.hh:84
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
static void output(const char *filename)
Definition: debug.cc:60

Generated on Wed Dec 21 2022 10:22:25 for gem5 by doxygen 1.9.1