Problem with conditional breakpoints

I am trying to set a conditional breakpoint using the following syntax as
documented:

0:000> bp Address "j (Condition) ‘OptionalCommands’; ‘gc’ "

I am using WinDbg 6.4.7. The actual command that I use is something like
this:

bp foo.cpp:365 “j (poi(bar)=0n41) ‘.echo *** conditional breakpoint hit
***’; ‘gc’”

This should cause a break whenever the variable ‘bar’ equals 41. ‘bar’ is a
local variable. The code is executing at DISPATCH_LEVEL.

The problem is that the breakpoint does not work consistently. It only
seems to work if I put a breakpoint in my code before the conditional break
point.

I have not experienced this issue while debugging user mode code with
WinDbg. So the problem seems to be related to running in kernel mode or at
DISPATCH_LEVEL. Has anyone run into this problem?

Takin

> Has anyone run into this problem?
I did, and IRQL seemed not to play any role.

After playing with the idea for a while, I stepped back to

ULONG g_fakeOne = 0;
. . .
if(myVar == the Value_I_am_interested) {
++g_fakeOne; // unconditional bp here
}

An extra recompilation costed less time than guesswork:-)

Regards,
Alex

----- Original Message -----
From: “Takin Nili-Esfahani”
Newsgroups: windbg
To: “Kernel Debugging Interest List”
Sent: Thursday, June 30, 2005 4:17 PM
Subject: [windbg] Problem with conditional breakpoints

>I am trying to set a conditional breakpoint using the following syntax as
>documented:
>
> 0:000> bp Address "j (Condition) ‘OptionalCommands’; ‘gc’ "
>
> I am using WinDbg 6.4.7. The actual command that I use is something like
> this:
>
> bp foo.cpp:365 “j (poi(bar)=0n41) ‘.echo conditional breakpoint hit
>
’; ‘gc’”
>
> This should cause a break whenever the variable ‘bar’ equals 41. ‘bar’ is
> a local variable. The code is executing at DISPATCH_LEVEL.
>
> The problem is that the breakpoint does not work consistently. It only
> seems to work if I put a breakpoint in my code before the conditional
> break point.
>
> I have not experienced this issue while debugging user mode code with
> WinDbg. So the problem seems to be related to running in kernel mode or
> at DISPATCH_LEVEL. Has anyone run into this problem?
>
> Takin
>
>
>
> —
> You are currently subscribed to windbg as: xxxxx@bellsouth.net
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Nevermind, it seems to be working now.

“Takin Nili-Esfahani” wrote in message
news:xxxxx@windbg…
>I am trying to set a conditional breakpoint using the following syntax as
>documented:
>
> 0:000> bp Address "j (Condition) ‘OptionalCommands’; ‘gc’ "
>
> I am using WinDbg 6.4.7. The actual command that I use is something like
> this:
>
> bp foo.cpp:365 “j (poi(bar)=0n41) ‘.echo conditional breakpoint hit
>
’; ‘gc’”
>
> This should cause a break whenever the variable ‘bar’ equals 41. ‘bar’ is
> a local variable. The code is executing at DISPATCH_LEVEL.
>
> The problem is that the breakpoint does not work consistently. It only
> seems to work if I put a breakpoint in my code before the conditional
> break point.
>
> I have not experienced this issue while debugging user mode code with
> WinDbg. So the problem seems to be related to running in kernel mode or
> at DISPATCH_LEVEL. Has anyone run into this problem?
>
> Takin
>
>
>