Author Topic: [New plugin] cbSystemView for embedded development  (Read 2102 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11394
    • Travis build status
Re: [New plugin] cbSystemView for embedded development
« Reply #15 on: January 07, 2019, 10:37:46 pm »
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: [Select]
cbDebuggerPlugin *dbg = Manager::Get()->GetDebuggerManager()->GetActiveDebugger();

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.
(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!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11394
    • Travis build status
Re: [New plugin] cbSystemView for embedded development
« Reply #16 on: January 07, 2019, 11:48:14 pm »
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: [Select]
cbDebuggerPlugin *plugin = Manager::Get()->GetDebuggerManager()->GetDebuggerHavingWatch(watch);
(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!]