gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
39#include "base/remote_gdb.hh"
40
41namespace gem5
42{
43
44namespace PowerISA
45{
46
47
49{
50 protected:
51 bool acc(Addr addr, size_t len);
52
54 {
56 private:
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); }
74 void setRegs(ThreadContext*) const;
75 const std::string
76 name() const
77 {
78 return gdb->name() + ".PowerGdbRegCache";
79 }
80 };
81
83 {
85 private:
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, ListenSocketConfig _listen_config);
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
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
struct gem5::PowerISA::RemoteGDB::Power64GdbRegCache::GEM5_PACKED r
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
const std::string name() const
Return the name to use in places like DPRINTF.
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).
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
const std::string name() const
Return the name to use in places like DPRINTF.
Definition remote_gdb.hh:76
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition remote_gdb.hh:71
struct gem5::PowerISA::RemoteGDB::PowerGdbRegCache::GEM5_PACKED r
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
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
PowerGdbRegCache regCache32
Power64GdbRegCache regCache64
RemoteGDB(System *_system, ListenSocketConfig _listen_config)
bool getXferFeaturesRead(const std::string &annex, std::string &output)
Get an XML target description.
bool acc(Addr addr, size_t len)
BaseGdbRegCache * gdbRegs()
std::vector< std::string > availableFeatures() const
ThreadContext is the external interface to all thread state for anything outside of the CPU.
STL vector class.
Definition stl.hh:37
BaseGdbRegCache(BaseRemoteGDB *g)
std::string name()
Bitfield< 18, 16 > len
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
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 Tue Jun 18 2024 16:23:59 for gem5 by doxygen 1.11.0