gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
remote_gdb.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 ARM Limited
3  *
4  * The license below extends only to copyright in the software and shall
5  * not be construed as granting a license to any other intellectual
6  * property including but not limited to intellectual property relating
7  * to a hardware implementation of the functionality of the software
8  * licensed hereunder. You may use the software subject to the license
9  * terms below provided that you ensure that this notice is replicated
10  * unmodified and in its entirety in all distributions of the software,
11  * modified or unmodified, in source code or in binary form.
12  *
13  * Copyright 2015, 2021 LabWare
14  * Copyright 2014 Google, Inc.
15  * Copyright (c) 2002-2005 The Regents of The University of Michigan
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions are
20  * met: redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer;
22  * redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution;
25  * neither the name of the copyright holders nor the names of its
26  * contributors may be used to endorse or promote products derived from
27  * this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  */
41 
42 #ifndef __REMOTE_GDB_HH__
43 #define __REMOTE_GDB_HH__
44 
45 
46 #include <cstdint>
47 #include <exception>
48 #include <map>
49 #include <string>
50 #include <vector>
51 
52 #include "arch/generic/pcstate.hh"
53 #include "base/cprintf.hh"
54 #include "base/pollevent.hh"
55 #include "base/socket.hh"
56 #include "base/types.hh"
57 #include "cpu/pc_event.hh"
58 #include "gdbremote/signals.hh"
59 #include "sim/debug.hh"
60 #include "sim/eventq.hh"
61 
62 /*
63  * This file implements a client for the GDB remote serial protocol as
64  * described in this official documentation:
65  *
66  * https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Protocol.html
67  */
68 
69 namespace gem5
70 {
71 
72 class System;
73 class ThreadContext;
74 
75 class BaseRemoteGDB;
76 class HardBreakpoint;
77 
86 {
87  public:
88 
96  virtual char *data() const = 0;
97 
104  virtual size_t size() const = 0;
105 
111  virtual void getRegs(ThreadContext*) = 0;
112 
119  virtual void setRegs(ThreadContext*) const = 0;
120 
129  virtual const std::string name() const = 0;
130 
135  {}
137  {}
138 
139  protected:
141 };
142 
143 class BaseRemoteGDB
144 {
145  friend class HardBreakpoint;
146  public:
147 
156  BaseRemoteGDB(System *system, ListenSocketConfig _listen_config);
157  virtual ~BaseRemoteGDB();
158 
159  std::string name();
160 
161  void listen();
162  void connect();
163 
164  const ListenSocket &hostSocket() const;
165 
166  void attach(int fd);
167  void detach();
168  bool isAttached() { return attached; }
169 
170  void addThreadContext(ThreadContext *_tc);
173 
174  void trap(ContextID id, GDBSignal sig,const std::string& stopReason="");
175  bool sendMessage(std::string message);
176  //schedule a trap event with these properties
177  void scheduleTrapEvent(ContextID id,GDBSignal type, int delta,
178  std::string stopReason); // end of api_remote_gdb
180 
181  template <class GDBStub, class ...Args>
182  static BaseRemoteGDB *
183  build(ListenSocketConfig listen_config, Args... args)
184  {
185  if (listen_config)
186  return new GDBStub(args..., listen_config);
187  else
188  return nullptr;
189  }
190 
191  protected:
192  /*
193  * Connection to the external GDB.
194  */
195 
196  /*
197  * Asynchronous socket events and event handlers.
198  *
199  * These events occur asynchronously and are handled asynchronously
200  * to main simulation loop - therefore they *shall not* interact with
201  * rest of gem5.
202  *
203  * The only thing they do is to schedule a synchronous event at instruction
204  * boundary to deal with the request.
205  */
206  void incomingData(int revent);
207  void incomingConnection(int revent);
208 
209  template <void (BaseRemoteGDB::*F)(int revent)>
210  class SocketEvent : public PollEvent
211  {
212  protected:
214 
215  public:
217  PollEvent(fd, e), gdb(gdb)
218  {}
219 
220  void process(int revent) { (gdb->*F)(revent); }
221  };
222 
223  typedef SocketEvent<&BaseRemoteGDB::incomingConnection>
227 
230 
233 
235 
236  // The socket commands come in through.
237  int fd;
238 
239  // Transfer data to/from GDB.
240  uint8_t getbyte();
241  bool try_getbyte(uint8_t* c,int timeout=-1);//return true if successful
242  void putbyte(uint8_t b);
243 
244  void recv(std::vector<char> &bp);
245  void send(const char *data);
246  void send(const std::string &data) { send(data.c_str()); }
247 
248  template <typename ...Args>
249  void
250  send(const char *format, const Args &...args)
251  {
252  send(csprintf(format, args...));
253  }
254 
255  /*
256  * Process commands from remote GDB. If simulation has been
257  * stopped because of some kind of fault (as segmentation violation,
258  * or SW trap), 'signum' is the signal value reported back to GDB
259  * in "S" packet (this is done in trap()).
260  */
261  void processCommands(GDBSignal sig=GDBSignal::ZERO);
262 
263  /*
264  * Simulator side debugger state.
265  */
266  bool attached = false;
267  bool threadSwitching = false;
268 
270 
271  std::map<ContextID, ThreadContext *> threads;
272  ThreadContext *tc = nullptr;
273 
275 
278 
279  class TrapEvent : public Event
280  {
281  protected:
282  GDBSignal _type;
284  std::string _stopReason;
286 
287  public:
289  {}
290 
291  void type(GDBSignal t) { _type = t; }
292  void stopReason(std::string s) {_stopReason = s; }
293  void id(ContextID id) { _id = id; }
295  } trapEvent;
296 
297  /*
298  * The interface to the simulated system.
299  */
300  virtual bool readBlob(Addr vaddr, size_t size, char *data);
301  virtual bool writeBlob(Addr vaddr, size_t size, const char *data);
302  bool read(Addr vaddr, size_t size, char *data);
303  bool write(Addr vaddr, size_t size, const char *data);
304 
305  template <class T> T read(Addr addr);
306  template <class T> void write(Addr addr, T data);
307 
308  // Single step.
309  void singleStep();
311 
312  void clearSingleStep();
313  void setSingleStep();
314 
316  void scheduleInstCommitEvent(Event *ev, int delta,ThreadContext* _tc);
317  void scheduleInstCommitEvent(Event *ev, int delta){
318  scheduleInstCommitEvent(ev, delta,tc);
319  };
322 
323  // Breakpoints.
324  void insertSoftBreak(Addr addr, size_t kind);
325  void removeSoftBreak(Addr addr, size_t kind);
326  void insertHardBreak(Addr addr, size_t kind);
327  void removeHardBreak(Addr addr, size_t kind);
328 
329  void sendTPacket(GDBSignal sig, ContextID id,
330  const std::string& stopReason);
331  void sendSPacket(GDBSignal sig);
332  //The OPacket allow to send string to be displayed by the remote GDB
333  void sendOPacket(const std::string message);
334  /*
335  * GDB commands.
336  */
337  struct GdbCommand
338  {
339  public:
340  struct Context
341  {
342  const GdbCommand *cmd;
343  char cmdByte;
344  GDBSignal type;
345  char *data;
346  int len;
347  };
348 
349  typedef bool (BaseRemoteGDB::*Func)(Context &ctx);
350 
351  const char * const name;
352  const Func func;
353 
354  GdbCommand(const char *_name, Func _func) : name(_name), func(_func) {}
355  };
356 
357  static std::map<char, GdbCommand> commandMap;
358 
360  {
361  public:
362  struct Context
363  {
365  std::string cmdTxt;
366  GDBSignal type;
367  char *data;
368  int len;
369  };
370 
371  typedef bool (BaseRemoteGDB::*Func)(Context &ctx);
372 
373  const char * const name;
374  const Func func;
375 
376  GdbMultiLetterCommand(const char *_name, Func _func) :
377  name(_name), func(_func) {}
378  };
379 
380 
381  static std::map<std::string, GdbMultiLetterCommand> multiLetterMap;
382 
384 
385  bool cmdSignal(GdbCommand::Context &ctx);
386  bool cmdCont(GdbCommand::Context &ctx);
388  bool cmdDetach(GdbCommand::Context &ctx);
389  bool cmdRegR(GdbCommand::Context &ctx);
390  bool cmdRegW(GdbCommand::Context &ctx);
393  bool cmdMemR(GdbCommand::Context &ctx);
394  bool cmdMemW(GdbCommand::Context &ctx);
395  bool cmdQueryVar(GdbCommand::Context &ctx);
396  bool cmdStep(GdbCommand::Context &ctx);
402 
403  //Multi letter command
405 
408 
410  {
411  struct Context
412  {
413  const std::string &name;
415 
416  Context(const std::string &_name) : name(_name) {}
417  };
418 
419  using Func = bool (BaseRemoteGDB::*)(Context &ctx);
420 
421  const char * const argSep;
422  const Func func;
423 
424  QuerySetCommand(Func _func, const char *_argSep=nullptr) :
425  argSep(_argSep), func(_func)
426  {}
427  };
428 
429  static std::map<std::string, QuerySetCommand> queryMap;
430 
431  bool queryC(QuerySetCommand::Context &ctx);
437 
438  size_t threadInfoIdx = 0;
441 
442  protected:
443  ThreadContext *context() { return tc; }
444  System *system() { return sys; }
445 
446  void encodeBinaryData(const std::string &unencoded,
447  std::string &encoded) const;
448 
449  void encodeXferResponse(const std::string &unencoded,
450  std::string &encoded, size_t offset, size_t unencoded_length) const;
451 
452  // checkBpKind checks if a kind of breakpoint is legal. This function should
453  // be implemented by subclasses by arch. The "kind" is considered to be
454  // breakpoint size in some arch.
455  virtual bool checkBpKind(size_t kind);
456 
457  virtual BaseGdbRegCache *gdbRegs() = 0;
458 
459  virtual bool acc(Addr addr, size_t len) = 0;
460 
462 
470  virtual bool getXferFeaturesRead(const std::string &annex,
471  std::string &output);
472 };
473 
474 template <class T>
475 inline T
477 {
478  T temp;
479  read(addr, sizeof(T), (char *)&temp);
480  return temp;
481 }
482 
483 template <class T>
484 inline void
486 {
487  write(addr, sizeof(T), (const char *)&data);
488 }
489 
490 } // namespace gem5
491 
492 #endif /* __REMOTE_GDB_H__ */
gem5::BaseRemoteGDB::incomingData
void incomingData(int revent)
Definition: remote_gdb.cc:606
gem5::BaseRemoteGDB::hostSocket
const ListenSocket & hostSocket() const
Definition: remote_gdb.cc:448
gem5::VegaISA::s
Bitfield< 1 > s
Definition: pagetable.hh:64
socket.hh
gem5::BaseRemoteGDB::cmdUnsupported
bool cmdUnsupported(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1074
gem5::BaseRemoteGDB::sendMessage
bool sendMessage(std::string message)
Definition: remote_gdb.cc:583
gem5::BaseRemoteGDB::GdbMultiLetterCommand::name
const char *const name
Definition: remote_gdb.hh:373
gem5::BaseRemoteGDB::cmdVKill
bool cmdVKill(GdbMultiLetterCommand::Context &ctx)
Definition: remote_gdb.cc:1294
gem5::BaseRemoteGDB::scheduleTrapEvent
void scheduleTrapEvent(ContextID id, GDBSignal type, int delta, std::string stopReason)
Definition: remote_gdb.cc:973
gem5::BaseRemoteGDB::GdbMultiLetterCommand::GdbMultiLetterCommand
GdbMultiLetterCommand(const char *_name, Func _func)
Definition: remote_gdb.hh:376
gem5::BaseRemoteGDB::isAttached
bool isAttached()
Definition: remote_gdb.hh:168
gem5::BaseRemoteGDB::multiLetterMap
static std::map< std::string, GdbMultiLetterCommand > multiLetterMap
Definition: remote_gdb.hh:381
gem5::BaseRemoteGDB::cmdDumpPageTable
bool cmdDumpPageTable(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1547
gem5::ArmISA::format
Bitfield< 31, 29 > format
Definition: misc_types.hh:704
gem5::BaseRemoteGDB::cmdMultiLetter
bool cmdMultiLetter(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1250
gem5::BaseRemoteGDB::cmdSetThread
bool cmdSetThread(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1146
gem5::BaseRemoteGDB::sendOPacket
void sendOPacket(const std::string message)
Definition: remote_gdb.cc:968
gem5::BaseRemoteGDB::querySymbol
bool querySymbol(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1400
gem5::BaseRemoteGDB::cmdMultiUnsupported
bool cmdMultiUnsupported(GdbMultiLetterCommand::Context &ctx)
Definition: remote_gdb.cc:1302
gem5::BaseRemoteGDB::insertSoftBreak
void insertSoftBreak(Addr addr, size_t kind)
Definition: remote_gdb.cc:900
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::BaseRemoteGDB::listen
void listen()
Definition: remote_gdb.cc:415
gem5::BaseRemoteGDB::TrapEvent::_type
GDBSignal _type
Definition: remote_gdb.hh:282
gem5::BaseRemoteGDB::GdbMultiLetterCommand::func
const Func func
Definition: remote_gdb.hh:374
gem5::BaseRemoteGDB::GdbCommand::name
const char *const name
Definition: remote_gdb.hh:351
gem5::BaseRemoteGDB::gdbRegs
virtual BaseGdbRegCache * gdbRegs()=0
gem5::BaseRemoteGDB::QuerySetCommand::Context::name
const std::string & name
Definition: remote_gdb.hh:413
gem5::BaseRemoteGDB::cmdRegR
bool cmdRegR(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1122
gem5::output
static void output(const char *filename)
Definition: debug.cc:60
gem5::BaseRemoteGDB::GdbMultiLetterCommand::Context::data
char * data
Definition: remote_gdb.hh:367
gem5::BaseRemoteGDB::cmdIsThreadAlive
bool cmdIsThreadAlive(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1186
gem5::BaseRemoteGDB::encodeBinaryData
void encodeBinaryData(const std::string &unencoded, std::string &encoded) const
Definition: remote_gdb.cc:1522
gem5::BaseRemoteGDB::GdbCommand::Func
bool(BaseRemoteGDB::* Func)(Context &ctx)
Definition: remote_gdb.hh:349
gem5::BaseRemoteGDB::putbyte
void putbyte(uint8_t b)
Definition: remote_gdb.cc:674
gem5::BaseGdbRegCache::name
virtual const std::string name() const =0
Return the name to use in places like DPRINTF.
gem5::BaseRemoteGDB::scheduleInstCommitEvent
void scheduleInstCommitEvent(Event *ev, int delta, ThreadContext *_tc)
Schedule an event which will be triggered "delta" instructions later.
Definition: remote_gdb.cc:985
gem5::BaseRemoteGDB::scheduleInstCommitEvent
void scheduleInstCommitEvent(Event *ev, int delta)
Definition: remote_gdb.hh:317
gem5::BaseRemoteGDB::QuerySetCommand
Definition: remote_gdb.hh:409
gem5::BaseRemoteGDB::fd
int fd
Definition: remote_gdb.hh:237
gem5::ListenSocketConfig
Definition: socket.hh:114
gem5::BaseRemoteGDB::removeHardBreak
void removeHardBreak(Addr addr, size_t kind)
Definition: remote_gdb.cc:933
gem5::ListenSocket
Definition: socket.hh:46
gem5::BaseRemoteGDB::commandMap
static std::map< char, GdbCommand > commandMap
Definition: remote_gdb.hh:357
gem5::ArmISA::e
Bitfield< 9 > e
Definition: misc_types.hh:65
gem5::BaseRemoteGDB::insertHardBreak
void insertHardBreak(Addr addr, size_t kind)
Definition: remote_gdb.cc:918
gem5::BaseRemoteGDB::TrapEvent
Definition: remote_gdb.hh:279
gem5::BaseRemoteGDB::acc
virtual bool acc(Addr addr, size_t len)=0
gem5::BaseRemoteGDB::read
bool read(Addr vaddr, size_t size, char *data)
Definition: remote_gdb.cc:839
gem5::BaseRemoteGDB::send
void send(const char *format, const Args &...args)
Definition: remote_gdb.hh:250
std::vector< char >
gem5::BaseRemoteGDB::singleStepEvent
MemberEventWrapper<&BaseRemoteGDB::singleStep > singleStepEvent
Definition: remote_gdb.hh:310
gem5::csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:161
gem5::BaseRemoteGDB::GdbMultiLetterCommand::Context
Definition: remote_gdb.hh:362
gem5::BaseRemoteGDB::connectEvent
MemberEventWrapper<&BaseRemoteGDB::connect > connectEvent
Definition: remote_gdb.hh:276
gem5::BaseRemoteGDB::cmdMemW
bool cmdMemW(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1226
gem5::BaseRemoteGDB::GdbMultiLetterCommand::Context::len
int len
Definition: remote_gdb.hh:368
gem5::BaseRemoteGDB::TrapEvent::_id
ContextID _id
Definition: remote_gdb.hh:283
gem5::PollEvent
Definition: pollevent.hh:43
gem5::BaseRemoteGDB::GdbCommand::Context::data
char * data
Definition: remote_gdb.hh:345
gem5::BaseRemoteGDB::sys
System * sys
Definition: remote_gdb.hh:269
gem5::BaseRemoteGDB::cmdStep
bool cmdStep(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1567
gem5::BaseRemoteGDB::TrapEvent::stopReason
void stopReason(std::string s)
Definition: remote_gdb.hh:292
gem5::BaseGdbRegCache
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
Definition: remote_gdb.hh:85
gem5::BaseRemoteGDB::SocketEvent::gdb
BaseRemoteGDB * gdb
Definition: remote_gdb.hh:213
gem5::BaseRemoteGDB::GdbCommand::Context::type
GDBSignal type
Definition: remote_gdb.hh:344
gem5::BaseRemoteGDB::sendTPacket
void sendTPacket(GDBSignal sig, ContextID id, const std::string &stopReason)
Definition: remote_gdb.cc:952
gem5::BaseRemoteGDB::IncomingConnectionEvent
friend IncomingConnectionEvent
Definition: remote_gdb.hh:228
gem5::BaseRemoteGDB::queryXfer
bool queryXfer(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1359
gem5::HardBreakpoint
Definition: remote_gdb.cc:171
gem5::BaseRemoteGDB::BaseRemoteGDB
BaseRemoteGDB(System *system, ListenSocketConfig _listen_config)
Interface to other parts of the simulator.
Definition: remote_gdb.cc:393
gem5::BaseRemoteGDB::queryC
bool queryC(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1338
gem5::BaseRemoteGDB::GdbCommand::Context::cmd
const GdbCommand * cmd
Definition: remote_gdb.hh:342
gem5::BaseRemoteGDB::SocketEvent
Definition: remote_gdb.hh:210
gem5::BaseRemoteGDB::queryRcmd
bool queryRcmd(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1444
gem5::BaseRemoteGDB::attach
void attach(int fd)
Definition: remote_gdb.cc:456
gem5::BaseGdbRegCache::getRegs
virtual void getRegs(ThreadContext *)=0
Fill the raw buffer from the registers in the ThreadContext.
gem5::BaseRemoteGDB::GdbCommand::GdbCommand
GdbCommand(const char *_name, Func _func)
Definition: remote_gdb.hh:354
gem5::BaseRemoteGDB::TrapEvent::gdb
BaseRemoteGDB * gdb
Definition: remote_gdb.hh:285
gem5::BaseRemoteGDB::incomingDataEvent
IncomingDataEvent * incomingDataEvent
Definition: remote_gdb.hh:232
gem5::BaseRemoteGDB::GdbCommand::func
const Func func
Definition: remote_gdb.hh:352
gem5::VegaISA::c
Bitfield< 2 > c
Definition: pagetable.hh:63
gem5::BaseRemoteGDB::encodeXferResponse
void encodeXferResponse(const std::string &unencoded, std::string &encoded, size_t offset, size_t unencoded_length) const
Definition: remote_gdb.cc:1536
gem5::System
Definition: system.hh:74
gem5::BaseRemoteGDB::availableFeatures
virtual std::vector< std::string > availableFeatures() const
Definition: remote_gdb.cc:1509
gem5::ArmISA::b
Bitfield< 7 > b
Definition: misc_types.hh:438
gem5::BaseRemoteGDB::incomingConnectionEvent
IncomingConnectionEvent * incomingConnectionEvent
Definition: remote_gdb.hh:231
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
gem5::VegaISA::t
Bitfield< 51 > t
Definition: pagetable.hh:56
gem5::BaseRemoteGDB::writeBlob
virtual bool writeBlob(Addr vaddr, size_t size, const char *data)
Definition: remote_gdb.cc:827
gem5::BaseRemoteGDB::QuerySetCommand::argSep
const char *const argSep
Definition: remote_gdb.hh:421
gem5::BaseRemoteGDB::GdbMultiLetterCommand::Context::cmd
const GdbMultiLetterCommand * cmd
Definition: remote_gdb.hh:364
gem5::BaseRemoteGDB::TrapEvent::process
void process()
Definition: remote_gdb.hh:294
gem5::BaseRemoteGDB::tc
ThreadContext * tc
Definition: remote_gdb.hh:272
gem5::Event
Definition: eventq.hh:254
gem5::BaseRemoteGDB::cmdSignal
bool cmdSignal(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1083
debug.hh
pollevent.hh
gem5::BaseRemoteGDB::setSingleStep
void setSingleStep()
Definition: remote_gdb.cc:893
gem5::X86ISA::type
type
Definition: misc.hh:734
gem5::BaseRemoteGDB::SocketEvent::process
void process(int revent)
Definition: remote_gdb.hh:220
gem5::BaseRemoteGDB::name
std::string name()
Definition: remote_gdb.cc:409
len
uint16_t len
Definition: helpers.cc:62
gem5::BaseRemoteGDB::cmdAsyncCont
bool cmdAsyncCont(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1102
gem5::BaseGdbRegCache::size
virtual size_t size() const =0
Return the size of the raw buffer, in bytes (i.e., half of the number of digits in the g/G packet).
gem5::BaseRemoteGDB::queryAttached
bool queryAttached(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1407
gem5::BaseRemoteGDB::IncomingDataEvent
friend IncomingDataEvent
Definition: remote_gdb.hh:229
gem5::ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:144
gem5::BaseGdbRegCache::data
virtual char * data() const =0
Return the pointer to the raw bytes buffer containing the register values.
gem5::BaseRemoteGDB::send
void send(const std::string &data)
Definition: remote_gdb.hh:246
cprintf.hh
gem5::BaseGdbRegCache::gdb
BaseRemoteGDB * gdb
Definition: remote_gdb.hh:140
gem5::BaseRemoteGDB::listener
ListenSocketPtr listener
Definition: remote_gdb.hh:234
gem5::BaseRemoteGDB::querySupported
bool querySupported(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1345
gem5::BaseRemoteGDB::trapEvent
gem5::BaseRemoteGDB::TrapEvent trapEvent
gem5::BaseRemoteGDB::QuerySetCommand::Context
Definition: remote_gdb.hh:411
gem5::BaseRemoteGDB::querySThreadInfo
bool querySThreadInfo(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1461
gem5::BaseRemoteGDB::replaceThreadContext
void replaceThreadContext(ThreadContext *tc)
Definition: remote_gdb.hh:54
gem5::BaseRemoteGDB::cmdRegW
bool cmdRegW(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1132
gem5::BaseGdbRegCache::BaseGdbRegCache
BaseGdbRegCache(BaseRemoteGDB *g)
Definition: remote_gdb.hh:134
gem5::BaseRemoteGDB::getXferFeaturesRead
virtual bool getXferFeaturesRead(const std::string &annex, std::string &output)
Get an XML target description.
Definition: remote_gdb.cc:1515
gem5::MipsISA::g
Bitfield< 4 > g
Definition: dt_constants.hh:86
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::BaseRemoteGDB::GdbMultiLetterCommand::Context::type
GDBSignal type
Definition: remote_gdb.hh:366
gem5::BaseRemoteGDB::removeSoftBreak
void removeSoftBreak(Addr addr, size_t kind)
Definition: remote_gdb.cc:909
gem5::BaseRemoteGDB::IncomingDataEvent
SocketEvent<&BaseRemoteGDB::incomingData > IncomingDataEvent
Definition: remote_gdb.hh:226
gem5::BaseRemoteGDB::clearSingleStep
void clearSingleStep()
Definition: remote_gdb.cc:887
gem5::BaseRemoteGDB::write
bool write(Addr vaddr, size_t size, const char *data)
Definition: remote_gdb.cc:864
gem5::BaseRemoteGDB::queryFThreadInfo
bool queryFThreadInfo(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1453
gem5::BaseRemoteGDB::detach
void detach()
Definition: remote_gdb.cc:481
gem5::BaseRemoteGDB::TrapEvent::id
void id(ContextID id)
Definition: remote_gdb.hh:293
gem5::BaseRemoteGDB::IncomingConnectionEvent
SocketEvent<&BaseRemoteGDB::incomingConnection > IncomingConnectionEvent
Definition: remote_gdb.hh:224
gem5::BaseRemoteGDB::QuerySetCommand::QuerySetCommand
QuerySetCommand(Func _func, const char *_argSep=nullptr)
Definition: remote_gdb.hh:424
gem5::BaseRemoteGDB::regCachePtr
BaseGdbRegCache * regCachePtr
Definition: remote_gdb.hh:274
pcstate.hh
gem5::BaseRemoteGDB::GdbMultiLetterCommand::Func
bool(BaseRemoteGDB::* Func)(Context &ctx)
Definition: remote_gdb.hh:371
gem5::BaseRemoteGDB::disconnectEvent
MemberEventWrapper<&BaseRemoteGDB::detach > disconnectEvent
Definition: remote_gdb.hh:277
gem5::BaseRemoteGDB::GdbCommand::Context
Definition: remote_gdb.hh:340
gem5::BaseRemoteGDB::processCommands
void processCommands(GDBSignal sig=GDBSignal::ZERO)
Definition: remote_gdb.cc:767
gem5::BaseRemoteGDB::selectThreadContext
bool selectThreadContext(ContextID id)
Definition: remote_gdb.cc:529
gem5::BaseRemoteGDB::GdbMultiLetterCommand::Context::cmdTxt
std::string cmdTxt
Definition: remote_gdb.hh:365
gem5::BaseRemoteGDB::trap
bool trap(ContextID id, int type)
Definition: remote_gdb.hh:55
gem5::BaseRemoteGDB::cmdClrHwBkpt
bool cmdClrHwBkpt(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1579
gem5::BaseRemoteGDB::cmdSetHwBkpt
bool cmdSetHwBkpt(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1612
gem5::BaseGdbRegCache::setRegs
virtual void setRegs(ThreadContext *) const =0
Set the ThreadContext's registers from the values in the raw buffer.
gem5::BaseRemoteGDB::send
void send(const char *data)
Definition: remote_gdb.cc:736
pc_event.hh
types.hh
gem5::BaseRemoteGDB::descheduleInstCommitEvent
void descheduleInstCommitEvent(Event *ev)
Deschedule an instruction count based event.
Definition: remote_gdb.cc:1000
gem5::BaseRemoteGDB::threadSwitching
bool threadSwitching
Definition: remote_gdb.hh:267
gem5::BaseRemoteGDB::TrapEvent::_stopReason
std::string _stopReason
Definition: remote_gdb.hh:284
gem5::BaseRemoteGDB::cmdReplyEmpty
bool cmdReplyEmpty(GdbMultiLetterCommand::Context &ctx)
Definition: remote_gdb.cc:1287
gem5::BaseRemoteGDB::QuerySetCommand::func
const Func func
Definition: remote_gdb.hh:422
gem5::BaseRemoteGDB::queryMap
static std::map< std::string, QuerySetCommand > queryMap
Definition: remote_gdb.hh:429
gem5::BaseRemoteGDB::recv
void recv(std::vector< char > &bp)
Definition: remote_gdb.cc:684
gem5::BaseRemoteGDB::cmdDetach
bool cmdDetach(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1115
gem5::ContextID
int ContextID
Globally unique thread context ID.
Definition: types.hh:239
gem5::BaseRemoteGDB::addThreadContext
void addThreadContext(ThreadContext *_tc)
Definition: remote_gdb.cc:506
gem5::BaseRemoteGDB::QuerySetCommand::Context::args
std::vector< std::string > args
Definition: remote_gdb.hh:414
gem5::BaseRemoteGDB::cmdMemR
bool cmdMemR(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1202
gem5::BaseRemoteGDB::~BaseRemoteGDB
virtual ~BaseRemoteGDB()
Definition: remote_gdb.hh:57
gem5::BaseRemoteGDB::GdbCommand
Definition: remote_gdb.hh:337
gem5::BaseRemoteGDB::context
ThreadContext * context()
Definition: remote_gdb.hh:443
gem5::BaseRemoteGDB::QuerySetCommand::Context::Context
Context(const std::string &_name)
Definition: remote_gdb.hh:416
gem5::BaseRemoteGDB::sendSPacket
void sendSPacket(GDBSignal sig)
Definition: remote_gdb.cc:964
gem5::BaseRemoteGDB::system
System * system()
Definition: remote_gdb.hh:444
gem5::BaseRemoteGDB::singleStep
void singleStep()
Definition: remote_gdb.cc:879
gem5::BaseRemoteGDB::GdbMultiLetterCommand
Definition: remote_gdb.hh:359
gem5::BaseRemoteGDB::incomingConnection
void incomingConnection(int revent)
Definition: remote_gdb.cc:593
gem5::BaseRemoteGDB
Definition: remote_gdb.hh:48
gem5::BaseRemoteGDB::SocketEvent::SocketEvent
SocketEvent(BaseRemoteGDB *gdb, int fd, int e)
Definition: remote_gdb.hh:216
gem5::MipsISA::vaddr
vaddr
Definition: pra_constants.hh:278
gem5::BaseRemoteGDB::GdbCommand::Context::cmdByte
char cmdByte
Definition: remote_gdb.hh:343
gem5::BaseRemoteGDB::build
static BaseRemoteGDB * build(ListenSocketConfig listen_config, Args... args)
Definition: remote_gdb.hh:183
gem5::BaseRemoteGDB::cmdCont
bool cmdCont(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1090
gem5::BaseRemoteGDB::threads
std::map< ContextID, ThreadContext * > threads
Definition: remote_gdb.hh:271
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::BaseRemoteGDB::try_getbyte
bool try_getbyte(uint8_t *c, int timeout=-1)
Definition: remote_gdb.cc:630
gem5::BaseRemoteGDB::connect
void connect()
Definition: remote_gdb.cc:430
gem5::BaseRemoteGDB::TrapEvent::type
void type(GDBSignal t)
Definition: remote_gdb.hh:291
gem5::BaseRemoteGDB::readBlob
virtual bool readBlob(Addr vaddr, size_t size, char *data)
Definition: remote_gdb.cc:816
gem5::BaseRemoteGDB::cmdAsyncStep
bool cmdAsyncStep(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1554
gem5::BaseRemoteGDB::attached
bool attached
Definition: remote_gdb.hh:266
gem5::BaseRemoteGDB::threadInfoIdx
size_t threadInfoIdx
Definition: remote_gdb.hh:438
gem5::BaseRemoteGDB::cmdQueryVar
bool cmdQueryVar(GdbCommand::Context &ctx)
Definition: remote_gdb.cc:1475
gem5::BaseGdbRegCache::~BaseGdbRegCache
virtual ~BaseGdbRegCache()
Definition: remote_gdb.hh:136
gem5::BaseRemoteGDB::TrapEvent::TrapEvent
TrapEvent(BaseRemoteGDB *g)
Definition: remote_gdb.hh:288
gem5::BaseRemoteGDB::QuerySetCommand::Func
bool(BaseRemoteGDB::*)(Context &ctx) Func
Definition: remote_gdb.hh:419
gem5::BaseRemoteGDB::GdbCommand::Context::len
int len
Definition: remote_gdb.hh:346
gem5::MemberEventWrapper<&BaseRemoteGDB::connect >
gem5::ListenSocketPtr
std::unique_ptr< ListenSocket > ListenSocketPtr
Definition: socket.hh:112
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84
gem5::BaseRemoteGDB::getbyte
uint8_t getbyte()
Definition: remote_gdb.cc:622
eventq.hh
gem5::BaseRemoteGDB::checkBpKind
virtual bool checkBpKind(size_t kind)
Definition: remote_gdb.cc:1068

Generated on Sun Jul 30 2023 01:56:47 for gem5 by doxygen 1.8.17