Author Topic: smallB's suggestions  (Read 19445 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: smallB's suggestions
« Reply #30 on: November 08, 2011, 01:00:07 pm »
About how to configure the compiler setting.
see:

and make sure no "-O2" and "-s" is selected in all the panels.
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 smallB

  • Almost regular
  • **
  • Posts: 193
Re: smallB's suggestions
« Reply #31 on: November 08, 2011, 03:05:19 pm »
@ollydbg, thank you for your reply. I'm quite sure that I didn't have them selected then (although it does work now as intended (after restarting cb)). The only options I mostly have selected are -Wall, -Wextra, -g, -Wfatal-errors and -std=c++0x;
Once again thanks for your help. Most appreciated.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: smallB's suggestions
« Reply #32 on: November 08, 2011, 03:08:34 pm »
7. Keep/Store breakpoints and watches permanently - unless I decide to remove them.
Guys I think that this is quite reasonable suggestion. It is just very tiring setting all the same watched vars and breakpoints every time I run cb. Disabled breakpoints should also be stored and be available after cb restarts. What'yer thinking?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: smallB's suggestions
« Reply #33 on: November 08, 2011, 04:45:25 pm »
What'yer thinking?
IMHO is is possible to save/load breakpoints from a file. At least in trunk.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: smallB's suggestions
« Reply #34 on: November 08, 2011, 05:45:03 pm »
What'yer thinking?
IMHO is is possible to save/load breakpoints from a file. At least in trunk.
I'm not really with you. So is the answer yey or ney ;)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6586
    • My Best Post
Re: smallB's suggestions
« Reply #35 on: November 08, 2011, 06:13:29 pm »
I'm not really with you. So is the answer yey or ney ;)

I think the answer is did you confirm it does NOT work in the nightly.
If it allows saving like he says.

I suggest you submit a patch to add a GUI to make it always do it.

If your suggestions are NOT worth you doing any work; why do you think it is worth the devs doing any work.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: smallB's suggestions
« Reply #36 on: November 08, 2011, 07:12:47 pm »
What'yer thinking?
IMHO is is possible to save/load breakpoints from a file. At least in trunk.
Are you sure ?

As far as I know, it's possible for watches, but I don't know a way to do so for breakpoints, or do I miss something ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: smallB's suggestions
« Reply #37 on: November 08, 2011, 08:18:58 pm »
Are you sure ?
I checked, but you are right. I wanted to commit patch #2775 which implements this and I thought I did, but in favour of the debugger branch I skipped it.

However, this patch could still work on trunk though...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
Re: smallB's suggestions
« Reply #38 on: November 08, 2011, 10:07:15 pm »
I suggest you submit a patch to add a GUI to make it always do it.
No patches for this or similar features, please.
Unfortunately C::B doesn't have the infrastructure to do it right, until then (I have a plan for it),
breakpoints and watches won't be saved automatically.
It isn't that useful anyways.
(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: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: smallB's suggestions
« Reply #39 on: November 09, 2011, 01:40:23 am »
Are you sure ?
I checked, but you are right. I wanted to commit patch #2775 which implements this and I thought I did, but in favour of the debugger branch I skipped it.

However, this patch could still work on trunk though...
Yeah, this patch Watches and breakpoints persistent was create by me years ago, but I use a separate file to save the breakpoints. As we have discussed, the best way was to save the breakpoint in the cbp file.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5223
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: smallB's suggestions
« Reply #40 on: November 09, 2011, 02:09:47 am »
@ollydbg, yes, sure that is good workaround but I think (if it's not to hard to implement) it would be nice to have it on a debugging toolbar.

Just a thought.
Regards
@OBF:
It looks like run the command "frame 0" will give us the "next line".

BTW: I found a tiny bug in the debugger branch, when I double click on the frame 0 of the call-stack window, I looked at the debugger-log, I see that
1, "frame 0" command was send
2, "bt" command was send

So, I think "bt" command do not need to send, right?
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: 11899
    • Travis build status
Re: smallB's suggestions
« Reply #41 on: November 09, 2011, 02:58:04 am »
As we have discussed, the best way was to save the breakpoint in the cbp file.
This is even worse, than saving in a separate file in the main project directory! Never do that, never ever think about it!

About the "bt" command, I'm not sure, but the reason is that the cursor has changed and the bt command is executed on cursor changed.
Not a big, deal, please don't report problems in other people topics, use the nightly build one.
(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 killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5177
Re: smallB's suggestions
« Reply #42 on: November 09, 2011, 07:31:31 am »
indeed do NOT save breakpoint info in the cbp file !
This file is the project configuration, something you put in version control system. As such a file that shouldn't change because one just had a debug session, and it wants to keep some breakpoints in mind.

We have a similar mistake today, the workspace contains the active project, and therefor changes when another project is active, this is bad for version control.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: smallB's suggestions
« Reply #43 on: November 09, 2011, 07:55:31 am »
I suggest you submit a patch to add a GUI to make it always do it.
No patches for this or similar features, please.
Unfortunately C::B doesn't have the infrastructure to do it right, until then (I have a plan for it),
breakpoints and watches won't be saved automatically.
It isn't that useful anyways.
I have to disagree with you on that one. How many times did you start and finish debugging a project/part of project in one session? It never happened to me so far, and I think I'm not the only one who has had this experience.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: smallB's suggestions
« Reply #44 on: November 09, 2011, 07:58:40 am »
I'm not really with you. So is the answer yey or ney ;)


If your suggestions are NOT worth you doing any work; why do you think it is worth the devs doing any work.

Tim S.
It's not about that Tim. If I'd had necessary skills I'd do it myself - much easier route - no need to ask anyone, no need to convince anyone etc. you're getting the general gist. But in view of the fact that I do not posses them (yet, or maybe never) I'm merely suggesting them and is up to devs to either implement them or not. As simple as that. But believe me, when I eventually will be able to do it myself will never ask anyone, for reasons mentioned above.
Regards