Next Previous Contents

18. DOSEMU debugger v0.4

This section written on 7/10/96. Send comments to Max Parke <mhp@light.lightlink.com> and to Hans Lermen <lermen@fgan.de>

18.1 Introduction

This is release v0.4 of the DOSEMU debugger, with the following features:

18.2 Files

All changes are #ifdef'ed with USE_MHPDBG

modules

executable

18.3 Installation

In order to use DOSEMU debugger you must also use EMUMODULE.

During ./configure be sure you have NOT set --enable-noemumod

18.4 Usage

To run, start up DOSEMU. Then switch to another virtual console (or remote login) and do:

  dosdebug
If there are more then one dosemu process running, you will need to pass the pid to dosdebug, e.g:

  dosdebug 2134

NOTE: You must be the owner of the running dosemu to 'debug-login'.

You should get connected and a banner message. If you type 'q', only the terminal client will terminate, if you type 'kill', both dosemu and the terminal client will be terminated.

18.5 Commands

See mhpdbgc.c for code and cmd table.

(all numeric args in hex)

?

Print a help page

q

Quit the debug session

kill

Kill the dosemu process (this may take a while, so be patient) See also Recovering the display

console n

Switch to console n

r

list regs

r reg val

change contents of 'reg' to 'val' (e.g: r AX 1234)

e ADDR HEXSTR

modify memory (0-1Mb)

d ADDR SIZE

dump memory (no limit)

u ADDR SIZE

unassemble memory (no limit)

g

go (if stopped)

stop

stop (if running)

mode 0|1|+d|-d

set mode (0=SEG16, 1=LIN32) for u and d commands +d enables DPMI mode (default on startup), -d disables DPMI mode.

t

single step (not fully debugged!!!)

tf

single step, force over IRET and POPF NOTE: the scope of 't' 'tf' or a 'come back for break' is either 'in DPMI' or realmode, depending on wether a DPMI-client is active (in_dpmi).

r32

dump regs in 32 bit format

bp addr

set int3 style breakpoint NOTE: the scope is defined wether a DPMI-client is active (in_dpmi). The resulting 'come back' will force the mode that was when you defined the breakpoint.

bc breakp.No.

Clear a breakpoint.

bpint xx

set breakpoint on INT xx

bcint xx

clr breakpoint on INT xx

bpintd xx [ax]

set breakpoint on DPMI INT xx optionaly matching ax.

bcintd xx [ax]

clear breakpoint on DPMI INT xx.

bpload

set one shot breakpoint at entry point of the next loaded DOS-program.

bl

list active breakpoints

ldt sel [lines]

dump ldt starting at selector 'sel' for 'lines' 'sel' may be a symbolic register name.

(rmapfile)

(internal command to read /usr/src/dosemu/dosemu.map at startup time)

rusermap org fn

read microsoft linker format .MAP file "fn" code origin = "org". for example if your code is at 1234:0, org would be 12340.

Addresses may be specified as:

  1. a linear address. Allows 'd' and 'u' commands to look at both DOSEMU kernel and DOS box memory (0-1Mb).
  2. a seg:off address (0-1Mb) seg as well as off can be a symbolic registers name (e.g cs:eip) 'seg' under DPMI is resolved via LDT, if so a numeric 'seg' value is prefixed by # (e.g. #00af:0000. You may force a seg to treaten as LDT selector by prefixing the '#'. Accordingly to the default address mode 'off' under DPMI is 16 or 32 bit. When in DPMI mode, and you want to address/display realmode stuff, then you must switch off DPMI mode ('mode -d')
  3. a symbolic address. usermap is searched first, then dosemu map. ( not for DPMI programms )
  4. an asterisk(*): CS:IP (cs:eip)
  5. a dollar sign($): SS:SP (ss:esp)

18.6 Performance

If you have dosemu compiled with the debugger support, but the debugger is not active and/or the process is not stopped, you will not see any great performance penalty.

18.7 Wish List

Main wish is to add support for hardware debug registers (if someone would point me in the direction, what syscalls to use, etc.) Then you could breakpoint on memory reads/writes, etc!

18.8 BUGS

There must be some.

Known bugs


Next Previous Contents