gem5  v21.1.0.2
remote_gdb.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2015 LabWare
3  * Copyright 2014 Google, Inc.
4  * Copyright (c) 2013, 2016, 2018-2019 ARM Limited
5  * All rights reserved
6  *
7  * The license below extends only to copyright in the software and shall
8  * not be construed as granting a license to any other intellectual
9  * property including but not limited to intellectual property relating
10  * to a hardware implementation of the functionality of the software
11  * licensed hereunder. You may use the software subject to the license
12  * terms below provided that you ensure that this notice is replicated
13  * unmodified and in its entirety in all distributions of the software,
14  * modified or unmodified, in source code or in binary form.
15  *
16  * Copyright (c) 2002-2005 The Regents of The University of Michigan
17  * Copyright (c) 2007-2008 The Florida State University
18  * All rights reserved.
19  *
20  * Redistribution and use in source and binary forms, with or without
21  * modification, are permitted provided that the following conditions are
22  * met: redistributions of source code must retain the above copyright
23  * notice, this list of conditions and the following disclaimer;
24  * redistributions in binary form must reproduce the above copyright
25  * notice, this list of conditions and the following disclaimer in the
26  * documentation and/or other materials provided with the distribution;
27  * neither the name of the copyright holders nor the names of its
28  * contributors may be used to endorse or promote products derived from
29  * this software without specific prior written permission.
30  *
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
36  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
37  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
39  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  */
43 
44 #ifndef __ARCH_ARM_REMOTE_GDB_HH__
45 #define __ARCH_ARM_REMOTE_GDB_HH__
46 
47 #include <algorithm>
48 
49 #include "arch/arm/regs/vec.hh"
50 #include "arch/arm/utility.hh"
51 #include "base/compiler.hh"
52 #include "base/remote_gdb.hh"
53 
54 namespace gem5
55 {
56 
57 class System;
58 class ThreadContext;
59 
60 namespace ArmISA
61 {
62 
63 class RemoteGDB : public BaseRemoteGDB
64 {
65  protected:
66  bool acc(Addr addr, size_t len);
67 
69  {
71  private:
72  struct GEM5_PACKED
73  {
74  uint32_t gpr[16];
75  uint32_t cpsr;
76  uint64_t fpr[32];
77  uint32_t fpscr;
78  } r;
79  public:
80  char *data() const { return (char *)&r; }
81  size_t size() const { return sizeof(r); }
82  void getRegs(ThreadContext*);
83  void setRegs(ThreadContext*) const;
84  const std::string
85  name() const
86  {
87  return gdb->name() + ".AArch32GdbRegCache";
88  }
89  };
90 
92  {
94  private:
95  struct GEM5_PACKED
96  {
97  uint64_t x[31];
98  uint64_t spx;
99  uint64_t pc;
100  uint32_t cpsr;
102  uint32_t fpsr;
103  uint32_t fpcr;
104  } r;
105  public:
106  char *data() const { return (char *)&r; }
107  size_t size() const { return sizeof(r); }
108  void getRegs(ThreadContext*);
109  void setRegs(ThreadContext*) const;
110  const std::string
111  name() const
112  {
113  return gdb->name() + ".AArch64GdbRegCache";
114  }
115  };
116 
119 
120  public:
121  RemoteGDB(System *_system, int _port);
125  {
126  return {"qXfer:features:read+"};
127  };
128  bool getXferFeaturesRead(const std::string &annex, std::string &output);
129 };
130 
131 } // namespace ArmISA
132 } // namespace gem5
133 
134 #endif /* __ARCH_ARM_REMOTE_GDB_H__ */
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::GEM5_PACKED
Definition: remote_gdb.hh:72
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED::cpsr
uint32_t cpsr
Definition: remote_gdb.hh:100
gem5::ArmISA::len
Bitfield< 18, 16 > len
Definition: misc_types.hh:444
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:301
gem5::ArmISA::NumVecElemPerNeonVecReg
constexpr unsigned NumVecElemPerNeonVecReg
Definition: vec.hh:56
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::GEM5_PACKED::fpr
uint64_t fpr[32]
Definition: remote_gdb.hh:76
gem5::output
static void output(const char *filename)
Definition: debug.cc:66
remote_gdb.hh
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED::fpsr
uint32_t fpsr
Definition: remote_gdb.hh:102
gem5::ArmISA::RemoteGDB::RemoteGDB
RemoteGDB(System *_system, int _port)
Definition: remote_gdb.cc:190
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED::spx
uint64_t spx
Definition: remote_gdb.hh:98
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED::pc
uint64_t pc
Definition: remote_gdb.hh:99
vec.hh
std::vector< std::string >
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:85
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::r
struct gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::GEM5_PACKED r
gem5::BaseGdbRegCache
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Definition: remote_gdb.hh:85
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::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:107
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::GEM5_PACKED::fpscr
uint32_t fpscr
Definition: remote_gdb.hh:77
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:242
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache
Definition: remote_gdb.hh:68
gem5::ArmISA::RemoteGDB::gdbRegs
BaseGdbRegCache * gdbRegs()
Definition: remote_gdb.cc:356
gem5::System
Definition: system.hh:77
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::GEM5_PACKED::cpsr
uint32_t cpsr
Definition: remote_gdb.hh:75
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:93
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache
Definition: remote_gdb.hh:91
gem5::ArmISA::RemoteGDB::acc
bool acc(Addr addr, size_t len)
Definition: remote_gdb.cc:199
gem5::BaseRemoteGDB::name
std::string name()
Definition: remote_gdb.cc:368
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:219
gem5::BaseRemoteGDB::_port
int _port
Definition: remote_gdb.hh:220
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:80
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED
Definition: remote_gdb.hh:95
compiler.hh
gem5::BaseGdbRegCache::gdb
BaseRemoteGDB * gdb
Definition: remote_gdb.hh:140
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:106
gem5::BaseGdbRegCache::BaseGdbRegCache
BaseGdbRegCache(BaseRemoteGDB *g)
Definition: remote_gdb.hh:134
gem5::ArmISA::RemoteGDB::regCache64
AArch64GdbRegCache regCache64
Definition: remote_gdb.hh:118
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
utility.hh
gem5::ArmISA::RemoteGDB
Definition: remote_gdb.hh:63
gem5::ArmISA::RemoteGDB::regCache32
AArch32GdbRegCache regCache32
Definition: remote_gdb.hh:117
gem5::ArmISA::VecElem
uint32_t VecElem
Definition: vec.hh:60
gem5::ArmISA::NumVecV8ArchRegs
const int NumVecV8ArchRegs
Definition: vec.hh:77
gem5::ArmISA::RemoteGDB::getXferFeaturesRead
bool getXferFeaturesRead(const std::string &annex, std::string &output)
Get an XML target description.
Definition: remote_gdb.cc:331
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::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:81
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED::fpcr
uint32_t fpcr
Definition: remote_gdb.hh:103
gem5::BaseRemoteGDB
Definition: remote_gdb.hh:48
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED::x
uint64_t x[31]
Definition: remote_gdb.hh:97
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:111
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::GEM5_PACKED::gpr
uint32_t gpr[16]
Definition: remote_gdb.hh:74
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::r
struct gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED r
gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:271
gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::GEM5_PACKED::v
VecElem v[NumVecV8ArchRegs *NumVecElemPerNeonVecReg]
Definition: remote_gdb.hh:101
gem5::ArmISA::RemoteGDB::availableFeatures
std::vector< std::string > availableFeatures() const
Definition: remote_gdb.hh:124
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84

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