db/Read_me 4/2/93
steve's notes on db source

A brief history:
db was originally written ca. 1982 (?) by Johann George for PDP-11 COHERENT.
It was subsequently ported to i8086, z8001, m68000, etc.
The source still shows the influence of these versions,
in particularly the segmentation for PDP-11 and segmented z8001 models.
It is also complicated considerably by understanding both COFF and l.out.

The initial i386 version was by a German associate of Frank Pfeifer,
Bernard Waldt, Waldt Software Consulting, Germany,
starting from existing i8086 sources.
He was not an MWC employee, and apparently it never worked.
hal hacked on the i386 sources somewhat in 1993, cleaning up the
ptrace() call in the COH386 system and making db sort of work.

By the time steve got the i386 sources, both machine-independent and
machine-independent sources lived in the same directory.
steve restored the subdirectory structure for the benefit of future ports
and rewrote and reorganized the source considerably; see the Changes
file for more details.

In the PDP-11 machine model, the same address could reference i-space (code)
or d-space (data).  Vestiges of this architecture are still very evident in
db source (as well as in the ptrace() interface), and make the source
confusing or wrongheaded for a flat address space machine architecture,
although much of this code is still necessary to support l.out.
In particular, a symbol has an associated segment (DSEG or ISEG,
or USEG for registers), but the mapping of an arbitrary address
to a segment can be many-one.  This could be clearer in the source.

Substantial amounts of other source cleanup remain to be done.
The code often assumes that the host machine object sizes are the same
as the target machine sizes (4 byte ints); it should instead define its
own target machine types, like ival_t in the compiler;
with a little fine-tuning of exec() and ptrace() interface,
this would allow remote (cross-machine) debugging.
The machine-independent code used to pass machine addresses in longs,
now it uses ADDR_T (defined in machine-dependent mdb.h).

Future coding improvements/ideas:
	type handling using char_t/short_t/int_t/long_t for target sizes
	symbol lookup by value: add ordered list field to SYM?
