Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-02

Ubuntu 9.10 x64 AMD Debugging multi-threaded system impossible

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Brunner

Is it just me who's having a problem with debugging threaded apps under Ubuntu?

I have a manager worker threaded networking engine I'm trying to debug. Windows 7 has no problems debugging the code. Unfortunately, my Linux setup will not permit me to trace into more then 1 line of code. Console reported GDB switched at the breakpoint. But that's as far as it gets. GDM (Desktop Manager) freezes. I have to ctrl+alt+F(#) and restart the GDM to get back in.

At this point I'm only able to use Windows 7 to debug. I'd really love to stop depending on this Windows boot to test. Anyone solve this problem or have any compiler options I need for Linux to get GDB to not cause GDM to halt?

Please help ;-)

Reply by email

Andrew Brunner
to Andrew Brunner

Problem solved: Project options for debugging (at least under Ubuntu x64) required extra information file...

Project Options,
Compiler Options,
Linking,
Debugging: Check Use external gdb debug symbols file (-Xg)

Fixed my GDB resulting in X-Windows desktop manager crash for Ubuntu X64 on trace.

Andrew Brunner wrote 16 lines
Is it just me who's having a problem with debugging threaded apps under Ubuntu? I have a manager worker threaded networking engine I'm trying to debug.  Windows 7 has no problems debugging the code.  Unfortunately, my Linux setup will not permit me to trace into more then 1 line of code.  Console reported GDB switched at the breakpoint.  But that's as far as it gets.  GDM (Desktop Manager) freezes.  I have to ctrl+alt+F(#) and restart the GDM to get back in. At this point I'm only able to use Windows 7 to debug.  I'd really love to stop depending on this Windows boot to test. Anyone solve this problem or have any compiler options I need for Linux to get GDB to not cause GDM to halt? Please help ;-)

Reply by email

Jonathan
to Andrew Brunner
Show quoted text 10 lines
Problem solved: Project options for debugging (at least under Ubuntu x64) required extra information file... Project Options, Compiler Options, Linking, Debugging: Check Use external gdb debug symbols file (-Xg) Fixed my GDB resulting in X-Windows desktop manager crash for Ubuntu X64 on trace.

That is good to know, I was using the guide at http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial. Maybe you could update it please?

Reply by email

Jonas Maebe
to Jonathan
Jonathan wrote 16 lines
Andrew Brunner wrote: > Problem solved: Project options for debugging (at least under Ubuntu > x64) required extra information file... > > Project Options, > Compiler Options, > Linking, > Debugging: Check Use external gdb debug symbols file (-Xg) > > Fixed my GDB resulting in X-Windows desktop manager crash for Ubuntu > X64 on trace. That is good to know, I was using the guide at http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial . Maybe you could update it please?

If you do so, please only mention it is as a tip that apparently might help if you have problems. There is no reason why using an external debug file should make any difference whatsoever, regardless of whether you are debugging a single or multi-threaded program.

Jonas

Reply by email

Anton Kavalenka
to Jonas Maebe
Jonas Maebe wrote 30 lines
On 03 Feb 2010, at 04:57, Jonathan wrote: > Andrew Brunner wrote: > >> Problem solved: Project options for debugging (at least under Ubuntu >> x64) required extra information file... >> >> Project Options, >> Compiler Options, >> Linking, >> Debugging: Check Use external gdb debug symbols file (-Xg) >> >> Fixed my GDB resulting in X-Windows desktop manager crash for Ubuntu >> X64 on trace. > > That is good to know, I was using the guide at > http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial. > Maybe you could update it please? If you do so, please only mention it is as a tip that apparently might help if you have problems. There is no reason why using an external debug file should make any difference whatsoever, regardless of whether you are debugging a single or multi-threaded program. Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Dear FPC-All

Debugging in GTK2-Linux of multithreaded GUI is a pain. Some notes:
I have debugged with Eclipse C++ .so with LCL application as host, Eclipse hangs as well.
and entire X stops responding (seems like X event loop was blocked). Switching to Text console and killing host application brings desktop to life, but this did not help in debugging :-(

Regards, Anton

Reply by email

Volker
to Anton Kavalenka
Show quoted text 51 lines
Jonas Maebe wrote: > > On 03 Feb 2010, at 04:57, Jonathan wrote: > >> Andrew Brunner wrote: >> >>> Problem solved: Project options for debugging (at least under Ubuntu >>> x64) required extra information file... >>> >>> Project Options, >>> Compiler Options, >>> Linking, >>> Debugging: Check Use external gdb debug symbols file (-Xg) >>> >>> Fixed my GDB resulting in X-Windows desktop manager crash for Ubuntu >>> X64 on trace. >> >> That is good to know, I was using the guide at >> http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial. >> Maybe you could update it please? > > If you do so, please only mention it is as a tip that apparently > might help if you have problems. There is no reason why using an > external debug file should make any difference whatsoever, regardless > of whether you are debugging a single or multi-threaded program. > > > Jonas > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel Dear FPC-All Debugging in GTK2-Linux of multithreaded GUI is a pain. Some notes: I have debugged with Eclipse C++ .so with LCL application as host, Eclipse hangs as well. and entire X stops responding (seems like X event loop was blocked). Switching to Text console and killing host application brings desktop to life, but this did not help in debugging :-( Regards, Anton ------------------------------------------------------------------------ _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Hi Anton

I had expired similar problems with console applications. After some investigations i came to the conclusion that there is something wrong with the dynamic loading of the "pthread" library. Removing line 18. in the file "rtl/unix/cthreads.pp" ( define dynpthreads} // Useless on BSD, since they are in libc ) solved my problem.

Volker

Reply by email

Jonathan
I just finished editing that section. I mentioned that this worked on Ubuntu x64 there. I'd like to know if other distros were able to resolve and debug using external GDB symbols option...

It works on Gentoo with Lazarus 0.9.28.2, Fpc 2.40, Gdb 7.0 and xorg-server 1.6.5-r1.

Reply by email