Debugging via GDB and 16-bit Application / Database

Greetings,

I’m working with a 16-bit x86 real mode application that was imported into IDA as such. Now, while working to connect to a GDB remote implementation in a fork of Dosbox, I am informed:

The current database is for a 16-bit application
but the debugged application (pid=0) is 32-bit.
Please check that you are running the correct application.

Is there some particular thing the GDB remote server must return to indicate the application is real mode, does IDA inspect CR0 PE bit, or is it controlled some other way?

Thanks!

Hi,
Alas, currently the GDB debugger can’t detect 16-bit applications. You can try marking your database 32-bit as a workaround:

ida_ida.inf_set_app_bitness(32)

P.S. In case the stub sends only 16 bits of IP, you should also set “Use CS:IP in real mode” in debugger-specific options.

1 Like

Thanks for the pointers. I have it working now.

Great! When you have some time, could you describe your whole set up for future reference?