Am 27.03.2015 14:17 schrieb "Joost van der Sluis" <[email protected]>: > > On 03/27/2015 01:45 PM, JuuS wrote: >> >> procedure BreakIf( b : Boolean ); >> begin >> if b then >> asm >> INT 3 <======debugger would then stop here >> and one could then F8 step to the offending >> routine based on the boolean condition passed >> end; >> end; >> >> I believe this is windows specific (?) and I'm now working on Linux >> machines. >> >> The question is: >> >> This does not work in Linux and I wonder if there is a similar way to >> achieve this in Linux environment? > > > Wow.. that's a nasty trick.... > > And it should still work, also on Linux. > > But I think that debuggers nowadays are more clever, they detect that the breakpoint is actually self-inflicted, and so they decide to continue. After all: the developer can have it's reasons to call this interrupt, and the debugger should not influence normal execution.
This might be true on an embedded system, but if you run any of the normal OSes where you can't modify interrupt handlers anyway then on x86(_64) INT 3 (or $CC) /always/ means breakpoint. And from experience I know that both GDB and WinDBG respect these as they should. Regards, Sven
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
