News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Automatically dereference pointers in watch window

Started by wtherapy, September 15, 2007, 10:28:03 AM

Previous topic - Next topic

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

CB LSI (C::B as a Little Secret Initiative)

XayC

I've made a patch, actually it simply removes the old watch, when it is dereferenced.

--- 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());


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

KammutierSpule


oBFusCATed

Two reasons:
1. it is hard, because C::B uses the command line protocol of gdb and there is no direct way.
2. it will be slow, the same reason

You're welcome to give it a try, but make patch against the debuggers branch, not trunk.
There are lots of changes related to the watches in the branch.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Max

I'm wondering why there are still two different version (trunk and debugger branch). It may be true the debbuger branch has bugs but it's better (much better) that the debuuger plugin (that  has bugs) used in the trunk. Moreover splitting the development is decreasing the number of people using (and so debugging) the new debugger interface. We are no longer in the early development stage.

IMHO obviously  :D

Max

oBFusCATed

Quote from: MaxGaspa on November 22, 2010, 07:29:53 PM
It may be true the debbuger branch has bugs.
I don't know about bugs, probably you could report the ones you've found? :)

The development is not split, in fact no development  is done on the debugger plugin in trunk.
Also, as I've stated many times, there is a pending patch for review, then we will have a nightly and probably then a merge will happen...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]