Recent

Author Topic: Problems with debugging  (Read 240 times)

backprop

  • Jr. Member
  • **
  • Posts: 93
Problems with debugging
« on: September 08, 2024, 02:23:16 am »
I have no idea which debugger to use. Any I have tried make problems

Whenever new project is created it demand to be used one of three debug info formats. But when using any debugger it making various problems.

With even simplest app, SIGSEG error raised at end of execution. Even it is evident that there is no memory leaks. Then three times need to stop debugger with Ctrl-F2 or pressing three times on stop debugging button.

Can anyone check and fix that? I do not recall that Lazarus 2.x had such problems.

Lazarus 3.2, FPC 3.2.2 installed from DEB files. KDE neon


« Last Edit: September 08, 2024, 02:25:24 am by backprop »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10310
  • Debugger - SynEdit - and more
    • wiki
Re: Problems with debugging
« Reply #1 on: September 08, 2024, 12:52:18 pm »
I never got that error.

Quote
I have no idea which debugger to use.
https://wiki.lazarus.freepascal.org/Debugger_Setup#Choosing_the_correct_debugger_backend

Gdb supports more platforms/architectures (FpDebug only support Intel/AMD and Win/Linux)
FpDebug however is more feature-rich and more stable.
https://wiki.freepascal.org/Debugger_Status

Quote
Whenever new project is created it demand to be used one of three debug info formats
If that refers to the dialog that pops up before RUN, then you are using FpDebug (and that is good/correct).

With FpDebug it is recommended to use Dwarf-3
With GDB it is better to choose Dwarf-2 with sets

You can change that once in the project settings, and before closing the project settings dialog check the checkbox (bottom left corner) "Set compiler options as default". Then new projects will have it (ideally create the 2 buildmodes before doing this)


Quote
With even simplest app, SIGSEG error raised at end of execution.
That is where I will need more info. Because it does not happen when I debug something (on Linux, though a different distro / several other distros).

In general, please make sure that for debugging you compile your project with optimization OFF (or at max level 1).

First of all the exact text of that exception dialog, or a screen shot.
It could be either (similar to either of)
- Project1 raised on exception (issued by the debugger)
- Lazarus / Access violation (the IDE itself crashed)


Also could you open a terminal (console), and run Lazarus from that terminal?
(If you have packages installed then you may need to find the lazarus exe in ~/.lazarus / or try startlazarus, but I am not sure the latter will do)
Code: Text  [Select][+][-]
  1. lazarus --debug-log=LOG_FILE  --debug-enable=DBG_VERBOSE,DBG_WARNINGS,DBG_ERRORS
  2. DBG_STATE,DBG_EVENTS,DBGMI_QUEUE_DEBUG,DBG_FPDEBUG_VERBOSE,FPDBG_COMMANDS,FPDBG_THREADS,FPDBG_QUEUE,DBG_DATA_MONITORS,DBG_THREAD_AND_FRAME,DBG_CMD_ECHO,DBG_CMD_ECHO_FULL
  3.  

Then upload the LOG_FILE please.
And if there is any output to the console: copy it and paste it here

Thank you.

 

TinyPortal © 2005-2018