gem5
v24.0.0.0
Loading...
Searching...
No Matches
arch
x86
remote_gdb.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2015 LabWare
3
* Copyright 2014 Google, Inc.
4
* Copyright (c) 2007 The Hewlett-Packard Development Company
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
* Redistribution and use in source and binary forms, with or without
17
* modification, are permitted provided that the following conditions are
18
* met: redistributions of source code must retain the above copyright
19
* notice, this list of conditions and the following disclaimer;
20
* redistributions in binary form must reproduce the above copyright
21
* notice, this list of conditions and the following disclaimer in the
22
* documentation and/or other materials provided with the distribution;
23
* neither the name of the copyright holders nor the names of its
24
* contributors may be used to endorse or promote products derived from
25
* this software without specific prior written permission.
26
*
27
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
*/
39
40
#ifndef __ARCH_X86_REMOTEGDB_HH__
41
#define __ARCH_X86_REMOTEGDB_HH__
42
43
#include <algorithm>
44
45
#include "
arch/x86/types.hh
"
46
#include "
base/compiler.hh
"
47
#include "
base/remote_gdb.hh
"
48
49
namespace
gem5
50
{
51
52
class
System;
53
class
ThreadContext;
54
55
namespace
X86ISA
56
{
57
class
RemoteGDB
:
public
BaseRemoteGDB
58
{
59
protected
:
60
bool
acc
(
Addr
addr
,
size_t
len
);
61
bool
checkBpKind
(
size_t
kind) {
return
kind == 1; }
62
class
X86GdbRegCache
:
public
BaseGdbRegCache
63
{
64
using
BaseGdbRegCache::BaseGdbRegCache
;
65
private
:
66
struct
67
{
68
uint32_t
eax
;
69
uint32_t
ecx
;
70
uint32_t
edx
;
71
uint32_t
ebx
;
72
uint32_t
esp
;
73
uint32_t
ebp
;
74
uint32_t
esi
;
75
uint32_t
edi
;
76
uint32_t
eip
;
77
uint32_t
eflags
;
78
uint32_t
cs
;
79
uint32_t
ss
;
80
uint32_t
ds
;
81
uint32_t
es
;
82
uint32_t
fs
;
83
uint32_t
gs
;
84
}
r
;
85
public
:
86
char
*
data
()
const
{
return
(
char
*)&
r
; }
87
size_t
size
()
const
{
return
sizeof
(
r
); }
88
void
getRegs
(
ThreadContext
*);
89
void
setRegs
(
ThreadContext
*)
const
;
90
const
std::string
91
name
()
const
92
{
93
return
gdb
->
name
() +
".X86GdbRegCache"
;
94
}
95
};
96
97
class
AMD64GdbRegCache
:
public
BaseGdbRegCache
98
{
99
using
BaseGdbRegCache::BaseGdbRegCache
;
100
private
:
101
struct
GEM5_PACKED
102
{
103
uint64_t
rax
;
104
uint64_t
rbx
;
105
uint64_t
rcx
;
106
uint64_t
rdx
;
107
uint64_t
rsi
;
108
uint64_t
rdi
;
109
uint64_t
rbp
;
110
uint64_t
rsp
;
111
uint64_t
r8
;
112
uint64_t
r9
;
113
uint64_t
r10
;
114
uint64_t
r11
;
115
uint64_t
r12
;
116
uint64_t
r13
;
117
uint64_t
r14
;
118
uint64_t
r15
;
119
uint64_t
rip
;
120
uint32_t
eflags
;
121
uint32_t
cs
;
122
uint32_t
ss
;
123
uint32_t
ds
;
124
uint32_t
es
;
125
uint32_t
fs
;
126
uint32_t
gs
;
127
/*
128
* We do not model st[], FPU status regs, xmm[] etc.
129
* While it's not ok to have G-packets larger than what gdb
130
* knows about, it is ok to have smaller ones.
131
*/
132
}
r
;
133
public
:
134
char
*
data
()
const
{
return
(
char
*)&
r
; }
135
size_t
size
()
const
{
return
sizeof
(
r
); }
136
void
getRegs
(
ThreadContext
*);
137
void
setRegs
(
ThreadContext
*)
const
;
138
const
std::string
139
name
()
const
140
{
141
return
gdb
->
name
() +
".AMD64GdbRegCache"
;
142
}
143
};
144
145
X86GdbRegCache
regCache32
;
146
AMD64GdbRegCache
regCache64
;
147
148
public
:
149
RemoteGDB
(
System
*
system
,
ListenSocketConfig
_listen_config);
150
BaseGdbRegCache
*
gdbRegs
();
151
};
152
153
}
// namespace X86ISA
154
}
// namespace gem5
155
156
#endif
// __ARCH_X86_REMOTEGDB_HH__
types.hh
remote_gdb.hh
gem5::BaseGdbRegCache
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Definition
remote_gdb.hh:86
gem5::BaseGdbRegCache::gdb
BaseRemoteGDB * gdb
Definition
remote_gdb.hh:140
gem5::BaseRemoteGDB
Definition
remote_gdb.hh:144
gem5::BaseRemoteGDB::system
System * system()
Definition
remote_gdb.hh:444
gem5::ListenSocketConfig
Definition
socket.hh:115
gem5::System
Definition
system.hh:75
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition
guest_abi.test.cc:41
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache
Definition
remote_gdb.hh:98
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition
remote_gdb.hh:134
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition
remote_gdb.hh:139
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition
remote_gdb.cc:126
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::r
struct gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED r
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition
remote_gdb.cc:178
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::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:135
gem5::X86ISA::RemoteGDB::X86GdbRegCache
Definition
remote_gdb.hh:63
gem5::X86ISA::RemoteGDB::X86GdbRegCache::gs
uint32_t gs
Definition
remote_gdb.hh:83
gem5::X86ISA::RemoteGDB::X86GdbRegCache::getRegs
void getRegs(ThreadContext *)
Fill the raw buffer from the registers in the ThreadContext.
Definition
remote_gdb.cc:156
gem5::X86ISA::RemoteGDB::X86GdbRegCache::es
uint32_t es
Definition
remote_gdb.hh:81
gem5::X86ISA::RemoteGDB::X86GdbRegCache::ebx
uint32_t ebx
Definition
remote_gdb.hh:71
gem5::X86ISA::RemoteGDB::X86GdbRegCache::ss
uint32_t ss
Definition
remote_gdb.hh:79
gem5::X86ISA::RemoteGDB::X86GdbRegCache::ecx
uint32_t ecx
Definition
remote_gdb.hh:69
gem5::X86ISA::RemoteGDB::X86GdbRegCache::edi
uint32_t edi
Definition
remote_gdb.hh:75
gem5::X86ISA::RemoteGDB::X86GdbRegCache::eflags
uint32_t eflags
Definition
remote_gdb.hh:77
gem5::X86ISA::RemoteGDB::X86GdbRegCache::name
const std::string name() const
Return the name to use in places like DPRINTF.
Definition
remote_gdb.hh:91
gem5::X86ISA::RemoteGDB::X86GdbRegCache::data
char * data() const
Return the pointer to the raw bytes buffer containing the register values.
Definition
remote_gdb.hh:86
gem5::X86ISA::RemoteGDB::X86GdbRegCache::eax
uint32_t eax
Definition
remote_gdb.hh:68
gem5::X86ISA::RemoteGDB::X86GdbRegCache::r
struct gem5::X86ISA::RemoteGDB::X86GdbRegCache::@41 r
gem5::X86ISA::RemoteGDB::X86GdbRegCache::fs
uint32_t fs
Definition
remote_gdb.hh:82
gem5::X86ISA::RemoteGDB::X86GdbRegCache::esp
uint32_t esp
Definition
remote_gdb.hh:72
gem5::X86ISA::RemoteGDB::X86GdbRegCache::cs
uint32_t cs
Definition
remote_gdb.hh:78
gem5::X86ISA::RemoteGDB::X86GdbRegCache::setRegs
void setRegs(ThreadContext *) const
Set the ThreadContext's registers from the values in the raw buffer.
Definition
remote_gdb.cc:214
gem5::X86ISA::RemoteGDB::X86GdbRegCache::eip
uint32_t eip
Definition
remote_gdb.hh:76
gem5::X86ISA::RemoteGDB::X86GdbRegCache::edx
uint32_t edx
Definition
remote_gdb.hh:70
gem5::X86ISA::RemoteGDB::X86GdbRegCache::ebp
uint32_t ebp
Definition
remote_gdb.hh:73
gem5::X86ISA::RemoteGDB::X86GdbRegCache::esi
uint32_t esi
Definition
remote_gdb.hh:74
gem5::X86ISA::RemoteGDB::X86GdbRegCache::ds
uint32_t ds
Definition
remote_gdb.hh:80
gem5::X86ISA::RemoteGDB::X86GdbRegCache::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:87
gem5::X86ISA::RemoteGDB
Definition
remote_gdb.hh:58
gem5::X86ISA::RemoteGDB::gdbRegs
BaseGdbRegCache * gdbRegs()
gem5::X86ISA::RemoteGDB::acc
bool acc(Addr addr, size_t len)
gem5::X86ISA::RemoteGDB::regCache64
AMD64GdbRegCache regCache64
Definition
remote_gdb.hh:146
gem5::X86ISA::RemoteGDB::RemoteGDB
RemoteGDB(System *system, ListenSocketConfig _listen_config)
gem5::X86ISA::RemoteGDB::regCache32
X86GdbRegCache regCache32
Definition
remote_gdb.hh:145
gem5::X86ISA::RemoteGDB::checkBpKind
bool checkBpKind(size_t kind)
Definition
remote_gdb.hh:61
compiler.hh
gem5::BaseGdbRegCache::BaseGdbRegCache
BaseGdbRegCache(BaseRemoteGDB *g)
Definition
remote_gdb.hh:134
gem5::BaseRemoteGDB::name
std::string name()
Definition
remote_gdb.cc:409
gem5::ArmISA::len
Bitfield< 18, 16 > len
Definition
misc_types.hh:529
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition
types.hh:84
gem5
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition
binary32.hh:36
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition
types.hh:147
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED
Definition
remote_gdb.hh:102
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r8
uint64_t r8
Definition
remote_gdb.hh:111
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::ss
uint32_t ss
Definition
remote_gdb.hh:122
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rcx
uint64_t rcx
Definition
remote_gdb.hh:105
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::fs
uint32_t fs
Definition
remote_gdb.hh:125
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r12
uint64_t r12
Definition
remote_gdb.hh:115
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r10
uint64_t r10
Definition
remote_gdb.hh:113
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r14
uint64_t r14
Definition
remote_gdb.hh:117
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::gs
uint32_t gs
Definition
remote_gdb.hh:126
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::es
uint32_t es
Definition
remote_gdb.hh:124
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::ds
uint32_t ds
Definition
remote_gdb.hh:123
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rsi
uint64_t rsi
Definition
remote_gdb.hh:107
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rdx
uint64_t rdx
Definition
remote_gdb.hh:106
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r9
uint64_t r9
Definition
remote_gdb.hh:112
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rbp
uint64_t rbp
Definition
remote_gdb.hh:109
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r15
uint64_t r15
Definition
remote_gdb.hh:118
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rsp
uint64_t rsp
Definition
remote_gdb.hh:110
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r13
uint64_t r13
Definition
remote_gdb.hh:116
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rip
uint64_t rip
Definition
remote_gdb.hh:119
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rbx
uint64_t rbx
Definition
remote_gdb.hh:104
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::r11
uint64_t r11
Definition
remote_gdb.hh:114
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rdi
uint64_t rdi
Definition
remote_gdb.hh:108
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::cs
uint32_t cs
Definition
remote_gdb.hh:121
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::rax
uint64_t rax
Definition
remote_gdb.hh:103
gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::GEM5_PACKED::eflags
uint32_t eflags
Definition
remote_gdb.hh:120
Generated on Tue Jun 18 2024 16:23:59 for gem5 by
doxygen
1.11.0