Author Topic: Cant figure out how to see memory info during debug.  (Read 13229 times)

Offline grechzoo

  • Single posting newcomer
  • *
  • Posts: 6
Cant figure out how to see memory info during debug.
« on: June 05, 2011, 12:07:52 pm »
Just learning to program, going through a few books and tutorials and im having real trouble with one aspect of codeblocks.

basically when a chapter in the book goes into debug mode and creates a breakpoint on the same line as a variable. (say an initialized int for example), it goes into the memory window of visual studio and analyses all the characters stored in there.

when i go into debug mode in codeblocks, nothing happens, i open the memory window and nothing is there ( nothing stored in 0x00 or something like that). i checked the wiki and it said to add the variable to the watch list.

EDIT: done this sucsessfully but there is still nothing populating the memory window during debug and there's nothing i can find in the menus to change that even after watching the variable.

im really confused. tried using visual studio 2010 express but that has all this precompile code that not only confusses me but i simply dont want in my files to start with.

I know this is basic stuff, but i love codeblocks and dont want to go to the microsoft software under any circumstance, so any help would be truly appreciated. (hopefully more in depth than the wiki as i obviously missed something.)
« Last Edit: June 05, 2011, 01:31:14 pm by grechzoo »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Cant figure out how to see memory info during debug.
« Reply #1 on: June 05, 2011, 01:03:20 pm »
The debugger has to run, to make the watch 'foo' option visible in context menu.
So if the debugger stops at the breakpoint, you should be able to add the watch. Just place the mouse-cursor over the variable and right-click.
Works fine here.

Offline grechzoo

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cant figure out how to see memory info during debug.
« Reply #2 on: June 05, 2011, 01:27:16 pm »
sorry yes, turns out another problem was causing lack of watchablility ;)


anyway im still not able to actually fill out the memory window with any data.

so even though i have added my variable to the watch list. i cant analyse the memory of my program at all during debug it seems. the window is always displaying "Cannot access memory at address 0x0", in the tutorial, visual studio pops up with memory 1 and displays the hex of the variable and stuff. i cant seem to get codeblocks to do that.

i know there is something else im missing but i would be grateful if anyone could explain how to populate the memory window during debug.
« Last Edit: June 05, 2011, 01:37:17 pm by grechzoo »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Cant figure out how to see memory info during debug.
« Reply #3 on: June 05, 2011, 02:14:33 pm »
Is you pointer != NULL?
(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 grechzoo

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cant figure out how to see memory info during debug.
« Reply #4 on: June 05, 2011, 02:37:30 pm »
how do you set up a pointer?, im following the tutorial exactly, they seem to have access to all the hex of the memory and they haven't mention the word pointer once.

when i types my variable into the memory window it did show the hex contents.

but i was hoping that when i put a breakpoint and debugged codeblocks would simply display the memory automatically like it seems visual studio does from the tutorial. esp if its on the watch list.

sorry about such a stupid newbie problem. it really is an annoying thing to get stuck up on, but i really want it to work like the tutorial, and i know it must be possible.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Cant figure out how to see memory info during debug.
« Reply #5 on: June 05, 2011, 03:06:23 pm »
If you follow a Visual Studio tutorial it can not work with C::B.

If you want to see the memory your variable uses, type &foo as address of the memory (where foo is the name of the variable) you want to see in the dialog.

Offline grechzoo

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cant figure out how to see memory info during debug.
« Reply #6 on: June 05, 2011, 04:53:31 pm »
okay thank you that brought up the memory thanks.

i know it might not work exactly which is why i was asking here so you guys could help me translate the difference so i could follow along fine in this IDE

thanks again