remote_gdb.cc (10589:5962812f80fe) | remote_gdb.cc (10597:bd68c6838b9f) |
---|---|
1/* | 1/* |
2 * Copyright 2014 Google, Inc. |
|
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; 9 * redistributions in binary form must reproduce the above copyright --- 114 unchanged lines hidden (view full) --- 124#include <string> 125 126#include "arch/vtophys.hh" 127#include "base/intmath.hh" 128#include "base/remote_gdb.hh" 129#include "base/socket.hh" 130#include "base/trace.hh" 131#include "config/the_isa.hh" | 3 * Copyright (c) 2002-2005 The Regents of The University of Michigan 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer; 10 * redistributions in binary form must reproduce the above copyright --- 114 unchanged lines hidden (view full) --- 125#include <string> 126 127#include "arch/vtophys.hh" 128#include "base/intmath.hh" 129#include "base/remote_gdb.hh" 130#include "base/socket.hh" 131#include "base/trace.hh" 132#include "config/the_isa.hh" |
133#include "cpu/base.hh" |
|
132#include "cpu/static_inst.hh" 133#include "cpu/thread_context.hh" 134#include "debug/GDBAll.hh" 135#include "mem/port.hh" 136#include "mem/fs_translating_port_proxy.hh" 137#include "mem/se_translating_port_proxy.hh" 138#include "sim/full_system.hh" 139#include "sim/system.hh" --- 101 unchanged lines hidden (view full) --- 241 242BaseRemoteGDB::Event::Event(BaseRemoteGDB *g, int fd, int e) 243 : PollEvent(fd, e), gdb(g) 244{} 245 246void 247BaseRemoteGDB::Event::process(int revent) 248{ | 134#include "cpu/static_inst.hh" 135#include "cpu/thread_context.hh" 136#include "debug/GDBAll.hh" 137#include "mem/port.hh" 138#include "mem/fs_translating_port_proxy.hh" 139#include "mem/se_translating_port_proxy.hh" 140#include "sim/full_system.hh" 141#include "sim/system.hh" --- 101 unchanged lines hidden (view full) --- 243 244BaseRemoteGDB::Event::Event(BaseRemoteGDB *g, int fd, int e) 245 : PollEvent(fd, e), gdb(g) 246{} 247 248void 249BaseRemoteGDB::Event::process(int revent) 250{ |
249 if (revent & POLLIN) 250 gdb->trap(SIGILL); 251 else if (revent & POLLNVAL) | 251 BaseCPU *cpu = gdb->context->getCpuPtr(); 252 EventQueue *eq = cpu->comInstEventQueue[gdb->context->threadId()]; 253 if (revent & POLLIN) { 254 gdb->trapEvent.type(SIGILL); 255 // Here "ticks" aren't simulator ticks which measure time, they're 256 // instructions committed by the CPU. 257 eq->schedule(&gdb->trapEvent, eq->getCurTick()); 258 } else if (revent & POLLNVAL) { 259 if (gdb->trapEvent.scheduled()) 260 eq->deschedule(&gdb->trapEvent); |
252 gdb->detach(); | 261 gdb->detach(); |
262 } |
|
253} 254 | 263} 264 |
265void 266BaseRemoteGDB::TrapEvent::process() 267{ 268 gdb->trap(_type); 269} 270 |
|
255BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, size_t cacheSize) | 271BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, size_t cacheSize) |
256 : event(NULL), listener(NULL), number(-1), fd(-1), | 272 : event(NULL), trapEvent(this), listener(NULL), number(-1), fd(-1), |
257 active(false), attached(false), 258 system(_system), context(c), 259 gdbregs(cacheSize) 260{ 261 memset(gdbregs.regs, 0, gdbregs.bytes()); 262} 263 264BaseRemoteGDB::~BaseRemoteGDB() --- 763 unchanged lines hidden --- | 273 active(false), attached(false), 274 system(_system), context(c), 275 gdbregs(cacheSize) 276{ 277 memset(gdbregs.regs, 0, gdbregs.bytes()); 278} 279 280BaseRemoteGDB::~BaseRemoteGDB() --- 763 unchanged lines hidden --- |