Deleted Added
sdiff udiff text old ( 10559:62f5f7363197 ) new ( 10589:5962812f80fe )
full compact
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
523BaseRemoteGDB::HardBreakpoint::HardBreakpoint(BaseRemoteGDB *_gdb, Addr pc)
524 : PCEvent(_gdb->getPcEventQueue(), "HardBreakpoint Event", pc),
525 gdb(_gdb), refcount(0)
526{
527 DPRINTF(GDBMisc, "creating hardware breakpoint at %#x\n", evpc);
528}
529
530void
531BaseRemoteGDB::HardBreakpoint::process(ThreadContext *tc)
532{
533 DPRINTF(GDBMisc, "handling hardware breakpoint at %#x\n", pc());
534
535 if (tc == gdb->context)
536 gdb->trap(SIGTRAP);
537}
538
539bool
540BaseRemoteGDB::insertSoftBreak(Addr addr, size_t len)
541{
542 if (len != sizeof(TheISA::MachInst))
543 panic("invalid length\n");
544
545 return insertHardBreak(addr, len);
546}
547
548bool
549BaseRemoteGDB::removeSoftBreak(Addr addr, size_t len)
550{
551 if (len != sizeof(MachInst))
552 panic("invalid length\n");
553
554 return removeHardBreak(addr, len);
555}
556
557bool
558BaseRemoteGDB::insertHardBreak(Addr addr, size_t len)
559{
560 if (len != sizeof(MachInst))
561 panic("invalid length\n");
562
563 DPRINTF(GDBMisc, "inserting hardware breakpoint at %#x\n", addr);
564
565 HardBreakpoint *&bkpt = hardBreakMap[addr];
566 if (bkpt == 0)
567 bkpt = new HardBreakpoint(this, addr);
568
569 bkpt->refcount++;
570
571 return true;
572}
573
574bool
575BaseRemoteGDB::removeHardBreak(Addr addr, size_t len)
576{
577 if (len != sizeof(MachInst))
578 panic("invalid length\n");
579
580 DPRINTF(GDBMisc, "removing hardware breakpoint at %#x\n", addr);
581
582 break_iter_t i = hardBreakMap.find(addr);
583 if (i == hardBreakMap.end())
584 return false;
585

--- 436 unchanged lines hidden ---