Can't find heap.trc lazarus / 12-Debugger ---------------------------------------------------------------------- JD · 2013-07-11 15:38 Hello there everyone, I'm trying to debug an application by looking into the heap.trc file. However in spite of the fact that I've set everything up properly for debugging i.e enabling Heaptrc, I can't find the file anywhere. What am I missing? JD Lazarus 1.1/FPC 2.6.2 svn 41998 on Win32 ---------------------------------------------------------------------- BigChimp · 2013-07-11 16:22 Perhaps Lazarus does not have write access to the location you specified for the trc file? ---------------------------------------------------------------------- Leledumbo · 2013-07-11 21:07 That file is an output of heaptrace, which is output to stderr (in windows GUI app, it would output to messagebox). Try calling SetHeapTraceOutput('heap.trc'); at the start of your program. ---------------------------------------------------------------------- JD · 2013-07-12 10:28 Quote from: Leledumbo on July 11, 2013, 11:07:43 pmThat file is an output of heaptrace, which is output to stderr (in windows GUI app, it would output to messagebox). Try calling SetHeapTraceOutput('heap.trc'); at the start of your program. I put this in the FormCreate procedure of a new project and I got the error below Code: [Select]unit1.pas(33,21) Error: Identifier not found "SetHeapTraceOutput" ---------------------------------------------------------------------- JD · 2013-07-12 10:34 I added Heaptrc to the uses clause and now the program runs & a file called 'heap.trc' has been created. I'll look into it & let you know what I find. ---------------------------------------------------------------------- JD · 2013-07-12 12:05 I'm disappointed. The contents of heap.trc are as follows: Code: [Select]C:\Users\Programming\Projects\Lazarus\Tutorial Projects\AProgram.exe Heap dump by heaptrc unit 35268 memory blocks allocated : 19229975/19334504 35261 memory blocks freed     : 19229839/19334344 This corresponds to the error dialog in the attached screenshot. How can one debug the program with so little information?  JD ---------------------------------------------------------------------- BigChimp · 2013-07-12 12:18 Enable debugging output (as well as line info) as well. Using that and the heaptrc package in Lazarus, it works ok for me. ---------------------------------------------------------------------- JD · 2013-07-12 14:28 Quote from: BigChimp on July 12, 2013, 02:18:31 pmEnable debugging output (as well as line info) as well. Using that and the heaptrc package in Lazarus, it works ok for me. I've already done that. See screenshot. I was expecting an output similar to the Tip of the Day on the new website where Heaptrc output shows the file name as well line numbers to the faulty code. JD ---------------------------------------------------------------------- Cyrax · 2013-07-12 18:54 You need to build FPC RTL and LCL and its related packages with debug and line info enabled.