Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* rules for conditional breakpoints
@ 2002-09-25 22:10 Peter Jay Salzman
  2002-09-25 22:53 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Jay Salzman @ 2002-09-25 22:10 UTC (permalink / raw)
  To: Gdb Mailing List

hi all,

what exactly are the rules for conditional breakpoints?  clearly the
condition can use the standard boolean operators, along with the logical
qualifiers:

   break main if i > 3
   break test.c:3 if i !=0 && j <=0

but libc functions linked to the code also seem to work:

   break 40 if *(string + strlen(string)) != '\0'

from a previous email i sent to this list, i gather that strlen() works
"by accident", and only functions that return an int work.  so this
won't work, even with typecasting:

   break 1 if (double)cos(0) == 1.0L

so, this seems to be the rule for conditional breakpoints:

1. equality/inequality operators. ie:
       <, >, <=, >=

2. logic operators.  ie:
      &&, ||

3. libc functions linked to code but ONLY if they return an int.  ie:
      strlen(), abs()

is this correct?

thanks!
pete

-- 
Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-26 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-25 22:10 rules for conditional breakpoints Peter Jay Salzman
2002-09-25 22:53 ` Eli Zaretskii
2002-09-25 23:40   ` Peter Jay Salzman
2002-09-26  7:23     ` Daniel Jacobowitz
2002-09-26 13:55   ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox