User forums > General (but related to Code::Blocks)
Automatically dereference pointers in watch window
wtherapy:
Please, implement the watch window as it is implemented in all the other debuggers, WinDbg, KDbg, Visual Studio: when you have a pointer, display it's value with a + sign in the left, then the user expands and sees the data referenced by the pointer. In the current implementation I need to separately dereference the pointer, thereby adding a lot of entries in the watch window.
Roman:
vote++
Roman
XayC:
I've made a patch, actually it simply removes the old watch, when it is dereferenced.
--- Code: ------ src/plugins/debuggergdb/debuggertree.cpp (revision 4481)
+++ src/plugins/debuggergdb/debuggertree.cpp (working copy)
@@ -757,7 +757,12 @@
WatchTreeData* data = static_cast<WatchTreeData*>(m_pTree->GetItemData(m_pTree->GetSelection()));
Watch* w = data ? data->m_pWatch : 0;
if (w)
+ {
m_Watches.Add(Watch(_T('*') + w->keyword));
+
+ DeleteWatch(w);
+ m_pTree->Delete(m_pTree->GetSelection());
+ }
else
{
wxString itemtext = m_pTree->GetItemText(m_pTree->GetSelection());
--- End code ---
Regards, XayC
wtherapy:
Hello,
that's good news, how can I use it now? Because I have build 4503 and still the same display.
XayC:
I'm still working on it, trying to implement what you actually requested. I didn't put that patch in the patch-manager (because it's a pretty trivial change), so it's not going to be merged in the svn trunk.
If you want to try that patch you have to apply it on a local copy of CB sources and compile them. And there's also another problem, if you try to dereference a pointer which is either in the Local Variables or in the Function Arguments, the item would be removed.
Regards, XayC
Navigation
[0] Message Index
[#] Next page
Go to full version