DEBUG.EXE single-step doesn't awork on dynamic recompiler...

Support and general discussion.
Post Reply
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

DEBUG.EXE single-step doesn't awork on dynamic recompiler...

Post by Battler »

DEBUG.EXE single-step doesn't work on dynamic recompiler. I tried to add the trap stuff, and got it to work for one instruction, and then it complained that CS is not present. Now, if EMM386 isn't loaded, and DEBUG does everything in real mode, it works fine, but when it is loaded and DEBUG does its stuff in protected mode, that error occurs and PCem fatals due to triple fault. I also noticed that on the dynamic recompiler, CALLs, INTs, etc. don t seem to get properly traced. Ie. when the TRAP should land me before a CALL or an INT, it instead goes ahead and executes that instruction anyway. On the interpreter, however, it behaves correctly.

Edit: Made it work correctly by moving the TRAP handler to inside the while(!cpu_block_end) code block when the code is dynamically interpreted. It now works exactly as it should, INT 1h correctly executed before all opcodes, and no faults or fatals. :p
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: DEBUG.EXE single-step doesn't awork on dynamic recompile

Post by SarahWalker »

Trap flag has been implemented in rev 193.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: DEBUG.EXE single-step doesn't awork on dynamic recompile

Post by Battler »

You accidentally removed:
int trap = flags & T_FLAG;
from exec386().
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: DEBUG.EXE single-step doesn't awork on dynamic recompile

Post by SarahWalker »

That's intentional.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: DEBUG.EXE single-step doesn't awork on dynamic recompile

Post by Battler »

But without that, the code won't work at all. It does if (trap) in many places, how can if (trap) possibly ever be true if trap is never declared and only ever set in one place, to 0.

Edit: Somehow, it's working without it. I guess I must have missed something then when I read the code.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: DEBUG.EXE single-step doesn't awork on dynamic recompile

Post by SarahWalker »

trap is set at the beginning of all interpreted instructions, in exec386().

I like how little faith you have in my abilities to actually test what I'm committing.
Post Reply