Re: BREAKing into Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message
abuaf said...

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.

Yes you're right. Sorry I missed that. But even without assembly code, poking directly at random memory addresses is bad. The correct way to do this is either in via the backend, as I've implemented above, or via the external debugger API, which I'll work on adapting to better accommodate this feature. I was busy digging into this and we both ended up replying at the same time. Hopefully what I posted above shows some progress towards this feature.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu