Index: lcrash/Makefile
===================================================================
--- lcrash/Makefile	(revision 1378)
+++ lcrash/Makefile	(working copy)
@@ -34,7 +34,7 @@
 DUMP_S390X = arch_s390x.c trace_s390x.c
 DUMP_S390_COMMON = dis_s390.c util_s390.c report_s390.c
 DUMP_PPC64 = arch_ppc64.c dis_ppc64.c trace_ppc64.c
-DUMP_X86_64 = arch_x86_64.c trace_x86_64.c
+DUMP_X86_64 = arch_x86_64.c dis_x86_64.c trace_x86_64.c
 
 SUB_DIRS  = man cmds 
 
Index: lcrash/dis.c
===================================================================
--- lcrash/dis.c	(revision 1378)
+++ lcrash/dis.c	(working copy)
@@ -90,6 +90,13 @@
 		}
 		break;
 #endif
+#if defined(DUMP_ARCH_X86_64)
+	case KL_ARCH_X86_64:
+		if (dis_init_x86_64(ofp, dumparch)) {
+			return(1);
+		}
+		break;
+#endif
 	default:
 		/* XXX set error code */
 		return(1);
Index: lcrash/dis_x86_64.c
===================================================================
--- lcrash/dis_x86_64.c	(revision 0)
+++ lcrash/dis_x86_64.c	(revision 0)
@@ -0,0 +1,166 @@
+/*
+ * $Id: dis_x86_64.c$
+ * Disassembly for the x86_64 architecture, based on dis_s390.c
+ * Copyright (C) 2007 Novell, Inc.
+ *
+ * This file is part of lcrash, an analysis tool for Linux memory dumps.
+ *
+ * Created by Silicon Graphics, Inc.
+ * Contributions by IBM, and others
+ *
+ * Copyright (C) 1999 - 2002 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version. See the file COPYING for more
+ * information.
+ */
+
+/*
+ * Known limitations:
+ * - No support for displaying opcodes and byte size ("-f" aka flags & C_FULL)
+ *
+ * TODO:
+ * - figure out why only dis_i386.c does so much by itself rather than use bfd
+ *
+ * DONE:
+ * - figure out correct alignment of pc
+ * 	On x86_64 there does not appear to be an alignment requirement on pc.
+ */
+
+#include <lcrash.h>
+#include <stdarg.h>
+
+/* Pick our assembly poison^Wsyntax */
+
+/* Use AT&T assembly syntax, "mnemonic	source, destination"; ("->")
+ * see e.g.
+ * 	http://asm.sourceforge.net/howto/gas.html#AEN343
+ *	http://sig9.com/articles/att-syntax 
+ */
+#define PRINT_INSN print_insn_i386_att
+
+/*
+ * Use Intel assembly syntax, "mnemonic	destination, source" (":=")
+ */
+/* #define PRINT_INSN print_insn_i386_intel */
+
+/*
+ * Go with bfd's default syntax.
+ */
+/* #define PRINT_INSN print_insn_i386 */
+
+
+/*
+ * function declarations
+ */
+static kaddr_t start_instr_x86_64(kaddr_t, int);
+static kaddr_t do_dis_x86_64(kaddr_t, int, FILE*);
+static kaddr_t print_instr_stream_x86_64(kaddr_t, int, int, int, FILE*);
+static int  print_instr_x86_64(kaddr_t, FILE*, int);
+
+
+/*
+ * function definitions
+ */
+
+/*
+ * start_instr_x86_64() - static function to ensure proper padding of instruction
+ */
+static kaddr_t
+start_instr_x86_64(kaddr_t pc, int before)
+{
+	/* AFAIK, instructions on x86_64 (without prefixes) can be up to 16
+ 	 * bytes.
+	 */
+	while (before--) {
+		pc -= 16;
+	}
+	return(pc);
+}
+
+/*
+ * do_dis_x86_64() - static function to disassemble i instructions
+ */
+static kaddr_t
+do_dis_x86_64(kaddr_t value, int lines, FILE *ofp)
+{
+	bfd_vma pc;
+	int i;
+
+	set_dis_ofp(ofp);
+
+        pc = value;
+	for (i = 0; i < lines; i++) {
+		dis_printintaddr(pc, &DISINFO, 1);
+		/* binutils/bfd handles x86_64 within i386 */
+		pc += PRINT_INSN(pc, &DISINFO);
+		DISINFO.fprintf_func(ofp, "\n");
+	}
+	return(pc);
+}
+
+/*
+ * print_instr_stream_x86_64() - static function to disassemble an
+ *                              instructions stream
+ */
+static kaddr_t
+print_instr_stream_x86_64(kaddr_t v, int bcount, int acount, int flags,
+			FILE *ofp)
+{
+	int count;
+	kaddr_t pc = v;
+
+	/* Make sure that output goes to the right place
+	 */
+	set_dis_ofp(ofp);
+
+	/* If there are alignment constraints on pc, enforce them here.
+	 * I'm not aware of any for x86_64.
+	 */
+	/* pc = ((pc >> 4) << 4); */
+
+	count = acount + 1;
+	if (bcount) {
+		pc = start_instr_x86_64(pc, bcount);
+		count += bcount;
+	}
+	pc = do_dis_x86_64(pc, count, ofp);
+	return(pc);
+}
+
+/*
+ * print_instr_x86_64() - static function
+ */
+static int
+print_instr_x86_64(kaddr_t pc, FILE *ofp, int flag)
+{
+	return(do_dis_x86_64(pc, 1, ofp) - pc);
+}
+
+/*
+ * dis_init_x86_64() - init arch specific stuff for disassembling
+ */
+int
+dis_init_x86_64(FILE *ofp, int dumparch)
+{
+	PRINT_INSTR        = print_instr_x86_64;
+	PRINT_INSTR_STREAM = print_instr_stream_x86_64;
+	USE_OPCODE         = 1;
+
+	DISINFO.fprintf_func   = dis_fprintf;
+	DISINFO.stream         = ofp;
+	DISINFO.flavour        = bfd_target_elf_flavour;
+	/* Within bfd, x86_64 is essentially handled through i386 */
+	DISINFO.arch           = bfd_arch_i386;
+	DISINFO.mach           = bfd_mach_x86_64;
+	DISINFO.endian         = BFD_ENDIAN_LITTLE;
+	DISINFO.read_memory_func       = getidmem;
+	DISINFO.print_address_func     = dis_printaddr;
+	DISINFO.symbol_at_address_func = dis_getsym;
+	DISINFO.display_endian = BFD_ENDIAN_LITTLE;
+
+	return(0);
+}
