Lets start with a minimal sample that demonstrates the problem or at least posting the full log from the debugger.
Here goes a minimal sample:
int main() {
int i = 123;
int* pi = &i;
return 0;
}
Cursor over pi. Debugger log:
[debug]> whatis pi
[debug]type = int *
[debug]>>>>>>cb_gdb:
[debug]> output pi
[debug](int *) 0x23fee8>>>>>>cb_gdb:
[debug]> output *pi
[debug]123>>>>>>cb_gdb:
Good, gdb dereferenced the value. Now, passing through the mentioned code:
ParseGDBWatchValue(watch, contents);
if (!m_Address.empty() && m_autoDereferenced)
watch->SetValue(m_Address);
After ParseGDBWatchValue:
(gdb) p *(watch._M_ptr)
$26 = {<cbWatch> = {_vptr.cbWatch = 0x6d903d28, m_parent = warning: (Internal er
ror: pc 0x0 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
std::tr1::weak_ptr (empty) 0x0,
m_children = std::vector of length 0, capacity 0, m_changed = true,
m_removed = false, m_expanded = false, m_autoUpdate = true},
m_symbol = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x7817334 L"*pi"}, <No data fields>},
m_type = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x7d63214 L"int *"}, <No data fields>},
m_raw_value = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x77ee47c L"123"}, <No data fields>},
m_debug_value = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x62b92134 L""}, <No data fields>}, m_format = Undefined,
m_array_start = 0, m_array_count = 0, m_is_array = false,
m_forTooltip = false}
Still good, m_raw_value contains the dereferenced value. But after the next two lines:
(gdb) p *(watch._M_ptr)
$27 = {<cbWatch> = {_vptr.cbWatch = 0x6d903d28, m_parent = warning: (Internal er
ror: pc 0x0 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
std::tr1::weak_ptr (empty) 0x0,
m_children = std::vector of length 0, capacity 0, m_changed = true,
m_removed = false, m_expanded = false, m_autoUpdate = true},
m_symbol = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x7817334 L"*pi"}, <No data fields>},
m_type = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x7d63214 L"int *"}, <No data fields>},
m_raw_value = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x77e4ca4 L"0x23fee8"}, <No data fields>},
m_debug_value = {<wxStringBase> = {static npos = <optimized out>,
m_pchData = 0x62b92134 L""}, <No data fields>}, m_format = Undefined,
m_array_start = 0, m_array_count = 0, m_is_array = false,
m_forTooltip = false}
The pointer address overwrote the dereferenced value which is nowhere to be seen.
Tooltip displays: *pi | 0x23fee8 | int *
and it's wrong, it's 'pi', not '*pi'.
After these two lines are commented out, tooltip is: *pi | 123 | int *
So it works as I expected.
I hope I made it clear. I tested this on clean CB installation (latest SVN) on different computers and it always worked like this.