Added the ability to get the disassembly instructions from the function and
symbol.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115734 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBFunction.cpp b/source/API/SBFunction.cpp
index 38e349b..f1426e7 100644
--- a/source/API/SBFunction.cpp
+++ b/source/API/SBFunction.cpp
@@ -10,10 +10,15 @@
 #include "lldb/API/SBFunction.h"
 #include "lldb/API/SBProcess.h"
 #include "lldb/API/SBStream.h"
+#include "lldb/Core/Disassembler.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/Function.h"
+#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Target/Target.h"
 
 using namespace lldb;
-
+using namespace lldb_private;
 
 SBFunction::SBFunction () :
     m_opaque_ptr (NULL)
@@ -77,3 +82,28 @@
 
     return true;
 }
+
+SBInstructionList
+SBFunction::GetInstructions (SBTarget target)
+{
+    SBInstructionList sb_instructions;
+    if (m_opaque_ptr)
+    {
+        ExecutionContext exe_ctx;
+        if (target.IsValid())
+        {
+            target->CalculateExecutionContext (exe_ctx);
+            exe_ctx.process = target->GetProcessSP().get();
+        }
+        Module *module = m_opaque_ptr->GetAddressRange().GetBaseAddress().GetModule();
+        if (module)
+        {
+            sb_instructions.SetDisassembler (Disassembler::DisassembleRange (module->GetArchitecture(),
+                                                                             exe_ctx,
+                                                                             m_opaque_ptr->GetAddressRange()));
+        }
+    }
+    return sb_instructions;
+}
+
+