Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » problem debugging theIde with theIde in Linux [BUG?]
problem debugging theIde with theIde in Linux [BUG?] [message #1822] Tue, 21 March 2006 13:30 Go to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
I am trying to debug multiple crashes in theIde on Linux, by compiling ide in DEBUG mode, and running it in the debugger of theIde itself. It doesn't seem to work. The debugger stops in the __atomic_add function of atomicity.h. I did not put any breakpoint to this method, and stack trace is emtpty in debugger. If I continue running the debugger with F5 it stops in this function again in very short time.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H	1

typedef int _Atomic_word;

static inline _Atomic_word 
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
  register _Atomic_word __result;
  __asm__ __volatile__ ("lock; xaddl %0,%2"
			: "=r" (__result) 
                        : "0" (__val), "m" (*__mem) 
                        : "memory");
  return __result;
}

static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
  __asm__ __volatile__ ("lock; addl %0,%1"
			: : "ir" (__val), "m" (*__mem) : "memory");
}

#endif /* atomicity.h */

[Updated on: Tue, 02 May 2006 10:26] by Moderator

Report message to a moderator

Re: problem debugging theIde with theIde in Linux [message #1825 is a reply to message #1822] Tue, 21 March 2006 18:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Unofortunately, until we will implement own debugger core for GCC, not everything is under our control - the only chance there is that we are misscommunicating with gdb...

If you switch Setup/Verbose on, you will see GDB communication log in console - please try that to find out whether it is our bug org GDB's....

Mirek
Re: problem debugging theIde with theIde in Linux [message #1827 is a reply to message #1825] Tue, 21 March 2006 20:42 Go to previous messageGo to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
After further experimenting it turned out that if I compile theIde 602 on Linux, it crashes in __atomic_add while attempting to start. The precompiled theIde 602 seems to run OK, except for some Assist & layout editor instabilities which I was trying to debug. It seems impossible to debug that instability if I am unable to compile a running theIde with DEBUG options (it crashed also when compiled for RELEASE). BTW there was multiple other problems with compiling theIde on Linux: #include <locale.h> seems to be missing (I added it) and I was only able to link shared, and not static, because some X library was missing.
I was able to get a backtrace of the crash by generating a core file, and opening with gdb, but not by running in theIde debugger. I don't have the backtrace with me now but I will post it in a day.
Re: problem debugging theIde with theIde in Linux [message #1828 is a reply to message #1827] Tue, 21 March 2006 21:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
hojtsy wrote on Tue, 21 March 2006 14:42

After further experimenting it turned out that if I compile theIde 602 on Linux, it crashes in __atomic_add while attempting to start. The precompiled theIde 602 seems to run OK, except for some Assist & layout editor instabilities which I was trying to debug. It seems impossible to debug that instability if I am unable to compile a running theIde with DEBUG options (it crashed also when compiled for RELEASE). BTW there was multiple other problems with compiling theIde on Linux: #include <locale.h> seems to be missing (I added it) and I was only able to link shared, and not static, because some X library was missing.
I was able to get a backtrace of the crash by generating a core file, and opening with gdb, but not by running in theIde debugger. I don't have the backtrace with me now but I will post it in a day.


Well, unfortunately, various Linux distros differ.

On any I have checked so far, static linking is impossible due to missing "XFT" static version (I am afraid, that one simply does not exist... Wink Therefore, never use "static" in Linux for GUI apps ("best results" are obtained by building "shared" with GCC 3.4.x - this produces binaries that run almost everywhere, and this is also how we produce Linux binary versions).

Mirek
Re: problem debugging theIde with theIde in Linux [message #1836 is a reply to message #1828] Wed, 22 March 2006 10:26 Go to previous message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
Would it be possible to also provide a precompiled DEBUG build of TheIDE for Linux? It would be easier to debug crashes in TheIDE this way. I understand that I should be able to compile one myself, but that one crashes before it starts. Here is the backtrace of the crash inside TheIDE which I compiled for DEBUG on Linux:
#0  0x080cd6df in __atomic_add (__mem=0x104, __val=-1) at atomicity.h:51
#1  0x080ecb5f in AtomicDec (t=@0x104) at Mt.h:51
#2  0x082fc539 in Callback::Release() (this=0xbffe86a8) at Cbgen.h:48
#3  0x082d5517 in Callback::operator=(Callback const&) (this=0xbffe86a8, c=@0xbffe6720) at Cbgen.h:130
#4  0x081047b7 in WithDropChoice (this=0xbffe7fac) at DropChoice.h:227
#5  0x081ce721 in WithIDEFindReplaceLayout (this=0xbffe7e38) at CodeEditor.cpp:821
#6  0x081cdd78 in FindReplace (this=0xbffe7e38) at CodeEditor.cpp:821
#7  0x081c85a2 in CodeEditor (this=0xbffe7638) at CodeEditor.cpp:821
#8  0x08079c4a in AssistEditor (this=0xbffe7638) at Assist.cpp:8
#9  0x0809a40c in Ide (this=0xbffe6960) at idewin.cpp:283
#10 0x0809e23b in GuiMainFn_() () at idewin.cpp:615
#11 0x0809df48 in main (argc=1, argv=0xbfffd594, envptr=0xbfffd59c) at idewin.cpp:510
#12 0x4a200704 in __libc_start_main () from /lib/tls/libc.so.6

(gdb) frame 5
#5  0x081ce721 in WithIDEFindReplaceLayout (this=0xbffe7e38) at CodeEditor.cpp:821
821     CodeEditor::CodeEditor() {

(gdb) frame 4
#4  0x081047b7 in WithDropChoice (this=0xbffe7fac) at DropChoice.h:227
227             select.WhenDrop = callback(this, &WithDropChoice::DoWhenDrop);

(gdb) frame 3
#3  0x082d5517 in Callback::operator=(Callback const&) (this=0xbffe86a8, c=@0xbffe6720) at Cbgen.h:130
130             Release();

(gdb) frame 2
#2  0x082fc539 in Callback::Release() (this=0xbffe86a8) at Cbgen.h:48
48              void Release()      { if(action  && AtomicDec(action->count) ==
0) delete action; }

(gdb) p *this
$2 = {<Moveable<Callback,EmptyClass>> = {<EmptyClass> = {<No data fields>}, <No data fields>}, action = 0x100}



Previous Topic: Linux compile fails
Next Topic: New To U++...Where to start?
Goto Forum:
  


Current Time: Fri Apr 19 08:04:23 CEST 2024

Total time taken to generate the page: 0.02841 seconds