Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
[New plugin] cbSystemView for embedded development
oBFusCATed:
More general comments on the code of the plugin:
1. Try to use unique_ptr and shared_ptr more often. You have tons of places where you use delete and this is error prone.
2. This
--- Code: ---cbDebuggerPlugin *dbg = Manager::Get()->GetDebuggerManager()->GetActiveDebugger();
--- End code ---
could return nullptr. Never use the dbg pointer without checking it! It is possible to have no active debugger if there are no debugger plugins loaded!
3. FindString seems a redundant and slow reimplementation of some of the methods in wxString. If there is particular reason it is good if you can write a comment about it.
4. There is no good reason to use std::list in 2019. It is slower than std::vector. If you don't believe me, search the internet for details. If for some reason you need to use a linked list you'll do it manually, because you'll have more complex data structure and you won't be storing the elements in a container.
oBFusCATed:
Another note I've just remembered. Using the active debugger is not a good idea. In theory it could change in the middle of a debugging session. What you should do is something similar to the watches dlg which uses this code:
--- Code: ---cbDebuggerPlugin *plugin = Manager::Get()->GetDebuggerManager()->GetDebuggerHavingWatch(watch);
--- End code ---
oBFusCATed:
The modified patches by bluehazzard has been pushed to this branch: https://github.com/obfuscated/codeblocks_sf/commits/debugger/memory_watches
And here is a branch to a modified version of the plugin to make use of the new features: https://github.com/obfuscated/cbSystemView/tree/debugger/memory_watches
@bluehazzard: Please test and let me know if I broke something vital. At the moment the only thing that is a bit different is that no notifications are sent for every memory range. Just one at the end. Probably this is not the best way to do it, but it is not something that it is hard to do. Just I'm a bit cautious because sending too many events too quickly it is not really fast.
BlueHazzard:
i will test it the next week! Thank you for your work!
BlueHazzard:
FIrst quick look it seems to work nicely and fast! Thank you! I think we are on a great path here!
There are some quirks, for example the update indicator is not in sync after the first halt and expanding all entries with the toolbar button will make the update dialog flash many times, instead of indicating all the update time.
I will look into this.
Can you make a pull request on github, so i can pull your changes?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version