Author Topic: Some thoughts on doing breakpoints persistent  (Read 42999 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some thoughts on doing breakpoints persistent
« Reply #30 on: December 15, 2012, 09:39:56 am »
Two questions:
what will we do with a project opened in a workspace and outside a workspace or in two different workspaces?
Also what about the inactive projects in a workspace?

I'm more in favour of a .user directory next to the workspace file, if there is a workspace of course, else place it next to the project file.
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some thoughts on doing breakpoints persistent
« Reply #31 on: December 15, 2012, 10:01:49 am »
I'm more in favour of a .user directory next to the workspace file
Why a directory? Isn't a descriptive file (maybe more) enough?

A general question: We have the project file where we can save stuff in it, right? So what we want to save here is something which is user-dependent and shall not be e.g. committed, right? What about using the concept of the project layout file, rename it to *.user.settings ("user" replaced with the actual user so you can have multiple in parallel) and extend it with the other stuff we want?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some thoughts on doing breakpoints persistent
« Reply #32 on: December 15, 2012, 10:13:02 am »
I want to make it directory in order to make the project/workspace directory a bit more clear.
My idea is to move all useless to the user files there, like the layout, depend, bmarks, etc.
If we choose a single file we will have to redo all current code, which saves user files.
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some thoughts on doing breakpoints persistent
« Reply #33 on: December 15, 2012, 11:38:22 am »
If we choose a single file we will have to redo all current code, which saves user files.
We don't have such code yet to my knowledge. My proposal was not to add new files, but to use/tweak what we have. And using ignore patterns for version control avoids the (already) visible clutter. In the end it would be a 1:1 relation between project files and files with meta-data. Having an API in place could also allow plugins to make use of it... How does that sound?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some thoughts on doing breakpoints persistent
« Reply #34 on: December 15, 2012, 12:14:14 pm »
We don't have such code yet to my knowledge.
What about the code used to save .depend, .layout, .bmarks files?

All of them use different format. I was thinking of providing a function like GetUserFilePath(...) which returns a proper folder.
But I've not tried to implement it, yet, because of the workspace problem.
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some thoughts on doing breakpoints persistent
« Reply #35 on: December 15, 2012, 02:39:07 pm »
What about the code used to save .depend, .layout, .bmarks files?
Al-right... now I know what you mean. I thought you only think about the .layout stuff and additional stuff.

I was thinking of providing a function like GetUserFilePath(...)
Well what about if you return a proper file instead and simply change the the methods to create its own node in this fiel instead of creating an new one? The file would look then like:

Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_meta_data_file>
  <debugger>
    <bmarks>
    </bmarks>
    <connectivity>
    </connectivity>
  </debugger>
  <core>
    <layout>
    </layout>
    <stuff_from_core_like_project_settings>
    </stuff_from_core_like_project_settings>
  </core>
</CodeBlocks_project_meta_data_file>

Note that with the .depend file it is different: It comes from a 3rd party lib and we cannot change it to something else, nor integrate it,not even move it most likely without changing the depends lib.

...whatever we choose it requires some refactoring, for sure.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some thoughts on doing breakpoints persistent
« Reply #36 on: December 15, 2012, 02:47:11 pm »
This is another option, but it is more limiting, because all files should be saved in xml format.

And yes, some refactoring will be required anyway.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Some thoughts on doing breakpoints persistent
« Reply #37 on: December 15, 2012, 02:58:03 pm »
Well what about if you return a proper file instead and simply change the the methods to create its own node in this fiel instead of creating an new one? The file would look then like:

Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_meta_data_file>
  <debugger>
    <bmarks>
    </bmarks>
    <connectivity>
    </connectivity>
  </debugger>
  <core>
    <layout>
    </layout>
    <stuff_from_core_like_project_settings>
    </stuff_from_core_like_project_settings>
  </core>
</CodeBlocks_project_meta_data_file>


The sdk can have a interface like:
Code
Manager::Get()->GetProjectMetaDataManager(_T("core"))         //Get the "core" Node.
which return a Node pointer, then the client plugins can write and wrote on these Node/blocks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some thoughts on doing breakpoints persistent
« Reply #38 on: December 15, 2012, 03:25:06 pm »
The sdk can have a interface like:
Code
Manager::Get()->GetProjectMetaDataManager(_T("core"))         //Get the "core" Node.
which return a Node pointer, then the client plugins can write and wrote on these Node/blocks.
Doesn't like.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Some thoughts on doing breakpoints persistent
« Reply #39 on: December 15, 2012, 03:30:28 pm »
The sdk can have a interface like:
Code
Manager::Get()->GetProjectMetaDataManager(_T("core"))         //Get the "core" Node.
which return a Node pointer, then the client plugins can write and wrote on these Node/blocks.
Doesn't like.
:), I'm not good at design interface, so can you give a good way? How can the interface like?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Some thoughts on doing breakpoints persistent
« Reply #40 on: December 15, 2012, 04:13:08 pm »
This is another option, but it is more limiting, because all files should be saved in xml format.
Yes, that is a limitation. I understand that this wouldn't be needed for the .user folder. However, the .user folder may not work, too because plugins may require relative files or simply not make use of the API (like the cscope plugin). So you still (most likely will) have clutter. Another case that won't work with XML on the other hand are the build logs in HTML...

Aaargh... we have so many cases... And btw: Talking about the debugger raises another one: What, if we want to have target related temporary settings, like connectivity options per target - that does make sense you know...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Some thoughts on doing breakpoints persistent
« Reply #41 on: December 15, 2012, 04:17:52 pm »
Aaargh... we have so many cases... And btw: Talking about the debugger raises another one: What, if we want to have target related temporary settings, like connectivity options per target - that does make sense you know...
It could be saved per target in the file.

About cscope, I suppose the plugin can be modified to generate its files in .user.
The valgrind plugin also generates a xml file, which could be save in .user.
Another benefit of using a directory is that files could be shared/backuped and so on (even if not supported by us :) )
(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!]