remote_gdb.hh (2665:a124942bacb8) remote_gdb.hh (2680:246e7104f744)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 25 unchanged lines hidden (view full) ---

34#include <map>
35
36#include "base/kgdb.h"
37#include "cpu/pc_event.hh"
38#include "base/pollevent.hh"
39#include "base/socket.hh"
40
41class System;
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 25 unchanged lines hidden (view full) ---

34#include <map>
35
36#include "base/kgdb.h"
37#include "cpu/pc_event.hh"
38#include "base/pollevent.hh"
39#include "base/socket.hh"
40
41class System;
42class ExecContext;
42class ThreadContext;
43class PhysicalMemory;
44
45class GDBListener;
46class RemoteGDB
47{
48 protected:
49 typedef TheISA::MachInst MachInst;
50 private:

--- 24 unchanged lines hidden (view full) ---

75#ifdef notyet
76 label_t recover;
77#endif
78 bool active;
79 bool attached;
80
81 System *system;
82 PhysicalMemory *pmem;
43class PhysicalMemory;
44
45class GDBListener;
46class RemoteGDB
47{
48 protected:
49 typedef TheISA::MachInst MachInst;
50 private:

--- 24 unchanged lines hidden (view full) ---

75#ifdef notyet
76 label_t recover;
77#endif
78 bool active;
79 bool attached;
80
81 System *system;
82 PhysicalMemory *pmem;
83 ExecContext *context;
83 ThreadContext *context;
84
85 protected:
86 uint8_t getbyte();
87 void putbyte(uint8_t b);
88
89 int recv(char *data, int len);
90 void send(const char *data);
91
92 protected:
93 // Machine memory
94 bool read(Addr addr, size_t size, char *data);
95 bool write(Addr addr, size_t size, const char *data);
96
97 template <class T> T read(Addr addr);
98 template <class T> void write(Addr addr, T data);
99
100 public:
84
85 protected:
86 uint8_t getbyte();
87 void putbyte(uint8_t b);
88
89 int recv(char *data, int len);
90 void send(const char *data);
91
92 protected:
93 // Machine memory
94 bool read(Addr addr, size_t size, char *data);
95 bool write(Addr addr, size_t size, const char *data);
96
97 template <class T> T read(Addr addr);
98 template <class T> void write(Addr addr, T data);
99
100 public:
101 RemoteGDB(System *system, ExecContext *context);
101 RemoteGDB(System *system, ThreadContext *context);
102 ~RemoteGDB();
103
102 ~RemoteGDB();
103
104 void replaceExecContext(ExecContext *xc) { context = xc; }
104 void replaceThreadContext(ThreadContext *tc) { context = tc; }
105
106 void attach(int fd);
107 void detach();
108 bool isattached();
109
110 bool acc(Addr addr, size_t len);
111 static int signal(int type);
112 bool trap(int type);

--- 15 unchanged lines hidden (view full) ---

128
129 public:
130 int refcount;
131
132 public:
133 HardBreakpoint(RemoteGDB *_gdb, Addr addr);
134 std::string name() { return gdb->name() + ".hwbkpt"; }
135
105
106 void attach(int fd);
107 void detach();
108 bool isattached();
109
110 bool acc(Addr addr, size_t len);
111 static int signal(int type);
112 bool trap(int type);

--- 15 unchanged lines hidden (view full) ---

128
129 public:
130 int refcount;
131
132 public:
133 HardBreakpoint(RemoteGDB *_gdb, Addr addr);
134 std::string name() { return gdb->name() + ".hwbkpt"; }
135
136 virtual void process(ExecContext *xc);
136 virtual void process(ThreadContext *tc);
137 };
138 friend class HardBreakpoint;
139
140 typedef std::map<Addr, HardBreakpoint *> break_map_t;
141 typedef break_map_t::iterator break_iter_t;
142 break_map_t hardBreakMap;
143
144 bool insertSoftBreak(Addr addr, size_t len);

--- 67 unchanged lines hidden ---
137 };
138 friend class HardBreakpoint;
139
140 typedef std::map<Addr, HardBreakpoint *> break_map_t;
141 typedef break_map_t::iterator break_iter_t;
142 break_map_t hardBreakMap;
143
144 bool insertSoftBreak(Addr addr, size_t len);

--- 67 unchanged lines hidden ---