Determine the operand/address size of %cs in a new function
authorbde <bde@FreeBSD.org>
Sun, 25 Sep 2016 16:30:29 +0000 (16:30 +0000)
committerbde <bde@FreeBSD.org>
Sun, 25 Sep 2016 16:30:29 +0000 (16:30 +0000)
commit7d8ccb0c00bff409a6b87b5c8a6d677ba189f82c
treec568d229aa0fb12470cef76df14ed843e6329e13
parent94a237c17c06741e0ffbf8367ea1e974c4571178
Determine the operand/address size of %cs in a new function
db_segsize().

Use db_segsize() to set the default operand/address size for
disassembling.  Allow overriding this with the "alternate" display
format /I.  The API of db_disasm() should be debooleanized to pass a
more general request (amd64 needs overrides to sizes of 16, 32, and
64, but this commit doesn't implement anything for amd64 since much
larger changes are needed to restore the amd64 disassmbler's support
for non-default sizes).

Fix db_print_loc_and_inst() to ask for the normal format and not the
alternate in normal operation.

This is most useful for vm86 mode, but also works for 16-bit protected
mode.

Use db_segsize() to avoid trying to print a garbage stack trace if %cs
is 16 bits.  Print something like the stack trace termination message
for a trap boundary instead.

Document that the alternate format is now useful on i386.
share/man/man4/ddb.4
sys/ddb/db_examine.c
sys/i386/i386/db_disasm.c
sys/i386/i386/db_interface.c
sys/i386/i386/db_trace.c
sys/i386/include/db_machdep.h