Forum > LCL
Desktop hangs when hitting break point in GTK2 TCombobox.OnDropDown
ccrause:
--- Quote from: Martin_fr on March 16, 2023, 08:57:27 am ---Afaik it's an issue in gtk (or some versions/builds thereof).
The same should happen if you place "while true do ;" into your event handler.
Apparently there is only one event thread for all the apps in gtk. If one blocks, then all others block too.
I am unaware of a fix for it.
--- End quote ---
Thank you Martin. I suspected the problem may be with GTK and not Lazarus but wasn't sure.
--- Quote ---But there are still ways to debug.
--- End quote ---
Thank you for the debug tips. In my case there was an issue with the code running in the event handler and it was easy to debug simply by moving the code outside of the event handler for testing.
MarkMLl:
--- Quote from: Martin_fr on March 16, 2023, 08:57:27 am ---Alternatively, remote debug. Then the desktop can freeze, but you need a 2nd machine (or run the to-be-debugged app in a virtual machine)
--- End quote ---
That's something I've not tried, but I can't remember whether I've seen "breakpoint in event handler" crash the debugger or the entire desktop.
I /do/, on occasion, get desktop lockups while debugging: and this is likely to be a GTK2 program on a KDE desktop. Using a root console session to kill the program being debugged sorts that one.
Another possibility for debugging might be to have Lazarus etc. in a Docker session into which one can SSH. However I suspect that one would have to plan for that in advance by using -v to expose the gdbserver socket when the container was first created.
MarkMLl
Navigation
[0] Message Index
[*] Previous page