Author Topic: Cannot evaluate function -- may be inlined  (Read 37536 times)

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Cannot evaluate function -- may be inlined
« Reply #15 on: November 06, 2011, 02:53:58 pm »
@Morten, I don't want to go into discussion who's fault is it when debugger doesn't show value of a variable (assuming that I set the settings in debugger correctly). It's just waste of time.
This is output from cb when string is used:
http://imageshack.us/photo/my-images/513/cannotevaluate1.png/

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Cannot evaluate function -- may be inlined
« Reply #16 on: November 06, 2011, 02:55:27 pm »
@Neil, that looks good! What settings am I suppose to set in order to "have what you've got"?

zabzonk

  • Guest
Re: Cannot evaluate function -- may be inlined
« Reply #17 on: November 06, 2011, 03:02:48 pm »
@smallB:

That is just an ordinary debug build, with no optimisations, using the CB debug nightly, SVN 7452. The version of GCC I use is TDM 4.6.1 and the version of GDB is 7.3 - the one that comes with the TDM GCC build.

Note that the GCC optimiser is very aggressive, and does not know anything about "debug builds". If you have any optimisations enabled at all, then all the code in main() will probably be removed, whether you have debug info enabled with -g or not.


Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Cannot evaluate function -- may be inlined
« Reply #18 on: November 06, 2011, 03:13:16 pm »
@Neil, thanks for your reply. Neil, I have cb 7550, and gcc ver same as yours. I've checked compiler settings and they are checked(see three images for - project settings, compiler_settings_general and debugger_settings):
http://imageshack.us/photo/my-images/171/compilersettingsglobal.png/
http://imageshack.us/photo/my-images/13/projectcompilersettings.png/
http://imageshack.us/photo/my-images/600/debuggersettings.png/

zabzonk

  • Guest
Re: Cannot evaluate function -- may be inlined
« Reply #19 on: November 06, 2011, 03:29:53 pm »
@smallB:

Yes, but what about these settings http://imgur.com/Kym4P ? All of them should be unchecked.

Also, the image of the code you posted in response to Morten is different from the code I am responding about. You have now posted at least three different chunks of code. Please identify, once and for all, which one you are asking about - and please make it simple, and compilable with no external dependencies.





Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Cannot evaluate function -- may be inlined
« Reply #20 on: November 06, 2011, 05:30:02 pm »
@Neil sorry for the disconnection. Neil, let's talk about the simplest code example which is main to string obj.
Code
#include <string>


    int main(int argc, char* argv[])
{
std::string foo = "1234567avavav";
return 0;
}
And yes, I do have them unchecked (those options you've shown in your previous post)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Cannot evaluate function -- may be inlined
« Reply #21 on: November 06, 2011, 06:47:29 pm »
Please do a full rebuild with full commandline enabled (or with enabled html log) and post he content of the build log or the html-log here (wherever the full commandline send to gcc/g++ is shown).
Without that it does not make any sense to discuss more.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Cannot evaluate function -- may be inlined
« Reply #22 on: November 06, 2011, 07:35:57 pm »
Hi Jens, this is build log:
-------------- Clean: Debug in 7500 ---------------

Cleaned "7500 - Debug"

-------------- Build: Debug in 7500 ---------------

g++.exe -Wall -g  -std=c++0x -Wextra -Wall -g  -std=c++0x -Wfatal-errors -Wextra -Wall -g   -IC:\excercizes\QT_projects\7500 -IC:\excercizes\QT_projects\7500 -c C:\excercizes\QT_projects\7500\main.cpp -o obj\Debug\main.o
C:\excercizes\QT_projects\7500\main.cpp:4:9: warning: unused parameter 'argc' [-Wunused-parameter]
C:\excercizes\QT_projects\7500\main.cpp:4:9: warning: unused parameter 'argv' [-Wunused-parameter]
mingw32-g++.exe -LC:\QtSDK\Desktop\Qt\4.7.4\mingw\lib  -o bin\Debug\7500.exe obj\Debug\main.o   
Output size is 75.46 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 2 warnings (0 minutes, 1 seconds)
Build log saved as:
file://C:/excercizes/QT_projects/7500/7500_build_log.html

zabzonk

  • Guest
Re: Cannot evaluate function -- may be inlined
« Reply #23 on: November 06, 2011, 08:06:37 pm »
@smallB:

My last post to you here, as I've become convinced that you are actually a troll. Nobody but a troll could keep up this steady flow of nearly comprehensible, but always vague crap. But still, in my last post I will try to be useful:

  • Post the complete HTML build log as an attachment.
  • Explain why you are using g++.exe in one place and mingw32-g++.exe in another.
  • Post your entire project somewhere (not here) that people can look at.


And with that, good-bye!

« Last Edit: November 06, 2011, 08:10:05 pm by Neil Butterworth »

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Cannot evaluate function -- may be inlined
« Reply #24 on: November 06, 2011, 08:21:20 pm »
@Neil, I am astonished after reading your last post. Never expected to hear anything like this while asking for help. Yes I think it will be better if you'd never reply to any of my future post. I cannot believe that anyone could think about me as a troll. I on the other hand have every reason to call you pig arrogant, boorish individual. And with that good bye you ignorant pig.
And just to prove (to others not to you) that I've never meant anything except getting help:
To answer to your question from previous post:
1. http://pastebin.com/GUPg9PvL
2. Cannot explain - don't know, probably have some settings wrongly set. That's one of the reasons I'm asking here for help.
3. http://www.mediafire.com/?kke26hj2zggk3za

Neil, you ignorant, rude pig.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cannot evaluate function -- may be inlined
« Reply #25 on: November 06, 2011, 08:29:42 pm »
Both of you are fun to read :)
Both are half-trolls, by the way :)
Unfortunately, I've run out of Coke :(, but if you continue in this fashion, I'll have to go to get some.

smallB: please put a description for you links, because the links look random.

2. Cannot explain - don't know, probably have some settings wrongly set. That's one of the reasons I'm asking here for help.
I can, you have different values for c++ compiler and linker.
Please go to your toolchain settings and hit auto detect :)
Then read a gdb manual and try some command line debugging.

You can enable the full log from the debugger, not the normal one, but the debugger's debug log, which should be enabled in the debugger's settings.
And post it here.
If you post the normal debug log, I'll ignore the topic, so read carefully!

p.s. please use code tags for pastes embedded in the posts.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Cannot evaluate function -- may be inlined
« Reply #26 on: November 06, 2011, 08:38:49 pm »
@obfuscated
1. After hitting auto detect I still see mingw32-g++.exe as a linker. Am I suppose to have g++ as a linker too? If needs be I'm prepared to make video file with camtasia and post it.
2. In settings/debugger/common: display debugger's log - that box I've checked just now.
3. Is the debuger's log now displayed in logs and others on build log tab instead of the regular one? if so that's the log if not I do not now where is it saved as there seems to be no path specified:

-------------- Clean: Debug in 7500 ---------------

Cleaned "7500 - Debug"

-------------- Build: Debug in 7500 ---------------

g++.exe -Wall -g  -std=c++0x -Wextra -Wall -g  -std=c++0x -Wfatal-errors -Wextra -Wall -g   -IC:\excercizes\QT_projects\7500 -IC:\excercizes\QT_projects\7500 -c C:\excercizes\QT_projects\7500\main.cpp -o obj\Debug\main.o
C:\excercizes\QT_projects\7500\main.cpp:4:9: warning: unused parameter 'argc' [-Wunused-parameter]
C:\excercizes\QT_projects\7500\main.cpp:4:9: warning: unused parameter 'argv' [-Wunused-parameter]
mingw32-g++.exe -LC:\QtSDK\Desktop\Qt\4.7.4\mingw\lib  -o bin\Debug\7500.exe obj\Debug\main.o    
Output size is 75.46 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 2 warnings (0 minutes, 1 seconds)
Build log saved as:
file://C:/excercizes/QT_projects/7500/7500_build_log.html
 

Thanks
P.S. gotta go, will check your answer tomorrow.
« Last Edit: November 06, 2011, 08:41:51 pm by smallB »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cannot evaluate function -- may be inlined
« Reply #27 on: November 06, 2011, 08:45:45 pm »
Hm, you're not reading mate!
I've said the debugger's debug log, you're pasting me the compiler's log.
I've said use code tags, you're pasting directly.

Please don't waste our time.

This is pretty strange that auto-detect is putting the g++ and mingw32-g++.exe in the options. I don't know what are the correct values for windows. So other dev should tell.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7576
    • My Best Post
Re: Cannot evaluate function -- may be inlined
« Reply #28 on: November 06, 2011, 09:41:59 pm »
This is pretty strange that auto-detect is putting the g++ and mingw32-g++.exe in the options. I don't know what are the correct values for windows. So other dev should tell.

Confirmed with CB 10.05; if they are manually set to g++ and mingw32-g++.exe in the options; doing auto detect will not change them to the normal values.

I consider the above the correct way to do it; just not the way I expected to happen

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Cannot evaluate function -- may be inlined
« Reply #29 on: November 06, 2011, 09:50:32 pm »
g++.exe and mingw32-g++.exe are the same in most cases, but in broken installs, they might differ, so use either the one or the other in both places (same is for gcc, either with or without mingw32-prefix, but the same as for g++).

And you really should learn to read and follow the advices you get.
And the debuggers debug-log is not really hard to find, it's in "Logs & others" like the other logs, maybe you should search for it.