


This file contains:

	- COMMAND LINE SWITCHES FOR RSX

	- DEBUGGING WITH DEB.EXE






COMMAND LINE SWITCHES FOR RSX ( a subset of EMX switches )
----------------------------------------------------------

Syntax:
        RSX [options] a.out-file

You can put command-line switches in the RSXOPT environment.

    Example:  SET RSXOPT=-s512 -e
	    This builds a 512KB stack for every programs
	    and disables rsx387 loading.


Switches:

-a[cmwi] enable some extra DOS features:
     -ac makes data,stack,heap executable (default now)
     -am enable _memaccess() (for writing 0xA0000h-0xFFFFFh), but this
	 option destroy protection under RSX (see source sysemx.c/loadprg.c)
     -aw enables write access to all areas for EMX,
         RSX ignore this
     -ai enables _portaccess() for EMX,
         RSX ignore this (DPMI-Server allow/emulate this)

     -as (RSX only) Don't use expand-down-stack-segment, ss = data segment.

	 RSX uses expand-down stack-segments to control the stack. But some
	 gcc-programs uses the EBP register for a pointer in the data-segment.
	 This causes a stack-fault (not for emx with default stack).
	 If the stack is changed, the place of the stack region is changed.

	 EMX default:

	 0	     64KB
	 |--<<stack---|-----code-----|----data/bss----|--heap------

	  ^- lower limit expand-down


	 EMX with big stack / DJGPP 1.11:

	 |-------|---code---|---data/bss---|----<<stack-------|--heap--
	      <no access esp,ebp>	   ^lower limit expand-down



	 older emTeX386 need the -as option, if you grow the stack
	 (beta11 is ok / Jan 1994)


-c   disable core dumps (core dumps not implemented yet).

-e   Don't check 387 coprocessor.
     Under RSX this disables loading 387 emulation. If the cpu detect a
     floating point exception, the program will terminated with signal SIGFPE.

-s#  set stack size in KB.
     default: 64 KB for EMX
              4 MB - text_size for DJGPP
     (!) Note:
         If you grow the stack for EMX programs the stack region is placed
	 in another area. If there is a stack fault using the EBP register,
         set the -as option to disable stack limit.
        (see -s option)

-p   for EMX: don't use all low DOS memory.

     for RSX: don't put rsx387 emulator in DOS memory
              DPMI doesn't use DOS memory for swapping

-S   Enable internal debugger (use RSXDEB.EXE)

-I   print all int0x21 calls (only for testing RSX)

-P   print some extra information (only for testing RSX)
     print registers after exception





DEBUGGING WITH DEB.EXE:
-----------------------


Now, DPMIGCC contains a debugger build with GNU C

Example session:
	C:> gcc -g -o myfile.emx myfile.c
	C:> deb -ansi myfile.emx

type help or h	for help

The input line has some doskey futures.
 (home, end, insert, delete, cursor moves, esc)




Command line : DEB.EXE [-ansi] program

If you use the '-ansi' parameter in the command line,
then ANSI commands will be used to colorize the debugging output.

The debugger allows the following actions:
- go/continue until a certain address
- step through code
- set 20 independent breakpoints
- set/clear/enable/disable breakpoints
- list program code with symbols
- view and change registers, memory
- execute shell commands
- view DPMI selectors
- view free DPMI memory

Whenever a prompt is displayed, a the default command is the last one.
If you just hit return, the previous command is repeated.


------------------------------------------------------------------------
Commands:

cmd: go(g) [to_address]

Continue execution from the current EIP. If an address is specified, one
breakpoint is temporarily set to this address.


cmd: cont(c) [to_address]

like go


cmd: step(s)

Execute one machine instruction. This command traces into function calls.


cmd: next(n)

Similar to step, but does not trace into function calls.


cmd: list(l) [address]

Lists assembler code (symbolically), starting at the given address,
or EIP if address not given.
Source lines are listed if the source files are present, and source
debugging information is available.


cmd: dump(d) [address]

dump memory


cmd: find <wildcard>

give a list of symbols that match <wildcard> and their hexadecimal
values.  Can also be used to evaluate expressions.  Wildcards are "*" for
match zero or more, "?" for match any one.


cmd: bp <address>

Sets breakpoint to address <address>. Displays breakpoint number.


cmd: bc <n>

Clears breakpoint number <n>


cmd: bd <n>

Disables breakpoint number <n>. Breakpoint is still in breakpoint list.


cmd: be <n>

Enable breakpoint number <n>, if previous disabled


cmd: bl

Lists all breakpoints and its status.


cmd: regs , r
Display the 80386 registers and flags.


cmd: set <what> <value>

Changes the contents of memory or registers.  To change memory, give any
standard address as <what>.  To change a register, specify and of %eax,
%ax, %ah, %al, %ebx, %bx, %bh, %bl, %ecx, %cx, %ch, %cl, %edx, %dx, %dh,
%dl, %esi, %edi, %ebp, %esi, %esp, %eip, %eflags.


cmd: help(h,?)

Displays help


cmd: quit(q)

Quit Deb.exe

