Under the 10.05 CodeBlocks MinGW compiler this is what happens...CodeBlocks handles the "incomplete type" and displays that message under the variable entry.
Breakpoint 1, main () at main.cpp:14
14 {
(gdb) n
15 testme();
(gdb) s
testme () at main.cpp:9
9 ostringstream mystring;
(gdb) p mystring
$1 = <incomplete type>
But under g++ (tdm64-1) 4.5.1 gdb tries to expand mystring but gets an "error reading variable" message which causes the script to bomb.
I don't see where "incomplete type" is handled in the scripts...but it seems like "error reading variable" is the same thing as "incomplete type" (at least in this case).
Apparently this is the behavior of the newer g++/gdb...and probably will occur in other classes too....
#0 main () at D:\Projects\stream\main.cpp:15
>>>>>>cb_gdb:
> step
testme () at D:\Projects\stream\main.cpp:9
D:\Projects\stream\main.cpp:9:87:beg:0x4015ed
>>>>>>cb_gdb:
> info locals
mystring = {
<std::basic_ostream<char, std::char_traits<char> >> = {
<std::basic_ios<char, std::char_traits<char> >> = <invalid address>,
members of std::basic_ostream<char, std::char_traits<char> >:
_vptr.basic_ostream = 0x49ac70
},
members of std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >:
_M_stringbuf = {
<std::basic_streambuf<char, std::char_traits<char> >> = {
_vptr.basic_streambuf = 0x6,
_M_in_beg = 0x1000000006 <Address 0x1000000006 out of bounds>,
_M_in_cur = 0x3e6880 '«' <repeats 16 times>,
_M_in_end = 0x100 <Address 0x100 out of bounds>,
_M_out_beg = 0x77f3d5a8 "Hƒø\020H‹ètleH‹\f%0",
_M_out_cur = 0x0,
_M_out_end = 0x22fe00 "",
_M_buf_locale = {
static none = 0,
static ctype = 1,
static numeric = 2,
static collate = 4,
static time = 8,
static monetary = 16,
static messages = 32,
static all = 63,
_M_impl = 0x3e3600,
static _S_classic = 0x499ce0,
static _S_global = 0x499ce0,
static _S_categories = 0x49b440,
static _S_once = {
done = 1,
started = 0
}
}
},
members of std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >:
_M_mode = 4770432,
_M_string = {
static npos = <error reading variable>
}
}
>>>>>>cb_gdb: