First post, by alex.123
Hello!
I am using dosbox debugger (heavydebug build) to test my patch of a dos program. I want to pause the program when a certain condition is met. How can I do it? I tried INT 3, but it does not work.
Hello!
I am using dosbox debugger (heavydebug build) to test my patch of a dos program. I want to pause the program when a certain condition is met. How can I do it? I tried INT 3, but it does not work.
You can't do it, and that is by design. No program running in the emulation should be aware of the debugger's presence or be able to influence it.
What you CAN do is identify a branch the program takes when the condition is met, or make the program take a branch, then set a breakpoint on that branch.
Use the debugger's command BPINT 3 together with INT 3 using the two-byte form of the instruction (CD 03).
wrote:Use the debugger's command BPINT 3 together with INT 3 using the two-byte form of the instruction (CD 03).
That works, thanks.
If you point the INT 3 vector at some address and set a breakpoint at that address, then you can also use the CC opcode. In any case the interrupt should only occur when the condition is met, and is just another form of the branch I referred to.
I am going to use it in my _die function, so longer opcode is no problem and easier setup with BPINT 3 is preferable to changing int 3 vector. Anyway thanks for your suggestion.
Also a stack trace would be handy. I assume dosbox debugger can't do it and i have to code it myself. Is this correct?
It might be easier to set up than you think: break into the debugger, use the INTHAND 3 command, set a breakpoint by pressing F9, resume execution with F5, then run your program. However, INT 3 initially points to the default interrupt handler that can also be triggered by other kinds of interrupts, so in some cases it might be necessary to point INT 3 to a unique address.
Yes, there is no built-in stack trace. The DOSBox debugger has no context for what a program does with the stack.