Thread: Does "conditional watchpoint" exist in gdb?

  1. #1
    Registered User
    Join Date
    Jan 2009

    Does "conditional watchpoint" exist in gdb?

    Is there anyway to set "conditional watchpoint", like "watch var1 if var1==0"? In my case, the condition does't work. gdb stops whenever var1's value is changed, instead of untill "var1==0" is true. My gdb is GNU gdb 6.8-debian.

    Thanks and regards!

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    IIRC, and I can't test it right now, watch conditions will still inspect and break at variable change. The only difference is that the watch result will include 'True' or 'False' information letting you know of the state of your condition.

    What you do want to do is instead create a conditional breakpoint.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. buffered vs unbuffered question
    By Overworked_PhD in forum Linux Programming
    Replies: 6
    Last Post: 07-04-2008, 04:57 PM
  2. Memory allocation error
    By cunnus88 in forum C++ Programming
    Replies: 5
    Last Post: 01-25-2008, 04:24 PM
  3. Contiguous Array version of Linked List
    By ampersand11 in forum C Programming
    Replies: 19
    Last Post: 10-07-2007, 03:05 AM
  4. Too much output in GDB
    By MacNilly in forum Tech Board
    Replies: 0
    Last Post: 09-13-2006, 12:45 PM
  5. does gdb lie?
    By dinjas in forum C Programming
    Replies: 8
    Last Post: 03-10-2005, 05:17 PM

Tags for this Thread