But if you find any way to make it misbehave again, I 'd like to know it ;)
Unfortunately I found a way :(. This is the example code, where I've placed a breakpoint at line 9:
#include <iostream>
#include <string>
int main()
{
std::string s1 = "Hoho";
std::string s2 = "Hähä";
std::cout << s1 << s2 << std::endl;
return 0;
}
This is the debuggers debug log (I've enabled watching local variables in the debugger's setup):
Command-line: D:\Devel\GCC345\bin\gdb.exe -nx -fullname -quiet -args Debug/hallo.exe
Working dir : C:\Dokumente und Einstellungen\ftmh.DLR\Desktop\hallo\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> directory C:/DOKUME~1/ftmh.DLR/Desktop/hallo/
>>>>>>cb_gdb:
> delete breakpoints
>>>>>>cb_gdb:
> break main.cpp:9
Breakpoint 1 at 0x401512: file main.cpp, line 9.
>>>>>>cb_gdb:
> run
Breakpoint 1, main () at main.cpp:9
C:/DOKUME~1/ftmh.DLR/Desktop/hallo/main.cpp:9:105:beg:0x401512
>>>>>>cb_gdb:
> info locals
s1 = {static npos = 4294967295, _M_dataplus = {<allocator<char>> = {<new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x3e2594 "Hoho"}}
s2 = {static npos = 4294967295, _M_dataplus = {<allocator<char>> = {<new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x3e25c4 "H>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
With regards, Morten.
Ps.: By the way: Do you know what is "funny", too? If the debugger stops at the breakpoint and you have local watches enabled, then select all text in the open editor (CTRL+A) and watch the debuggers debug log when you place the mouse cursor over the selected text... ;-)
Edit: In the case of the example above it is:
> whatis #include <iostream>
#include <string>
int main()
{
std::string s1 = "Hoho";
std::string s2 = "Hähä";
std::cout << s1 << s2 << std::endl;
return 0;
}
Invalid character '#' in expression.
>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
> output #include <iostream>
#include <string>
int main()
{
std::string s1 = "Hoho";
std::string s2 = "Hähä";
std::cout << s1 << s2 << std::endl;
return 0;
}
Ambiguous command "int main()": internals, interpreter-exec, interrupt.
Undefined command: "". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Invalid character ';' in expression.
Undefined command: "". Try "help".
Undefined command: "". Try "help".
Invalid character '#' in expression.
>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
Ambiguous command "int main()": internals, interpreter-exec, interrupt.
Undefined command: "". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Undefined command: "std". Try "help".
Invalid character ';' in expression.
Undefined command: "". Try "help".
Undefined command: "". Try "help".
...another nice example on that topic in addition to my previous post:
The code (breakpoint again at line 9):
#include <iostream>
#include <string>
int main()
{
const char s1 = 'H';
const char s2 = 'Ä';
std::cout << s1 << s2 << std::endl;
return 0;
}
The debugger's debug log:
Command-line: D:\Devel\GCC345\bin\gdb.exe -nx -fullname -quiet -args Debug/hallo.exe
Working dir : C:\Dokumente und Einstellungen\ftmh.DLR\Desktop\hallo\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> directory C:/DOKUME~1/ftmh.DLR/Desktop/hallo/
>>>>>>cb_gdb:
> delete breakpoints
>>>>>>cb_gdb:
> break main.cpp:9
Breakpoint 1 at 0x401410: file main.cpp, line 9.
>>>>>>cb_gdb:
> run
Breakpoint 1, main () at main.cpp:9
C:/DOKUME~1/ftmh.DLR/Desktop/hallo/main.cpp:9:97:beg:0x401410
>>>>>>cb_gdb:
> info locals
s1 = 72 'H'
s2 = -60 '>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
...edit: Could you (maybe) move this to a new topic? We have hijacked this one by now... ;-)
I don't think we can have a solution for this, at least not an easy one...
...I wonder what makes you think so? :?:
BTW: If I switch to UTF-8 it workes fine here, too. At least that's an information one can give for such purposes.
I've compared the hex-dump of both files. This is for Windows-1252:
3D 20 22 48 E4 68 E4 22 │ 3B 0A 0A 20 20 73 74 64 -> [= "Hähä";◙◙ std]
...and this for UTF-8:
3D 20 22 48 C3 A4 68 C3 │ A4 22 3B 0A 0A 20 20 73 -> [= "Hähä";◙◙ s]
mandrav: You said it's working for you with Windows-1253. What hex values do you have in that case?
Edit: Sorry, I misunderstood:
I 'm using WINDOWS-1253 but I couldn't even see the file so I switched to UTF8.
This makes things obvious...