#1 2025-01-30 09:08:07

zen010101
Member
Registered: 2024-06-15
Posts: 99

Issue about .mab debug file

To compile the LoggingTest.dpr project with debug information and generate a .map file with the FPC, followed by executing the program, a .mab debug file will be created. The log file will display the source line number during the initial execution. However, upon running the program a second time, it loads the .mab file but does not include the line numbers in the log file. This suggests there may be an issue with the .mab file. I have traced the problem for some time but have not found anything conclusive; the following statement consistently returns -1:

u := debug.FindUnit(offset, Line) 

Online

#2 2025-01-30 09:38:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,845
Website

Re: Issue about .mab debug file

On which Operating System?

(it may be due to wrong offset calculation due to ASLR)

Offline

#3 2025-01-30 09:48:33

zen010101
Member
Registered: 2024-06-15
Posts: 99

Re: Issue about .mab debug file

Yeah, you're right! I tried it on Linux and it worked fine. The issue only popped up on my Windows 11.

But I'm curious, why did it work the first time I ran it?

Last edited by zen010101 (2025-01-30 11:56:45)

Online

#4 2025-01-31 14:49:04

zen010101
Member
Registered: 2024-06-15
Posts: 99

Re: Issue about .mab debug file

Supplementary Note:

The information I provided earlier was incorrect. Through today's testing, I found that whether on Windows or Linux, only the first run can obtain the program's line number information. As long as the .mab file is generated, in subsequent runs, the program will not be able to find the line number information as long as the .mab is loaded.

Online

#5 2025-02-01 10:15:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,845
Website

Re: Issue about .mab debug file

I see no problem with Delphi + Windows.
I see no problem with FPC + Linux (and Dwarf 3 debug info).
I see indeed some problems with FPC + Windows (and Dwarf 2 or 3 debug info).

Offline

#6 2025-02-01 16:21:44

zen010101
Member
Registered: 2024-06-15
Posts: 99

Re: Issue about .mab debug file

Wired.

Here is my environment:

OS: Windows 11
Compiler: Free Pascal Compiler version 3.2.3-1404-g57e84ef714 [2024/11/20] for aarch64
Target: Linux  aarch64 (and Dwarf3 debug info)

Every time I delete the .mab file, I can see line number information in the Log.

How can I find some more useful information?

Online

Board footer

Powered by FluxBB