Exemplo n.º 1
0
 public DbgLanguageDebugInfoKey(ModuleId moduleId, uint token)
 {
     this.token       = token;
     this.moduleId    = moduleId;
     module           = null;
     refreshedVersion = 0;
 }
Exemplo n.º 2
0
 public DbgLanguageDebugInfoKey(DbgModule module, uint token)
 {
     this.token       = token;
     moduleId         = default;
     this.module      = module;
     refreshedVersion = module.RefreshedVersion;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="location">Location</param>
 /// <param name="module">Module or null if none</param>
 /// <param name="address">Address or <see cref="NoAddress"/> if it's not known</param>
 /// <param name="message">Warning/error message or default if none</param>
 /// <param name="data">Data to add to the <see cref="DbgBoundCodeBreakpoint"/> or null if nothing gets added.
 /// If the data implements <see cref="IDisposable"/>, it gets disposed when the bound breakpoint gets deleted.</param>
 public DbgBoundCodeBreakpointInfo(DbgCodeLocation location, DbgModule?module, ulong address, DbgEngineBoundCodeBreakpointMessage message, T?data)
 {
     Location = location ?? throw new ArgumentNullException(nameof(location));
     Module   = module;
     Address  = address;
     Message  = message;
     Data     = data;
 }
 public SpecialDbgEngineStackFrame(string name, DbgCodeLocation?location, DbgModule?module, uint functionOffset, uint functionToken)
 {
     this.name      = name ?? throw new ArgumentNullException(nameof(name));
     Location       = location;
     Module         = module;
     FunctionOffset = functionOffset;
     FunctionToken  = functionToken;
 }
Exemplo n.º 5
0
 public DbgBoundCodeBreakpointImpl(DbgRuntimeImpl runtime, DbgCodeBreakpoint breakpoint, DbgModule?module, ulong address, DbgBoundCodeBreakpointMessage message)
 {
     lockObj         = new object();
     this.runtime    = runtime ?? throw new ArgumentNullException(nameof(runtime));
     this.breakpoint = breakpoint ?? throw new ArgumentNullException(nameof(breakpoint));
     this.module     = module;
     this.address    = address;
     this.message    = message;
 }
Exemplo n.º 6
0
 internal void UpdateModule_DbgThread(DbgModule?module)
 {
     Dispatcher.VerifyAccess();
     if (this.module != module)
     {
         this.module = module;
         OnPropertyChanged(nameof(Module));
     }
 }
Exemplo n.º 7
0
 public DbgExceptionImpl(DbgRuntime runtime, DbgExceptionId id, DbgExceptionEventFlags flags, string?message, DbgThread?thread, DbgModule?module)
 {
     if (id.IsDefaultId)
     {
         throw new ArgumentException();
     }
     Runtime = runtime ?? throw new ArgumentNullException(nameof(runtime));
     Id      = id;
     Flags   = flags;
     Message = message;
     Thread  = thread;
     Module  = module;
 }
 /// <summary>
 /// Updates <see cref="DbgBoundCodeBreakpoint"/> properties
 /// </summary>
 /// <param name="options">Options</param>
 /// <param name="module">New <see cref="DbgBoundCodeBreakpoint.Module"/> value</param>
 /// <param name="address">New <see cref="DbgBoundCodeBreakpoint.Address"/> value</param>
 /// <param name="message">New <see cref="DbgBoundCodeBreakpoint.Message"/> value</param>
 public abstract void Update(UpdateOptions options, DbgModule?module = null, ulong address = 0, DbgEngineBoundCodeBreakpointMessage message = default);
Exemplo n.º 9
0
 public override DbgEngineStackFrame CreateSpecialStackFrame(string name, DbgCodeLocation?location, DbgModule?module, uint functionOffset, uint functionToken)
 {
     if (name is null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     return(new SpecialDbgEngineStackFrame(name, location, module, functionOffset, functionToken));
 }
Exemplo n.º 10
0
        public override DbgException CreateException <T>(DbgExceptionId id, DbgExceptionEventFlags flags, string?message, DbgThread?thread, DbgModule?module, DbgEngineMessageFlags messageFlags, T?data, Action <DbgException>?onCreated) where T : class
        {
            if (id.IsDefaultId)
            {
                throw new ArgumentException();
            }
            var exception = new DbgExceptionImpl(runtime, id, flags, message, thread, module);

            if (data is not null)
            {
                exception.GetOrCreateData(() => data);
            }
            onCreated?.Invoke(exception);
            owner.Dispatcher.BeginInvoke(() => owner.AddException_DbgThread(runtime, exception, messageFlags));
            return(exception);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a special stack frame that's displayed as [name], eg. [Managed to Native Transition]
 /// </summary>
 /// <param name="name">Name, eg. "Managed to Native Transition"</param>
 /// <param name="location">Location or null</param>
 /// <param name="module">Module or null</param>
 /// <param name="functionOffset">Function offset</param>
 /// <param name="functionToken">Function token</param>
 /// <returns></returns>
 public abstract DbgEngineStackFrame CreateSpecialStackFrame(string name, DbgCodeLocation?location = null, DbgModule?module = null, uint functionOffset = 0, uint functionToken = DbgEngineStackFrame.InvalidFunctionToken);
Exemplo n.º 12
0
 /// <summary>
 /// Creates a bound breakpoint. This method returns null if there was no breakpoint matching <paramref name="location"/>.
 ///
 /// To get notified when a bound breakpoint gets deleted, add custom data that implements <see cref="IDisposable"/>.
 /// </summary>
 /// <typeparam name="T">Type of data</typeparam>
 /// <param name="location">Breakpoint location</param>
 /// <param name="module">Module or null if none</param>
 /// <param name="address">Address or <see cref="BoundBreakpointNoAddress"/> if unknown</param>
 /// <param name="message">Warning/error message or default if none</param>
 /// <param name="data">Data to add to the <see cref="DbgEngineBoundCodeBreakpoint"/> or null if nothing gets added</param>
 /// <returns></returns>
 public DbgEngineBoundCodeBreakpoint?Create <T>(DbgCodeLocation location, DbgModule?module, ulong address, DbgEngineBoundCodeBreakpointMessage message, T?data) where T : class =>
 Create(new[] { new DbgBoundCodeBreakpointInfo <T>(location, module, address, message, data) }).FirstOrDefault();
Exemplo n.º 13
0
 /// <summary>
 /// Creates a bound breakpoint. This method returns null if there was no breakpoint matching <paramref name="location"/>.
 ///
 /// To get notified when a bound breakpoint gets deleted, add custom data that implements <see cref="IDisposable"/>.
 /// </summary>
 /// <param name="location">Breakpoint location</param>
 /// <param name="module">Module or null if none</param>
 /// <param name="address">Address or <see cref="BoundBreakpointNoAddress"/> if unknown</param>
 /// <param name="message">Warning/error message or default if none</param>
 /// <returns></returns>
 public DbgEngineBoundCodeBreakpoint?Create(DbgCodeLocation location, DbgModule?module, ulong address, DbgEngineBoundCodeBreakpointMessage message) =>
 Create(new[] { new DbgBoundCodeBreakpointInfo <object>(location, module, address, message, null) }).FirstOrDefault();
Exemplo n.º 14
0
 /// <summary>
 /// Creates an exception. The engine has paused the program.
 /// </summary>
 /// <typeparam name="T">Type of data</typeparam>
 /// <param name="id">Exception id</param>
 /// <param name="flags">Exception event flags</param>
 /// <param name="message">Exception message or null if it's not available</param>
 /// <param name="thread">Thread where exception was thrown or null if it's unknown</param>
 /// <param name="module">Module where exception was thrown or null if it's unknown</param>
 /// <param name="messageFlags">Message flags</param>
 /// <param name="data">Data to add to the <see cref="DbgException"/> or null if nothing gets added</param>
 /// <param name="onCreated">Called right after creating the exception but before adding it to internal data structures. This can be null.</param>
 /// <returns></returns>
 public abstract DbgException CreateException <T>(DbgExceptionId id, DbgExceptionEventFlags flags, string?message, DbgThread?thread, DbgModule?module, DbgEngineMessageFlags messageFlags, T?data, Action <DbgException>?onCreated = null) where T : class;
Exemplo n.º 15
0
 /// <summary>
 /// Creates an exception. The engine has paused the program.
 /// </summary>
 /// <param name="id">Exception id</param>
 /// <param name="flags">Exception event flags</param>
 /// <param name="message">Exception message or null if it's not available</param>
 /// <param name="thread">Thread where exception was thrown or null if it's unknown</param>
 /// <param name="module">Module where exception was thrown or null if it's unknown</param>
 /// <param name="messageFlags">Message flags</param>
 /// <returns></returns>
 public DbgException CreateException(DbgExceptionId id, DbgExceptionEventFlags flags, string?message, DbgThread?thread, DbgModule?module, DbgEngineMessageFlags messageFlags) =>
 CreateException <object>(id, flags, message, thread, module, messageFlags, null, null);
Exemplo n.º 16
0
 internal void SetModule(DbgModule module)
 {
     this.module = module ?? throw new ArgumentNullException(nameof(module));
     ReflectionModule !.GetOrCreateData(() => module);
 }
 /// <summary>
 /// Gets the location
 /// </summary>
 /// <param name="module">Module</param>
 /// <param name="token">Method token</param>
 /// <param name="offset">IL offset</param>
 /// <returns></returns>
 public abstract bool TryGetLocation([NotNullWhenTrue] out DbgModule?module, out uint token, out uint offset);