problems with quickdebug under Ubuntu

CodeLite installation/troubleshooting forum
jsterman
CodeLite Curious
Posts: 1
Joined: Thu Jun 30, 2011 4:52 am
Genuine User: Yes
IDE Question: C++
Contact:

problems with quickdebug under Ubuntu

Post by jsterman »

Im using codelite v2.8.0.4537 (not self built) under Ubuntu and am trying to launch a runnable file that was compiled with g++ and built with debugging information. I open 'Quick Debugging', specify my executable and then specify the working directory to be the same directory that the executable is in. When I try to run it, the executable fails because it cannot load a required .so that happens to be in the same directory. I noticed in the logging window that it says:

Current working dir: /home/puser/.codelite/jsdk

...despite me having specified the working directory in the Quick Debugging window. Any ideas how to fix the issue that the working dir isnt properly being set? I know the .so and executable are built correctly because running with the same settings in eclipse runs the program and imports all of the symbols properly.

The full debug log is:

Using gdbinit file: /home/puser/.gdbinit
Current working dir: /home/puser/.codelite/jsdk
Launching gdb from : /home/puser/workspace/openjdk/build/linux-i586/hotspot/outputdir/linux_i486_compiler1/debug
Starting debugger : gdb --tty=/dev/pts/2 --interpreter=mi /home/puser/workspace/openjdk/build/linux-i586/hotspot/outputdir/linux_i486_compiler1/debug/gamma
DEBUG>>set unwindonsignal on
DEBUG>>set breakpoint pending on
DEBUG>>set width 0
DEBUG>>set height 0
DEBUG>>set print pretty on
DEBUG>>set print elements 200
DEBUG>>00000009-break-insert main
DEBUG>>00000010-exec-arguments
DEBUG>>00000011-exec-run
DEBUG>>set unwindonsignal on
set unwindonsignal on
DEBUG>>set breakpoint pending on
set breakpoint pending on
DEBUG>>set width 0
set width 0
DEBUG>>set height 0
set height 0
DEBUG>>set print pretty on
set print pretty on
DEBUG>>set print elements 200
set print elements 200
DEBUG>>00000009-break-insert main
DEBUG>>00000010-exec-arguments
DEBUG>>00000011-exec-run
DEBUG>>=thread-group-added,id="i1"
=thread-group-added,id="i1"
DEBUG>>~"GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2\n"
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
DEBUG>>~"Copyright (C) 2010 Free Software Foundation, Inc.\n"
Copyright (C) 2010 Free Software Foundation, Inc.
DEBUG>>~"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"
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.
DEBUG>>~"This GDB was configured as \"i686-linux-gnu\".\nFor bug reporting instructions, please see:\n"
This GDB was configured as "i686-linux-gnu".\nFor bug reporting instructions, please see:
DEBUG>>~"<http://www.gnu.org/software/gdb/bugs/>...\n"
<http://www.gnu.org/software/gdb/bugs/>...
DEBUG>>~"Reading symbols from /home/puser/workspace/openjdk/build/linux-i586/hotspot/outputdir/linux_i486_compiler1/debug/gamma..."
Reading symbols from /home/puser/workspace/openjdk/build/linux-i586/hotspot/outputdir/linux_i486_compiler1/debug/gamma...
DEBUG>>~"done.\n"
done.
DEBUG>>&"set unwindonsignal on\n"
DEBUG>>^done
DEBUG>>&"set breakpoint pending on\n"
DEBUG>>^done
DEBUG>>&"set width 0\n"
DEBUG>>^done
DEBUG>>&"set height 0\n"
DEBUG>>^done
DEBUG>>&"set print pretty on\n"
DEBUG>>^done
DEBUG>>&"set print elements 200\n"
DEBUG>>^done
DEBUG>>00000009^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804a5ad",func="main",file="/home/puser/workspace/openjdk/hotspot/src/share/tools/launcher/java.c",fullname="/home/puser/workspace/openjdk/hotspot/src/share/tools/launcher/java.c",line="228",times="0",original-location="main"}
DEBUG>>00000010^done
DEBUG>>=thread-group-started,id="i1",pid="4954"
=thread-group-started,id="i1",pid="4954"
DEBUG>>=thread-created,id="1",group-id="i1"
=thread-created,id="1",group-id="i1"
DEBUG>>00000011^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>=library-loaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2",symbols-loaded="0",thread-group="i1"
DEBUG>>=thread-exited,id="1",group-id="i1"
=thread-exited,id="1",group-id="i1"
DEBUG>>=thread-group-exited,id="i1"
=thread-group-exited,id="i1"
DEBUG>>*stopped,reason="exited",exit-code="0177"
Program exited normally.
DEBUG>>00000012-var-update "*"
Debug session ended
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: problems with quickdebug under Ubuntu

Post by eranif »

jsterman wrote:Current working dir: /home/puser/.codelite/jsdk
This is the *current* working directory before launching gdb
jsterman wrote:Launching gdb from : /home/puser/workspace/openjdk/build/linux-i586/hotspot/outputdir/linux_i486_compiler1/debug
This is the 'Working directory' you set in the quick debug window
jsterman wrote:/home/puser/workspace/openjdk/build/linux-i586/hotspot/outputdir/linux_i486_compiler1/debug/gamma
And this is the executable that you are debugging.
jsterman wrote:When I try to run it, the executable fails because it cannot load a required .so that happens to be in the same directory.
This is Linux not Windows... unless you set your LD_LIBRARY_PATH it does not search for shared libraries under the same path of the executable.

Add this line:

Code: Select all

LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH)
To 'Settings | Environment variables...' use the 'Default' set (unless you are using a different environment variables set)

And use the 'Quick Debug' again

(I tried it here and it is working as it should - using codelite trunk build)

Eran
Make sure you have read the HOW TO POST thread
Post Reply