Merging the iohandler branch back into main. 

The many many benefits include:
1 - Input/Output/Error streams are now handled as real streams not a push style input
2 - auto completion in python embedded interpreter
3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use
4 - it is now possible to use curses to drive LLDB (please try the "gui" command)

We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases.

llvm-svn: 200263
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index 31334a6..e6d6c00 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/Symbol/Function.h"
+#include "lldb/Core/Disassembler.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Section.h"
 #include "lldb/Host/Host.h"
@@ -404,6 +405,43 @@
     return this;
 }
 
+lldb::DisassemblerSP
+Function::GetInstructions (const ExecutionContext &exe_ctx,
+                           const char *flavor,
+                           bool prefer_file_cache)
+{
+    ModuleSP module_sp (GetAddressRange().GetBaseAddress().GetModule());
+    if (module_sp)
+    {
+        const bool prefer_file_cache = false;
+        return Disassembler::DisassembleRange (module_sp->GetArchitecture(),
+                                               NULL,
+                                               flavor,
+                                               exe_ctx,
+                                               GetAddressRange(),
+                                               prefer_file_cache);
+    }
+    return lldb::DisassemblerSP();
+}
+
+bool
+Function::GetDisassembly (const ExecutionContext &exe_ctx,
+                          const char *flavor,
+                          bool prefer_file_cache,
+                          Stream &strm)
+{
+    lldb::DisassemblerSP disassembler_sp = GetInstructions (exe_ctx, flavor, prefer_file_cache);
+    if (disassembler_sp)
+    {
+        const bool show_address = true;
+        const bool show_bytes = false;
+        disassembler_sp->GetInstructionList().Dump (&strm, show_address, show_bytes, &exe_ctx);
+        return true;
+    }
+    return false;
+}
+
+
 //Symbol *
 //Function::CalculateSymbolContextSymbol ()
 //{