Author Topic: Automatically dereference pointers in watch window  (Read 10073 times)

wtherapy

  • Guest
Automatically dereference pointers in watch window
« on: September 15, 2007, 10:28:03 am »
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.

Offline Roman

  • Multiple posting newcomer
  • *
  • Posts: 78
Re: Automatically dereference pointers in watch window
« Reply #1 on: September 19, 2007, 08:34:17 pm »
vote++

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

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: Automatically dereference pointers in watch window
« Reply #2 on: September 19, 2007, 09:33:24 pm »
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());

Regards, XayC

wtherapy

  • Guest
Re: Automatically dereference pointers in watch window
« Reply #3 on: October 06, 2007, 07:12:16 am »
Hello,

that's good news, how can I use it now? Because I have build 4503 and still the same display.

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: Automatically dereference pointers in watch window
« Reply #4 on: October 06, 2007, 10:34:11 am »
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

Offline KammutierSpule

  • Single posting newcomer
  • *
  • Posts: 3
Re: Automatically dereference pointers in watch window
« Reply #5 on: November 21, 2010, 07:22:14 pm »
why this feature isn't already implemented?! :|

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Automatically dereference pointers in watch window
« Reply #6 on: November 21, 2010, 11:04:48 pm »
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

  • Guest
Re: Automatically dereference pointers in watch window
« Reply #7 on: November 22, 2010, 07:29:53 pm »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Automatically dereference pointers in watch window
« Reply #8 on: November 22, 2010, 07:51:13 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!]