Author Topic: How to use "watch"?  (Read 8495 times)

Offline TheUnusualGuy

  • Single posting newcomer
  • *
  • Posts: 5
How to use "watch"?
« on: October 16, 2019, 09:25:34 pm »
How do I use the "watch" feature in Windows?
I have the following line:
void exp10ToExp2(struct Number *pn)
My professor, who runs Linux, is able to right-click the "*pn" and select watch "pn".
However, I'm unable to do the same on Windows.
The following timestamped link shows my professor doing it. https://youtu.be/iEDFTMjyeWk?t=793
I've found the Watches window (Debug > Debugging windows > Watches) but it doesn't have the data filled out like it shows on my professor's screen.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to use "watch"?
« Reply #1 on: October 16, 2019, 09:45:10 pm »
Are you able to stop on a break point?
What is the result in the full debugger log (enable it in Settings -> Debugger)?
Do you see the watches window (Debug -> Debugging windows -> Watches)?
(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 TheUnusualGuy

  • Single posting newcomer
  • *
  • Posts: 5
Re: How to use "watch"?
« Reply #2 on: October 17, 2019, 05:01:00 am »
Are you able to stop on a break point?
What is the result in the full debugger log (enable it in Settings -> Debugger)?
Do you see the watches window (Debug -> Debugging windows -> Watches)?
My professor said that a yellow triangle should appear on the breakpoint, but it doesn't.
Here's the debugger info, to save space on the thread: https://www.heypasteit.com/clip/0ITAFU. It appears to be the same message twice.
Screenshot of my code after pressing Debug/Continue: https://imgur.com/a/4z2TUiG
Yes, I can see the watches window, but my professor was able to do this: https://youtu.be/y73kULpEfxA?t=764 (it shows the fields already filled in when he presses "watch")
« Last Edit: October 17, 2019, 08:39:23 am by TheUnusualGuy »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to use "watch"?
« Reply #3 on: October 17, 2019, 09:07:52 am »
What is the result in the full debugger log (enable it in Settings -> Debugger)?

You've not pasted the full debugger log...
(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 TheUnusualGuy

  • Single posting newcomer
  • *
  • Posts: 5
Re: How to use "watch"?
« Reply #4 on: October 17, 2019, 07:29:04 pm »
What is the result in the full debugger log (enable it in Settings -> Debugger)?

You've not pasted the full debugger log...
Apologies.
https://www.heypasteit.com/clip/0ITAID
This is the full debugger log after running the debugger once.
« Last Edit: October 17, 2019, 07:30:36 pm by TheUnusualGuy »

Offline TheUnusualGuy

  • Single posting newcomer
  • *
  • Posts: 5
Re: How to use "watch"?
« Reply #5 on: October 17, 2019, 07:55:24 pm »
Weird, I've also just realized that I'm unable to type anything in the command: field as well.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to use "watch"?
« Reply #6 on: October 17, 2019, 07:55:50 pm »
Code
Starting debugger: C:\Program Files\CodeBlocks\MinGW\gdb32\bin\gdb32.exe -G -lines -2 -y C:/Users/glf4tim/Desktop/double1/double1/; -srcpath C:/Users/glf4tim/Desktop/double1/double1/; C:/Users/glf4tim/Desktop/double1/double1/bin/Debug/double1.exe
done

[debug]C:\Program Files\CodeBlocks\MinGW\gdb32\bin\gdb32.exe: unrecognized option `-G'
[debug]Use `C:\Program Files\CodeBlocks\MinGW\gdb32\bin\gdb32.exe --help' for a complete list of options.
Obviously this is your problem. I guess you've set some options to gdb which you shouldn't have done.
Inspect the options in Settings -> Debugger and remove the things that won't work.
(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 TheUnusualGuy

  • Single posting newcomer
  • *
  • Posts: 5
Re: How to use "watch"?
« Reply #7 on: October 18, 2019, 08:20:51 am »
Code
Starting debugger: C:\Program Files\CodeBlocks\MinGW\gdb32\bin\gdb32.exe -G -lines -2 -y C:/Users/glf4tim/Desktop/double1/double1/; -srcpath C:/Users/glf4tim/Desktop/double1/double1/; C:/Users/glf4tim/Desktop/double1/double1/bin/Debug/double1.exe
done

[debug]C:\Program Files\CodeBlocks\MinGW\gdb32\bin\gdb32.exe: unrecognized option `-G'
[debug]Use `C:\Program Files\CodeBlocks\MinGW\gdb32\bin\gdb32.exe --help' for a complete list of options.
Obviously this is your problem. I guess you've set some options to gdb which you shouldn't have done.
Inspect the options in Settings -> Debugger and remove the things that won't work.
Thanks! It seems that I just had the wrong debugger type chosen!
Is this how the debugger log should appear to be? https://www.heypasteit.com/clip/0ITAK7

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to use "watch"?
« Reply #8 on: October 19, 2019, 11:41:36 am »
Yes, the log looks fine.
(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!]