Recent

Author Topic: Problem with resolving stack trace with Leaks and Traces  (Read 1768 times)

PawelO

  • New Member
  • *
  • Posts: 20
    • Polish railway traffic and interlocking simulator developed with Lazarus
Problem with resolving stack trace with Leaks and Traces
« on: February 26, 2024, 12:20:45 pm »
Hello,

I use BackTraceStrFunc to create exception stack traces logged to files. Project is compiled with -gl (display line numbers) and -Xg (external debug symbols file), user gets .exe and I keep .dbg for debugging purposes (to keep small .exe size). I used View -> Leaks and Traces with pasting stack trace and selecting .dbg to translate it into symbols, however it does not work for me anymore after upgrade to Lazarus 3.0 - no description of pasted addresses appears, just nothing happens.

Type of debug info is "Automatic", changing it doesn't make a difference. Addresses are valid as I can still find symbols for them in Assembler window.

Worked in Lazarus 2.0.8, which I had previously installed. Currently using Lazarus 3.0 32bit on Windows 10 64bit.

Are there any changes which I'm missing?

Best reagards

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Problem with resolving stack trace with Leaks and Traces
« Reply #1 on: February 26, 2024, 02:36:17 pm »
I have to double check => but the resolve probably only works for Dwarf.

32 bit Windows still as Stabs as default. If you change your project settings, that does not affect packages. => So you may need to use "Additions and overrides" or some other mean to change packages too.

PawelO

  • New Member
  • *
  • Posts: 20
    • Polish railway traffic and interlocking simulator developed with Lazarus
Re: Problem with resolving stack trace with Leaks and Traces
« Reply #2 on: February 26, 2024, 03:36:30 pm »
I'm not sure how to use Additions and Overrides to do this, but resolve do not show any symbols also for addresses directly in project source, not in other packages.

I have tried changing Type of debug info to Dwarf 2, Dwarf 2 with sets, Dwarf 3, Stabs, and also changing IDE Options -> Debugger backend from default Gdb to FpDebug, combined with different Type of debug info. In all cases no success.

Curiously, when I provide stacktrace and .dbg file compiled with Lazarus 3.0 to Leaks and Traces in Lazarus 2.0.8, it does show some valid symbol names (although not all of them).
« Last Edit: February 26, 2024, 03:42:49 pm by PawelO »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Problem with resolving stack trace with Leaks and Traces
« Reply #3 on: February 26, 2024, 04:32:56 pm »
Strange... I'll have to see when I can make time to test it myself. (May be a while)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Problem with resolving stack trace with Leaks and Traces
« Reply #4 on: February 26, 2024, 04:37:51 pm »
Also, if it is not to big, could you provide the exe, the dbg and the trace, please? (compressed)

PawelO

  • New Member
  • *
  • Posts: 20
    • Polish railway traffic and interlocking simulator developed with Lazarus
Re: Problem with resolving stack trace with Leaks and Traces
« Reply #5 on: February 26, 2024, 05:13:52 pm »
In attachment simple console project which raises, catches exception and saves stack trace to file, with external .dbg file.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Problem with resolving stack trace with Leaks and Traces
« Reply #6 on: February 28, 2024, 10:28:03 pm »
Ok, the attachment contained stabs (afaik also created by "automatic" on Win-32bits).

But Dwarf is also broken. I committed a fix https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/8ca43789be9d04baf9c699ca4421b7fce0a21234
You can find the same source file in your Lazarus installation. => Just change the 2 lines, and recompile.



Stabs is indeed currently not supported. I have to check if it can be re-added (fpc itself only supports it for selected targets, and it needs the stabs-reader units from fpc for each target). 
That may be a while before I will be able to think about it (if I don't forget / if stabs matters to you, report an issue on the bugtracker).

PawelO

  • New Member
  • *
  • Posts: 20
    • Polish railway traffic and interlocking simulator developed with Lazarus
Re: Problem with resolving stack trace with Leaks and Traces
« Reply #7 on: February 29, 2024, 05:25:35 pm »
I might have left it on "automatic" when building.

Anyway, provided fix + change to dwarf resolves problem - thanks for quick response.

 

TinyPortal © 2005-2018