Since I am one of those unlucky souls suffering from the dreaded message
'Cannot evaluate function -- may be inlined' while trying to see a string
at the watch window, I'd thought to give it another try with a recent
version of gdb with python support which I've built with the help of instructions
from the
http://code.google.com/p/qp-gcc/wiki/build_gdb_msys_enStarting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args E:/codeblocks_svn/src/devel/codeblocks.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]Reading symbols from E:\codeblocks_svn\src\devel\codeblocks.exe...(no debugging symbols found)...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
Reading symbols from E:\codeblocks_svn\src\devel\codeblocks.exe...(no debugging symbols found)...done.
[debug]GNU gdb (GDB) 7.6.50.20130705-cvs
[debug]Copyright (C) 2013 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.6.50.20130705-cvs
Yup, right off the head. Although I've failed to build it at first
because of the reading fail of the warning about the line endings.
Anyway, with still no joy and seeing the same dreaded message
about strings.I've turned on the full debug log and hovering over
a string variable I noticed this.
[debug]> whatis fileToParse
[debug]type = std::string
[debug]>>>>>>cb_gdb:
[debug]> output &fileToParse
[debug](std::string *) 0x3f0fd14>>>>>>cb_gdb:
[debug]> output fileToParse.c_str()[0]@fileToParse.size()
[debug]Cannot evaluate function -- may be inlined
[debug]>>>>>>cb_gdb:
Cannot evaluate function -- may be inlined
whereas using the commands <print> or <output> from the debugger
log window prints the string nicely.
> p fileToParse
[debug]> p fileToParse
[debug]$5337 = "E:\\c++11.denemeler\\clang_cc\\TestFiles\\classtest.cpp"
[debug]>>>>>>cb_gdb:
$5337 = "E:\\c++11.denemeler\\clang_cc\\TestFiles\\classtest.cpp"
> output fileToParse
[debug]> output fileToParse
[debug]"E:\\c++11.denemeler\\clang_cc\\TestFiles\\classtest.cpp">>>>>>cb_gdb:
"E:\\c++11.denemeler\\clang_cc\\TestFiles\\classtest.cpp"
So I am guessing that debugger plugin is sending the wrong commands to the debugger
Is there a way to fix this?
Edit: Oh darn it.I've just noticed there is a option for disabling watch scrips if you are using python
enabled gdb in debugger configuration window.All is well I can see my strings now.