gem5
v20.1.0.0
arch
mips
remote_gdb.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2015-2020 LabWare
3
* Copyright 2014 Google, Inc.
4
* Copyright (c) 2007 The Regents of The University of Michigan
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are
9
* met: redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer;
11
* redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in the
13
* documentation and/or other materials provided with the distribution;
14
* neither the name of the copyright holders nor the names of its
15
* contributors may be used to endorse or promote products derived from
16
* this software without specific prior written permission.
17
*
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
*/
30
31
#ifndef __ARCH_MIPS_REMOTE_GDB_HH__
32
#define __ARCH_MIPS_REMOTE_GDB_HH__
33
34
#include "
arch/mips/registers.hh
"
35
#include "
base/bitfield.hh
"
36
#include "
base/remote_gdb.hh
"
37
38
class
System
;
39
class
ThreadContext
;
40
41
namespace
MipsISA
42
{
43
44
class
RemoteGDB
:
public
BaseRemoteGDB
45
{
46
protected
:
47
bool
acc
(
Addr
addr
,
size_t
len
);
48
49
class
MipsGdbRegCache
:
public
BaseGdbRegCache
50
{
51
using
BaseGdbRegCache::BaseGdbRegCache
;
52
private
:
53
struct
{
54
uint32_t
gpr
[32];
55
uint32_t
sr
;
56
uint32_t
lo
;
57
uint32_t
hi
;
58
uint32_t
badvaddr
;
59
uint32_t
cause
;
60
uint32_t
pc
;
61
uint32_t
fpr
[32];
62
uint32_t
fsr
;
63
uint32_t
fir
;
64
}
r
;
65
public
:
66
char
*
data
()
const
{
return
(
char
*)&
r
; }
67
size_t
size
()
const
{
return
sizeof
(
r
); }
68
void
getRegs
(
ThreadContext
*);
69
void
setRegs
(
ThreadContext
*)
const
;
70
const
std::string
71
name
()
const
72
{
73
return
gdb
->
name
() +
".MipsGdbRegCache"
;
74
}
75
};
76
77
MipsGdbRegCache
regCache
;
78
79
public
:
80
RemoteGDB
(
System
*_system,
ThreadContext
*
tc
,
int
_port
);
81
BaseGdbRegCache
*
gdbRegs
();
82
std::vector<std::string>
83
availableFeatures
()
const
84
{
85
return
{
"qXfer:features:read+"
};
86
};
87
bool
getXferFeaturesRead
(
const
std::string &annex, std::string &
output
);
88
};
89
90
}
// namespace MipsISA
91
92
#endif
/* __ARCH_MIPS_REMOTE_GDB_H__ */
MipsISA::RemoteGDB::MipsGdbRegCache
Definition:
remote_gdb.hh:49
output
static void output(const char *filename)
Definition:
debug.cc:60
MipsISA::RemoteGDB::MipsGdbRegCache::r
struct MipsISA::RemoteGDB::MipsGdbRegCache::@15 r
MipsISA::RemoteGDB::MipsGdbRegCache::hi
uint32_t hi
Definition:
remote_gdb.hh:57
MipsISA::RemoteGDB::MipsGdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition:
remote_gdb.hh:66
MipsISA::RemoteGDB::getXferFeaturesRead
bool getXferFeaturesRead(const std::string &annex, std::string &output)
Get an XML target description.
Definition:
remote_gdb.cc:207
registers.hh
MipsISA::RemoteGDB::regCache
MipsGdbRegCache regCache
Definition:
remote_gdb.hh:77
remote_gdb.hh
MipsISA::RemoteGDB::acc
bool acc(Addr addr, size_t len)
Definition:
remote_gdb.cc:158
MipsISA::RemoteGDB::MipsGdbRegCache::fir
uint32_t fir
Definition:
remote_gdb.hh:63
MipsISA::RemoteGDB::MipsGdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition:
remote_gdb.hh:71
MipsISA::RemoteGDB::gdbRegs
BaseGdbRegCache * gdbRegs()
Definition:
remote_gdb.cc:201
MipsISA::RemoteGDB::MipsGdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition:
remote_gdb.cc:167
BaseGdbRegCache::gdb
BaseRemoteGDB * gdb
Definition:
remote_gdb.hh:125
BaseGdbRegCache::BaseGdbRegCache
BaseGdbRegCache(BaseRemoteGDB *g)
Definition:
remote_gdb.hh:119
std::vector< std::string >
MipsISA
Definition:
decoder.cc:31
BaseRemoteGDB::tc
ThreadContext * tc
Definition:
remote_gdb.hh:212
MipsISA::RemoteGDB::MipsGdbRegCache::pc
uint32_t pc
Definition:
remote_gdb.hh:60
MipsISA::RemoteGDB::RemoteGDB
RemoteGDB(System *_system, ThreadContext *tc, int _port)
Definition:
remote_gdb.cc:149
MipsISA::RemoteGDB::MipsGdbRegCache::fsr
uint32_t fsr
Definition:
remote_gdb.hh:62
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition:
thread_context.hh:88
bitfield.hh
System
Definition:
system.hh:73
BaseRemoteGDB::_port
int _port
Definition:
remote_gdb.hh:193
MipsISA::RemoteGDB::MipsGdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition:
remote_gdb.cc:184
MipsISA::RemoteGDB::MipsGdbRegCache::lo
uint32_t lo
Definition:
remote_gdb.hh:56
MipsISA::RemoteGDB::MipsGdbRegCache::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:67
MipsISA::RemoteGDB::MipsGdbRegCache::sr
uint32_t sr
Definition:
remote_gdb.hh:55
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
MipsISA::RemoteGDB::MipsGdbRegCache::fpr
uint32_t fpr[32]
Definition:
remote_gdb.hh:61
BaseGdbRegCache
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Definition:
remote_gdb.hh:70
MipsISA::RemoteGDB::MipsGdbRegCache::gpr
uint32_t gpr[32]
Definition:
remote_gdb.hh:54
MipsISA::RemoteGDB::MipsGdbRegCache::cause
uint32_t cause
Definition:
remote_gdb.hh:59
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
MipsISA::RemoteGDB::MipsGdbRegCache::badvaddr
uint32_t badvaddr
Definition:
remote_gdb.hh:58
MipsISA::RemoteGDB::availableFeatures
std::vector< std::string > availableFeatures() const
Definition:
remote_gdb.hh:83
MipsISA::RemoteGDB
Definition:
remote_gdb.hh:44
Generated on Wed Sep 30 2020 14:02:01 for gem5 by
doxygen
1.8.17