Ejemplo n.º 1
0
 bool CheckBreakFlags(DbgExceptionDefinitionFlags defFlags, DbgExceptionEventFlags exFlags)
 {
     if ((exFlags & DbgExceptionEventFlags.FirstChance) != 0 && (defFlags & DbgExceptionDefinitionFlags.StopFirstChance) != 0)
     {
         return(true);
     }
     if ((exFlags & DbgExceptionEventFlags.SecondChance) != 0 && (defFlags & DbgExceptionDefinitionFlags.StopSecondChance) != 0)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
        public override DbgException CreateException <T>(DbgExceptionId id, DbgExceptionEventFlags flags, string message, DbgThread thread, DbgModule module, DbgEngineMessageFlags messageFlags, T data, Action <DbgException> onCreated)
        {
            if (id.IsDefaultId)
            {
                throw new ArgumentException();
            }
            var exception = new DbgExceptionImpl(runtime, id, flags, message, thread, module);

            if (data != null)
            {
                exception.GetOrCreateData(() => data);
            }
            onCreated?.Invoke(exception);
            owner.Dispatcher.BeginInvoke(() => owner.AddException_DbgThread(runtime, exception, messageFlags));
            return(exception);
        }
Ejemplo n.º 4
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;
Ejemplo n.º 5
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);