User forums > Nightly builds
The 25 August 2012 build (8248) is out.
Agetian:
--- Quote from: oBFusCATed on August 27, 2012, 09:20:23 am ---Putting a breakpoint on the initialization line is not a good idea.
Can you try to put a breakpoint only on the next line?
Also can you disable the watch scripts and post the log again?
Another thing to try is to execute the commands: "p s.size()" and "p s.c_str()" in the debug log window.
--- End quote ---
Putting a breakpoint on the next line remedies the segfault but still doesn't resolve the problem completely:
With the watch scripts disabled, no segfault occurs and the proper value is shown when I hover the mouse over "s", but doing "p s.c_str()" and "p s.size()" both yield a strange outcome in the form of the message "Cannot evaluate function - may be inlined". Here's the full output:
--- Code: ---Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\cppclasstest\
Adding source dir: D:\cppclasstest\
Adding file: D:\cppclasstest\bin\Debug\cppclasstest.exe
Changing directory to: D:/cppclasstest/.
[debug]PATH=.;D:\MinGW-4.7.1\bin;D:\MinGW-4.7.1;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Windows Live\Shared;D:\MinGW-TDD-4.6.1\bin;C:\Program Files\Calibre2;C:\D\dmd\windows\bin;C:\D\dmd2\windows\bin;C:\D\dm\bin;C:\Program Files\TortoiseSVN\bin
[debug]Command-line: D:\MinGW-4.7.1\bin\gdb.exe -nx -fullname -quiet -args D:/cppclasstest/bin/Debug/cppclasstest.exe
[debug]Working dir : D:\cppclasstest
Starting debugger: D:\MinGW-4.7.1\bin\gdb.exe -nx -fullname -quiet -args D:/cppclasstest/bin/Debug/cppclasstest.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from D:/cppclasstest/bin/Debug/cppclasstest.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.4.1
[debug]Copyright (C) 2012 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 "i686-w64-mingw32".
[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.4.1
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/cppclasstest/
[debug]>>>>>>cb_gdb:
[debug]> break "D:/cppclasstest/main.cpp:17"
[debug]Breakpoint 2 at 0x401638: file D:\cppclasstest\main.cpp, line 17.
[debug]>>>>>>cb_gdb:
[debug]> run
Child process PID: 4036
[debug][New Thread 4036.0x548]
[debug]Breakpoint 2, main () at D:\cppclasstest\main.cpp:17
[debug]D:\cppclasstest\main.cpp:17:214:beg:0x401638
[debug]>>>>>>cb_gdb:
At D:\cppclasstest\main.cpp:17
[debug]> bt 30
[debug]#0 main () at D:\cppclasstest\main.cpp:17
[debug]>>>>>>cb_gdb:
> p s.c_str()
[debug]> p s.c_str()
[debug]Cannot evaluate function -- may be inlined
[debug]>>>>>>cb_gdb:
Cannot evaluate function -- may be inlined
Cannot evaluate function -- may be inlined
> p s.size()
[debug]> p s.size()
[debug]Cannot evaluate function -- may be inlined
[debug]>>>>>>cb_gdb:
Cannot evaluate function -- may be inlined
Cannot evaluate function -- may be inlined
--- End code ---
With the watch scripts enabled, the same thing happens with both "p s.size()" and "p s.c_str()" but also the proper value is not shown in the watch window or when hovering the mouse over "s" - instead, the message "Cannot evaluate function -- may be inlined" also shows up in the watch window. Here's the full output with watch scripts enabled:
--- Code: ---Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\cppclasstest\
Adding source dir: D:\cppclasstest\
Adding file: D:\cppclasstest\bin\Debug\cppclasstest.exe
Changing directory to: D:/cppclasstest/.
[debug]PATH=.;D:\MinGW-4.7.1\bin;D:\MinGW-4.7.1;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Windows Live\Shared;D:\MinGW-TDD-4.6.1\bin;C:\Program Files\Calibre2;C:\D\dmd\windows\bin;C:\D\dmd2\windows\bin;C:\D\dm\bin;C:\Program Files\TortoiseSVN\bin
[debug]Command-line: D:\MinGW-4.7.1\bin\gdb.exe -nx -fullname -quiet -args D:/cppclasstest/bin/Debug/cppclasstest.exe
[debug]Working dir : D:\cppclasstest
Starting debugger: D:\MinGW-4.7.1\bin\gdb.exe -nx -fullname -quiet -args D:/cppclasstest/bin/Debug/cppclasstest.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 D:/cppclasstest/bin/Debug/cppclasstest.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.4.1
[debug]Copyright (C) 2012 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 "i686-w64-mingw32".
[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.4.1
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source D:\CB_Portable\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory D:/cppclasstest/
[debug]>>>>>>cb_gdb:
[debug]> break "D:/cppclasstest/main.cpp:17"
[debug]Breakpoint 2 at 0x401638: file D:\cppclasstest\main.cpp, line 17.
[debug]>>>>>>cb_gdb:
[debug]> run
Child process PID: 4380
[debug][New Thread 4380.0x11b0]
[debug]Breakpoint 2, main () at D:\cppclasstest\main.cpp:17
[debug]D:\cppclasstest\main.cpp:17:214:beg:0x401638
[debug]>>>>>>cb_gdb:
At D:\cppclasstest\main.cpp:17
[debug]> bt 30
[debug]#0 main () at D:\cppclasstest\main.cpp:17
[debug]>>>>>>cb_gdb:
[debug]> whatis s
[debug]type = std::string
[debug]>>>>>>cb_gdb:
[debug]> output &s
[debug](std::string *) 0x22fe80>>>>>>cb_gdb:
[debug]> output s.c_str()[0]@s.size()
[debug]Cannot evaluate function -- may be inlined
[debug]>>>>>>cb_gdb:
Cannot evaluate function -- may be inlined
> p s.c_str()
[debug]> p s.c_str()
[debug]Cannot evaluate function -- may be inlined
[debug]>>>>>>cb_gdb:
Cannot evaluate function -- may be inlined
Cannot evaluate function -- may be inlined
> p s.size()
[debug]> p s.size()
[debug]Cannot evaluate function -- may be inlined
[debug]>>>>>>cb_gdb:
Cannot evaluate function -- may be inlined
--- End code ---
Hope this helps.
ollydbg:
@Agetian, I think it is a gdb bug or gcc bug, as you can see, print a value/expression does not work under the command line.
Agetian:
--- Quote from: ollydbg on August 27, 2012, 03:22:42 pm ---@Agetian, I think it is a gdb bug or gcc bug, as you can see, print a value/expression does not work under the command line.
--- End quote ---
Yeah, it might as well be - I'll retry with some older revisions of MinGW (I have old binaries for 4.5 and 4.6 series) and see if that solves the issue, I'll keep you posted. Thanks!
EDIT: Yeah, definitely works after reverting to MinGW v4.6.1 - so, could be related to some gdb bug in the 4.7 series. Looks like this is not C::B-related.
xunxun:
--- Quote from: Agetian on August 27, 2012, 03:57:42 pm ---
--- Quote from: ollydbg on August 27, 2012, 03:22:42 pm ---@Agetian, I think it is a gdb bug or gcc bug, as you can see, print a value/expression does not work under the command line.
--- End quote ---
Yeah, it might as well be - I'll retry with some older revisions of MinGW (I have old binaries for 4.5 and 4.6 series) and see if that solves the issue, I'll keep you posted. Thanks!
EDIT: Yeah, definitely works after reverting to MinGW v4.6.1 - so, could be related to some gdb bug in the 4.7 series. Looks like this is not C::B-related.
--- End quote ---
Can you provide your project (maybe put it on some web space)?
I will look into the issue to see whether its related with gcc/gdb.
Agetian:
--- Quote from: xunxun on August 27, 2012, 04:20:36 pm ---
--- Quote from: Agetian on August 27, 2012, 03:57:42 pm ---
--- Quote from: ollydbg on August 27, 2012, 03:22:42 pm ---@Agetian, I think it is a gdb bug or gcc bug, as you can see, print a value/expression does not work under the command line.
--- End quote ---
Yeah, it might as well be - I'll retry with some older revisions of MinGW (I have old binaries for 4.5 and 4.6 series) and see if that solves the issue, I'll keep you posted. Thanks!
EDIT: Yeah, definitely works after reverting to MinGW v4.6.1 - so, could be related to some gdb bug in the 4.7 series. Looks like this is not C::B-related.
--- End quote ---
Can you provide your project (maybe put it on some web space)?
I will look into the issue to see whether its related with gcc/gdb.
--- End quote ---
Sure thing, it's really a very simple test though, the entire test project that works as a test case consists of one file which is as follows:
--- Code: ---#include <iostream>
using namespace std;
int main()
{
string s = "Test";
cout << s << endl;
return 0;
}
--- End code ---
The breakpoint is set on the "cout << s << endl" line. I think it most surely is a gcc/gdb/mingw issue though, cause 4.6.1 works fine and 4.7.1 doesn't. I have, in addition to everything else, made double sure that I'm generating debugging symbols and that no optimizations are set, so it looks like a bug in gcc/gdb... Thanks for your desire to look into it!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version