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; --- 506 unchanged lines hidden (view full) --- 515 return true; 516} 517 518PCEventQueue *BaseRemoteGDB::getPcEventQueue() 519{ 520 return &system->pcEventQueue; 521} 522 |
523bool 524BaseRemoteGDB::checkBpLen(size_t len) 525{ 526 return len == sizeof(MachInst); 527} 528 |
529BaseRemoteGDB::HardBreakpoint::HardBreakpoint(BaseRemoteGDB *_gdb, Addr pc) 530 : PCEvent(_gdb->getPcEventQueue(), "HardBreakpoint Event", pc), 531 gdb(_gdb), refcount(0) 532{ 533 DPRINTF(GDBMisc, "creating hardware breakpoint at %#x\n", evpc); 534} 535 536void 537BaseRemoteGDB::HardBreakpoint::process(ThreadContext *tc) 538{ 539 DPRINTF(GDBMisc, "handling hardware breakpoint at %#x\n", pc()); 540 541 if (tc == gdb->context) 542 gdb->trap(SIGTRAP); 543} 544 545bool 546BaseRemoteGDB::insertSoftBreak(Addr addr, size_t len) 547{ |
548 if (!checkBpLen(len)) |
549 panic("invalid length\n"); 550 551 return insertHardBreak(addr, len); 552} 553 554bool 555BaseRemoteGDB::removeSoftBreak(Addr addr, size_t len) 556{ |
557 if (!checkBpLen(len)) |
558 panic("invalid length\n"); 559 560 return removeHardBreak(addr, len); 561} 562 563bool 564BaseRemoteGDB::insertHardBreak(Addr addr, size_t len) 565{ |
566 if (!checkBpLen(len)) |
567 panic("invalid length\n"); 568 569 DPRINTF(GDBMisc, "inserting hardware breakpoint at %#x\n", addr); 570 571 HardBreakpoint *&bkpt = hardBreakMap[addr]; 572 if (bkpt == 0) 573 bkpt = new HardBreakpoint(this, addr); 574 575 bkpt->refcount++; 576 577 return true; 578} 579 580bool 581BaseRemoteGDB::removeHardBreak(Addr addr, size_t len) 582{ |
583 if (!checkBpLen(len)) |
584 panic("invalid length\n"); 585 586 DPRINTF(GDBMisc, "removing hardware breakpoint at %#x\n", addr); 587 588 break_iter_t i = hardBreakMap.find(addr); 589 if (i == hardBreakMap.end()) 590 return false; 591 --- 436 unchanged lines hidden --- |