When you have an assembly aspect that changes the code of a method, and this code fails (or shows a failed assert), the debugger shows the aspect as current code line.
Example source code:
[assembly: MyAspect]
method MyMethod;
begin
//some code
end;
The aspect MyAspect changes the code of MyMethod to:
method MyMethod;
begin
System.Diagnostics.Debug.Assert(false, 'the error'); //inserted by the aspect, not in the source code
//some code
end;
When MyMethod is executed, the assert is shown, but the debugger breaks on the line:
[assembly: MyAspect]
instead of (what should be more logical for debugging) on the line
But it confuses me when the code breaks on the [assembly:MyAspect] line in assembly.pas, while the call stack window says that the code is in mycode.pas, and when I doubleclick on the line in the call stack window, it goes to assembly.pas instead of mycode.pas - while it is stating that the error occurred in mycode.pas, method myMethod.