Author Topic: see current user defined variables by default???  (Read 6031 times)

Offline iamk2

  • Multiple posting newcomer
  • *
  • Posts: 12
see current user defined variables by default???
« on: June 18, 2013, 02:00:21 am »
Is there a setting to have the watchlist follow all my user defined variable as they are affecting the program through-out the debug process?
I am transitioning from netbeans because I get a lot more umph from my PC while using codeblocks (It loads five times faster and the editor defaults are so much better in CB). I know I can add them to the watchlist as I go along  but I am used to netbeans having the variables values displayed by default. I could not find anything anywhere about setting up CB for this, so here I am.
Thanks

Offline iamk2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: see current user defined variables by default???
« Reply #1 on: July 22, 2013, 01:43:04 am »
Hope that bumping this does not offend anyone - It has been some time since this was first asked and there have been zero responses. Looking for how or e definite NO.

If NO - where would be the appropriate place to suggest this setting be added??? I would think others would find it very useful also. To each his own though.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: see current user defined variables by default???
« Reply #2 on: July 22, 2013, 02:02:01 am »
This feature unfortunately does not currently exist in Code::Blocks because no one has yet had the time/willpower to program it.  (If you want to try your hands at writing it, I, or one of the other devs, can point you towards some resources.)

Offline iamk2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: see current user defined variables by default???
« Reply #3 on: July 22, 2013, 02:33:21 am »
POINT AWAY - I will at least be able to see what I would be getting myself into. Not scared and retired with lots of time to burn

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: see current user defined variables by default???
« Reply #4 on: July 22, 2013, 11:44:28 pm »
You will have to build the trunk version from source; skim through the developer info.  Look up the GDB commands necessary to do this command line.  Read into the source of the debugger plugin.  Maybe search for Code::Blocks' experimental GDB-MI plugin if you have a lot more time.
oBFusCATed should be able to give you more specifics on the debugger plugin itself.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: see current user defined variables by default???
« Reply #5 on: July 23, 2013, 02:01:10 am »
Is there a setting to have the watchlist follow all my user defined variable as they are affecting the program through-out the debug process?
What do you mean by "user defined variable"?
Do you mean all the local variables in a function?
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 iamk2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: see current user defined variables by default???
« Reply #6 on: July 23, 2013, 05:08:56 am »
variables passed into the function'.   variables defined in the function - etc

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: see current user defined variables by default???
« Reply #7 on: July 23, 2013, 05:16:16 am »
variables passed into the function'.   variables defined in the function - etc
The gdb command: "info locals" have such feature. But please note, when python pretty printer is enabled in GDB, GDB will crash when it try to show an uninitialized local variable, see my bug report on GDB: Bug 12127 – gdb with python support still get crash on showing uninitialized local variables

This is why currently C::B disable showing this feature.

BTW: I have find one crash reason, and there is a workround, see my comments in Comment 3

BTW2: the problem you mentioned has discussed in our forum for many times, you can search the forum and get those discussions.
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 iamk2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: see current user defined variables by default???
« Reply #8 on: July 23, 2013, 06:07:37 am »
Thanks ollydbg for the direction to look more into this. I will be able to dive in more next week - have another project to get finished first but I look forward to working in this. Will post back once I am started and could use some assistance.