When assert is hit, debugger breaks one function call down the call stack
Original Reporter info from Mantis: ahydra
-
Reporter name: Colin Haywood
Original Reporter info from Mantis: ahydra
- Reporter name: Colin Haywood
Description:
When an assert is hit, the debugger breaks one function call down the call stack rather than on the assert itself. For example, if function A calls function B that then asserts, the debugger breaks at the line in A that called into B.
This is a bit of a nuisance when A and B are in different objects; normally you'd want to examine the properties of B (since the assert's condition likely involves properties of B), but the debugger's context is in object A, so hovering over things in B or using the Evaluate/Modify window gives the "No symbol &LtPos;something> in current context" error.
Steps to reproduce:
Create a project of type "FPCUnit Console Test Application" (for some reason this doesn't reproduce with a "Simple Program" project), and use the following testcase unit:
unit TestCase1;
{$mode objfpc}{$H+}{$C+}
interface
uses
Classes, SysUtils, fpcunit, testutils, testregistry;
type
TAssertTest = class(TTestCase)
published
procedure TestHookUp();
end;
implementation
procedure ActualTest();
begin
Assert(false);
end;
procedure TAssertTest.TestHookUp();
begin
ActualTest();
end;
initialization
RegisterTest(TAssertTest);
end.
Compile and run the program. When the assert is hit the debugger breaks at the ActualTest() line rather than the assert itself.
Mantis conversion info:
- Mantis ID: 29959
- OS: Windows 7
- Build: 49931
- Platform: Win32
- Version: 1.4.4
- Fixed in version: 2.0
- Fixed in revision: 58283 (#018bda7a)
- Target version: 2.0
- LazTarget: 1.10