Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
DDD-like watches
oBFusCATed:
m.29:
Probably you need to modify the sdk and put most of the drawing code and data structures there.
If you do so all plugins can implement this graphical mode, not only the current one and there will be minimal code duplication.
See how it is done for the other features (watches, breakpoints, etc).
m.29:
Thanks for your replies and sorry for my inattention. I use debugger_branch (/branches/wxpropgrid_debugger/) now.
I'm still implementing this feature to C::B and have one question. I try to add functionality that after double click on pointer element in structure dereferences pointer and join nodes of graph by edge. Here is relevant part of my event handler for that:
--- Code: ---cbDebuggerPlugin* debugger = Manager::Get()->GetDebuggerManager()->GetActiveDebugger();
wxString watchString; watch->GetFullWatchString(watchString);
watch = debugger->AddWatch(wxT("(*") + watchString + wxT(')'));
if(!watch) { return; }
ViewNode* node = new ViewNode(
this->GetParent(),
watch,
this->GetPosition() + wxPoint(this->GetSize().GetWidth() + 20, 0) // TODO (m.29##): automatic graph layouts
);
this->GetParent()->AddChild(node);
ViewNode::JoinNodes(this, node);
--- End code ---
But in ViewNode's constructor I get uninitialized watch (e.g. watch->GetChildCount() == 0 if watch is structure type). I know it is because watch is parsed in parallel to my code. I don't know how to wait for end of parsing. Or how can I find out that watch was parsed yet? I tried find answer in C::B codes but it seems nothing special is done after calling cbDebuggerPlugin::AddWatch() there.
oBFusCATed:
When watches are updated WatchesDlg::UpdateWatches() is called
m.29:
Thanks, it helps. I'm implementing "index out of bounds" checking now. I noticed some things during exploring C::B sources:
1) Function ParseCDBWatchValue has some strange (for me) condition
--- Code: ---if (tokens[0] == wxT("class") || tokens[0] == wxT("class"))
--- End code ---
I think it should be
--- Code: ---if (tokens[0] == wxT("struct") || tokens[0] == wxT("class"))
--- End code ---
as it is a few rows below.
2) I edited GDBWatch::GetFullWatchString function 'cause for arrays it always gave me ArrayName.[index].
3) Because I would like to check indexing out of bounds I added size to array watches in GdbCmd_Watch class.
4) In GdbCmd_FindWatchType class there was "whatis &" instead of "whatis " string used to finding type of watch and then tmp.substr(0, tmp.length() - 1); used to removing last "*". But this was bad for arrays or functions:
* int (*)[4] -> int (*)[4
* int (*)(int) -> int (*)(int
* ...
I made the patch for this things, but if I done something wrong someone explain me what and why, please.
oBFusCATed:
1. Have you tried it with real CDB and can you provide a test case (see debuggergdb_test_parser.cpp)
2. This seems unused in current code, so it was not tested
3. SetArray and SetArrayParams are called by the GUI, so set the properties of the watch, then this properties are used to execute the correct commands.
So your usage is wrong, because you'll override the choice made by the user (probably you need to add more members).
Also GetFullWatchString should not call contains, but use some member to check if the symbol is array.
4. This is a workaround for a problem in GDB -> "const wxString &" passed as parameter was not watchable...
But the main problem is that I don't get the whole picture, why you need this changes.
'index out of bounds checking' means nothing to me.
Can you explain in more details, please?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version