This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: rules for conditional breakpoints
hi eli,
unfortunately, the user manual doesn't really say much about this. the
relevent section is 5.1.6 (break conditions) which references section
8.1 (expressions).
in the first paragraph os 5.1.6:
A condition is just a Boolean expression in your programming language
(see section 8.1 Expressions).
but this is where my confusion is coming from. here is a boolean
expression:
break main if cos(0.0) == 1.0
the condition "cos(0.0) == 1.0" is a boolean expression. it's either
true or false. yet it's not valid in a conditional breakpoint.
looking further down the section 5.1.6, it mentions that user defined
functions are allowed in conditions.
looking at section 8.1, it has something relevent:
Any kind of constant, variable or operator defined by the programming
language you are using is valid in an expression in GDB. This
includes conditional expressions, function calls, casts and string
constants. It unfortunately does no include symbols defined by
preprocessor #define commands.
this is kind of ambiguous whether "the programming language" includes
glibc or not. if it doesn't, then i'm unsure what "functions" this
paragraph is talking about. if it does, then it directly conflicts with
my "cos(0.0) == 1.0" as an example of something that should work but
doesn't.
either way, i can appreciate the fact that the user's manual doesn't
have examples. that's what books are for. but it seems to me that it
leaves some details in an ambiguous state.
this email was longer than i intended. thanks for reading down to here.
:)
peter
begin Eli Zaretskii <eliz@is.elta.co.il>
>
> On Wed, 25 Sep 2002, Peter Jay Salzman wrote:
>
> > what exactly are the rules for conditional breakpoints?
>
> If that's not clear from reading the manual, I think we should fix the
> manual.
--
Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D