Original date:2022-02-26 23:23:18 Edited by: abuaf Subject: Re: BREAKing into Euphoria

[quote ghaberek]

abuaf said...

What's the easiest way to contribute the TraceOn functionality patches to euphoria 4.1 source?

ghaberek said...

If this is something you want to implement, you are welcome to open a pull request against the Euphoria repo on GitHub. However, I'll warn you now that your method of using assembly code to inject tracing into the code stack is not going to be accepted. It looks quite dangerous and it's not portable to other platforms as it stands. Anything we implement should work on at least x86/x64 Windows and x86/x64/ARM Linux.

See my quote below. This is *not* how my code works. Essentially in the eu source, trace(1) sets the C var "TraceOn=1;" . This then triggers the debugger to be invoked when the existing "trace on" eu byte code is next hit (what i referred to as "pop up the debugger when the next trace'able code is encounterred"). My code patches the C var "TraceOn=1;" in the eu binary in virtual memory (because there's no api access for this). You can then refer to my comments to provide this access via trivial additions to allow_break() in interpreter's C source; this is then the implementaion - nothing to do with the problematic mission of patching eu byte code; i dont think there is any way to locate at runtime where in the bytecode to patch and how to revector the old byte code to allow continuity. Me thinks I'd have to parse eu's symbolic debug stream wind forward to the next eu instruction bytecode address and patch that ... ugly, and not needed, this is not how eu's debugger works; basically the bytecode has the 'trace on' opcode, that the interpreter then polls the C "TraceOn" var and invokes the debugger if true, so all the machinery to internally (via API) trigger the debugger at any abitrary moment is there; which my code does without an API.

Anyone who wants to wrap their head around my code, pls read my comments very carefully. Anyway i reimplemented it without ASM with eu equivalent and some fluff, but the 'hack' is the same methodology.

abuaf said...

I had a closer look at "external debugger" api, doesn't seem to provide this functionality to queue a "TraceOn=1" trap out to the debugger at the next traceable code, which is great for pin

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu