cannot debug

General questions regarding the usage of CodeLite
freanux
CodeLite Enthusiast
Posts: 12
Joined: Fri Oct 25, 2013 11:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by freanux »

no difference after enabling the option "Use filename only for breakpoints (NO full path)"

this happens, if all commands are entered manually:

Code: Select all

flynn@voyager ~/Programming/TestProj2/Debug $ gdb --command="/tmp/codelite_gdbinit.txt" --tty=/dev/pts/3 --interpreter=mi "./TestProj2"
=thread-group-added,id="i1"
~"GNU gdb (Gentoo 7.5.1 p2) 7.5.1\n"
~"Copyright (C) 2012 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-pc-linux-gnu\".\nFor bug reporting instructions, please see:\n"
~"<http://bugs.gentoo.org/>...\n"
~"Reading symbols from /home/flynn/Programming/TestProj2/Debug/TestProj2..."
~"done.\n"
(gdb) 
set unwindonsignal on
&"set unwindonsignal on\n"
^done
(gdb) 
set breakpoint pending on
&"set breakpoint pending on\n"
^done
(gdb) 
set width 0
&"set width 0\n"
^done
(gdb) 
set height 0
&"set height 0\n"
^done
(gdb) 
set print elements 200 
&"set print elements 200\n"
^done
(gdb) 
-break-insert -f "\"main.c:6\""
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400575",func="main",file="/home/flynn/Programming/TestProj2/main.c",fullname="/home/flynn/Programming/TestProj2/main.c",line="6",times="0",original-location="main.c:6"}
(gdb) 
-exec-arguments
^done
(gdb) 
-exec-run
&"warning: GDB: Failed to set controlling terminal: Operation not permitted\n"
=thread-group-started,id="i1",pid="17219"
=thread-created,id="1",group-id="i1"
^running
*running,thread-id="all"
(gdb) 
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
=library-loaded,id="linux-vdso.so.1",target-name="linux-vdso.so.1",host-name="linux-vdso.so.1",symbols-loaded="0",thread-group="i1"
&"warning: Could not load shared library symbols for linux-vdso.so.1.\nDo you need \"set solib-search-path\" or \"set sysroot\"?"
&"\n"
=library-loaded,id="/lib64/libc.so.6",target-name="/lib64/libc.so.6",host-name="/lib64/libc.so.6",symbols-loaded="0",thread-group="i1"
hello world
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400575",func="main",file="/home/flynn/Programming/TestProj2/main.c",fullname="/home/flynn/Programming/TestProj2/main.c",line="6",times="1",original-location="main.c:6"}
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000000000400575",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffdf58"}],file="/home/flynn/Programming/TestProj2/main.c",fullname="/home/flynn/Programming/TestProj2/main.c",line="6"},thread-id="1",stopped-threads="all",core="1"
(gdb) 

all is running fine. i did open a bigger project with a mass of .c files, set a breakpoint somewhere (where i know, the code has to run through), the effect is the same.
wtf's going on here? :-D i never had this issue and i'm working a lot with codelite, on windows, on linux.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by eranif »

Last thing to test: change settings so codelite will apply breakpoints after 'main' is hit (from Settings -> GDB Settings)

Eran
Make sure you have read the HOW TO POST thread
freanux
CodeLite Enthusiast
Posts: 12
Joined: Fri Oct 25, 2013 11:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by freanux »

the same behaviour. :-(

i downloaded the code of gdb. i found in gdb/fork_child.c the piece of code, where gdb outputs this stupid message, if a child is forked and gdb wants to follow the child. i played around with the gdb flags

Code: Select all

set follow-fork-mode parent
(default) and

Code: Select all

set follow-fork-mode child
but the behaviour is the same. i don't understand, why a fork of the inferior should happen during startup of the debugger.

i also played around with following flags

Code: Select all

set detach-on-fork on/off
on my other gentoo machine with codelite installed (btw runs perfecty on there). but it seems, that there no forks happen.
for a short moment, i thought, it could be something with the current tty, in which the debugger runs. but.. nah.

i'm going to check my whole system. something is really strange and wrong. i'm going to install an another ide on both machines to compare their behaviour. i will report.

and... sorry for my swiss-english :-)

greez
freanux
freanux
CodeLite Enthusiast
Posts: 12
Joined: Fri Oct 25, 2013 11:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by freanux »

i compiled anjuta and kdevelop. both are working as expected.

if i delete the ~/.codelite directory with all subdirectories and rerun codelite, codelite stucks at startup.

Code: Select all

flynn@voyager ~ $ ps --forest -u
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
flynn     1536  0.0  0.0  22000  2364 pts/0    Ss   18:57   0:00 bash
flynn     1962  0.0  0.0  17028  1276 pts/0    R+   19:11   0:00  \_ ps --forest -u
flynn     1177  0.0  0.0  22000  2400 pts/1    Ss   18:06   0:00 bash
flynn     1801  0.3  0.5 1306460 72680 pts/1   Sl+  19:04   0:01  \_ codelite
flynn     1826  0.0  0.3 459236 39404 pts/2    Ssl+ 19:04   0:00      \_ /usr/bin/codelite_indexer 1801 --pid
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by eranif »

Instead of running 'ps', try attaching gdb and post it here:

Code: Select all

gdb -p <codelite-pid>
bt
Eran
Make sure you have read the HOW TO POST thread
freanux
CodeLite Enthusiast
Posts: 12
Joined: Fri Oct 25, 2013 11:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by freanux »

Code: Select all

(gdb) backtrace
#0  0x00007f0e9990cbdf in poll () from /lib64/libc.so.6
#1  0x00007f0e9f2602e4 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f0e9f260742 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f0ea086bcc7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#4  0x00007f0e9d51a7b5 in wxGUIEventLoop::DoRun() () from /usr/local/lib/libwx_gtk2u_core-2.9.so.5
#5  0x00007f0e9ca6fb00 in wxEventLoopBase::Run() () from /usr/local/lib/libwx_baseu-2.9.so.5
#6  0x00007f0e9cb66890 in wxAppTraits::RunLoopUntilChildExit(wxExecuteData&, wxEventLoopBase&) () from /usr/local/lib/libwx_baseu-2.9.so.5
#7  0x00007f0e9d543279 in wxGUIAppTraits::WaitForChild(wxExecuteData&) () from /usr/local/lib/libwx_gtk2u_core-2.9.so.5
#8  0x00007f0e9cb6bd8d in wxExecute(char**, int, wxProcess*, wxExecuteEnv const*) () from /usr/local/lib/libwx_baseu-2.9.so.5
#9  0x00007f0e9cb6c7a2 in wxExecute(wxString const&, int, wxProcess*, wxExecuteEnv const*) () from /usr/local/lib/libwx_baseu-2.9.so.5
#10 0x00007f0e665dfd55 in CallGraph::LocateApp (this=0x198ff90, app_name=...) at /home/flynn/Temp/codelitegit/CallGraph/callgraph.cpp:290
#11 0x00007f0e665e0273 in CallGraph::GetDotPath (this=0x198ff90) at /home/flynn/Temp/codelitegit/CallGraph/callgraph.cpp:357
#12 0x00007f0e665de693 in CallGraph::CallGraph (this=0x198ff90, manager=0xdf09a0 <PluginManager::Get()::theManager>) at /home/flynn/Temp/codelitegit/CallGraph/callgraph.cpp:95
#13 0x00007f0e665de13a in CreatePlugin (manager=0xdf09a0 <PluginManager::Get()::theManager>) at /home/flynn/Temp/codelitegit/CallGraph/callgraph.cpp:39
#14 0x000000000065375d in PluginManager::Load (this=0xdf09a0 <PluginManager::Get()::theManager>) at /home/flynn/Temp/codelitegit/LiteEditor/pluginmanager.cpp:234
#15 0x0000000000789f20 in clMainFrame::CompleteInitialization (this=0x1282bd0) at /home/flynn/Temp/codelitegit/LiteEditor/frame.cpp:3372
#16 0x000000000076d127 in clMainFrame::Initialize (loadLastSession=true) at /home/flynn/Temp/codelitegit/LiteEditor/frame.cpp:795
#17 0x00000000006fa7e4 in CodeLiteApp::OnInit (this=0xee19f0) at /home/flynn/Temp/codelitegit/LiteEditor/app.cpp:560
#18 0x00000000006fda5f in wxAppConsoleBase::CallOnInit (this=0xee19f0) at /usr/local/include/wx-2.9/wx/app.h:94
#19 0x00007f0e9cab3a04 in wxEntry(int&, wchar_t**) () from /usr/local/lib/libwx_baseu-2.9.so.5
#20 0x00000000006f9314 in main (argc=1, argv=0x7fffd996b188) at /home/flynn/Temp/codelitegit/LiteEditor/app.cpp:218
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by eranif »

I am pretty sure I fixed this bug before...
Anyways, please do a git pull, compile and try it again

Thanks
Eran
Make sure you have read the HOW TO POST thread
freanux
CodeLite Enthusiast
Posts: 12
Joined: Fri Oct 25, 2013 11:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by freanux »

done. this bug has gone. thanks.
now i can play with the settings to find out, how to get codelite run the debugger correctly... hopefully :-)
freanux
CodeLite Enthusiast
Posts: 12
Joined: Fri Oct 25, 2013 11:45 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: cannot debug

Post by freanux »

i traced codelite with

Code: Select all

strace codelite
to see, if/how the debugger session looses his tty during debugging. but with strace running, the debugger runs fine, very surprisingly.
Post Reply