Recent

Author Topic: Cumbersome warning message with gdb  (Read 1202 times)

franzala

  • New Member
  • *
  • Posts: 17
Cumbersome warning message with gdb
« on: January 11, 2020, 10:53:09 pm »
When I debug with gdb, a black window appears after a moment with the following message (in french) "Project name" does not answer
with to buttons  Force to quit  or Wait.

How could I suppress it?

valdir.marcos

  • Hero Member
  • *****
  • Posts: 993
Re: Cumbersome warning message with gdb
« Reply #1 on: January 12, 2020, 04:07:14 am »
When I debug with gdb, a black window appears after a moment with the following message (in french) "Project name" does not answer
with to buttons  Force to quit  or Wait.
How could I suppress it?
What OS and bitness?
What Lazarus, Free Pascal and GDB versions?

franzala

  • New Member
  • *
  • Posts: 17
Re: Cumbersome warning message with gdb
« Reply #2 on: January 12, 2020, 05:24:38 pm »
By continuing to search, I have got the same window without being debugging, which seems to exclude that the origin of the problem is gdb.



The OS is ubuntu 18.04LTS   64 bits
FPC 3.0.4
Lazarus 1.8.2+dfsg-3
but I do not know the version of gdb (it is not in the help of Lazarus); where could I get it?


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6454
    • wiki
Re: Cumbersome warning message with gdb
« Reply #3 on: January 12, 2020, 05:34:14 pm »
Just to be clear, you get the warning window when:
1) the app is paused at a breakpoint / or during single-stepping
2) the app is running
2a) while the app is starting up in gdb. Once it is gone through any initialization it is fine
2b) any time while the app is running.

When the app is paused this is normal. The app can not answer to the window-manager. So the window-manager produces a warning.

I have no idea, if this feature can be disabled in the window manager, and if so that will depend on which window manager is in use.

If the problem happens, while the app is running, then that is odd. GDB should not slow it down that much.
If it is during startup, you can try "DisableLoadSymbolsForLibraries" = true. https://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working . It is possible that gdb takes to long, when loading extra symbols (though very unlikely)

Slowdown can also happen if you hit lots of exceptions (even if the debugger ignores them and continues, and they are caught and handled by the app).
Or if you have breakpoints that are hit (but have a condition, or auto continue). Though you have to hit such a breakpoint hundreds of times.....

franzala

  • New Member
  • *
  • Posts: 17
Re: Cumbersome warning message with gdb
« Reply #4 on: January 13, 2020, 01:50:31 pm »
It appears mainly during single-stepping when I'm looking if some variables have the value I wanted for instance; but it appeared also at least one time while the application was running and waiting for a hit on one button or another.

I never had that previously but I changed my OS recently from mageia to ubuntu and I wonder if it could be  related to that change or more probably with a problem between ubuntu and Lazarus, because it appears up to now exclusively under Lazarus.

Did you ever hear from the same problem?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6454
    • wiki
Re: Cumbersome warning message with gdb
« Reply #5 on: January 13, 2020, 02:30:03 pm »
I never had that previously but I changed my OS recently from mageia to ubuntu and I wonder if it could be  related to that change
Different distros come with different window managers pre-installed. (You can always install another one, if you like).

This "not responding / wait" alert, is a feature of the window manager. So assuming that ubuntu comes with a diff window-mgr, then yes that would be related to the change.

Window managers send signals to all the running apps, all the time. And the apps are supposed to answer. If an app does not answer, then usually something is wrong with the app, hence you get a warning.

In the debugger (while stepping) this is normal (annoying, but normal). The app is paused, so it can't answer...
 
The message would also appear if you do long calculations inside an event (in the main thread) without calling Application.ProcessMessages. Because while your code is running (in the main thread), the LCL code that would answer messages does not run.

I usually see them when using valgrind. valgind slows down execution. So an app running under valgrind often replies to late.

Quote
or more probably with a problem between ubuntu and Lazarus, because it appears up to now exclusively under Lazarus.

Well do you debug any apps that are not written in Lazarus?
As for none debugging occurrence, check what your app does. Use threads or Application.ProcessMessages.

As for none-Laz apps do not get that warning... Well then, they are probably well coded.

franzala

  • New Member
  • *
  • Posts: 17
Re: Cumbersome warning message with gdb
« Reply #6 on: January 13, 2020, 03:44:56 pm »
Well, I will investigate the window manager; I do not debug  apps  written under other EDI than Lazarus.

In between, I use a larger form than necessary trying not to use the region where the window is located; I hope I will find a netter solution!

Many thanks, I will let you know if I find something.

 

TinyPortal © 2005-2018