Recent

Author Topic: FPC 3.2.4-rc1 available  (Read 18400 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11824
  • Debugger - SynEdit - and more
    • wiki

pleumann

  • Full Member
  • ***
  • Posts: 106
Re: FPC 3.2.4-rc1 available
« Reply #46 on: November 07, 2025, 06:53:04 pm »
Thanks for your effort, guys! I'm really looking forward to the new version!

Is there any chance that someone has a look at fixing stack traces (-gl) for MacOS in this release or is it too late / too difficult?

PascalDragon

  • Hero Member
  • *****
  • Posts: 6195
  • Compiler Developer
Re: FPC 3.2.4-rc1 available
« Reply #47 on: November 08, 2025, 06:26:08 pm »
Is there any chance that someone has a look at fixing stack traces (-gl) for MacOS in this release or is it too late / too difficult?

Is this even fixed in main? If not, though luck.

pleumann

  • Full Member
  • ***
  • Posts: 106
Re: FPC 3.2.4-rc1 available
« Reply #48 on: November 09, 2025, 11:37:38 am »
Is there any chance that someone has a look at fixing stack traces (-gl) for MacOS in this release or is it too late / too difficult?

Is this even fixed in main? If not, though luck.

I admit I didn't check. And I've never tried to build FPC from source (as opposed to Lazarus, which I routinely build myself). Maybe I should. I was kind of hoping that it's just a small glitch in the specific binary format that slipped into 3.2.2 back then and broke stack traces for MacOS. Is there an open ticket for it? I did search the issue tracker, but couldn't find anything (maybe due to using the wrong search terms). Anyway, this is really my biggest wish for 3.2.4 or another (hopefully not too distant) future version of FPC. Debugging without getting source code information in case of a crash is really a major PITA.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11824
  • Debugger - SynEdit - and more
    • wiki
Re: FPC 3.2.4-rc1 available
« Reply #49 on: November 09, 2025, 11:56:28 am »
Is there any chance that someone has a look at fixing stack traces (-gl) for MacOS in this release or is it too late / too difficult?

Is this even fixed in main? If not, though luck.
I think, I've read in another post that it is implemented in 3.3.1. But I have not tested myself.

Quote
Debugging without getting source code information in case of a crash is really a major PITA.

In general (and afaik it works on Mac, but I don't have one to test), if
- you get the trace with addresses only
- and your app has debug info

then you can in Lazarus go to menu: View > Leaks and traces.
Paste the addresses there, press resolve and select the exe (not sure if that is the bundle, or the exe inside the bundle...).
And then you should get the addresses.

Outside of Lazarus, there may be a way to translate addresses using lldb (or gdb), but that is more work...

pleumann

  • Full Member
  • ***
  • Posts: 106
Re: FPC 3.2.4-rc1 available
« Reply #50 on: November 09, 2025, 05:12:32 pm »
Is there any chance that someone has a look at fixing stack traces (-gl) for MacOS in this release or is it too late / too difficult?

Is this even fixed in main? If not, though luck.
I think, I've read in another post that it is implemented in 3.3.1. But I have not tested myself.

Quote
Debugging without getting source code information in case of a crash is really a major PITA.

In general (and afaik it works on Mac, but I don't have one to test), if
- you get the trace with addresses only
- and your app has debug info

then you can in Lazarus go to menu: View > Leaks and traces.
Paste the addresses there, press resolve and select the exe (not sure if that is the bundle, or the exe inside the bundle...).
And then you should get the addresses.

Outside of Lazarus, there may be a way to translate addresses using lldb (or gdb), but that is more work...


My main/problem use case is a command-line app (Lazarus apps I can simply run through the debugger and catch exceptions there). When I compile with "-gl" for Windows or Linux, I get file/line info in case of a crash (like a range error or so). For MacOS (both Intel and Arm) I only get the list of addresses. I assume that basically the same mechanism at work for all three platform (at least the docs didn't seem to contain an obvious hint that I need to do something special for MacOS).

Pasting the hex address into a dialog and letting the compiler resolve it reminds me of Turbo Pascal 3.0 or even earlier. But thanks for the hint. I might try that. If it works it's still better than plastering the code with WriteLn statements. :)

JdeHaan

  • Full Member
  • ***
  • Posts: 170
Re: FPC 3.2.4-rc1 available
« Reply #51 on: November 10, 2025, 09:40:36 pm »
Next to -gl also include -Xg (Use external debug symbols file). That might help.


 

TinyPortal © 2005-2018