VOGONS

Common searches


Question about DOSBox-X Debugger

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by myrkraverk

User metadata
Rank Newbie
Rank
Newbie

I was trying to use DOSBox-X to debug a program [1] but when I used the log command to create a CPU trace, all it does is create an empty LOGCPU.TXT file, and no trace is generated. I am using the latest provided DOSBox-X binary, that I know of; specifically dosbox-x-vsbuild-win64-20221226190454.zip downloaded from Github.

My steps were, open the debugger, enter the log command, followed by run after which I ran the program in the normal DOSBox-X shell. Nothing showed up in the trace file. Am I doing something wrong, or is this feature missing from the provided DOSBox-X build? How do I use this feature?

[1] More specifically, I want to trace the execution of the CauseWay extender, for which I don't have many useful other tools than in-emulator debuggers, that I know of. If something other than DOSBox-X internal debugger is useful, I'm all ears.

Reply 1 of 4, by xcomcmdr

User metadata
Rank Oldbie
Rank
Oldbie

The source code of CauseWay extender is here: https://github.com/amindlost/cw

I'm part of a team who works on this project, in order to reverse-enginneer real-mode programs (which offers also a GDB server) : https://github.com/OpenRakis/Spice86

CauseWay extender MIGHT run with it. Emulation-wise, it runs Dune, Dune 2, and not much else right now. 😁

Reply 2 of 4, by myrkraverk

User metadata
Rank Newbie
Rank
Newbie
xcomcmdr wrote on 2023-03-03, 17:12:

The source code of CauseWay extender is here: https://github.com/amindlost/cw

I'm part of a team who works on this project, in order to reverse-enginneer real-mode programs (which offers also a GDB server) : https://github.com/OpenRakis/Spice86

CauseWay extender MIGHT run with it. Emulation-wise, it runs Dune, Dune 2, and not much else right now. 😁

Thanks, I may look into it. So far I'm browsing the CW code that's part of Open Watcom [it's been massaged to compile with wasm, but I believe it's identical in all other ways.]

Still, I want to know -- if possible -- how to use the dosbox debugger for this. And I've encountered some issues with it. One notable problem is if I use the run command, and there are no breakpoints nor anything to make it stop, there's no way to get the prompt back, and I have to restart dosobox-x for it. Dosbox-x does not seem to have a way to start a program in the internal debugger; I believe previous posts mentioned using the debug command in the DOS window for this, but that doesn't work in dosbox-x.

It would help if there was a simple way to have the internal debugger breakpoint on the first instruction in a new program, started from the shell, so I don't have to debug the shell nor keyboard input, before the process starts.

Reply 3 of 4, by myrkraverk

User metadata
Rank Newbie
Rank
Newbie

The DOSBox-X discord came to rescue. I have to use log ffffff to log lots of instructions, and with it I got a 500mb file I used to find the startup sequence of CauseWay at line one million and change. The startup sequence has an evil loop for about 40k instructions, but my editor is up to the task of trivially finding the end of it, once I realized searching for iret was not going to help.