Maybe it's a stupid question, but... is there a way to hard-code a breakpoint ? I need to check a bit of code that gets called too many times and I'd like to put a conditional breakpoints compiled in code; no way to use winedbg built-in conditional breaks, the condition is too complicated..... Regards Max hmmm... BTW, somebody knows what's the meaning ow window message # 0x1018 ? :-)
On Thu, 25 Jul 2002, Max wrote:
Maybe it's a stupid question, but... is there a way to hard-code a breakpoint ? I need to check a bit of code that gets called too many times and I'd like to put a conditional breakpoints compiled in code; no way to use winedbg built-in conditional breaks, the condition is too complicated.....
You can do: if (complex condition) { _CrtDbgBreak(); } Or equivalently: if (complex condition) { __asm__ ("\tint $0x3\n"); } The int 3 is a software breakpoint (or rather, a software breakpoint is an int 3). The bove code will cause you to drop in the debugger if the int 3 ever gets executed. This only works on x86 architectures but this is probably all you need. -- Francois Gouget fgouget(a)free.fr http://fgouget.free.fr/ Advice is what we ask for when we already know the answer but wish we didn't -- Eric Jong
You could do a "raise(SIGSTOP)", or if your lazy, "raise(19)". Replace SIGSTOP with your faviourate signal. I know that works when debugging with gdb, I guess it should with winedbg... David On Thu, 25 Jul 2002 01:08:51 +0200, Max wrote: | Maybe it's a stupid question, but... is there a way to hard-code a | breakpoint ? I need to check a bit of code that gets called too many times and | I'd like to put a conditional breakpoints compiled in code; no way to use | winedbg built-in conditional breaks, the condition is too complicated..... -- David Hammerton programmer TransGaming Technologies Inc. http://www.transgaming.com david(a)transgaming.com
David Hammerton wrote:
You could do a "raise(SIGSTOP)", or if your lazy, "raise(19)".
Replace SIGSTOP with your faviourate signal. I know that works when debugging with gdb, I guess it should with winedbg...
David
On Thu, 25 Jul 2002 01:08:51 +0200, Max wrote:
| Maybe it's a stupid question, but... is there a way to hard-code a | breakpoint ? I need to check a bit of code that gets called too many times and | I'd like to put a conditional breakpoints compiled in code; no way to use | winedbg built-in conditional breaks, the condition is too complicated.....
Is this documented anywhere? I was thinking about this for a while and poking around the documentation with no success. Thankyou to Max for asking the question because I was simply to shy/embarassed to ask. Tony Lambregts
Personally, I do: if( condition) some meaningless nop; And then set or clear the breakpoint on the nop if I want. This gives me debug time control over the breakpoint without giving up on the flexability. Shachar David Hammerton wrote:
You could do a "raise(SIGSTOP)", or if your lazy, "raise(19)".
Replace SIGSTOP with your faviourate signal. I know that works when debugging with gdb, I guess it should with winedbg...
David
On Thu, 25 Jul 2002 01:08:51 +0200, Max wrote:
| Maybe it's a stupid question, but... is there a way to hard-code a | breakpoint ? I need to check a bit of code that gets called too many times and | I'd like to put a conditional breakpoints compiled in code; no way to use | winedbg built-in conditional breaks, the condition is too complicated.....
On Thu, Jul 25, 2002 at 01:08:51AM +0200, Max wrote:
Maybe it's a stupid question, but... is there a way to hard-code a breakpoint ? I need to check a bit of code that gets called too many times and I'd like to put a conditional breakpoints compiled in code; no way to use winedbg built-in conditional breaks, the condition is too complicated.....
Just call DbgBreakPoint(); Ciao, Marcus
participants (6)
-
David Hammerton -
Francois Gouget -
Marcus Meissner -
Max -
Shachar Shemesh -
Tony Lambregts