[Lazarus] BreakIf

Sven Barth pascaldragon at googlemail.com
Fri Mar 27 14:50:21 CET 2015


Am 27.03.2015 14:32 schrieb "JuuS" <JuuS at mykolab.ch>:
>
>
>
> On 03/27/2015 02:17 PM, Joost van der Sluis wrote:
> > 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....
>
> Mmmm, nasty maybe...but cool! Just tried it again and it won't compile
> "INT 3" line because "invalid reference syntax".

You need to write either "INT $3" or switch the assembler syntax to Intel
({$asmmode intel}) as the default one is AT&T on Linux.

Please note that INT 3 is specific to x86 (and will likely also work on
x86_64), but for other architectures you'll need to look up their specific
breakpoint sequences.

Please state beforehand next time whether you can't compile or can't run.
We have no crystal balls after all...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150327/400cac12/attachment-0003.html>


More information about the Lazarus mailing list