gem5  v20.1.0.0
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/registers.hh"
50 #include "arch/arm/utility.hh"
51 #include "base/compiler.hh"
52 #include "base/remote_gdb.hh"
53 
54 class System;
55 class ThreadContext;
56 
57 namespace ArmISA
58 {
59 
60 class RemoteGDB : public BaseRemoteGDB
61 {
62  protected:
63  bool acc(Addr addr, size_t len);
64 
66  {
68  private:
69  struct {
70  uint32_t gpr[16];
71  uint32_t cpsr;
72  uint64_t fpr[32];
73  uint32_t fpscr;
74  } M5_ATTR_PACKED r;
75  public:
76  char *data() const { return (char *)&r; }
77  size_t size() const { return sizeof(r); }
78  void getRegs(ThreadContext*);
79  void setRegs(ThreadContext*) const;
80  const std::string
81  name() const
82  {
83  return gdb->name() + ".AArch32GdbRegCache";
84  }
85  };
86 
88  {
90  private:
91  struct {
92  uint64_t x[31];
93  uint64_t spx;
94  uint64_t pc;
95  uint32_t cpsr;
97  uint32_t fpsr;
98  uint32_t fpcr;
99  } M5_ATTR_PACKED r;
100  public:
101  char *data() const { return (char *)&r; }
102  size_t size() const { return sizeof(r); }
103  void getRegs(ThreadContext*);
104  void setRegs(ThreadContext*) const;
105  const std::string
106  name() const
107  {
108  return gdb->name() + ".AArch64GdbRegCache";
109  }
110  };
111 
114 
115  public:
116  RemoteGDB(System *_system, ThreadContext *tc, int _port);
120  {
121  return {"qXfer:features:read+"};
122  };
123  bool getXferFeaturesRead(const std::string &annex, std::string &output);
124 };
125 } // namespace ArmISA
126 
127 #endif /* __ARCH_ARM_REMOTE_GDB_H__ */
output
static void output(const char *filename)
Definition: debug.cc:60
ArmISA::RemoteGDB::AArch32GdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:81
ArmISA::RemoteGDB::AArch64GdbRegCache
Definition: remote_gdb.hh:87
ArmISA::RemoteGDB::AArch64GdbRegCache::v
VecElem v[NumVecV8ArchRegs *NumVecElemPerNeonVecReg]
Definition: remote_gdb.hh:96
ArmISA::RemoteGDB
Definition: remote_gdb.hh:60
remote_gdb.hh
ArmISA::RemoteGDB::AArch64GdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:218
ArmISA::RemoteGDB::regCache64
AArch64GdbRegCache regCache64
Definition: remote_gdb.hh:113
M5_ATTR_PACKED
struct FXSave M5_ATTR_PACKED
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:77
BaseGdbRegCache::gdb
BaseRemoteGDB * gdb
Definition: remote_gdb.hh:125
BaseGdbRegCache::BaseGdbRegCache
BaseGdbRegCache(BaseRemoteGDB *g)
Definition: remote_gdb.hh:119
std::vector< std::string >
ArmISA::RemoteGDB::AArch64GdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition: remote_gdb.hh:106
ArmISA::NumVecV8ArchRegs
const int NumVecV8ArchRegs
Definition: registers.hh:94
ArmISA
Definition: ccregs.hh:41
BaseRemoteGDB::tc
ThreadContext * tc
Definition: remote_gdb.hh:212
ArmISA::RemoteGDB::AArch32GdbRegCache::fpr
uint64_t fpr[32]
Definition: remote_gdb.hh:72
ArmISA::RemoteGDB::AArch32GdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition: remote_gdb.cc:270
ArmISA::VecElem
uint32_t VecElem
Definition: registers.hh:68
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:102
ArmISA::RemoteGDB::AArch64GdbRegCache::pc
uint64_t pc
Definition: remote_gdb.hh:94
ArmISA::RemoteGDB::AArch64GdbRegCache::x
uint64_t x[31]
Definition: remote_gdb.hh:92
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
ArmISA::RemoteGDB::AArch32GdbRegCache::cpsr
uint32_t cpsr
Definition: remote_gdb.hh:71
System
Definition: system.hh:73
BaseRemoteGDB::_port
int _port
Definition: remote_gdb.hh:193
ArmISA::RemoteGDB::AArch32GdbRegCache
Definition: remote_gdb.hh:65
ArmISA::RemoteGDB::AArch32GdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:300
ArmISA::RemoteGDB::AArch64GdbRegCache::fpsr
uint32_t fpsr
Definition: remote_gdb.hh:97
compiler.hh
ArmISA::RemoteGDB::AArch64GdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition: remote_gdb.cc:241
ArmISA::RemoteGDB::availableFeatures
std::vector< std::string > availableFeatures() const
Definition: remote_gdb.hh:119
ArmISA::RemoteGDB::AArch32GdbRegCache::fpscr
uint32_t fpscr
Definition: remote_gdb.hh:73
ArmISA::RemoteGDB::AArch64GdbRegCache::fpcr
uint32_t fpcr
Definition: remote_gdb.hh:98
BaseRemoteGDB
Definition: remote_gdb.hh:43
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
ArmISA::RemoteGDB::AArch32GdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:76
BaseGdbRegCache
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Definition: remote_gdb.hh:70
utility.hh
ArmISA::RemoteGDB::getXferFeaturesRead
bool getXferFeaturesRead(const std::string &annex, std::string &output)
Get an XML target description.
Definition: remote_gdb.cc:330
ArmISA::RemoteGDB::AArch64GdbRegCache::cpsr
uint32_t cpsr
Definition: remote_gdb.hh:95
ArmISA::RemoteGDB::RemoteGDB
RemoteGDB(System *_system, ThreadContext *tc, int _port)
Definition: remote_gdb.cc:189
ArmISA::RemoteGDB::AArch32GdbRegCache::gpr
uint32_t gpr[16]
Definition: remote_gdb.hh:70
ArmISA::RemoteGDB::gdbRegs
BaseGdbRegCache * gdbRegs()
Definition: remote_gdb.cc:355
ArmISA::RemoteGDB::AArch64GdbRegCache::r
struct ArmISA::RemoteGDB::AArch64GdbRegCache::@4 r
ArmISA::RemoteGDB::AArch64GdbRegCache::spx
uint64_t spx
Definition: remote_gdb.hh:93
ArmISA::RemoteGDB::acc
bool acc(Addr addr, size_t len)
Definition: remote_gdb.cc:198
registers.hh
ArmISA::NumVecElemPerNeonVecReg
constexpr unsigned NumVecElemPerNeonVecReg
Definition: registers.hh:64
ArmISA::len
Bitfield< 18, 16 > len
Definition: miscregs_types.hh:439
addr
ip6_addr_t addr
Definition: inet.hh:423
BaseRemoteGDB::name
std::string name()
Definition: remote_gdb.cc:332
ArmISA::RemoteGDB::AArch32GdbRegCache::r
struct ArmISA::RemoteGDB::AArch32GdbRegCache::@3 r
ArmISA::RemoteGDB::regCache32
AArch32GdbRegCache regCache32
Definition: remote_gdb.hh:112
ArmISA::RemoteGDB::AArch64GdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition: remote_gdb.hh:101

Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17