コード例 #1
0
 public WatchpointDescriptor(ulong address, SysbusAccessWidth width, Access access, BusHookDelegate hook)
 {
     Address = address;
     Width   = width;
     Access  = access;
     Hook    = hook;
 }
コード例 #2
0
 private static IEnumerable <WatchpointDescriptor> CalculateAllCoveringAddressess(ulong address, uint kind, Access access, BusHookDelegate hook)
 {
     foreach (SysbusAccessWidth width in Enum.GetValues(typeof(SysbusAccessWidth)))
     {
         for (var offset = -(long)(address % (ulong)width); offset < kind; offset += (long)width)
         {
             yield return(new WatchpointDescriptor(address - (ulong)(-offset), width, access, hook));
         }
     }
 }
コード例 #3
0
 private void RemoveWatchpointsCoveringMemoryArea(ulong address, uint kind, Access access, BusHookDelegate hook)
 {
     // we need to unregister hooks from all possible access widths convering memory fragment
     // [address, address + kind) referred by GDB
     foreach (var descriptor in CalculateAllCoveringAddressess(address, kind, access, hook))
     {
         lock (watchpoints)
         {
             if (watchpoints[descriptor] > 1)
             {
                 watchpoints[descriptor]--;
             }
             else
             {
                 watchpoints.Remove(descriptor);
                 manager.Machine.SystemBus.RemoveWatchpointHook(descriptor.Address, hook);
             }
         }
     }
 }
コード例 #4
0
 private void AddWatchpointsCoveringMemoryArea(ulong address, uint kind, Access access, BusHookDelegate hook)
 {
     // we need to register hooks for all possible access widths covering memory fragment
     // [address, address + kind) referred by GDB
     foreach (var descriptor in CalculateAllCoveringAddressess(address, kind, access, hook))
     {
         lock (watchpoints)
         {
             if (watchpoints.ContainsKey(descriptor))
             {
                 watchpoints[descriptor]++;
             }
             else
             {
                 watchpoints.Add(descriptor, 1);
                 manager.Machine.SystemBus.AddWatchpointHook(descriptor.Address, descriptor.Width, access, hook);
             }
         }
     }
 }
コード例 #5
0
 public bool ContainsAction(BusHookDelegate actionToTest)
 {
     return(action == actionToTest);
 }
コード例 #6
0
 public BusHookHandler(BusHookDelegate action, SysbusAccessWidth width)
 {
     this.action = action;
     this.width  = width;
     Enabled     = true;
 }