History log of /freebsd-current/sys/amd64/amd64/db_disasm.c
Revision Date Author Comments
# 1027e838 02-Feb-2024 John Baldwin <jhb@FreeBSD.org>

ddb: Use bool for boolean variables in MD code

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43695


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b2c68dc6 07-Feb-2023 Mateusz Guzik <mjg@FreeBSD.org>

amd64: ansify

Reported by: clang 15
Sponsored by: Rubicon Communications, LLC ("Netgate")


# 543769bf 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

amd64: clean up empty lines in .c and .h files


# f677fed5 16-Oct-2019 Conrad Meyer <cem@FreeBSD.org>

ddb: Add support for disassembling 'crc32' on amd64


# e099b90b 21-Feb-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys: Replace zero with NULL for pointers.

Found with: devel/coccinelle
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9694


# cd508278 21-May-2015 Pedro F. Giffuni <pfg@FreeBSD.org>

ddb: finish converting boolean values.

The replacement started at r283088 was necessarily incomplete without
replacing boolean_t with bool. This also involved cleaning some type
mismatches and ansifying old C function declarations.

Pointed out by: bde
Discussed with: bde, ian, jhb


# 7f192d49 12-Feb-2015 Mark Johnston <markj@FreeBSD.org>

Add support for decoding multibyte NOPs.

Differential Revision: https://reviews.freebsd.org/D1830
Reviewed by: jhb, kib
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison


# 674b6d6e 19-May-2014 John Baldwin <jhb@FreeBSD.org>

Add support for decoding the AMD SVM instructions.


# 8b3949c3 17-May-2014 John Baldwin <jhb@FreeBSD.org>

Add support for decoding rdrand and rdseed.


# 3d2ec117 27-Jan-2014 John Baldwin <jhb@FreeBSD.org>

Add support for 'clac' and 'stac' to DDB's disassembler on amd64.


# dffe0dc4 03-Sep-2013 John Baldwin <jhb@FreeBSD.org>

Add support for the 'invpcid' instruction to binutils and DDB's
disassembler on amd64.

MFC after: 1 month


# 6632f457 06-Jul-2012 John Baldwin <jhb@FreeBSD.org>

Several fixes to the amd64 disassembler:
- Add generic support for opcodes that are escape bytes used for
multi-byte opcodes (such as the 0x0f prefix). Use this to replace
the hard-coded 0x0f special case and add support for three-byte
opcodes that use the 0x0f38 prefix.
- Decode all Intel VMX instructions. invept and invvpid in particular are
three-byte opcodes that use the 0x0f38 escape prefix.
- Rework how the special 'SDEP' size flag works such that the default
instruction name (i_name) is the instruction when the data size
prefix (0x66) is not specified, and the alternate name in i_extra is
used when the prefix is included.
- Add a new 'ADEP' size flag similar to 'SDEP' except that it chooses
between i_name and i_extra based on the address size prefix (0x67).
Use this to fix the decoding for jrcxz vs jecxz which is determined
by the address size prefix, not the operand size prefix. Also, jcxz
is not possible in 64-bit mode, but jrcxz is the default instruction
for that opcode.
- Add support for handling instructions that have a mandatory 'rep'
prefix (this means not outputting the 'repe ' prefix until determining
if it is used as part of an opcode). Make 'pause' less of a special
case this way.
- Decode 'cmpxchg16b' and 'cdqe' which are variants of other instructions
but with a REX.W prefix.

MFC after: 1 month


# 66f9aec0 04-Jul-2012 John Baldwin <jhb@FreeBSD.org>

Decode the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', 'xsetbv', and
'rdtscp' instructions.

MFC after: 1 month


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# e80531c2 11-Aug-2008 John Baldwin <jhb@FreeBSD.org>

Decode some more "exotic" instructions including: fxsave, fxrstor, ldmxcsr,
stmxcsr, clflush, lfence, mfence, sfence, syscall, sysret, sysenter,
sysexit, pause, monitor, mwait, and swapgs (amd64 only).

MFC after: 1 week


# 818b0b4b 13-Nov-2006 John Baldwin <jhb@FreeBSD.org>

Various fixes:
- Remove an extra entry from the array for 0x0f prefixed instruction groups.
This fixes decoding of instructions where the second opcode >= 0x80.
- Add support for the 64-bit immediate mov instructions.
- When short_addr is enabled, don't parse the modr/m byte for a 16-bit
address, but as a 32-bit address.
- Support %rip relative addressing.
- Don't print a displacement of 0 if there is a base or index register.

MFC after: 3 days


# 58aa36f3 30-Mar-2005 Peter Wemm <peter@FreeBSD.org>

Checkpoint today's tidy-up of the WIP disassembler. It now agrees with
objdump --disassemble when disassembling itself in userland. I've added
the cmovCC instruction group and tweaked a bunch of size sensitive array
indexes to either fix my mistakes and/or force it to work by any means
necessary.

I'm committing this because it is usable enough to see what is going on
when single stepping via ddb.

It might still tell lies, but its lies will be far more subtle now. I'm
not sure that this is a good thing or not.


# dc37635d 30-Mar-2005 Peter Wemm <peter@FreeBSD.org>

Commit my checkpoint of db_disasm.c that I hacked to understand some amd64
instructions as it was when I dropped it back in May 31, 2003. I'm
committing this as an intermediate stage because back then I thought I
understood what I was doing with this file.


# 46280ae7 05-Jan-2005 Warner Losh <imp@FreeBSD.org>

Begin all license/copyright comments with /*-


# 56ae44c5 25-Jul-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID().

Brought to you by: a boring talk at Ottawa Linux Symposium


# fa9c948c 23-Mar-2002 Bruce Evans <bde@FreeBSD.org>

Fixed some style bugs in the removal of __P(()). The main ones were
not removing tabs before "__P((", and not outdenting continuation lines
to preserve non-KNF lining up of code with parentheses. Switch to KNF
formatting and/or rewrap the whole prototype in some cases.


# 15fe3067 20-Mar-2002 Alfred Perlstein <alfred@FreeBSD.org>

Remove __P.


# a081aa7d 18-Jul-2001 Kris Kennaway <kris@FreeBSD.org>

Quiet a variable format-string warning.

MFC after: 1 week


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 0a5e03dd 27-Jan-1999 Matthew Dillon <dillon@FreeBSD.org>

Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile


# 596dfc04 08-Jul-1998 Bruce Evans <bde@FreeBSD.org>

Use not-so-new printf formats %r and/or %z instead of %n and/or %+x.


# 12f29877 01-Apr-1997 Bruce Evans <bde@FreeBSD.org>

Removed a wrong comment of mine.

Removed unused #includes.


# 6875d254 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# ab372207 04-Jan-1997 Bruce Evans <bde@FreeBSD.org>

Fixed botched tables:
- the operands for bt, bts, arpl and `enter' were reversed.
- btr was reported as bts (with the correct operand order).
- cmpxchg was misplaced. It was misplaced differently in the
comments. It is misplaced differently again in the i486 manual.
I put it where the i586 manual and gas say it is.
- fucompp was misplaced.
- the rr table for(s) some versions of fstp, fcom and fcomp was non-null.
This caused some invalid opcodes to be reported as "" instead of as
"<bad instruction>".
- the word and long versions of the fi* instructions were reversed.
- aaa and daa were reversed.

Fixed bugs involving unusual operand sizes:
- 32-bit registers weren't always forced for bswap or for moves to and
from special registers.
- the operand sizes weren't reported for [l]call or [l]jmp.
- displacements weren't truncated mod 2^16 when the operand size was
16-bit.
- too-large displacements and offsets were fetched, and too-large
offsets were reported, when the operand size was 16-bit.
- sign extended immediate bytes were extended too far when the operand
size was 16-bit.

Fixed bugs involving usual operand sizes:
- 8-bit source registers weren't forced for mov[sz]b[wl].
- 16-bit source registers weren't forced for mov[sz]w[wl].
- immediate bytes were sometimes reported as sign extended even for
byte operations. Same for immediate words in word operations.
- the immediate byte was not reported as sign extended for `push'.

Finished Pentium support:
- cpuid, cmpxchg8b and rsm were missing.

Finished i287 support:
- fneni, fndisi and fsetpm were missing. These are harmless nops on
later FPUs.

Improvements:
- report invalid opcodes 0xd6 and 0xf1 using .byte. They are special
in not causing invalid operand exceptions when executed.
- report the immediate byte for unusual aam and aad instuctions.
Immediate bytes other than 0x0a always worked and are documented to
work on Pentiums.


# 0873c1f1 11-Jul-1996 Bruce Evans <bde@FreeBSD.org>

Fixed operand order for shld and shrd.

Finished the constant poisoning that was begun in rev.1.14. Consts
aren't very poisonous (or useful) unless -Wcast-qual is in CFLAGS,
and it isn't in the default CFLAGS.


# 6f745883 08-Jun-1996 Bruce Evans <bde@FreeBSD.org>

Removed bogus `altfmt' code. No alternative formats are supported, but
altfmt was abused to sometimes screw up the disassembly of the bytes
following unconditional jump instructions. Gas doesn't pad to a longword
boundary like the comment said - that is the programmer's responsibility.


# f7ff2482 28-Mar-1996 Garrett Wollman <wollman@FreeBSD.org>

Teach the disassembler about the 0f,3x family of instructions
(RDMSR, RDTSC, WRMSR, and RDPMC).


# 791d77e0 15-Jan-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Get rid of two and a half printf in the kernel.
Add more features to the one remaining to handle the job:
+ signed quantity.
# alternate format
- left padding
* read width as next arg.
n numeric in (argument specified) default radix.

Fix the DDB debugger to use these.
Use vprintf in debug routine in pcvt.

The warnings from gcc may become more wrong and intolerable because
of this.

Warning: I have not checked the entire source for unsupported or
changed constructs, but generally belive that there are only a few.

Suggested by: bde


# efeaf95a 06-Dec-1995 David Greenman <dg@FreeBSD.org>

Untangled the vm.h include file spaghetti.


# c991e170 30-Oct-1995 Bruce Evans <bde@FreeBSD.org>

Removed bogus statics in declarations that don't allocate storage.

Added prototypes.


# a98ca469 29-Oct-1995 Poul-Henning Kamp <phk@FreeBSD.org>

Second batch of cleanup changes.
This time mostly making a lot of things static and some unused
variables here and there.


# 9b2e5354 30-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 15e633f0 28-Jan-1995 Bruce Evans <bde@FreeBSD.org>

Fix disassembly of `bt[crs] $Ib,E'.


# 3fb3086e 08-Oct-1994 Poul-Henning Kamp <phk@FreeBSD.org>

db_disasm.c: Unused var zapped.
pmap.c: tons of unused vars zapped, various other warnings silenced.
trap.c: unused vars zapped.
vm_machdep.c: A wrong argument, which by chance did the right thing, was
corrected.


# f540b106 12-Aug-1994 Garrett Wollman <wollman@FreeBSD.org>

Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles. This is not
quite complete yet, as `config' doesn't yet do the right thing. You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make


# aaf08d94 18-Dec-1993 Garrett Wollman <wollman@FreeBSD.org>

Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit. Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.

NB: -Wtraditional will henceforth be forgotten. This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax. These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.


# 381fe1aa 24-Nov-1993 Garrett Wollman <wollman@FreeBSD.org>

Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
add same (sans -Werror) to Makefile for future compilations.


# 47cacd38 16-Oct-1993 Rodney W. Grimes <rgrimes@FreeBSD.org>

Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup. Added $Id$ to files that did not have any version info, etc


# 605d6559 12-Jul-1993 Rodney W. Grimes <rgrimes@FreeBSD.org>

Fixed two occarances of ldos which should have been lods.
(From Christoph Robitschko)


# 5b81b6b3 12-Jun-1993 Rodney W. Grimes <rgrimes@FreeBSD.org>

Initial import, 0.1 + pk 0.2.4-B1