CodeLite Debug -- unable to show variables' values.

General questions regarding the usage of CodeLite
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

CodeLite Debug -- unable to show variables' values.

Post by jiapei100 »

Hi:

A new video file can be retrieved at http://www.visionopen.com/codelitedebug.ogv

It looks like a serious bug of CodeLite.

As you can see, I'm trying to display a member variable's value (value of unsigned int m_iFrames ), but failed.

Seriously can't understand how this happens. And, seems always happen.
It looks the debugger works fine with local variables.

The debug error messages are

Code: Select all

DEBUG>>00000671-var-create - * "m_iFrames"
DEBUG>>00000671^error,msg="mi_cmd_var_create: unable to create variable object"
Cheers
JiA
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by eranif »

jiapei100 wrote:It looks like a serious bug of CodeLite.
Nope. Not a codelite bug.

CodeLite is not a debugger, it nearly displays the output of gdb.
To confirm this, there is a little 'text control' at the bottom of the 'Debug' output tab, you can send commands directly to gdb and confirm that it is a gdb issue.

The log you pasted is the output from gdb.
jiapei100 wrote:DEBUG>>00000671-var-create - * "m_iFrames"
DEBUG>>00000671^error,msg="mi_cmd_var_create: unable to create variable object"
This is gdb's output, seems like codelite is passing the correct value
-var-create - * "m_iFrames"
but for some reason gdb cant create a variable object out of it.

I would suggest that you check your compilation flags, make sure there is no unneeded optimization flags (-O2)
If the problem still persist, you might open a bug for this at gdb's forum.

Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by jiapei100 »

Hi, Eran:

Thanks for your prompt reply.

My compilation option is "-g" only, that what I can see from Project Settings.

But, is there a way to check the compilation configurations as a summary?

Cheers
JIA
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by eranif »

When you are building the project, look at the output of the 'Build' window.

Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by jiapei100 »

Thanks.
There is a "-o"

Code: Select all

/usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ -unix -o objectdetection.mk objectdetection.pro
But, where to specify this?
where to change "-o" to "non -o"?

Cheers
JIA
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by eranif »

jiapei100 wrote:Thanks.
There is a "-o"

Code: Select all

/usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ -unix -o objectdetection.mk objectdetection.pro
But, where to specify this?
where to change "-o" to "non -o"?

Cheers
JIA
This is not the build line, this is the qmake line to generate the makefile.

Please note that this topic is becoming not related to codelite.
Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by jiapei100 »

Alright, but which line is for build?

All the following is the output when I "build" the project.
Right click project's name, and then "Build". ("Rebuild" is just next to "Build" )

Code: Select all

----------Build Started--------
/bin/sh -c '"make"  -j 2 -f "aam_wsp.mk"'
----------Building project:[ utils - Debug ]----------
make[1]: Entering directory `/home/jiapei/MyPrograms/codelite/aam/utils'
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: Nothing to be done for `first'.
make[1]: Leaving directory `/home/jiapei/MyPrograms/codelite/aam/utils'
----------Building project:[ AAM - Debug ]----------
make[1]: Entering directory `/home/jiapei/MyPrograms/codelite/aam/AAM'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jiapei/MyPrograms/codelite/aam/AAM'
----------Building project:[ comalgs - Debug ]----------
make[1]: Entering directory `/home/jiapei/MyPrograms/codelite/aam/comalgs'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jiapei/MyPrograms/codelite/aam/comalgs'
----------Building project:[ objectdetection - Debug ]----------
make[1]: Entering directory `/home/jiapei/MyPrograms/codelite/aam/objectdetection'
make[1]: warning: -jN forced in submake: disabling jobserver mode.
/usr/bin/qmake -spec /usr/share/qt4/mkspecs/linux-g++ -unix -o objectdetection.mk objectdetection.pro
make[1]: Leaving directory `/home/jiapei/MyPrograms/codelite/aam/objectdetection'
make[1]: Entering directory `/home/jiapei/MyPrograms/codelite/aam/objectdetection'
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: Nothing to be done for `first'.
make[1]: Leaving directory `/home/jiapei/MyPrograms/codelite/aam/objectdetection'
----------Build Ended----------
0 errors, 0 warnings

So, can you please tell me, which line(s) are for the "build" information that you require?
BTW, I can't see anything about "-O2" in the above information.
So, let's suppose there is a "-O2" in my compilation configuration, where to change it in CodeLite?


Cheers
JIA
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by eranif »

None of the log that you provided is actually building something.
jiapei100 wrote:make[1]: Nothing to be done for `first'.
This means that the target is up to date and no actual build is taking place.

The makefile wont compile anything unless a file is modified. You should do 'Rebuild' (which is equal to clean followed by build)

Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by jiapei100 »

Ok, I did a thorough rebuild, with all dependencies rebuilt, please see the attached file.

By the way, no matter how my code was built, there still must be a place for me to specify whether optimization (-O2) has been enabled or not, right?


Cheers
JIA
You do not have the required permissions to view the files attached to this post.
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CodeLite Debug -- unable to show variables' values.

Post by eranif »

jiapei100 wrote:Ok, I did a thorough rebuild, with all dependencies rebuilt, please see the attached file.
Yes, I can now see that everything was build.
jiapei100 wrote:By the way, no matter how my code was built, there still must be a place for me to specify whether optimization (-O2) has been enabled or not, right?
Yes, right click on your project settings and select the 'Compiler' tab. You can any option you want to send to the compiler in this page.
To add -O2, add it as 'Compiler Options' (this is a semi-colon separated string)

BTW: Your build seems OK, there is no -O2 (note that it is upper case 'o').
Do you still can't see the variable while debugging? If you cant, then this is most definitely gdb issue.

Did you try my other suggestion? in the 'Debug' tab, when you hit a breakpoint, type: 'print m_iFrames' (or whatever the variable name is)

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